123 lines
6 KiB
TypeScript
123 lines
6 KiB
TypeScript
// Module ID: 16213
|
|
// Function ID: 16214
|
|
// Name: handleSelectedGuildChange
|
|
// Dependencies: [1862, 3821, 4010, 4080, 5138, 1865, 4104, 4121, 4123, 4124, 11614, 11618, 15160, 4430, 4122, 11607, 11593, 11686, 4089, 2]
|
|
|
|
// Module 16213 (handleSelectedGuildChange)
|
|
import createGuildRecordFromRust from "createGuildRecordFromRust";
|
|
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
|
|
import handleConnectionOpen from "handleConnectionOpen";
|
|
import calculateAppliedBoosts from "calculateAppliedBoosts";
|
|
import "initialize";
|
|
|
|
const require = arg1;
|
|
class GuildPowerupsManager extends tmp2 {
|
|
constructor() {
|
|
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
|
|
map = new Map();
|
|
applyArgumentsResult.stores = map.set(handleConnectionOpen, applyArgumentsResult.handleSelectedGuildChange);
|
|
obj = { GUILD_POWERUP_ENTITLEMENTS_CREATE: handleEntitlementUpdate.bind(applyArgumentsResult), GUILD_POWERUP_ENTITLEMENTS_DELETE: handleEntitlementUpdate2.bind(applyArgumentsResult), GUILD_APPLIED_BOOSTS_UPDATE: handleAppliedBoostUpdate.bind(applyArgumentsResult) };
|
|
({ handleEntitlementUpdate, handleEntitlementUpdate: handleEntitlementUpdate2, handleAppliedBoostUpdate } = applyArgumentsResult);
|
|
applyArgumentsResult.actions = obj;
|
|
return applyArgumentsResult;
|
|
}
|
|
}
|
|
const prototype = GuildPowerupsManager.prototype;
|
|
prototype["handleSelectedGuildChange"] = function handleSelectedGuildChange() {
|
|
guildId = guildId.getGuildId();
|
|
if (null != guildId) {
|
|
if (!obj12.isFavoritesGuildId(guildId)) {
|
|
const guild = store.getGuild(guildId);
|
|
if (null != guild) {
|
|
const GameServerExperiment = tmp10(4104).GameServerExperiment;
|
|
let obj = { guildId: null, location: "GuildPowerupsManager" };
|
|
obj[0] = guild.id;
|
|
GameServerExperiment.trackExposure(obj);
|
|
const FileUpload250MbPowerupExperiment = tmp10(4121).FileUpload250MbPowerupExperiment;
|
|
obj = { guildId: null, location: "GuildPowerupsManager" };
|
|
obj[0] = guild.id;
|
|
FileUpload250MbPowerupExperiment.trackExposure(obj);
|
|
const ServerThemeExperiment = tmp10(4123).ServerThemeExperiment;
|
|
const obj1 = { guildId: null, location: "GuildPowerupsManager" };
|
|
obj1[0] = guild.id;
|
|
ServerThemeExperiment.trackExposure(obj1);
|
|
const ServerThemeApexShadowExperiment = tmp10(4124).ServerThemeApexShadowExperiment;
|
|
const obj2 = { guildId: null, location: "GuildPowerupsManager" };
|
|
obj2[0] = guild.id;
|
|
const config = ServerThemeApexShadowExperiment.getConfig(obj2);
|
|
let tmp10Result = tmp10(4104);
|
|
if (tmp10Result.getGameServerEnabled(guild.id, "GuildPowerupsManager")) {
|
|
const GameServerPricingExperiment = tmp10(11614).GameServerPricingExperiment;
|
|
obj = { guildId: null, location: "GuildPowerupsManager" };
|
|
obj[0] = guild.id;
|
|
GameServerPricingExperiment.trackExposure(obj);
|
|
}
|
|
tmp10Result = tmp10(11618);
|
|
if (!tmp10Result.getHasAllocateBoostPermission(getUncachedChannelPermissions, guild)) {
|
|
let isCurrentUserEligibleForPowerupUpsells = tmp10(15160).getIsCurrentUserEligibleForPowerupUpsells();
|
|
let isMobile = tmp10(4430).isMobile;
|
|
if (isMobile) {
|
|
isMobile = tmp10(4123).getServerThemeEnabled(guildId, "GuildPowerupsManager");
|
|
const tmp10Result2 = tmp10(4123);
|
|
}
|
|
if (isMobile) {
|
|
isMobile = tmp10(15160).getIsCurrentUserEligibleForPowerupUpsells();
|
|
const tmp10Result3 = tmp10(15160);
|
|
}
|
|
if (isMobile) {
|
|
isMobile = tmp10(4122).getServerThemeUserEnabled("GuildPowerupsManager");
|
|
const tmp10Result4 = tmp10(4122);
|
|
}
|
|
let showCoachmark = tmp10(4430).isMobile;
|
|
if (showCoachmark) {
|
|
showCoachmark = tmp10(15160).getIsCurrentUserEligibleForPowerupUpsells();
|
|
const tmp10Result5 = tmp10(15160);
|
|
}
|
|
if (showCoachmark) {
|
|
showCoachmark = importDefault(11607).getConfig({ location: "GuildPowerupsManager" }).showCoachmark;
|
|
const obj8 = importDefault(11607);
|
|
}
|
|
if (tmp10(4430).isMobile) {
|
|
if (!isMobile) {
|
|
isMobile = showCoachmark;
|
|
}
|
|
isCurrentUserEligibleForPowerupUpsells = isMobile;
|
|
}
|
|
const tmp10Result1 = tmp10(15160);
|
|
}
|
|
if (calculateAppliedBoosts.shouldFetchCatalogForGuild(guildId)) {
|
|
const powerupCatalogForGuild = tmp10(11593).fetchPowerupCatalogForGuild(guildId);
|
|
const tmp10Result6 = tmp10(11593);
|
|
}
|
|
if (obj9.shouldFetchPowerupsForGuild(guildId)) {
|
|
const guildBoostEntitlements = tmp10(11593).fetchGuildBoostEntitlements(guildId);
|
|
const tmp10Result7 = tmp10(11593);
|
|
}
|
|
obj9 = calculateAppliedBoosts;
|
|
}
|
|
}
|
|
obj12 = require(1865) /* getFavoritesAwareGuildName */;
|
|
}
|
|
};
|
|
prototype["handleEntitlementUpdate"] = function handleEntitlementUpdate(guildId) {
|
|
this.refreshGuildPowerups(guildId.guildId);
|
|
};
|
|
prototype["handleAppliedBoostUpdate"] = function handleAppliedBoostUpdate(guildId) {
|
|
this.refreshGuildPowerups(guildId.guildId);
|
|
};
|
|
prototype["refreshGuildPowerups"] = function refreshGuildPowerups(guildId) {
|
|
let obj = require(11618) /* useHasAllocateBoostPermission */;
|
|
if (true === obj.getHasAllocateBoostPermission(getUncachedChannelPermissions, store.getGuild(guildId))) {
|
|
let tmpResult = tmp(11593);
|
|
const guildBoostEntitlements = tmpResult.fetchGuildBoostEntitlements(guildId);
|
|
tmpResult = tmp(4089);
|
|
obj = { includeEnded: null };
|
|
obj[0] = importDefault(11686).getConfig({ location: "GuildPowerupsManager" }).enabled;
|
|
const appliedGuildBoostsForGuild = tmpResult.fetchAppliedGuildBoostsForGuild(guildId, obj);
|
|
const obj3 = importDefault(11686);
|
|
}
|
|
};
|
|
const guildPowerupsManager = new GuildPowerupsManager();
|
|
const result = require("handleConnectionOpen").fileFinishedImporting("modules/premium/powerups/GuildPowerupsManager.tsx");
|
|
|
|
export default guildPowerupsManager;
|