Files
2026-07-28 01:06:53 +03:00

194 lines
12 KiB
TypeScript

/* 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] */
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import SelectedGuildStore from '../../../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */
import AutomaticLifecycleManager from '../../../lib/AutomaticLifecycleManager.tsx'; /* Metro dependency 4860 */
import GuildPowerupsStore from './GuildPowerupsStore.tsx'; /* Metro dependency 8258 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as UseHasAllocateBoostPermissionModule from './hooks/useHasAllocateBoostPermission.tsx'; /* Metro dependency 12310 */
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});
let value = AutomaticLifecycleManager;
value = _fun120726(value);
value = new value();
(FileImportTrackerModule).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 GuildPowerupsManager2 = GuildPowerupsManager;
Inherits(GuildPowerupsManager2, a0);
return CreateClass(GuildPowerupsManager2, [{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
var guildPowerupsStoreBinding;
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])) {
guildPowerupsStoreBinding = GuildPowerupsStore;
if (guildPowerupsStoreBinding.shouldFetchCatalogForGuild(guildId)) {
(require(12307) /* metro dependency 12307: GuildPowerupsActionCreators */).fetchPowerupCatalogForGuild(guildId);
}
guildPowerupsStoreBinding = GuildPowerupsStore;
if (guildPowerupsStoreBinding.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) {
guildPowerupsStoreBinding = GuildPowerupsStore;
if (guildPowerupsStoreBinding.shouldFetchCatalogForGuild(guildId)) {
(require(12307) /* metro dependency 12307: GuildPowerupsActionCreators */).fetchPowerupCatalogForGuild(guildId);
}
guildPowerupsStoreBinding = GuildPowerupsStore;
if (guildPowerupsStoreBinding.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 getHasAllocateBoostPermission = UseHasAllocateBoostPermissionModule.getHasAllocateBoostPermission;
const permissionStoreBinding = PermissionStore;
const guildStoreBinding = GuildStore;
const getGuild = guildStoreBinding.getGuild;
if (Reflect.apply(getHasAllocateBoostPermission, UseHasAllocateBoostPermissionModule, [permissionStoreBinding,
Reflect.apply(getGuild, guildStoreBinding, [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});
}
}
}
}
global.__d(_fun120722, 15721, [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]) /* metro module 15721, 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] */;