/* Metro module 15721; source: modules/premium/powerups/GuildPowerupsManager.tsx; dependencies: [6, 7, 15, 17, 18, 1867, 3784, 3969, 8258, 6892, 6857, 8262, 8263, 8264, 14618, 14614, 14616, 12310, 15722, 4140, 12307, 14675, 8251, 4860, 2] */ function _fun120722(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15929:6, offset: 0x02533f09, size: 294 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(6) /* metro dependency 6 */; const env0_4 = importDefault(7) /* metro dependency 7 */; const env0_5 = importDefault(15) /* metro dependency 15 */; const env0_6 = importDefault(17) /* metro dependency 17 */; const env0_7 = importDefault(18) /* metro dependency 18 */; const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */; const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */; const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */; const guildPowerupsStore = importDefault(8258) /* metro dependency 8258: GuildPowerupsStore */; let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */; value = _fun120726(value); value = new value(); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/powerups/GuildPowerupsManager.tsx'); exports.default = value; } function _isNativeReflectConstruct_120723() { // fn#120723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15929:188, offset: 0x0253402f, size: 98 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_120723_isNativeReflectConstruct = function() { return !!result; })(); } function _fun120726(a0) { // fn#120726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15929:391, offset: 0x02534091, size: 151 bytes, params: 2, frame: 16 const closure = GuildPowerupsManager; env0_7(closure, a0); return env0_4(closure, [{key: 'handleSelectedGuildChange', value: value_120728}, {key: 'handleEntitlementUpdate', value: function({guildId}) { this.refreshGuildPowerups(guildId); }}, {key: 'handleAppliedBoostUpdate', value: function({guildId}) { this.refreshGuildPowerups(guildId); }}, {key: 'refreshGuildPowerups', value: value_120731}]); } function GuildPowerupsManager(a0) { // fn#120727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15929:403, offset: 0x02534128, size: 258 bytes, params: 2, frame: 20 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_3; binding(this, GuildPowerupsManager); let object = []; arraySpread(object, value, 0, object); value = env1_6(GuildPowerupsManager); binding = env1_5; if (_isNativeReflectConstruct_120723()) { Reflect = global.Reflect; value = Reflect.construct(value, object, env1_6(this).constructor); r0 = value; } else { value = value.apply(this, object); r0 = value; } value = binding(this, r0); const Map = global.Map; const map = new Map(); value.stores = map.set(SelectedGuildStore, value.handleSelectedGuildChange); object = {}; object.GUILD_POWERUP_ENTITLEMENTS_CREATE = value.handleEntitlementUpdate.bind(value); object.GUILD_POWERUP_ENTITLEMENTS_DELETE = value.handleEntitlementUpdate.bind(value); object.GUILD_APPLIED_BOOSTS_UPDATE = value.handleAppliedBoostUpdate.bind(value); value.actions = object; return value; } function value_120728() { // fn#120728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15929:1012, offset: 0x0253422a, size: 646 bytes, params: 1, frame: 21 const value = environment.__proto__; const guildId = SelectedGuildStore.getGuildId(); if (guildId != null) { var moduleValue = require(6892) /* metro dependency 6892: FavoritesUtils */; if (moduleValue.isFavoritesGuildId(guildId)) { return undefined; } var guild = GuildStore.getGuild(guildId); if (guild == null) { return undefined; } var GameServerExperiment = (require(6857) /* metro dependency 6857: GameServerExperiment */).GameServerExperiment; var trackExposure = GameServerExperiment.trackExposure; var id = guild.id; Reflect.apply(trackExposure, GameServerExperiment, [{guildId: id, location: 'GuildPowerupsManager'}]); var FileUpload250MbPowerupExperiment = (require(8262) /* metro dependency 8262: FileUpload250MbPowerupExperiment */).FileUpload250MbPowerupExperiment; trackExposure = FileUpload250MbPowerupExperiment.trackExposure; id = guild.id; Reflect.apply(trackExposure, FileUpload250MbPowerupExperiment, [{guildId: id, location: 'GuildPowerupsManager'}]); var ServerThemeExperiment = (require(8263) /* metro dependency 8263: ServerThemeExperiment */).ServerThemeExperiment; trackExposure = ServerThemeExperiment.trackExposure; id = guild.id; Reflect.apply(trackExposure, ServerThemeExperiment, [{guildId: id, location: 'GuildPowerupsManager'}]); var ServerThemeApexShadowExperiment = (require(8264) /* metro dependency 8264: ServerThemeApexShadowExperiment */).ServerThemeApexShadowExperiment; var getConfig = ServerThemeApexShadowExperiment.getConfig; id = guild.id; Reflect.apply(getConfig, ServerThemeApexShadowExperiment, [{guildId: id, location: 'GuildPowerupsManager'}]); var moduleValue2 = require(6857) /* metro dependency 6857: GameServerExperiment */; var getGameServerEnabled = moduleValue2.getGameServerEnabled; id = guild.id; if (Reflect.apply(getGameServerEnabled, moduleValue2, [id, 'GuildPowerupsManager'])) { (require(14618) /* metro dependency 14618: GameServerPricingExperiment */).GameServerPricingExperiment.trackExposure({guildId: guild.id, location: 'GuildPowerupsManager'}); } var defaultImport = importDefault(14614) /* metro dependency 14614: BoostToUnlockCoachmarkExperiment */; getConfig = defaultImport.getConfig; var enabled = Reflect.apply(getConfig, defaultImport, [{location: 'GuildPowerupsManager'}]).enabled; var defaultImport2 = importDefault(14616) /* metro dependency 14616: ExpiringPowerupCoachmarkExperiment */; getConfig = defaultImport2.getConfig; var enabled2 = Reflect.apply(getConfig, defaultImport2, [{location: 'GuildPowerupsManager'}]).enabled; var moduleValue3 = require(12310) /* metro dependency 12310: useHasAllocateBoostPermission */; var getHasAllocateBoostPermission = moduleValue3.getHasAllocateBoostPermission; if (Reflect.apply(getHasAllocateBoostPermission, moduleValue3, [PermissionStore, guild])) { if (GuildPowerupsStore.shouldFetchCatalogForGuild(guildId)) { (require(12307) /* metro dependency 12307: GuildPowerupsActionCreators */).fetchPowerupCatalogForGuild(guildId); } if (GuildPowerupsStore.shouldFetchPowerupsForGuild(guildId)) { (require(12307) /* metro dependency 12307: GuildPowerupsActionCreators */).fetchGuildBoostEntitlements(guildId); } return undefined; } var r1 = enabled || enabled2; r1 = r1 && (require(15722) /* metro dependency 15722: useIsCurrentUserEligibleForPowerupUpsells */).getIsCurrentUserEligibleForPowerupUpsells(); if ((require(4140) /* metro dependency 4140: PlatformUtils */).isMobile) { return undefined; } if (r1) { if (GuildPowerupsStore.shouldFetchCatalogForGuild(guildId)) { (require(12307) /* metro dependency 12307: GuildPowerupsActionCreators */).fetchPowerupCatalogForGuild(guildId); } if (GuildPowerupsStore.shouldFetchPowerupsForGuild(guildId)) { (require(12307) /* metro dependency 12307: GuildPowerupsActionCreators */).fetchGuildBoostEntitlements(guildId); } return undefined; } } } function value_120731(a0) { // fn#120731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15929:2313, offset: 0x025344ca, size: 173 bytes, params: 2, frame: 17 var enabled; let value = environment.__proto__; const useHasAllocateBoostPermissionModule = require(12310) /* metro dependency 12310: useHasAllocateBoostPermission */; const getHasAllocateBoostPermission = useHasAllocateBoostPermissionModule.getHasAllocateBoostPermission; const getGuild = GuildStore.getGuild; if (Reflect.apply(getHasAllocateBoostPermission, useHasAllocateBoostPermissionModule, [PermissionStore, Reflect.apply(getGuild, GuildStore, [a0])]) === true) { (require(12307) /* metro dependency 12307: GuildPowerupsActionCreators */).fetchGuildBoostEntitlements(a0); value = importDefault(14675) /* metro dependency 14675: ExpiringBoostsExperiment */; enabled = value.getConfig({location: 'GuildPowerupsManager'}).enabled; value = require(8251) /* metro dependency 8251: BoostingActionCreators */; value.fetchAppliedGuildBoostsForGuild(a0, {includeEnded: enabled}); } }