decord/source/modules/user_profile/native/EditCollectiblesPreviewDetails.tsx

168 lines
6.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8446
// Function ID: 8447
2026-07-20 16:05:17 +00:00
// Name: EditCollectiblesPreviewDescription
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 1995, 21, 4668, 589, 4042, 5318, 4066, 4739, 1236, 8426, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 8446 (EditCollectiblesPreviewDescription)
import noopAll from "noop" /* 19 */;
import initialize from "initialize" /* 589 */;
import getPremiumPlanItemDefault from "getPremiumPlanItem" /* 4042 */;
import Text2 from "Text" /* 4739 */;
import getItemRecordsFromPurchases from "getItemRecordsFromPurchases" /* 5318 */;
import useCollectiblesDataDefault from "useCollectiblesData" /* 8426 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_4 from "_getSystemLocale" /* 1995 */;
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-07-20 16:05:17 +00:00
function EditCollectiblesPreviewDescription(arg0) {
({ user, purchase } = arg0);
2026-07-29 08:29:29 +00:00
let stringResult = dependencyMap;
2026-07-20 16:05:17 +00:00
({ product, nitroJoinCTA, nitroUpgradeCTA } = arg0);
2026-08-24 06:08:38 +00:00
let obj = initialize;
const items = [closure_4];
2026-07-29 08:29:29 +00:00
const stateFromStores = obj.useStateFromStores(items, () => locale.locale);
2026-08-24 06:08:38 +00:00
obj1 = getPremiumPlanItemDefault;
2026-07-20 16:05:17 +00:00
const canUseCollectiblesResult = obj1.canUseCollectibles(user);
2026-08-24 06:08:38 +00:00
let obj2 = getItemRecordsFromPurchases;
2026-07-20 16:05:17 +00:00
let result = obj2.isPremiumCollectiblesProduct(product);
if (!result) {
2026-08-24 06:08:38 +00:00
let tmpResult = tmp(5318);
2026-07-29 08:29:29 +00:00
result = tmpResult.isPremiumCollectiblesPurchase(purchase);
2026-07-20 16:05:17 +00:00
}
let result1 = !canUseCollectiblesResult;
2026-07-29 08:29:29 +00:00
if (!canUseCollectiblesResult) {
2026-08-24 06:08:38 +00:00
tmpResult = tmp(5318);
2026-07-29 08:29:29 +00:00
result1 = tmpResult.isPremiumCollectiblesPurchase(purchase);
2026-07-20 16:05:17 +00:00
}
if (null != purchase) {
if (!result1) {
let expiresAt;
2026-07-29 08:29:29 +00:00
if (purchase != null) {
2026-07-20 16:05:17 +00:00
expiresAt = purchase.expiresAt;
}
let diffAsUnitsResult = null;
if (null != expiresAt) {
const _Date = Date;
const date = new Date();
2026-08-24 06:08:38 +00:00
diffAsUnitsResult = tmp(4066).diffAsUnits(date, purchase.expiresAt);
const tmpResult1 = tmp(4066);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp17 = null != diffAsUnitsResult;
if (tmp17) {
obj = { variant: "text-sm/medium", color: "text-default", children: null };
const intl = tmp(1236).intl;
obj = { days: null };
obj[0] = diffAsUnitsResult.days.toString();
obj[2] = intl.format(tmp(1236).t.Io7ozn, obj);
2026-08-24 06:08:38 +00:00
tmp17 = callback(tmp(4739).Text, obj);
2026-07-20 16:05:17 +00:00
const str = diffAsUnitsResult.days;
}
2026-07-29 08:29:29 +00:00
const items1 = [tmp17, , ];
const intl2 = tmp(1236).intl;
2026-07-20 16:05:17 +00:00
let toLocaleDateStringResult;
2026-07-29 08:29:29 +00:00
if (purchase != null) {
2026-07-20 16:05:17 +00:00
const purchasedAt = purchase.purchasedAt;
2026-07-23 10:11:24 +00:00
toLocaleDateStringResult = purchasedAt.toLocaleDateString(stateFromStores, { month: "long", year: "numeric" });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1 = { variant: "text-sm/medium", color: "text-default", children: null };
obj2 = { date: null };
obj2[0] = toLocaleDateStringResult;
obj1[2] = intl2.format(tmp(1236).t.gW9R4B, obj2);
2026-08-24 06:08:38 +00:00
items1[1] = callback(tmp(4739).Text, obj1);
2026-07-20 16:05:17 +00:00
let expiresAt1;
2026-07-29 08:29:29 +00:00
if (purchase != null) {
2026-07-20 16:05:17 +00:00
expiresAt1 = purchase.expiresAt;
}
2026-07-29 08:29:29 +00:00
let tmp19Result = null != expiresAt1;
if (tmp19Result) {
const obj3 = { variant: "text-sm/medium", color: "text-default", children: null };
const intl3 = tmp(1236).intl;
const obj4 = { date: null };
2026-07-20 16:05:17 +00:00
expiresAt = purchase.expiresAt;
2026-07-29 08:29:29 +00:00
obj4[0] = expiresAt.toLocaleDateString(stateFromStores, { minute: "numeric", hour: "numeric", day: "numeric", month: "long", year: "numeric" });
obj3[2] = intl3.format(tmp(1236).t.eZSTa5, obj4);
2026-08-24 06:08:38 +00:00
tmp19Result = tmp19(tmp(4739).Text, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj5 = { children: null };
items1[2] = tmp19Result;
obj5[0] = items1;
return closure_7(closure_6, obj5);
2026-07-20 16:05:17 +00:00
}
}
if (result) {
if (canUseCollectiblesResult) {
2026-07-29 08:29:29 +00:00
const obj6 = { variant: "text-sm/medium", color: "text-default", children: null };
const intl5 = tmp(1236).intl;
stringResult = intl5.string(tmp(1236).t.hmyYK8);
obj6[2] = stringResult;
2026-08-24 06:08:38 +00:00
let tmp25Result = callback(tmp(4739).Text, obj6);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
const tmp4Result = getPremiumPlanItemDefault;
const Text = tmp(4739).Text;
2026-07-29 08:29:29 +00:00
const obj7 = { variant: "text-sm/medium", color: "text-default", children: null };
2026-07-20 16:05:17 +00:00
if (isPremiumResult) {
2026-07-29 08:29:29 +00:00
obj7[2] = nitroUpgradeCTA;
tmp25Result = tmp25(Text, obj7);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj7[2] = nitroJoinCTA;
tmp25Result = tmp25(Text, obj7);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
isPremiumResult = getPremiumPlanItemDefault.isPremium(user);
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
const obj8 = { variant: "text-sm/medium", color: "text-default", children: null };
const intl4 = tmp(1236).intl;
obj8[2] = intl4.string(tmp(1236).t.fEGjVQ);
2026-08-24 06:08:38 +00:00
return callback(tmp(4739).Text, obj8);
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
({ jsx: c5, Fragment: closure_6, jsxs: error } = jsxProd);
let closure_8 = createCacheKey.createStyles({ productDetailsContainer: { width: "100%", marginTop: 16, alignItems: "center", gap: 2 } });
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/user_profile/native/EditCollectiblesPreviewDetails.tsx");
2026-07-20 16:05:17 +00:00
export default function EditCollectiblesPreviewDetails(previewSkuId) {
previewSkuId = previewSkuId.previewSkuId;
({ user, nitroJoinCTA, nitroUpgradeCTA } = previewSkuId);
const tmp = callback2();
2026-08-24 06:08:38 +00:00
({ product, purchase } = useCollectiblesDataDefault(previewSkuId));
2026-07-29 08:29:29 +00:00
let tmp5Result = null;
2026-07-20 16:05:17 +00:00
if (null != previewSkuId) {
if (null != product) {
2026-07-29 08:29:29 +00:00
let obj = { style: null, children: null };
obj[0] = tmp.productDetailsContainer;
2026-07-20 16:05:17 +00:00
let name;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
name = product.name;
}
2026-07-29 08:29:29 +00:00
if (name == null) {
2026-07-20 16:05:17 +00:00
let name1;
2026-07-29 08:29:29 +00:00
if (purchase != null) {
2026-07-20 16:05:17 +00:00
name1 = purchase.name;
}
name = name1;
}
2026-07-29 08:29:29 +00:00
obj = { variant: "text-md/bold", color: "text-default", children: null };
obj[2] = name;
2026-08-24 06:08:38 +00:00
const items = [closure_5(Text2.Text, obj), ];
2026-07-29 08:29:29 +00:00
obj = { user: null, product: null, purchase: null, nitroJoinCTA: null, nitroUpgradeCTA: null };
obj[0] = user;
obj[1] = product;
obj[2] = purchase;
obj[3] = nitroJoinCTA;
obj[4] = nitroUpgradeCTA;
items[1] = closure_5(EditCollectiblesPreviewDescription, obj);
obj[1] = items;
tmp5Result = closure_7(View, obj);
const tmp5 = closure_7;
const tmp6 = View;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp5Result = null;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp5Result;
2026-07-20 16:05:17 +00:00
};