decord/alpha/source/components_native/premium/OutboundPromotionCard.tsx
2026-10-13 12:43:34 +00:00

223 lines
9.3 KiB
TypeScript

// Module ID: 14187
// Function ID: 14188
// Name: OutboundPromotionCard
// Dependencies: [32, 19, 17, 1085, 21, 5092, 587, 5969, 558, 576, 6839, 1126, 5079, 6840, 5088, 5031, 9157, 14188, 5300, 14189, 2000, 9158, 6157, 5379, 5056, 2]
// Exports: default
// Module 14187 (OutboundPromotionCard)
import react_native from "react-native" /* 17 */;
import react2 from "react" /* 576 */;
import nativeDefault from "native" /* 587 */;
import Constants from "Constants" /* 1085 */;
import intl4 from "intl" /* 1126 */;
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 5056 */;
import MarkupUtilsDefault from "MarkupUtils" /* 5079 */;
import Text_Text from "Text/Text" /* 5088 */;
import actions_AlertActionCreatorsDefault from "actions/AlertActionCreators" /* 5300 */;
import LegacyTokens from "LegacyTokens" /* 5969 */;
import BottomSheetTitleHeader2 from "BottomSheetTitleHeader" /* 6839 */;
import Sheet_BottomSheet from "Sheet/BottomSheet" /* 6840 */;
import _slicedToArray_mod from "_slicedToArray" /* 32 */;
import react from "react" /* 19 */;
import Fragment from "Fragment" /* 21 */;
import createStyles_mod from "createStyles" /* 5092 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size_mod from "module_2" /* 2 */;
let BottomSheet;
let metroImportDefault;
let metroRequire;
let obj2;
let size;
let _slicedToArray = _slicedToArray_mod;
const View = react_native.View;
const USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING = Constants.USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING;
({ jsx: metroRequire, jsxs: metroImportDefault } = Fragment);
let createStyles = createStyles_mod;
let obj = { card: obj2, mainContainer: { flex: 1, flexDirection: "row", alignItems: "center", justifyContent: "space-between" }, textContainer: { flexDirection: "row", flexShrink: 1, alignItems: "center" }, imageContainer: size, image: { width: 28, height: 28, resizeMode: "contain" }, title: { lineHeight: 20 }, subText: { lineHeight: 18 }, claimButton: { paddingHorizontal: 12 }, moreDetails: { marginLeft: 40 }, termsAndConditionsText: { paddingHorizontal: 16, paddingTop: 16 }, buttonContainer: { flexGrow: 1, flexDirection: "row", marginLeft: 4, justifyContent: "flex-end" } };
obj2 = { flex: 1, flexDirection: "column", paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING, paddingVertical: 12, backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW, marginTop: 8 };
createStyles = createStyles.createStyles;
size = { width: 32, height: 32, marginRight: 8, borderRadius: nativeDefault.radii.xs, alignItems: "center", justifyContent: "center", backgroundColor: LegacyTokens.DARK_BLACK_500_LIGHT_PRIMARY_100 };
let closure_8 = createStyles(obj);
let closure_9 = ReactCompilerGating.isReactCompilerEnabled() ? (function TermsAndConditionsActionSheet(termsAndConditions) {
let first;
let intl;
let tmp8;
const obj = react2;
const cResult = obj.c(6);
termsAndConditions = termsAndConditions.termsAndConditions;
const tmp4 = closure_8();
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const obj2 = { title: intl.string(intl4.t.PdKWVT) };
const BottomSheetTitleHeader = tmp(6839).BottomSheetTitleHeader;
intl = tmp(1126).intl;
const tmp7 = metroRequire(BottomSheetTitleHeader, obj2);
cResult[0] = tmp7;
first = tmp7;
} else {
first = cResult[0];
}
const termsAndConditionsText = tmp4.termsAndConditionsText;
if (cResult[1] !== termsAndConditions) {
const obj3 = MarkupUtilsDefault;
const parsed = obj3.parse(termsAndConditions, false, { allowLinks: true });
cResult[1] = termsAndConditions;
cResult[2] = parsed;
tmp8 = parsed;
} else {
tmp8 = cResult[2];
}
if (cResult[3] === tmp4.termsAndConditionsText) {
let tmp11;
if (cResult[4] === tmp8) {
tmp11 = cResult[5];
}
return tmp11;
}
const obj4 = { header: first, children: metroRequire(Text_Text.Text, { style: termsAndConditionsText, variant: "text-sm/medium", children: tmp8 }) };
BottomSheet = tmp(6840).BottomSheet;
const tmp12 = metroRequire(BottomSheet, obj4);
cResult[3] = tmp4.termsAndConditionsText;
cResult[4] = tmp8;
cResult[5] = tmp12;
tmp11 = tmp12;
}) : (function TermsAndConditionsActionSheet(termsAndConditions) {
let BottomSheetTitleHeader;
let Text;
let intl;
let obj2;
let obj3;
let obj4;
termsAndConditions = termsAndConditions.termsAndConditions;
const obj = { header: metroRequire(BottomSheetTitleHeader, obj2), children: metroRequire(Text, obj3) };
const tmp = closure_8();
BottomSheet = Sheet_BottomSheet.BottomSheet;
obj2 = { title: intl.string(intl4.t.PdKWVT) };
BottomSheetTitleHeader = BottomSheetTitleHeader2.BottomSheetTitleHeader;
intl = intl4.intl;
obj3 = { style: tmp.termsAndConditionsText, variant: "text-sm/medium", children: obj4.parse(termsAndConditions, false, { allowLinks: true }) };
Text = Text_Text.Text;
obj4 = MarkupUtilsDefault;
return metroRequire(BottomSheet, obj);
});
size = size_mod;
const result = size.fileFinishedImporting("components_native/premium/OutboundPromotionCard.tsx");
export default function OutboundPromotionCard(outboundPromotion) {
let Text;
let closure_3;
let first;
let formatToPlainStringResult;
let intl3;
let items1;
let items2;
let items3;
let obj13;
let obj14;
let obj16;
let obj17;
let obj7;
let obj9;
let stringResult;
outboundPromotion = outboundPromotion.outboundPromotion;
const code = outboundPromotion.code;
first = undefined;
_slicedToArray = undefined;
let tmp = closure_8();
const tmp2 = code;
const tmp4 = code(first[15])();
let obj = outboundPromotion(first[16]);
const promotionImageURL = obj.getPromotionImageURL(outboundPromotion.id, tmp4);
const tmp8 = code(first[17])(outboundPromotion, null != code);
const intl = outboundPromotion(first[11]).intl;
const formatToPlainString = intl.formatToPlainString;
const t = outboundPromotion(first[11]).t;
if (null != code) {
let obj2 = { endDate: tmp8 };
formatToPlainStringResult = formatToPlainString(t.VaD05h, obj2);
} else {
let obj3 = { endDate: tmp8 };
formatToPlainStringResult = formatToPlainString(t["/XWgfG"], obj3);
}
const intl2 = tmp5(tmp3[11]).intl;
const string = intl2.string;
const t2 = tmp5(tmp3[11]).t;
if (null != code) {
stringResult = string(t2["2cHUti"]);
} else {
stringResult = string(t2.O13yhz);
}
[first, _slicedToArray] = react.useState(false);
const items = [first, code, outboundPromotion];
const layoutEffect = react.useLayoutEffect(() => {
const tmp = first;
if (tmp) {
let obj = actions_AlertActionCreatorsDefault;
const obj2 = {
importer() {
const promise = outboundPromotion(first[20])(first[19], first.paths);
return promise.then((result) => {
let closure_0 = result.default;
return (arg0) => {
let obj = {
onCancel() {
const obj = code(closure_2_2[18]);
obj.close();
closure_1_3(false);
},
onClaim: closure_3_1(first[21]).addClaimedOutboundPromotionCode,
code,
outboundPromotion
};
const merged = Object.assign(arg0);
return closure_3_6(closure_0, obj);
};
});
},
isDismissable: false
};
obj.openLazy(obj2);
}
}, items);
const obj4 = { style: tmp.card, children: items3 };
const obj5 = { style: tmp.mainContainer, children: items1 };
const obj6 = { style: tmp.imageContainer, children: closure_6(tmp2(first[22]), obj7) };
obj7 = { style: tmp.image, source: { uri: promotionImageURL } };
items1 = [closure_6(View, obj6), , ];
const obj8 = { style: tmp.textContainer, children: closure_7(View, obj9) };
obj9 = { children: items2 };
items2 = [, ];
const obj10 = { style: tmp.title, accessibilityRole: "header", variant: "text-md/semibold", color: "mobile-text-heading-primary", children: outboundPromotion.outboundTitle };
items2[0] = closure_6(outboundPromotion(first[14]).Text, obj10);
const obj11 = { style: tmp.subText, variant: "text-sm/medium", color: "text-default", children: formatToPlainStringResult };
items2[1] = closure_6(outboundPromotion(first[14]).Text, obj11);
items1[1] = closure_6(View, obj8);
const obj12 = { style: tmp.buttonContainer, children: closure_6(View, obj13) };
obj13 = { style: tmp.claimButton, children: closure_6(outboundPromotion(first[23]).Button, obj14) };
obj14 = {
size: "sm",
shrink: true,
text: stringResult,
onPress() {
return closure_3(true);
}
};
items1[2] = closure_6(View, obj12);
items3 = [closure_7(View, obj5), ];
const obj15 = { children: closure_6(Text, obj16) };
obj16 = { style: tmp.moreDetails, variant: "text-sm/medium", children: intl3.format(outboundPromotion(first[11]).t.sCm3Zb, obj17) };
Text = tmp5(tmp3[14]).Text;
intl3 = tmp5(tmp3[11]).intl;
obj17 = {
onClick: function showTermsAndConditions() {
const obj = ActionSheetActionCreatorsDefault;
obj.hideActionSheet();
const obj2 = ActionSheetActionCreatorsDefault;
const obj3 = { termsAndConditions: outboundPromotion.outboundTermsAndConditions };
obj2.openLazy(() => Promise.resolve(closure_1_9), "OutboundPromotionTermsAndConditions-" + outboundPromotion.id, obj3);
}
};
items3[1] = closure_6(View, obj15);
return closure_7(View, obj4);
};