2026-08-24 06:08:38 +00:00
|
|
|
// Module ID: 12908
|
|
|
|
|
// Function ID: 12909
|
2026-07-29 08:29:29 +00:00
|
|
|
// Name: getSubscriptionPlansLoaded
|
2026-08-24 06:08:38 +00:00
|
|
|
// Dependencies: [4045, 4047, 4048, 1924, 3, 589, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: useSubscriptionPlansLoaded
|
|
|
|
|
|
2026-08-24 06:08:38 +00:00
|
|
|
// Module 12908 (getSubscriptionPlansLoaded)
|
|
|
|
|
import timestampDefault from "timestamp" /* 3 */;
|
|
|
|
|
import closure_2 from "handlePaymentSourceUpdate" /* 4045 */;
|
|
|
|
|
import closure_3 from "addSubscriptionPlan" /* 4047 */;
|
|
|
|
|
import closure_4 from "reset" /* 4048 */;
|
|
|
|
|
import { ACTIVE_PREMIUM_SKUS } from "GuildFeatures" /* 1924 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-08-24 06:08:38 +00:00
|
|
|
const require = arg1;
|
2026-07-29 08:29:29 +00:00
|
|
|
function getSubscriptionPlansLoaded(items) {
|
|
|
|
|
let tmp = items;
|
|
|
|
|
if (items === undefined) {
|
|
|
|
|
items = [];
|
2026-07-20 16:05:17 +00:00
|
|
|
HermesBuiltin.arraySpread(ACTIVE_PREMIUM_SKUS, 0);
|
|
|
|
|
tmp = items;
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
let tmp5 = arg1;
|
|
|
|
|
if (arg1 === undefined) {
|
2026-08-24 06:08:38 +00:00
|
|
|
const items1 = [closure_2, closure_3, closure_4];
|
2026-07-29 08:29:29 +00:00
|
|
|
tmp5 = items1;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
[tmp9, obj, obj2] = tmp5;
|
|
|
|
|
({ paymentSourceIds, defaultPaymentSourceId } = tmp9);
|
2026-07-20 16:05:17 +00:00
|
|
|
const premiumTypeSubscription = obj2.getPremiumTypeSubscription();
|
|
|
|
|
let paymentSourceId;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (premiumTypeSubscription != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
paymentSourceId = premiumTypeSubscription.paymentSourceId;
|
|
|
|
|
}
|
|
|
|
|
if (null != paymentSourceId) {
|
|
|
|
|
if (!obj.hasPaymentSourceForSKUIds(paymentSourceId, tmp)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (null != defaultPaymentSourceId) {
|
|
|
|
|
if (!obj.hasPaymentSourceForSKUIds(defaultPaymentSourceId, tmp)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
for (const item10046 of paymentSourceIds) {
|
|
|
|
|
if (obj.hasPaymentSourceForSKUIds(item10046, tmp)) {
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
|
|
|
|
let tmp13 = obj3;
|
|
|
|
|
obj3.return();
|
|
|
|
|
let flag3 = false;
|
|
|
|
|
return false;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return obj.isLoadedForSKUs(tmp);
|
|
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
new timestampDefault("useSubscriptionPlansLoaded");
|
|
|
|
|
const result = require("set").fileFinishedImporting("modules/billing/hooks/useSubscriptionPlansLoaded.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const useSubscriptionPlansLoaded = function useSubscriptionPlansLoaded() {
|
|
|
|
|
let tmp = arg0;
|
|
|
|
|
if (arg0 === undefined) {
|
2026-07-23 10:11:24 +00:00
|
|
|
let items = [];
|
2026-07-20 16:05:17 +00:00
|
|
|
HermesBuiltin.arraySpread(ACTIVE_PREMIUM_SKUS, 0);
|
|
|
|
|
tmp = items;
|
|
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
items = tmp;
|
|
|
|
|
const items1 = [closure_2, closure_3, closure_4];
|
2026-07-20 16:05:17 +00:00
|
|
|
const items2 = [tmp];
|
2026-08-24 06:08:38 +00:00
|
|
|
return items(589).useStateFromStores(items1, () => {
|
|
|
|
|
items = [closure_1_2, closure_1_3, closure_1_4];
|
|
|
|
|
return closure_1_6(items, items);
|
2026-07-20 16:05:17 +00:00
|
|
|
}, items2);
|
|
|
|
|
};
|
|
|
|
|
export { getSubscriptionPlansLoaded };
|