Module 400528

1,377 characters · in 84dc12d644285bff.js
Dependencies
Required by (2)
Lazily required by (0)none
Requires (3)
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{A:()=>u});var i=n(17928),l=n(228366),a=n(967198);let s=null,r=null,o={reportedMessages:{}};function d(){let e=a.A.getLastSelectedGuildId();e!==s&&(r=null,s=e??null)}class c extends i.Ay.PersistedStore{static displayName="ReportToModStore";static persistKey="ReportToModStore";static migrations=[e=>({reportedMessages:e?.reportedMessages??{}})];initialize(e){null!=e&&(o.reportedMessages=Object.fromEntries(Object.entries(e.reportedMessages).map(e=>{let[t,n]=e;return[t,new Set(n)]}))),this.syncWith([a.A],d)}getState(){return o}isUserBanned(e){return r?.get(e)??null}getReportedMessages(){return o.reportedMessages}hasReportedMessage(e,t){return o.reportedMessages[e]?.has(t)??!1}}let u=new c(l.h,{REPORT_TO_MOD_REPORT_MESSAGE_SUCCESS:function(e){let{channelId:t,messageId:n}=e;null==o.reportedMessages[t]&&(o.reportedMessages[t]=new Set),o.reportedMessages[t].add(n)},GUILD_BAN_ADD:function(e){let{user:t,guildId:n}=e;n!==s||null!=r&&r.set(t.id,!0)},GUILD_BAN_REMOVE:function(e){let{user:t,guildId:n}=e;n!==s||null!=r&&r.set(t.id,!1)},GUILD_SETTINGS_LOADED_BANS_BATCH:function(e){let{bans:t,guildId:n,userIds:i}=e;if(n!==s)return;let l=new Set(t.map(e=>e.user?.id)),a=Array.from(new Set(i??[])).filter(e=>!l.has(e));null==r&&(r=new Map),l.forEach(e=>{r?.set(e,!0)}),a.forEach(e=>{r?.set(e,!1)})},LOGOUT:function(){s=null,r=null,o.reportedMessages={}}})}