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

323 lines
14 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10342
// Function ID: 10343
2026-08-13 07:00:46 +00:00
// Name: PremiumGiftPlanSelectPromotionDetails
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 7666, 1924, 505, 21, 712, 4668, 6819, 589, 7970, 10343, 9365, 10344, 10345, 9668, 5454, 8439, 10346, 9369, 9367, 4739, 1236, 9374, 4750, 4107, 4761, 10348, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 10342 (PremiumGiftPlanSelectPromotionDetails)
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
import ManaContext from "ManaContext" /* 4107 */;
import Button from "Button" /* 4750 */;
import LinearGradientDefault from "LinearGradient" /* 4761 */;
import createTextStyleDefault from "createTextStyle" /* 6819 */;
import usePremiumFeaturesDefault from "usePremiumFeatures" /* 9365 */;
import useThemeAndReducedMotionAwareAssetUrl from "useThemeAndReducedMotionAwareAssetUrl" /* 10343 */;
import usePremiumProductPricingStringDefault from "usePremiumProductPricingString" /* 10344 */;
import useShouldShowGiftingPromotionDecoDefault from "useShouldShowGiftingPromotionDeco" /* 10345 */;
import AnimatedImageDefault from "AnimatedImage" /* 10348 */;
import closure_3 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_6 from "createEmptyPromotionsByType" /* 7666 */;
import GuildFeatures from "GuildFeatures" /* 1924 */;
import { Fonts } from "sum" /* 505 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-08-13 07:00:46 +00:00
function PremiumGiftPlanSelectPromotionDetails(config) {
config = config.config;
({ isSelected, onPress } = config);
2026-08-24 06:08:38 +00:00
obj = useThemeAndReducedMotionAwareAssetUrl;
2026-08-13 07:00:46 +00:00
const themeAndReducedMotionAwareAssetUrl = obj.useThemeAndReducedMotionAwareAssetUrl(config.avatarAsset, true);
obj = { theme: "dark", children: null };
obj = { style: callback4(config.isLargeSize).promotionDetailsContainer, colors: [4294967102, 4294967053], children: null };
const tmp = callback4(config.isLargeSize);
2026-08-24 06:08:38 +00:00
const items = [callback2(AnimatedImageDefault, { imageUrl: themeAndReducedMotionAwareAssetUrl, title: config.header, subtitle: config.mobileBody, shouldAnimate: isSelected }), ];
obj2 = { variant: "primary-overlay", text: null, onPress: null };
const intl = getSystemLocale.intl;
obj2[1] = intl.string(getSystemLocale.t.Ve9Ge6);
2026-08-13 07:00:46 +00:00
obj2[2] = onPress;
2026-08-24 06:08:38 +00:00
items[1] = callback2(Button.Button, obj2);
2026-08-13 07:00:46 +00:00
obj[2] = items;
2026-08-24 06:08:38 +00:00
obj[1] = callback3(LinearGradientDefault, obj);
return callback2(ManaContext.ThemeContextProvider, obj);
2026-08-13 07:00:46 +00:00
}
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
2026-08-24 06:08:38 +00:00
({ PremiumTypes: error, SubscriptionIntervalTypes: closure_8 } = GuildFeatures);
2026-07-29 08:29:29 +00:00
({ jsx: c10, Fragment: unpackModuleId, jsxs: closure_12 } = jsxProd);
let obj = { default: null, compact: null, smallCompact: null };
2026-08-24 06:08:38 +00:00
obj = { paddingVertical: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
obj[0] = obj;
2026-08-24 06:08:38 +00:00
obj[1] = { paddingVertical: ThemesDefault.space.PX_4 };
2026-07-29 08:29:29 +00:00
obj[2] = { paddingVertical: 2 };
let obj2 = { default: null, compact: null, smallCompact: null };
2026-08-24 06:08:38 +00:00
let obj1 = { paddingVertical: ThemesDefault.space.PX_4 };
obj2[0] = { marginTop: ThemesDefault.space.PX_24 };
let obj3 = { marginTop: ThemesDefault.space.PX_24 };
obj2[1] = { marginTop: ThemesDefault.space.PX_12 };
let obj4 = { marginTop: ThemesDefault.space.PX_12 };
obj2[2] = { marginTop: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
let obj6 = { default: null, compact: null, smallCompact: null };
2026-08-24 06:08:38 +00:00
let obj5 = { marginTop: ThemesDefault.space.PX_8 };
obj6[0] = { marginTop: ThemesDefault.space.PX_8 };
let obj7 = { marginTop: ThemesDefault.space.PX_8 };
obj6[1] = { marginTop: ThemesDefault.space.PX_12 };
let obj8 = { marginTop: ThemesDefault.space.PX_12 };
obj6[2] = { marginTop: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
let obj10 = { default: null, compact: null, smallCompact: null };
2026-08-24 06:08:38 +00:00
let obj9 = { marginTop: ThemesDefault.space.PX_8 };
obj10[0] = { marginTop: ThemesDefault.space.PX_24 };
let obj11 = { marginTop: ThemesDefault.space.PX_24 };
obj10[1] = { marginTop: ThemesDefault.space.PX_12 };
let obj12 = { marginTop: ThemesDefault.space.PX_12 };
obj10[2] = { marginTop: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
let closure_17 = createCacheKey.createStyles(() => {
2026-08-24 06:08:38 +00:00
obj = { promotional: null, card: null, logo: null, promotionalLogo: null, promotionalLogoSingleLine: null, promotionalLogoSmallCompact: null, pricing: null, featureTitle: null, features: null, button: null, promotionalButton: null, featureIcon: null, featureText: null, promotionalCardImage: null, promotionalBackground: null, promotionDetailsContainer: null };
obj = { overflow: "hidden", borderRadius: ThemesDefault.radii.sm };
2026-07-29 08:29:29 +00:00
obj[0] = obj;
2026-08-24 06:08:38 +00:00
obj = { justifyContent: "flex-start", borderRadius: ThemesDefault.radii.sm, backgroundColor: ThemesDefault.colors.BG_SURFACE_RAISED };
const merged = Object.assign(ThemesDefault.shadows.SHADOW_LOW);
2026-07-29 08:29:29 +00:00
obj[1] = obj;
2026-08-24 06:08:38 +00:00
obj[2] = { marginTop: ThemesDefault.space.PX_40, marginStart: ThemesDefault.space.PX_24 };
obj1 = { marginTop: ThemesDefault.space.PX_40, marginStart: ThemesDefault.space.PX_24 };
obj[3] = { marginTop: ThemesDefault.space.PX_24 };
obj2 = { marginTop: ThemesDefault.space.PX_24 };
obj[4] = { marginTop: ThemesDefault.space.PX_32 };
2026-07-29 08:29:29 +00:00
obj[5] = { marginTop: 18 };
2026-08-24 06:08:38 +00:00
const obj3 = { marginTop: ThemesDefault.space.PX_32 };
obj[6] = { maxWidth: 140, marginStart: ThemesDefault.space.PX_24 };
const obj4 = { maxWidth: 140, marginStart: ThemesDefault.space.PX_24 };
obj[7] = { marginStart: ThemesDefault.space.PX_24 };
const obj5 = { marginStart: ThemesDefault.space.PX_24 };
obj[8] = { marginTop: ThemesDefault.space.PX_8, marginHorizontal: ThemesDefault.space.PX_24 };
obj6 = { marginTop: ThemesDefault.space.PX_8, marginHorizontal: ThemesDefault.space.PX_24 };
obj[9] = { marginHorizontal: ThemesDefault.space.PX_24, marginBottom: ThemesDefault.space.PX_24 };
const obj7 = { marginHorizontal: ThemesDefault.space.PX_24, marginBottom: ThemesDefault.space.PX_24 };
obj[10] = { marginTop: ThemesDefault.space.PX_12 };
2026-07-29 08:29:29 +00:00
obj[11] = { width: 24, height: 24 };
2026-07-20 16:05:17 +00:00
const obj9 = {};
2026-08-24 06:08:38 +00:00
const obj8 = { marginTop: ThemesDefault.space.PX_12 };
const merged1 = Object.assign(createTextStyleDefault(Fonts.PRIMARY_NORMAL, ThemesDefault.colors.WHITE, 16));
2026-07-29 08:29:29 +00:00
obj9.marginStart = -8;
obj[12] = obj9;
2026-08-07 06:50:47 +00:00
obj[13] = { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 };
obj[14] = { position: "absolute", height: 300, width: 150, right: 0 };
2026-08-24 06:08:38 +00:00
const tmp2 = createTextStyleDefault;
obj[15] = { marginHorizontal: ThemesDefault.space.PX_24, marginTop: ThemesDefault.space.PX_20, marginBottom: ThemesDefault.space.PX_32, padding: ThemesDefault.space.PX_12, gap: ThemesDefault.space.PX_12, borderRadius: ThemesDefault.radii.sm };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-08-24 06:08:38 +00:00
let obj13 = { marginTop: ThemesDefault.space.PX_8 };
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function PremiumGiftFeaturesCard(variant) {
2026-08-13 07:00:46 +00:00
({ premiumType, onPress, style, claimableRewards, isSelected } = variant);
2026-07-20 16:05:17 +00:00
if (isSelected === undefined) {
isSelected = true;
}
let str = variant.variant;
if (str === undefined) {
str = "default";
}
2026-07-29 08:29:29 +00:00
const merged = Object.assign(variant, Object.create(null));
2026-07-23 10:11:24 +00:00
let _require;
2026-08-24 06:08:38 +00:00
obj = _require(589);
const items = [closure_6];
2026-07-29 08:29:29 +00:00
const stateFromStores = obj.useStateFromStores(items, () => {
marketingComponentByType = marketingComponentByType.getMarketingComponentByType(_undefined(table[11]).MarketingComponentType.GIFT_PLAN_SELECTION_CARD_BANNER);
2026-07-20 16:05:17 +00:00
let prop = null;
if (null != marketingComponentByType) {
prop = null;
if ("giftPlanSelectionCardBanner" === marketingComponentByType.properties.properties.oneofKind) {
prop = marketingComponentByType.properties.properties.giftPlanSelectionCardBanner;
}
}
return prop;
});
2026-08-24 06:08:38 +00:00
obj1 = _require(10343);
2026-07-20 16:05:17 +00:00
let cardAsset;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
cardAsset = stateFromStores.cardAsset;
}
2026-07-29 08:29:29 +00:00
const themeAndReducedMotionAwareAssetUrl = obj1.useThemeAndReducedMotionAwareAssetUrl(cardAsset);
2026-07-20 16:05:17 +00:00
let backgroundAsset;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
backgroundAsset = stateFromStores.backgroundAsset;
}
2026-08-24 06:08:38 +00:00
const themeAndReducedMotionAwareAssetUrl1 = _require(10343).useThemeAndReducedMotionAwareAssetUrl(backgroundAsset);
2026-07-29 08:29:29 +00:00
let tmp9 = null != claimableRewards;
if (tmp9) {
tmp9 = 1 === claimableRewards.length;
2026-07-20 16:05:17 +00:00
}
2026-08-13 07:00:46 +00:00
const tmp10 = callback4(tmp9);
2026-08-24 06:08:38 +00:00
const tmp2Result = _require(10343);
const tmp12 = usePremiumFeaturesDefault(premiumType);
const tmp13 = usePremiumProductPricingStringDefault(premiumType, constants.MONTH);
let enabled = useShouldShowGiftingPromotionDecoDefault(premiumType) && null != claimableRewards;
2026-08-13 07:00:46 +00:00
if (enabled) {
enabled = claimableRewards.length > 0;
}
2026-08-24 06:08:38 +00:00
let tmp11Result = tmp11(9668);
2026-08-13 07:00:46 +00:00
const config = tmp11Result.useConfig({ location: "PremiumGiftFeaturesCard" });
let promotionalButton = enabled;
if (enabled) {
promotionalButton = !config.enabled;
2026-07-20 16:05:17 +00:00
}
2026-08-13 07:00:46 +00:00
if (enabled) {
enabled = config.enabled;
}
let tmp16 = promotionalButton;
2026-07-29 08:29:29 +00:00
if (promotionalButton) {
2026-08-13 07:00:46 +00:00
tmp16 = null != themeAndReducedMotionAwareAssetUrl;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp14 = usePremiumProductPricingStringDefault(premiumType, constants.YEAR);
2026-08-13 07:00:46 +00:00
[tmp18, c0] = callback(importAllResult.useState(0), 2);
2026-07-29 08:29:29 +00:00
const items1 = [tmp10.card, style, ];
2026-07-20 16:05:17 +00:00
let promotional = promotionalButton;
callback = importAllResult.useCallback((nativeEvent) => {
_undefined(nativeEvent.nativeEvent.layout.height);
}, []);
if (promotionalButton) {
2026-07-29 08:29:29 +00:00
promotional = tmp10.promotional;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { style: items1, children: null };
2026-07-20 16:05:17 +00:00
items1[2] = promotional;
2026-08-13 07:00:46 +00:00
let tmp22 = tmp16;
if (tmp16) {
2026-07-29 08:29:29 +00:00
obj = { style: null, resizeMode: "cover", source: null };
obj[0] = tmp10.promotionalCardImage;
obj1 = { uri: null };
obj1[0] = themeAndReducedMotionAwareAssetUrl;
obj[2] = obj1;
2026-08-24 06:08:38 +00:00
tmp22 = callback2(tmp11(5454), obj);
2026-07-20 16:05:17 +00:00
}
2026-08-13 07:00:46 +00:00
const items2 = [tmp22, ];
2026-08-24 06:08:38 +00:00
obj2 = { premiumType, opacity: null, style: null };
2026-07-20 16:05:17 +00:00
let num3 = 1;
2026-08-24 06:08:38 +00:00
tmp11Result = tmp11(8439);
2026-08-13 07:00:46 +00:00
if (tmp16) {
2026-07-20 16:05:17 +00:00
num3 = 0.82;
}
2026-07-29 08:29:29 +00:00
obj2[1] = num3;
const items3 = [tmp10.card, style, ];
2026-07-20 16:05:17 +00:00
let promotional2 = promotionalButton;
if (promotionalButton) {
2026-07-29 08:29:29 +00:00
promotional2 = tmp10.promotional;
2026-07-20 16:05:17 +00:00
}
items3[2] = promotional2;
2026-07-29 08:29:29 +00:00
obj2[2] = items3;
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
if (promotionalButton) {
2026-08-13 07:00:46 +00:00
let tmp29 = null != stateFromStores;
if (tmp29) {
2026-08-07 06:50:47 +00:00
const obj3 = { giftPlanSelectionCardBannerComponent: null, claimableRewards: null, isSelected: null, onLayout: null };
2026-07-29 08:29:29 +00:00
obj3[0] = stateFromStores;
obj3[1] = claimableRewards;
obj3[2] = isSelected;
obj3[3] = callback;
2026-08-24 06:08:38 +00:00
tmp29 = callback2(tmp11(10346), obj3);
2026-07-20 16:05:17 +00:00
}
2026-08-13 07:00:46 +00:00
const items4 = [tmp29, ];
let tmp31 = null != themeAndReducedMotionAwareAssetUrl1;
if (tmp31) {
2026-07-29 08:29:29 +00:00
const obj4 = { style: null, resizeMode: "cover", source: null };
const items5 = [tmp10.promotionalBackground, ];
const obj5 = { top: null };
2026-08-13 07:00:46 +00:00
obj5[0] = tmp18;
2026-07-29 08:29:29 +00:00
items5[1] = obj5;
obj4[0] = items5;
2026-08-24 06:08:38 +00:00
obj6 = { uri: null };
2026-07-29 08:29:29 +00:00
obj6[0] = themeAndReducedMotionAwareAssetUrl1;
obj4[2] = obj6;
2026-08-24 06:08:38 +00:00
tmp31 = callback2(tmp11(5454), obj4);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj7 = { children: null };
2026-08-13 07:00:46 +00:00
items4[1] = tmp31;
2026-07-29 08:29:29 +00:00
obj7[0] = items4;
2026-08-13 07:00:46 +00:00
let tmp20Result = tmp20(closure_11, obj7);
const tmp28 = closure_11;
2026-07-20 16:05:17 +00:00
} else {
2026-08-07 06:50:47 +00:00
const obj8 = { premiumType: null };
2026-07-29 08:29:29 +00:00
obj8[0] = premiumType;
2026-08-24 06:08:38 +00:00
tmp20Result = callback2(tmp11(9369), obj8);
2026-07-20 16:05:17 +00:00
}
2026-08-13 07:00:46 +00:00
const items6 = [tmp20Result, , , , , , ];
2026-07-29 08:29:29 +00:00
const items7 = [tmp10.logo, , ];
2026-07-20 16:05:17 +00:00
if (!promotionalButton) {
items7[1] = promotionalButton;
let promotionalLogoSmallCompact = promotionalButton;
if (promotionalButton) {
promotionalLogoSmallCompact = "smallCompact" === str;
}
if (promotionalLogoSmallCompact) {
2026-07-29 08:29:29 +00:00
promotionalLogoSmallCompact = tmp10.promotionalLogoSmallCompact;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj9 = { style: null, premiumType: null };
2026-07-20 16:05:17 +00:00
items7[2] = promotionalLogoSmallCompact;
2026-07-29 08:29:29 +00:00
obj9[0] = items7;
obj9[1] = premiumType;
2026-08-13 07:00:46 +00:00
items6[1] = tmp33(tmp34, obj9);
2026-08-24 06:08:38 +00:00
obj10 = { style: null, variant: "text-sm/medium", color: "text-overlay-light", children: null };
2026-08-07 06:50:47 +00:00
const items8 = [tmp10.pricing, obj6[str]];
obj10[0] = items8;
const intl = tmp2(1236).intl;
const obj11 = { monthlyPrice: null, yearlyPrice: null };
obj11[0] = tmp13;
obj11[1] = tmp14;
obj10[3] = intl.format(tmp2(1236).t.Ob6fwp, obj11);
2026-08-24 06:08:38 +00:00
items6[2] = tmp33(tmp2(4739).Text, obj10);
2026-08-07 06:50:47 +00:00
const obj12 = { style: null, variant: "heading-sm/bold", color: "text-overlay-light", children: null };
const items9 = [tmp10.featureTitle, obj2[str]];
obj12[0] = items9;
const intl2 = tmp2(1236).intl;
obj12[3] = intl2.string(tmp2(1236).t.JgsVht);
2026-08-24 06:08:38 +00:00
items6[3] = tmp33(tmp2(4739).Text, obj12);
2026-08-07 06:50:47 +00:00
const obj13 = { style: null, features: null, iconStyle: null, labelStyle: null, rowStyle: null };
obj13[0] = tmp10.features;
obj13[1] = tmp12;
2026-08-13 07:00:46 +00:00
({ featureIcon: obj19[2], featureText: obj19[3] } = tmp10);
2026-08-07 06:50:47 +00:00
obj13[4] = obj[str];
2026-08-24 06:08:38 +00:00
items6[4] = tmp33(tmp11(9374), obj13);
2026-08-07 06:50:47 +00:00
const obj14 = { style: null };
obj14[0] = { flexGrow: 1 };
2026-08-13 07:00:46 +00:00
items6[5] = tmp33(tmp21, obj14);
if (enabled) {
if (null != stateFromStores) {
if (premiumType === closure_7.TIER_2) {
const obj15 = { config: null, isLargeSize: null, isSelected: null, onPress: null };
obj15[0] = stateFromStores;
obj15[1] = tmp9;
obj15[2] = isSelected;
obj15[3] = onPress;
let tmp33Result = tmp33(PremiumGiftPlanSelectPromotionDetails, obj15);
}
items6[6] = tmp33Result;
obj2.children = items6;
items2[1] = tmp20(tmp11Result, obj2);
obj[1] = items2;
return tmp20(tmp21, obj);
}
}
2026-08-07 06:50:47 +00:00
const items10 = [tmp10.button, obj10[str], ];
if (promotionalButton) {
promotionalButton = tmp10.promotionalButton;
}
2026-08-13 07:00:46 +00:00
const obj16 = { style: null, children: null };
2026-08-07 06:50:47 +00:00
items10[2] = promotionalButton;
2026-08-13 07:00:46 +00:00
obj16[0] = items10;
if (premiumType === closure_7.TIER_0) {
2026-08-07 06:50:47 +00:00
const intl4 = tmp2(1236).intl;
let stringResult = intl4.string(tmp2(1236).t.rk4Uu8);
2026-07-20 16:05:17 +00:00
} else {
2026-08-07 06:50:47 +00:00
const intl3 = tmp2(1236).intl;
stringResult = intl3.string(tmp2(1236).t.Ve9Ge6);
2026-07-20 16:05:17 +00:00
}
2026-08-13 07:00:46 +00:00
const obj17 = { variant: "primary-overlay", text: null, onPress: null };
obj17[1] = stringResult;
obj17[2] = onPress;
2026-08-24 06:08:38 +00:00
obj16[1] = tmp33(tmp2(4750).Button, obj17);
2026-08-13 07:00:46 +00:00
tmp33Result = tmp33(tmp21, obj16);
2026-07-20 16:05:17 +00:00
}
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/premium/native/gifting/PremiumGiftFeaturesCard.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;