decord/source/modules/premium/PremiumSubscription.tsx

100 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 4055
// Function ID: 4056
2026-07-20 16:05:17 +00:00
// Name: getNonePlanIdForIntervalType
2026-08-11 06:20:06 +00:00
// Dependencies: [1924, 2]
2026-07-29 08:29:29 +00:00
// Exports: getBasePlanIdForSubscriptionItems, getBaseSubscriptionItemForSubscriptionItems, getNonePlanIdForIntervalType, getNonePlanIdForSubscription
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 4055 (getNonePlanIdForIntervalType)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import GuildFeatures from "GuildFeatures" /* 1924 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
({ SubscriptionPlans: c0, SubscriptionPlanInfo: closure_1, PremiumSubscriptionSKUs: obj1 } = GuildFeatures);
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/premium/PremiumSubscription.tsx");
2026-07-29 08:29:29 +00:00
export const getNonePlanIdForIntervalType = function getNonePlanIdForIntervalType(arg0) {
const constants = arg0;
let num = arg1;
if (arg1 === undefined) {
2026-07-20 16:05:17 +00:00
num = 1;
}
const keys = Object.keys(num);
let NONE_MONTH = keys.find((arg0) => {
let tmp2 = null != tmp;
if (tmp2) {
2026-08-24 06:08:38 +00:00
tmp2 = tmp.skuId === closure_1_2.NONE;
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
2026-07-29 08:29:29 +00:00
tmp2 = tmp.interval === interval;
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
2026-07-29 08:29:29 +00:00
tmp2 = tmp.intervalCount === intervalCount;
2026-07-20 16:05:17 +00:00
}
return tmp2;
});
2026-07-29 08:29:29 +00:00
if (NONE_MONTH == null) {
2026-07-23 10:11:24 +00:00
NONE_MONTH = constants.NONE_MONTH;
2026-07-20 16:05:17 +00:00
}
return NONE_MONTH;
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const getNonePlanIdForSubscription = function getNonePlanIdForSubscription(arg0) {
2026-07-29 08:29:29 +00:00
let num = tmp2.intervalCount;
num = undefined;
const interval = tmp2.interval;
if (num === undefined) {
num = 1;
}
const keys = Object.keys(num);
let NONE_MONTH = keys.find((arg0) => {
let tmp2 = null != tmp;
if (tmp2) {
2026-08-24 06:08:38 +00:00
tmp2 = tmp.skuId === closure_1_2.NONE;
2026-07-29 08:29:29 +00:00
}
if (tmp2) {
tmp2 = tmp.interval === interval;
}
if (tmp2) {
tmp2 = tmp.intervalCount === intervalCount;
}
return tmp2;
});
if (NONE_MONTH == null) {
NONE_MONTH = interval.NONE_MONTH;
}
return NONE_MONTH;
};
2026-08-13 07:00:46 +00:00
export const getBaseSubscriptionItemForSubscriptionItems = function getBaseSubscriptionItemForSubscriptionItems(items) {
return items.find((arg0) => null != intervalCount[arg0.planId] && null != intervalCount[arg0.planId].premiumType);
2026-07-20 16:05:17 +00:00
};
export const getBasePlanIdForSubscriptionItems = function getBasePlanIdForSubscriptionItems(items, interval, intervalCount) {
2026-07-29 08:29:29 +00:00
const found = items.find((arg0) => null != intervalCount[arg0.planId] && null != intervalCount[arg0.planId].premiumType);
if (null == found) {
2026-07-20 16:05:17 +00:00
if (items.length > 0) {
2026-07-29 08:29:29 +00:00
({ interval, intervalCount } = intervalCount[items[0].planId]);
}
if (intervalCount === undefined) {
intervalCount = 1;
}
const _Object = Object;
const keys = Object.keys(intervalCount);
let NONE_MONTH = keys.find((arg0) => {
let tmp2 = null != tmp;
if (tmp2) {
2026-08-24 06:08:38 +00:00
tmp2 = tmp.skuId === closure_1_2.NONE;
2026-07-29 08:29:29 +00:00
}
if (tmp2) {
tmp2 = tmp.interval === interval;
}
if (tmp2) {
tmp2 = tmp.intervalCount === intervalCount;
}
return tmp2;
});
if (NONE_MONTH == null) {
NONE_MONTH = interval.NONE_MONTH;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return NONE_MONTH;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
return found.planId;
2026-07-20 16:05:17 +00:00
}
};