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

113 lines
4 KiB
TypeScript
Raw Normal View History

// Module ID: 13495
// Function ID: 13496
2026-07-20 16:05:17 +00:00
// Name: PremiumText
// Dependencies: [19, 17, 1923, 21, 4481, 4329, 709, 4139, 1233, 1296, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 13495 (PremiumText)
2026-08-24 06:08:38 +00:00
import noopAll from "noop" /* 19 */;
2026-09-02 09:53:35 +00:00
import ThemesDefault from "Themes" /* 709 */;
import getSystemLocale from "getSystemLocale" /* 1233 */;
import Button from "Button" /* 1296 */;
2026-09-01 10:26:29 +00:00
import getPremiumPlanItemDefault from "getPremiumPlanItem" /* 4139 */;
2026-08-24 06:08:38 +00:00
import { View } from "get ActivityIndicator" /* 17 */;
2026-09-02 09:53:35 +00:00
import GuildFeatures from "GuildFeatures" /* 1923 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4481 */;
import hexToRgba from "hexToRgba" /* 4329 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function PremiumText(basePlanId) {
({ style, isCurrentPlan, isGift, product, text } = basePlanId);
2026-08-24 06:08:38 +00:00
const tmp = callback2();
let obj = getPremiumPlanItemDefault;
2026-07-20 16:05:17 +00:00
const intervalType = obj.getInterval(basePlanId.basePlanId).intervalType;
let combined = null;
if (intervalType === constants.YEAR) {
combined = null;
if (!isCurrentPlan) {
const _HermesInternal = HermesInternal;
combined = "-" + closure_4 + "%";
}
}
2026-07-29 08:29:29 +00:00
if (text != null) {
obj = { style: null, children: null };
obj[0] = tmp.premiumText;
obj = { style: null, numberOfLines: 1, accessibilityLabel: null, children: null };
obj[0] = style;
2026-08-24 06:08:38 +00:00
const intl3 = getSystemLocale.intl;
2026-07-20 16:05:17 +00:00
let title;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
title = product.title;
}
2026-08-24 06:08:38 +00:00
obj1 = { product: null, description: null };
2026-07-29 08:29:29 +00:00
obj1[0] = title;
obj1[1] = text;
2026-08-24 06:08:38 +00:00
obj[2] = intl3.formatToPlainString(getSystemLocale.t.E0lS2r, obj1);
2026-07-29 08:29:29 +00:00
obj[3] = text;
2026-08-24 06:08:38 +00:00
const items = [closure_7(Button.LegacyText, obj), ];
2026-07-29 08:29:29 +00:00
let tmp16Result = null;
2026-07-20 16:05:17 +00:00
if (null != combined) {
2026-07-29 08:29:29 +00:00
const obj2 = { style: null, children: null };
obj2[0] = tmp.discount;
const obj3 = { style: null, numberOfLines: 1, children: null };
obj3[0] = style;
obj3[2] = combined;
2026-08-24 06:08:38 +00:00
obj2[1] = tmp16(Button.LegacyText, obj3);
2026-07-29 08:29:29 +00:00
tmp16Result = tmp16(tmp15, obj2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items[1] = tmp16Result;
obj[1] = items;
2026-07-24 07:16:23 +00:00
return closure_8(View, obj);
2026-07-20 16:05:17 +00:00
} else {
let priceString;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
priceString = product.priceString;
}
2026-07-29 08:29:29 +00:00
if (priceString == null) {
2026-07-24 07:16:23 +00:00
priceString = closure_5;
2026-07-20 16:05:17 +00:00
}
if (intervalType !== constants.MONTH) {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
2026-07-29 08:29:29 +00:00
const formatToPlainString = intl.formatToPlainString;
2026-08-24 06:08:38 +00:00
let t = getSystemLocale.t;
2026-07-20 16:05:17 +00:00
if (isGift) {
2026-07-29 08:29:29 +00:00
const obj4 = { price: null };
obj4[0] = priceString;
let formatToPlainStringResult = formatToPlainString(t.rm53bV, obj4);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj5 = { price: null };
obj5[0] = priceString;
formatToPlainStringResult = formatToPlainString(isCurrentPlan ? t.dFbQCa : t["rS8FA+"], obj5);
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale.intl;
2026-07-29 08:29:29 +00:00
const formatToPlainString2 = intl2.formatToPlainString;
2026-08-24 06:08:38 +00:00
t = getSystemLocale.t;
2026-07-20 16:05:17 +00:00
if (isGift) {
2026-07-29 08:29:29 +00:00
t = { price: null };
t[0] = priceString;
let formatToPlainString2Result = formatToPlainString2(t.FIjgMp, t);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj6 = { price: null };
obj6[0] = priceString;
formatToPlainString2Result = formatToPlainString2(isCurrentPlan ? t.V6iX43 : t.AbOLNu, obj6);
2026-07-20 16:05:17 +00:00
}
}
}
2026-08-24 06:08:38 +00:00
noopAll;
2026-07-29 08:29:29 +00:00
({ PREMIUM_YEARLY_DISCOUNT_PERCENT: c4, PRICE_PLACEHOLDER: c5, SubscriptionIntervalTypes: closure_6 } = GuildFeatures);
2026-08-24 06:08:38 +00:00
({ jsx: error, jsxs: closure_8 } = jsxProd);
2026-07-29 08:29:29 +00:00
createCacheKey = { discount: null, premiumText: null };
createCacheKey = { borderWidth: 1, borderColor: null, borderRadius: 2, marginLeft: 4, paddingHorizontal: 2 };
2026-08-24 06:08:38 +00:00
createCacheKey[1] = hexToRgba.hexWithOpacity(ThemesDefault.unsafe_rawColors.WHITE, 0.3);
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { flexDirection: "row" };
2026-08-24 06:08:38 +00:00
let closure_9 = createCacheKey.createStyles(createCacheKey);
const result = require("set").fileFinishedImporting("modules/premium/native/renderPremiumButtonText.tsx");
2026-07-20 16:05:17 +00:00
export default function renderPremiumText(arg0) {
const merged = Object.assign(arg0);
return callback(PremiumText, {});
};