Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
162 lines
4.8 KiB
TypeScript
162 lines
4.8 KiB
TypeScript
// Module ID: 10170
|
|
// Function ID: 10171
|
|
// Name: GuildIncidentsStore
|
|
// Dependencies: [4522, 1221, 1979, 4245, 8089, 504, 573, 2]
|
|
|
|
// Module 10170 (GuildIncidentsStore)
|
|
import initializeDefault from "initialize" /* 504 */;
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
import GuildAntiRaidUtils from "GuildAntiRaidUtils" /* 8089 */;
|
|
import ExperimentStore from "ExperimentStore" /* 4522 */;
|
|
import UserSettingsProtoStore from "UserSettingsProtoStore" /* 1221 */;
|
|
import GuildStore from "GuildStore" /* 1979 */;
|
|
import PermissionStore from "PermissionStore" /* 4245 */;
|
|
|
|
require = fn;
|
|
function computeAlertSettings() {
|
|
let guildsProto = UserSettingsProtoStore.getGuildsProto();
|
|
if (guildsProto == null) {
|
|
guildsProto = {};
|
|
}
|
|
const guildsArray = GuildStore.getGuildsArray();
|
|
closure_7 = {};
|
|
for (const item10012 of guildsArray) {
|
|
let obj = { guildId: null, guildName: null };
|
|
({ id: obj2.guildId, name: obj2.guildName } = item10012);
|
|
let merged = Object.assign(guildsProto[item10012.id]);
|
|
closure_7[item10012.id] = obj;
|
|
continue;
|
|
}
|
|
}
|
|
function updateGuildIncident(id) {
|
|
const guild = GuildStore.getGuild(id);
|
|
let incidentsData;
|
|
if (guild != null) {
|
|
incidentsData = guild.incidentsData;
|
|
}
|
|
let tmp5;
|
|
if (null != incidentsData) {
|
|
let hasDetectedActivityResult = GuildAntiRaidUtils.hasDetectedActivity(incidentsData);
|
|
if (!hasDetectedActivityResult) {
|
|
hasDetectedActivityResult = tmp6(8089).isUnderLockdown(incidentsData);
|
|
const tmp6Result = tmp6(8089);
|
|
}
|
|
if (hasDetectedActivityResult) {
|
|
tmp5 = incidentsData;
|
|
}
|
|
tmp6 = require;
|
|
}
|
|
let flag = dependencyMap[id] !== tmp5;
|
|
if (flag) {
|
|
if (null == tmp5) {
|
|
delete tmp[tmp2];
|
|
flag = true;
|
|
} else {
|
|
dependencyMap[id] = tmp5;
|
|
flag = true;
|
|
}
|
|
}
|
|
return flag;
|
|
}
|
|
const dependencyMap = {};
|
|
let closure_7 = {};
|
|
const Store = initializeDefault.Store;
|
|
class GuildIncidentsStore extends Store {
|
|
}
|
|
const prototype = GuildIncidentsStore.prototype;
|
|
prototype["initialize"] = function initialize() {
|
|
this.waitFor(UserSettingsProtoStore, GuildStore, PermissionStore, ExperimentStore);
|
|
const items = [UserSettingsProtoStore, GuildStore, PermissionStore, ExperimentStore];
|
|
this.syncWith(items, computeAlertSettings);
|
|
};
|
|
prototype["getGuildIncident"] = function getGuildIncident(id) {
|
|
return dependencyMap[id];
|
|
};
|
|
prototype["getIncidentsByGuild"] = function getIncidentsByGuild() {
|
|
return closure_6;
|
|
};
|
|
prototype["getGuildAlertSettings"] = function getGuildAlertSettings() {
|
|
return closure_7;
|
|
};
|
|
GuildIncidentsStore.displayName = "GuildIncidentsStore";
|
|
const guildIncidentsStore = new GuildIncidentsStore(DispatcherDefault, {
|
|
CONNECTION_OPEN: function handleConnectionOpen(arg0) {
|
|
closure_6 = {};
|
|
while (tmp !== undefined) {
|
|
let tmp4 = updateGuildIncident(tmp2.id);
|
|
continue;
|
|
}
|
|
},
|
|
GUILD_CREATE: function handleGuildCreate(guild) {
|
|
const id = guild.guild.id;
|
|
guild = GuildStore.getGuild(id);
|
|
let incidentsData;
|
|
if (guild != null) {
|
|
incidentsData = guild.incidentsData;
|
|
}
|
|
let tmp5;
|
|
if (null != incidentsData) {
|
|
let hasDetectedActivityResult = GuildAntiRaidUtils.hasDetectedActivity(incidentsData);
|
|
if (!hasDetectedActivityResult) {
|
|
hasDetectedActivityResult = tmp6(8089).isUnderLockdown(incidentsData);
|
|
const tmp6Result = tmp6(8089);
|
|
}
|
|
if (hasDetectedActivityResult) {
|
|
tmp5 = incidentsData;
|
|
}
|
|
tmp6 = require;
|
|
}
|
|
let flag = dependencyMap[id] !== tmp5;
|
|
if (flag) {
|
|
if (null == tmp5) {
|
|
delete tmp[tmp2];
|
|
flag = true;
|
|
} else {
|
|
dependencyMap[id] = tmp5;
|
|
flag = true;
|
|
}
|
|
}
|
|
return flag;
|
|
},
|
|
GUILD_UPDATE: function handleGuildUpdate(guild) {
|
|
const id = guild.guild.id;
|
|
guild = GuildStore.getGuild(id);
|
|
let incidentsData;
|
|
if (guild != null) {
|
|
incidentsData = guild.incidentsData;
|
|
}
|
|
let tmp5;
|
|
if (null != incidentsData) {
|
|
let hasDetectedActivityResult = GuildAntiRaidUtils.hasDetectedActivity(incidentsData);
|
|
if (!hasDetectedActivityResult) {
|
|
hasDetectedActivityResult = tmp6(8089).isUnderLockdown(incidentsData);
|
|
const tmp6Result = tmp6(8089);
|
|
}
|
|
if (hasDetectedActivityResult) {
|
|
tmp5 = incidentsData;
|
|
}
|
|
tmp6 = require;
|
|
}
|
|
let flag = dependencyMap[id] !== tmp5;
|
|
if (flag) {
|
|
if (null == tmp5) {
|
|
delete tmp[tmp2];
|
|
flag = true;
|
|
} else {
|
|
dependencyMap[id] = tmp5;
|
|
flag = true;
|
|
}
|
|
}
|
|
return flag;
|
|
},
|
|
GUILD_DELETE: function handleGuildDelete(arg0) {
|
|
delete tmp2[tmp];
|
|
},
|
|
LOGOUT: function handleLogout() {
|
|
closure_6 = {};
|
|
}
|
|
});
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/guild_antiraid/GuildIncidentsStore.tsx");
|
|
|
|
export default guildIncidentsStore;
|