Module 610136

1,275 characters · in bbd15cf51653cee5.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(t,e,n){n.d(e,{A:()=>A});var i=n(17928),l=n(228366),d=n(736056),a=n(617617),u=n(71393),r=n(576705),s=n(903093);let o={},c={};function D(){let t=a.A.getGuildsProto()??{},e=u.A.getGuildsArray();for(let n of(c={},e))c[n.id]={guildId:n.id,guildName:n.name,...t[n.id]}}function _(t){return null!=t&&Object.keys(t).length>0?{raidDetectedAt:t.raid_detected_at,dmSpamDetectedAt:t.dm_spam_detected_at,dmsDisabledUntil:t.dms_disabled_until,invitesDisabledUntil:t.invites_disabled_until,lockdownDurationHours:t.lockdown_duration_hours}:null}class m extends i.Ay.Store{static displayName="GuildIncidentsStore";initialize(){this.waitFor(a.A,u.A,r.A,d.A),this.syncWith([a.A,u.A,r.A,d.A],D)}getGuildIncident(t){return o[t]}getIncidentsByGuild(){return o}getGuildAlertSettings(){return c}}let A=new m(l.h,{CONNECTION_OPEN:function(t){for(let e of(o={},t.guilds)){let t=_(e.properties?.incidents_data);null!=t&&((0,s.k$)(t)||(0,s._J)(t))&&(o[e.id]=t)}},GUILD_CREATE:function(t){let{guild:e}=t,n=_(e.properties?.incidents_data);null!=n&&((0,s.k$)(n)||(0,s._J)(n))&&(o[e.id]=n)},GUILD_UPDATE:function(t){let{guild:e}=t,n=_(e.incidents_data);null!=n&&((0,s.k$)(n)||(0,s._J)(n))?o[e.id]=n:delete o[e.id]},GUILD_DELETE:function(t){let{guild:e}=t;delete o[e.id]},LOGOUT:function(t){o={}}})}