decord/source/modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx

152 lines
6.9 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10424
// Function ID: 10425
2026-07-20 16:05:17 +00:00
// Name: PremiumGiftSuccessBody
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 4526, 1924, 676, 21, 4668, 712, 9662, 1500, 9629, 4385, 10335, 9104, 4750, 1236, 4042, 7205, 4096, 9636, 4739, 8848, 4327, 2]
2026-07-20 16:05:17 +00:00
// Exports: PremiumGiftSuccessActions, default
2026-08-24 06:08:38 +00:00
// Module 10424 (PremiumGiftSuccessBody)
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_5 from "addSku" /* 4526 */;
import { SubscriptionIntervalTypes } from "GuildFeatures" /* 1924 */;
import { AnalyticsSections } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
({ jsx: closure_8, Fragment: c9, jsxs: c10 } = jsxProd);
2026-07-29 08:29:29 +00:00
createCacheKey = { disclaimer: null, title: null, description: null, input: null, inputLabel: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { marginTop: ThemesDefault.space.PX_4, marginBottom: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { marginTop: ThemesDefault.space.PX_24, textAlign: "center" };
let obj1 = { marginTop: ThemesDefault.space.PX_24, textAlign: "center" };
createCacheKey[2] = { marginTop: ThemesDefault.space.PX_8, textAlign: "center" };
let obj2 = { marginTop: ThemesDefault.space.PX_8, textAlign: "center" };
createCacheKey[3] = { marginTop: ThemesDefault.space.PX_24 };
let obj3 = { marginTop: ThemesDefault.space.PX_24 };
createCacheKey[4] = { marginBottom: ThemesDefault.space.PX_4 };
let closure_11 = createCacheKey.createStyles(createCacheKey);
let obj4 = { marginBottom: ThemesDefault.space.PX_4 };
let result = require("set").fileFinishedImporting("modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx");
2026-07-20 16:05:17 +00:00
export default function PremiumGiftSuccessBody(giftCodeRecord) {
giftCodeRecord = giftCodeRecord.giftCodeRecord;
2026-07-29 08:29:29 +00:00
let giftCodeURL;
2026-08-24 06:08:38 +00:00
let tmp = callback3();
let obj = giftCodeRecord(9662);
2026-07-20 16:05:17 +00:00
const nativeGiftContext = obj.useNativeGiftContext();
2026-07-29 08:29:29 +00:00
({ giftStyle, premiumType, planInterval } = nativeGiftContext);
2026-08-24 06:08:38 +00:00
obj1 = giftCodeRecord(4385);
2026-07-29 08:29:29 +00:00
giftCodeURL = obj1.getGiftCodeURL(giftCodeRecord.code);
2026-07-20 16:05:17 +00:00
if (null != giftCodeRecord.giftStyle) {
giftStyle = giftCodeRecord.giftStyle;
}
if (null != giftCodeRecord.subscriptionPlanId) {
let subscriptionPlanId = giftCodeRecord.subscriptionPlanId;
} else {
2026-08-24 06:08:38 +00:00
subscriptionPlanId = tmp2(4042).getPlanIdForPremiumType(premiumType, planInterval);
const tmp2Result = tmp2(4042);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let obj3 = giftCodeURL(4042);
2026-07-20 16:05:17 +00:00
const tierDisplayNameByPlanId = obj3.getTierDisplayNameByPlanId(subscriptionPlanId);
2026-08-24 06:08:38 +00:00
let obj4 = giftCodeURL(4042);
2026-07-20 16:05:17 +00:00
const items = [giftCodeRecord, giftCodeURL];
2026-07-29 08:29:29 +00:00
obj = { children: null };
2026-07-20 16:05:17 +00:00
const callback = React.useCallback(() => {
2026-08-24 06:08:38 +00:00
const value = closure_1_5.get(giftCodeRecord.skuId);
2026-07-20 16:05:17 +00:00
if (null != value) {
2026-08-24 06:08:38 +00:00
giftCodeRecord(closure_1_2[11]).trackGiftCodeCopy(tmp, value);
const obj = giftCodeRecord(closure_1_2[11]);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
giftCodeRecord(closure_1_2[17]).copy(giftCodeURL);
const obj2 = giftCodeRecord(closure_1_2[17]);
2026-07-29 08:29:29 +00:00
tmp = giftCodeRecord;
2026-08-24 06:08:38 +00:00
const result = giftCodeRecord(closure_1_2[18]).presentCopiedToClipboard();
2026-07-20 16:05:17 +00:00
}, items);
2026-08-24 06:08:38 +00:00
obj[0] = callback(giftCodeURL(9636), { giftStyle });
2026-07-20 16:05:17 +00:00
const items1 = [callback(View, obj), , , , ];
2026-07-29 08:29:29 +00:00
obj = { style: tmp.title, variant: "heading-lg/bold", children: null };
const intl = tmp2(1236).intl;
obj[2] = intl.string(giftCodeRecord(1236).t["/s1xR7"]);
2026-08-24 06:08:38 +00:00
items1[1] = callback(giftCodeRecord(4739).Text, obj);
2026-07-29 08:29:29 +00:00
obj1 = { style: tmp.description, variant: "text-md/medium", children: null };
const intl2 = tmp2(1236).intl;
2026-07-20 16:05:17 +00:00
if (obj4.getInterval(subscriptionPlanId).intervalType === SubscriptionIntervalTypes.YEAR) {
2026-07-29 08:29:29 +00:00
let bUdTqI = tmp2(1236).t.rli5ey;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
bUdTqI = tmp2(1236).t.bUdTqI;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj2 = { children: null };
obj1[2] = intl2.format(bUdTqI, { intervalCount: 1, name: tierDisplayNameByPlanId });
2026-08-24 06:08:38 +00:00
items1[2] = callback(giftCodeRecord(4739).Text, obj1);
2026-07-29 08:29:29 +00:00
obj3 = { style: tmp.input, children: null };
obj4 = { style: tmp.inputLabel, variant: "heading-md/bold", children: null };
const intl3 = tmp2(1236).intl;
obj4[2] = intl3.string(giftCodeRecord(1236).t["qS+yMo"]);
2026-08-24 06:08:38 +00:00
const items2 = [callback(giftCodeRecord(4739).Text, obj4), callback(giftCodeRecord(8848).InputButton, { text: giftCodeURL, icon: giftCodeURL(4327), iconPosition: "end", onPress: callback })];
2026-07-29 08:29:29 +00:00
obj3[1] = items2;
items1[3] = closure_10(View, obj3);
const obj6 = { style: tmp.disclaimer, variant: "text-xs/normal", children: null };
const intl4 = tmp2(1236).intl;
obj6[2] = intl4.string(giftCodeRecord(1236).t.As9eLl);
2026-08-24 06:08:38 +00:00
items1[4] = callback(giftCodeRecord(4739).Text, obj6);
2026-07-29 08:29:29 +00:00
obj2[0] = items1;
return closure_10(closure_9, obj2);
2026-07-20 16:05:17 +00:00
};
export const PremiumGiftSuccessActions = function PremiumGiftSuccessActions(giftCodeRecord) {
2026-07-29 08:29:29 +00:00
let onClose;
let prePurchaseGiftingBadgeProgress;
let navigation;
let enabled;
let giftCodeURL;
2026-07-23 10:11:24 +00:00
let obj = onClose(navigation[8]);
2026-07-20 16:05:17 +00:00
const nativeGiftContext = obj.useNativeGiftContext();
2026-07-23 10:11:24 +00:00
onClose = nativeGiftContext.onClose;
2026-07-29 08:29:29 +00:00
prePurchaseGiftingBadgeProgress = nativeGiftContext.prePurchaseGiftingBadgeProgress;
2026-08-24 06:08:38 +00:00
obj1 = onClose(navigation[9]);
2026-07-23 10:11:24 +00:00
navigation = obj1.useNavigation();
const GiftingBadgeExperiment = onClose(navigation[10]).GiftingBadgeExperiment;
2026-07-29 08:29:29 +00:00
enabled = GiftingBadgeExperiment.useConfig({ location: "PremiumGiftSuccessActions" }).enabled;
giftCodeURL = onClose(navigation[11]).getGiftCodeURL(giftCodeRecord.giftCodeRecord.code);
2026-07-20 16:05:17 +00:00
const items = [enabled, prePurchaseGiftingBadgeProgress, navigation, onClose];
const items1 = [giftCodeURL, enabled, prePurchaseGiftingBadgeProgress, navigation];
2026-07-23 10:11:24 +00:00
const callback = enabled.useCallback(() => {
2026-07-20 16:05:17 +00:00
if (enabled) {
if (null != prePurchaseGiftingBadgeProgress) {
2026-07-29 08:29:29 +00:00
const obj = { currentProgress: null };
obj[0] = tmp;
2026-07-20 16:05:17 +00:00
navigation.navigate(onClose(navigation[12]).PremiumGiftScreens.GIFTING_BADGE, obj);
}
}
onClose();
}, items);
2026-07-29 08:29:29 +00:00
obj = { children: null };
2026-07-23 10:11:24 +00:00
const callback1 = enabled.useCallback(() => {
2026-07-20 16:05:17 +00:00
let obj = onClose(navigation[13]);
obj = { url: giftCodeURL };
2026-08-24 06:08:38 +00:00
obj.showShareActionSheet(obj, closure_1_7.PREMIUM_GIFT_SUCCESS_MODAL);
2026-07-29 08:29:29 +00:00
let tmp4 = enabled;
2026-07-20 16:05:17 +00:00
if (enabled) {
2026-07-29 08:29:29 +00:00
tmp4 = null != prePurchaseGiftingBadgeProgress;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
obj = { currentProgress: null };
obj[0] = prePurchaseGiftingBadgeProgress;
2026-07-20 16:05:17 +00:00
navigation.navigate(onClose(navigation[12]).PremiumGiftScreens.GIFTING_BADGE, obj);
}
}, items1);
2026-07-29 08:29:29 +00:00
obj = { variant: "primary", text: null, onPress: null };
2026-07-23 10:11:24 +00:00
const intl = onClose(navigation[15]).intl;
2026-07-29 08:29:29 +00:00
obj[1] = intl.string(onClose(navigation[15]).t.RDE0Sc);
obj[2] = callback1;
2026-07-23 10:11:24 +00:00
const items2 = [callback(onClose(navigation[14]).Button, obj), ];
2026-07-29 08:29:29 +00:00
obj1 = { variant: "secondary", text: null, onPress: null };
2026-07-23 10:11:24 +00:00
const intl2 = onClose(navigation[15]).intl;
2026-07-29 08:29:29 +00:00
obj1[1] = intl2.string(onClose(navigation[15]).t.cpT0Cq);
obj1[2] = callback;
2026-07-23 10:11:24 +00:00
items2[1] = callback(onClose(navigation[14]).Button, obj1);
2026-07-29 08:29:29 +00:00
obj[0] = items2;
2026-07-20 16:05:17 +00:00
return callback2(closure_9, obj);
};