Files
discord-decomp/sources/modules/guild_role_subscriptions/useTrialIntervalOptions.tsx
T
2026-07-27 16:20:00 +03:00

76 lines
3.8 KiB
TypeScript

/* Metro module 13695; source: modules/guild_role_subscriptions/useTrialIntervalOptions.tsx; dependencies: [31, 13668, 1880, 1244, 13694, 2] */
function _fun104654(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13892:6, offset: 0x0229cb67, size: 158 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(13668) /* metro dependency 13668: GuildRoleSubscriptionsConstants */).TIER_TRIAL_INTERVALS;
const env0_4 = (require(1880) /* metro dependency 1880: PremiumConstants */).SubscriptionIntervalTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_role_subscriptions/useTrialIntervalOptions.tsx');
exports.default = useTrialIntervalOptions;
}
function useTrialIntervalOptions(a0) { // fn#104655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13892:277, offset: 0x0229cc05, size: 44 bytes, params: 2, frame: 14
const env0_0 = a0;
return env0_2.useMemo(_fun104656, [a0]);
}
function _fun104656() { // fn#104656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13892:331, offset: 0x0229cc31, size: 93 bytes, params: 1, frame: 13
var environment;
let value = environment.__proto__;
value = TIER_TRIAL_INTERVALS.map(_fun104657);
return {options: value, selectedOption: env0_0 != null ? value.find(_fun104658)?.value : env0_0};
}
function _fun104657(a0) { // fn#104657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13892:351, offset: 0x0229cc8e, size: 219 bytes, params: 2, frame: 21
var r3;
var intl;
var formatToPlainString;
var XfSsr1;
var object;
let interval = a0.interval;
const value = environment.__proto__.__proto__;
let DAY = SubscriptionIntervalTypes.DAY;
if (interval !== DAY) {
r3 = (require(13694) /* metro dependency 13694: GuildRoleSubscriptionTypeUtils */).formatPlanIntervalDuration(a0);
} else if (a0.interval_count === 7) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
formatToPlainString = intl.formatToPlainString;
XfSsr1 = (require(1244) /* metro dependency 1244: indexNative */).t.XfSsr1;
object = {};
object.defaultLimit = (require(13694) /* metro dependency 13694: GuildRoleSubscriptionTypeUtils */).formatPlanIntervalDuration(a0);
r3 = Reflect.apply(formatToPlainString, intl, [XfSsr1, object]);
} else {
r3 = (require(13694) /* metro dependency 13694: GuildRoleSubscriptionTypeUtils */).formatPlanIntervalDuration(a0);
}
interval = a0.interval;
DAY = SubscriptionIntervalTypes.DAY;
return {value: a0, label: r3, isDefault: interval === DAY && a0.interval_count === 7};
}
function _fun104658(a0) { // fn#104658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13892:635, offset: 0x0229cd69, size: 78 bytes, params: 2, frame: 4
var r0;
var interval;
var interval_count;
let value = a0.value;
value = value != null;
if (value) {
value = a0.value;
interval = value.interval;
value = environment.__proto__;
value = interval === env1_0.interval;
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = a0.value;
interval_count = value.interval_count;
value = environment.__proto__;
value = interval_count === env1_0.interval_count;
r0 = value;
}
return r0;
}