decord/source/modules/premium/native/PremiumPlanSelectYearlyUpsellModal.tsx

158 lines
6.3 KiB
TypeScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 12887
// Function ID: 12888
2026-07-20 16:05:17 +00:00
// Name: PremiumPlanSelectYearlyUpsellModal
2026-08-12 06:57:52 +00:00
// Dependencies: [32, 19, 17, 1994, 5897, 12878, 1924, 505, 21, 4344, 5275, 5198, 6912, 589, 1898, 4772, 12888, 1297, 1236, 4007, 4754, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-12 06:57:52 +00:00
// Module 12887 (PremiumPlanSelectYearlyUpsellModal)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import getPremiumPlanItem from "getPremiumPlanItem";
import get_ActivityIndicator from "Button";
import _getSystemLocale from "_getSystemLocale";
import updateProduct from "updateProduct";
2026-07-23 10:11:24 +00:00
import { usePremiumPlanSelectStore } from "usePremiumPlanSelectStore";
import { PREMIUM_YEARLY_DISCOUNT_PERCENT as closure_10 } from "GuildFeatures";
2026-07-29 08:29:29 +00:00
import jsxProd from "set";
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_12;
let closure_6;
2026-07-29 08:29:29 +00:00
let unpackModuleId;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ Image: c5, View: closure_6 } = get_ActivityIndicator);
({ jsx: unpackModuleId, jsxs: closure_12 } = jsxProd);
createCacheKey = { container: { marginHorizontal: 26 }, image: { alignSelf: "center", marginVertical: 32 }, header: null, description: null, upsellButton: null, continueButton: null, cancelButton: null };
createCacheKey = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(require("createTextStyle")(require("sum").Fonts.DISPLAY_EXTRABOLD, undefined, 24));
2026-07-29 08:29:29 +00:00
createCacheKey.alignSelf = "center";
createCacheKey.textAlign = "center";
createCacheKey.paddingBottom = 8;
createCacheKey.color = require("result").DARK_WHITE_500_LIGHT_BLACK_500;
createCacheKey[2] = createCacheKey;
createCacheKey[3] = { alignSelf: "center", textAlign: "center", paddingBottom: 32, color: require("result").DARK_WHITE_500_LIGHT_BLACK_500 };
createCacheKey[4] = { marginBottom: 16 };
createCacheKey[5] = { marginBottom: 4 };
createCacheKey[6] = { marginTop: 8, marginBottom: 4 };
createCacheKey = createCacheKey.createStyles(createCacheKey);
2026-07-23 10:11:24 +00:00
let obj1 = { alignSelf: "center", textAlign: "center", paddingBottom: 32, color: require("result").DARK_WHITE_500_LIGHT_BLACK_500 };
const result = require("get ActivityIndicator").fileFinishedImporting("modules/premium/native/PremiumPlanSelectYearlyUpsellModal.tsx");
2026-07-20 16:05:17 +00:00
export default function PremiumPlanSelectYearlyUpsellModal(arg0) {
2026-07-29 08:29:29 +00:00
let c3;
2026-07-23 10:11:24 +00:00
let dependencyMap;
let importDefault;
2026-07-20 16:05:17 +00:00
let onClose;
let orderPriceString;
let productId;
2026-07-29 08:29:29 +00:00
let tmp4;
2026-07-20 16:05:17 +00:00
({ onClose, productId } = arg0);
2026-07-23 10:11:24 +00:00
({ orderPriceString, continueWithUpsell: importDefault, continueWithDefault: dependencyMap } = arg0);
2026-07-29 08:29:29 +00:00
let callback;
2026-07-20 16:05:17 +00:00
let React;
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
2026-07-20 16:05:17 +00:00
const tmp2 = usePremiumPlanSelectStore((isPurchasing) => isPurchasing.isPurchasing);
2026-07-29 08:29:29 +00:00
let obj = React;
[tmp4, c3] = callback(React.useState(null), 2);
2026-08-12 06:57:52 +00:00
let obj1 = productId(6912);
2026-07-29 08:29:29 +00:00
const premiumBundledItemsFromProductId = obj1.getPremiumBundledItemsFromProductId(productId);
let obj2 = productId(589);
let items = [_getSystemLocale];
const stateFromStores = obj2.useStateFromStores(items, () => locale.locale);
let obj3 = productId(589);
const items1 = [updateProduct];
const tmp9 = callback(obj3.useStateFromStoresArray(items1, () => {
2026-07-23 10:11:24 +00:00
const items = [outer1_8.getProduct(productId), outer1_8.isBusy()];
2026-07-20 16:05:17 +00:00
return items;
}), 2);
2026-07-29 08:29:29 +00:00
const first = tmp9[0];
let tmp11 = tmp2;
2026-07-20 16:05:17 +00:00
if (!tmp2) {
2026-07-29 08:29:29 +00:00
tmp11 = tmp9[1];
2026-07-20 16:05:17 +00:00
}
const premiumTier = premiumBundledItemsFromProductId.premiumTier;
2026-07-29 08:29:29 +00:00
if (orderPriceString == null) {
2026-07-20 16:05:17 +00:00
let priceString;
2026-07-29 08:29:29 +00:00
if (first != null) {
priceString = first.priceString;
2026-07-20 16:05:17 +00:00
}
orderPriceString = priceString;
}
2026-07-29 08:29:29 +00:00
React = tmp13;
const effect = obj.useEffect(() => {
2026-07-23 10:11:24 +00:00
if (c4) {
2026-07-20 16:05:17 +00:00
callback2();
}
});
if (null == premiumTier || null == orderPriceString) {
return null;
} else {
2026-08-11 06:20:06 +00:00
let tmp5Result = tmp5(1898);
2026-07-29 08:29:29 +00:00
const formatPercentResult = tmp5Result.formatPercent(stateFromStores, closure_10 / 100);
obj = { onClose: null, noDefaultButtons: true, children: null };
obj[0] = onClose;
obj = { style: null, children: null };
obj[0] = tmp.container;
obj1 = { style: null, source: null };
obj1[0] = tmp.image;
2026-08-12 06:57:52 +00:00
obj1[1] = importDefault(12888);
2026-07-20 16:05:17 +00:00
const items2 = [callback2(closure_5, obj1), , , , , ];
2026-07-29 08:29:29 +00:00
obj2 = { style: null, accessibilityRole: "header", children: null };
obj2[0] = tmp.header;
const intl = tmp5(1236).intl;
obj3 = { discountPercentage: null, planName: null };
obj3[0] = formatPercentResult;
2026-08-12 06:57:52 +00:00
tmp5Result = tmp5(4007);
2026-07-29 08:29:29 +00:00
obj3[1] = tmp5Result.getPremiumTypeDisplayName(premiumTier);
obj2[2] = intl.format(tmp5(1236).t.LQCVfK, obj3);
items2[1] = callback2(tmp5(1297).LegacyText, obj2);
const obj4 = { style: null, children: null };
obj4[0] = tmp.description;
const intl2 = tmp5(1236).intl;
const obj5 = { discountPercentage: null };
obj5[0] = formatPercentResult;
obj4[1] = intl2.format(tmp5(1236).t["7chOVL"], obj5);
items2[2] = callback2(tmp5(1297).LegacyText, obj4);
const obj6 = { style: null, children: null };
obj6[0] = tmp.upsellButton;
const obj7 = { variant: "active", text: null, onPress: null, disabled: null, loading: null };
const intl3 = tmp5(1236).intl;
const obj8 = { price: null };
obj8[0] = orderPriceString;
obj7[1] = intl3.formatToPlainString(tmp5(1236).t.Qvq6GE, obj8);
obj7[2] = function onPress() {
_undefined("upsell");
2026-07-20 16:05:17 +00:00
callback();
};
2026-07-29 08:29:29 +00:00
obj7[3] = tmp11;
obj7[4] = "upsell" === tmp4 && tmp2;
2026-08-12 06:57:52 +00:00
obj6[1] = callback2(tmp5(4754).Button, obj7);
2026-07-20 16:05:17 +00:00
items2[3] = callback2(closure_6, obj6);
2026-07-29 08:29:29 +00:00
const obj9 = { style: null, children: null };
obj9[0] = tmp.continueButton;
const obj10 = { variant: "secondary", text: null, onPress: null, disabled: null, loading: null };
const intl4 = tmp5(1236).intl;
obj10[1] = intl4.string(tmp5(1236).t.YwEyQM);
obj10[2] = function onPress() {
_undefined("default");
2026-07-20 16:05:17 +00:00
callback2();
};
2026-07-29 08:29:29 +00:00
obj10[3] = tmp11;
obj10[4] = "default" === tmp4 && tmp2;
2026-08-12 06:57:52 +00:00
obj9[1] = callback2(tmp5(4754).Button, obj10);
2026-07-20 16:05:17 +00:00
items2[4] = callback2(closure_6, obj9);
2026-07-29 08:29:29 +00:00
const obj11 = { style: null, children: null };
obj11[0] = tmp.cancelButton;
const obj12 = { variant: "tertiary", text: null, onPress: null };
const intl5 = tmp5(1236).intl;
obj12[1] = intl5.string(tmp5(1236).t.cpT0Cq);
obj12[2] = onClose;
2026-08-12 06:57:52 +00:00
obj11[1] = callback2(tmp5(4754).Button, obj12);
2026-07-20 16:05:17 +00:00
items2[5] = callback2(closure_6, obj11);
2026-07-29 08:29:29 +00:00
obj[1] = items2;
obj[2] = closure_12(closure_6, obj);
2026-08-12 06:57:52 +00:00
return callback2(importDefault(4772), obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp3 = callback(React.useState(null), 2);
2026-07-20 16:05:17 +00:00
};