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

80 lines
4.7 KiB
TypeScript

/* Metro module 14649; source: modules/premium/powerups/hooks/useCanGuildPowerupBeToggled.tsx; dependencies: [31, 8258, 8259, 566, 14635, 1244, 2256, 2] */
import GuildPowerupsStore from '../GuildPowerupsStore.tsx'; /* Metro dependency 8258 */
import UsePowerupActiveStatus from './usePowerupActiveStatus.tsx'; /* Metro dependency 14635 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as GuildPowerupsConstantsModule from '../constants/GuildPowerupsConstants.tsx'; /* Metro dependency 8259 */
function _fun110664(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14846:6, offset: 0x0238202a, size: 159 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/premium/powerups/hooks/useCanGuildPowerupBeToggled.tsx');
exports.default = useCanGuildPowerupBeToggled;
function useCanGuildPowerupBeToggled(a0, a1, a2) { // fn#110665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14846:256, offset: 0x023820c9, size: 172 bytes, params: 4, frame: 20
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const stateForGuild = (FluxModule).useStateFromStores([GuildPowerupsStore],
_fun110666);
return stateForGuild.useMemo(_fun110667, [stateForGuild, a1.skuId, a1.dependencies, a2,
(UsePowerupActiveStatus)(a0, a1).type]);
function _fun110666() { // fn#110666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14846:338, offset: 0x0237bb5b, size: 27 bytes, params: 1, frame: 11
return GuildPowerupsStore.getStateForGuild(env0_0);
}
function _fun110667() { // fn#110667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14846:399, offset: 0x02382175, size: 339 bytes, params: 1, frame: 21
var r3;
var r1;
var intl;
var formatToPlainString;
var property;
var value;
if (stateForGuild == null) {
return {disabled: true, reason: undefined};
}
const type = env0_4.type;
const LEVEL_ACTIVATED = PowerupActiveStatusType.LEVEL_ACTIVATED;
if (type === LEVEL_ACTIVATED) {
return {disabled: true, reason: undefined};
}
stateForGuildBinding = stateForGuild;
const allPowerups = stateForGuildBinding.allPowerups;
const r7 = importDefault ? global.Object.values(stateForGuildBinding.unlockedPowerups).find(_fun110668)?.sku_id : require.dependencies.find(function(a0) {
return unlockedPowerups[a0] == null;
});
const object = {disabled: r7 != null};
const value7 = undefined;
if (r7 != null) {
if (allPowerups[r7] != null) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
formatToPlainString = intl.formatToPlainString;
value = importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */;
r3 = importDefault ? value.vCEBiS : value['1B8AZr'];
property = allPowerups[r7];
value = Reflect.apply(formatToPlainString, intl, [r3, {perk: property == null ? value7 : property.title}]);
r1 = value;
} else {
r1 = value7;
}
} else {
r1 = value7;
}
object.reason = r1;
return object;
function _fun110668({sku}) { // fn#110668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14846:598, offset: 0x023822c8, size: 44 bytes, params: 2, frame: 3
const dependent_sku_id = sku?.dependent_sku_id;
value = environment.__proto__;
return dependent_sku_id === require.skuId;
}
}
}
}
global.__d(_fun110664, 14649, [31, 8258, 8259, 566, 14635, 1244, 2256,
2]) /* metro module 14649, dependencies: [31, 8258, 8259, 566, 14635, 1244, 2256, 2] */;