decord/source/modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

149 lines
7.1 KiB
TypeScript

// Module ID: 11207
// Function ID: 11208
// Name: PremiumGiftPurchaseSuccess
// Dependencies: [19, 17, 5591, 1373, 1074, 21, 4636, 576, 10827, 1483, 10871, 4875, 10790, 8479, 5056, 1114, 4294, 7292, 4334, 10958, 4632, 9031, 4584, 2]
// Exports: PremiumGiftSuccessActions, default
// Module 11207 (PremiumGiftPurchaseSuccess)
import nativeDefault from "native" /* 576 */;
import ToastUtils from "ToastUtils" /* 4334 */;
import GiftCodeUtils from "GiftCodeUtils" /* 4875 */;
import ClipboardUtils from "ClipboardUtils" /* 7292 */;
import showShareActionSheet from "showShareActionSheet" /* 8479 */;
import PremiumGiftModal from "PremiumGiftModal" /* 10790 */;
import noop from "module_19" /* 19 */;
import SKUStore from "SKUStore" /* 5591 */;
require = fn;
const View = fn(17).View;
const SubscriptionIntervalTypes = fn(1373).SubscriptionIntervalTypes;
const AnalyticsSections = fn(1074).AnalyticsSections;
const jsxProd = fn(21);
({ jsx: closure_8, Fragment: closure_9, jsxs: c10 } = jsxProd);
const createStyles = fn(4636);
let obj2 = { disclaimer: { marginTop: nativeDefault.space.PX_4, marginBottom: nativeDefault.space.PX_16 }, title: null, description: null, input: null, inputLabel: null };
let obj3 = { marginTop: nativeDefault.space.PX_4, marginBottom: nativeDefault.space.PX_16 };
obj2.title = { marginTop: nativeDefault.space.PX_24, textAlign: "center" };
let obj4 = { marginTop: nativeDefault.space.PX_24, textAlign: "center" };
obj2.description = { marginTop: nativeDefault.space.PX_8, textAlign: "center" };
let obj5 = { marginTop: nativeDefault.space.PX_8, textAlign: "center" };
obj2.input = { marginTop: nativeDefault.space.PX_24 };
let obj6 = { marginTop: nativeDefault.space.PX_24 };
obj2.inputLabel = { marginBottom: nativeDefault.space.PX_4 };
let closure_11 = createStyles.createStyles(obj2);
const size = fn(2);
let result = size.fileFinishedImporting("modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx");
export default function PremiumGiftSuccessBody(giftCodeRecord) {
giftCodeRecord = giftCodeRecord.giftCodeRecord;
let tmp = closure_11();
const nativeGiftContext = giftCodeRecord(10827).useNativeGiftContext();
({ giftStyle, premiumType, planInterval } = nativeGiftContext);
let obj = giftCodeRecord(10827);
const giftCodeURL = giftCodeRecord(4875).getGiftCodeURL(giftCodeRecord.code);
if (null != giftCodeRecord.giftStyle) {
giftStyle = giftCodeRecord.giftStyle;
}
if (null != giftCodeRecord.subscriptionPlanId) {
let subscriptionPlanId = giftCodeRecord.subscriptionPlanId;
} else {
subscriptionPlanId = tmp2(4294).getPlanIdForPremiumType(premiumType, planInterval);
const tmp2Result = tmp2(4294);
}
let obj2 = giftCodeRecord(4875);
const tmp6 = giftCodeURL;
const tierDisplayNameByPlanId = giftCodeURL(4294).getTierDisplayNameByPlanId(subscriptionPlanId);
const obj4 = giftCodeURL(4294);
const items = [giftCodeRecord, giftCodeURL];
const obj3 = { children: null };
const callback = noop.useCallback(() => {
value = SKUStore.get(giftCodeRecord.skuId);
if (null != value) {
GiftCodeUtils.trackGiftCodeCopy(tmp, value);
}
ClipboardUtils.copy(giftCodeURL);
tmp = giftCodeRecord;
const result = ToastUtils.presentCopiedToClipboard();
}, items);
obj3.children = closure_8(giftCodeURL(10958), { giftStyle });
const items1 = [closure_8(View, obj3), , , , ];
const obj6 = { style: tmp.title, variant: "heading-lg/bold", children: null };
const intl = tmp2(1114).intl;
obj6.children = intl.string(giftCodeRecord(1114).t["/s1xR7"]);
items1[1] = closure_8(giftCodeRecord(4632).Text, obj6);
const obj7 = { style: tmp.description, variant: "text-md/medium", children: null };
const intl2 = tmp2(1114).intl;
if (obj5.getInterval(subscriptionPlanId).intervalType === SubscriptionIntervalTypes.YEAR) {
let bUdTqI = tmp2(1114).t.rli5ey;
} else {
bUdTqI = tmp2(1114).t.bUdTqI;
}
const obj8 = { children: null };
obj7.children = intl2.format(bUdTqI, { intervalCount: 1, name: tierDisplayNameByPlanId });
items1[2] = closure_8(giftCodeRecord(4632).Text, obj7);
const obj9 = { style: tmp.input, children: null };
const obj10 = { style: tmp.inputLabel, variant: "heading-md/bold", children: null };
const intl3 = tmp2(1114).intl;
obj10.children = intl3.string(giftCodeRecord(1114).t["qS+yMo"]);
const items2 = [closure_8(giftCodeRecord(4632).Text, obj10), ];
obj5 = giftCodeURL(4294);
const tmp10 = closure_9;
const tmp12 = View;
items2[1] = closure_8(giftCodeRecord(9031).InputButton, { text: giftCodeURL, icon: tmp6(4584), iconPosition: "end", onPress: callback });
obj9.children = items2;
items1[3] = closure_10(tmp12, obj9);
const obj12 = { style: tmp.disclaimer, variant: "text-xs/normal", children: null };
const intl4 = tmp2(1114).intl;
obj12.children = intl4.string(giftCodeRecord(1114).t.As9eLl);
items1[4] = closure_8(giftCodeRecord(4632).Text, obj12);
obj8.children = items1;
return closure_10(tmp10, obj8);
};
export const PremiumGiftSuccessActions = function PremiumGiftSuccessActions(giftCodeRecord) {
let onClose;
let navigation;
const nativeGiftContext = onClose(navigation[8]).useNativeGiftContext();
onClose = nativeGiftContext.onClose;
const prePurchaseGiftingBadgeProgress = nativeGiftContext.prePurchaseGiftingBadgeProgress;
let obj = onClose(navigation[8]);
navigation = onClose(navigation[9]).useNavigation();
const GiftingBadgeExperiment = onClose(navigation[10]).GiftingBadgeExperiment;
const enabled = GiftingBadgeExperiment.useConfig({ location: "PremiumGiftSuccessActions" }).enabled;
const obj2 = onClose(navigation[9]);
const giftCodeURL = onClose(navigation[11]).getGiftCodeURL(giftCodeRecord.giftCodeRecord.code);
const items = [enabled, prePurchaseGiftingBadgeProgress, navigation, onClose];
const items1 = [giftCodeURL, enabled, prePurchaseGiftingBadgeProgress, navigation];
const callback = enabled.useCallback(() => {
if (enabled) {
if (null != prePurchaseGiftingBadgeProgress) {
const obj = { currentProgress: tmp };
navigation.navigate(PremiumGiftModal.PremiumGiftScreens.GIFTING_BADGE, obj);
}
}
onClose();
}, items);
const obj4 = { children: null };
const callback1 = enabled.useCallback(() => {
showShareActionSheet.showShareActionSheet({ url: giftCodeURL }, AnalyticsSections.PREMIUM_GIFT_SUCCESS_MODAL);
let tmp4 = enabled;
if (enabled) {
tmp4 = null != prePurchaseGiftingBadgeProgress;
}
if (tmp4) {
const obj3 = { currentProgress: prePurchaseGiftingBadgeProgress };
navigation.navigate(PremiumGiftModal.PremiumGiftScreens.GIFTING_BADGE, obj3);
}
}, items1);
const obj5 = { variant: "primary", text: null, onPress: null };
const intl = onClose(navigation[15]).intl;
obj5.text = intl.string(onClose(navigation[15]).t.RDE0Sc);
obj5.onPress = callback1;
const items2 = [closure_8(onClose(navigation[14]).Button, obj5), ];
const obj6 = { variant: "secondary", text: null, onPress: null };
const intl2 = onClose(navigation[15]).intl;
obj6.text = intl2.string(onClose(navigation[15]).t.cpT0Cq);
obj6.onPress = callback;
items2[1] = closure_8(onClose(navigation[14]).Button, obj6);
obj4.children = items2;
return closure_10(closure_9, obj4);
};