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

65 lines
5.4 KiB
TypeScript

/* Metro module 10054; source: modules/collectibles/hooks/useCanPurchaseFrames.tsx; dependencies: [1878, 1880, 8499, 10055, 1900, 1895, 566, 2] */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import CollectiblesProfileFramesPurchaseExperiment from '../experiments/CollectiblesProfileFramesPurchaseExperiment.tsx'; /* Metro dependency 10055 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as PremiumConstantsModule from '../../premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
import * as PremiumTypeUtilsModule from '../../../utils/PremiumTypeUtils.tsx'; /* Metro dependency 1900 */
import * as CollectiblesProfileFramesExperimentModule from '../experiments/CollectiblesProfileFramesExperiment.tsx'; /* Metro dependency 8499 */
import * as CollectiblesProfileFramesPurchaseExperimentModule from '../experiments/CollectiblesProfileFramesPurchaseExperiment.tsx'; /* Metro dependency 10055 */
function _fun78612(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10240:6, offset: 0x01e2de47, size: 183 bytes, params: 8, frame: 20
const env0_0 = require;
const isUserPaidTier22 = isUserPaidTier2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/hooks/useCanPurchaseFrames.tsx');
exports.default = useCanPurchaseFrames;
exports.useCanViewProfileFramesInCollectiblesShop = useCanViewProfileFramesInCollectiblesShop;
exports.useIsProfileFramesEarlyAccessPhase = useIsProfileFramesEarlyAccessPhase;
exports.isUserPaidTier2 = isUserPaidTier22;
function isUserPaidTier2(a0) { // fn#78613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10240:129, offset: 0x01e2defe, size: 127 bytes, params: 2, frame: 16
const value2 = undefined;
const isPremiumExactly = PremiumTypeUtilsModule.isPremiumExactly;
const TIER_2 = PremiumTypes.TIER_2;
return Reflect.apply(isPremiumExactly, PremiumTypeUtilsModule, [a0,
TIER_2]) && (a0 == null ? value2 : a0.premiumState) != null && a0.premiumState.premiumSubscriptionType === (require(1895) /* metro dependency 1895: user */).PremiumSubscriptionType.TIER_2;
}
function useCanPurchaseFrames(a0) { // fn#78614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10240:416, offset: 0x01e2df7d, size: 200 bytes, params: 2, frame: 20
const value2 = (CollectiblesProfileFramesExperimentModule).useIsProfileFramesEnabled(a0);
const defaultImport = CollectiblesProfileFramesPurchaseExperiment;
const useConfig = defaultImport.useConfig;
const bucket = Reflect.apply(useConfig, defaultImport, [{location: a0}]).bucket;
const value3 = (FluxModule).useStateFromStores([UserStore], _fun78615);
const ProfileFramesPurchaseBucket = (CollectiblesProfileFramesPurchaseExperimentModule).ProfileFramesPurchaseBucket;
const OPEN_PURCHASE = ProfileFramesPurchaseBucket.OPEN_PURCHASE;
return value2 && (bucket === OPEN_PURCHASE || bucket === ProfileFramesPurchaseBucket.PAID_PREMIUM_SUBSCRIBERS_ONLY && value3);
function _fun78615() { // fn#78615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10240:567, offset: 0x01e2e045, size: 29 bytes, params: 1, frame: 11
const value = environment.__proto__;
return isUserPaidTier2(UserStore.getCurrentUser());
}
}
function useCanViewProfileFramesInCollectiblesShop(a0) { // fn#78616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10240:796, offset: 0x01e2e062, size: 116 bytes, params: 2, frame: 16
const value2 = (CollectiblesProfileFramesExperimentModule).useIsProfileFramesEnabled(a0);
const defaultImport = CollectiblesProfileFramesPurchaseExperiment;
const useConfig = defaultImport.useConfig;
return value2 && Reflect.apply(useConfig, defaultImport,
[{location: a0}]).bucket !== (require(10055) /* metro dependency 10055: CollectiblesProfileFramesPurchaseExperiment */).ProfileFramesPurchaseBucket.CONTROL;
}
function useIsProfileFramesEarlyAccessPhase(a0) { // fn#78617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10240:1030, offset: 0x01e2e0d6, size: 116 bytes, params: 2, frame: 16
const value2 = (CollectiblesProfileFramesExperimentModule).useIsProfileFramesEnabled(a0);
const defaultImport = CollectiblesProfileFramesPurchaseExperiment;
const useConfig = defaultImport.useConfig;
return value2 && Reflect.apply(useConfig, defaultImport,
[{location: a0}]).bucket === (require(10055) /* metro dependency 10055: CollectiblesProfileFramesPurchaseExperiment */).ProfileFramesPurchaseBucket.PAID_PREMIUM_SUBSCRIBERS_ONLY;
}
}
global.__d(_fun78612, 10054, [1878, 1880, 8499, 10055, 1900, 1895, 566,
2]) /* metro module 10054, dependencies: [1878, 1880, 8499, 10055, 1900, 1895, 566, 2] */;