Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
66 lines
2.9 KiB
TypeScript
66 lines
2.9 KiB
TypeScript
// Module ID: 15185
|
|
// Function ID: 15186
|
|
// Name: FamilyCenterActivityGiftRowUtils
|
|
// Dependencies: [1115, 4023, 7511, 2482, 2]
|
|
// Exports: formatGiftDate, getGiftRowDisplayInfo, getGiftSubtext
|
|
|
|
// Module 15185 (FamilyCenterActivityGiftRowUtils)
|
|
import util from "util" /* 1115 */;
|
|
import _modDef2482 from "module_2482" /* 2482 */;
|
|
import _mod4023 from "module_4023" /* 4023 */;
|
|
import PriceUtils from "PriceUtils" /* 7511 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const result = size.fileFinishedImporting("modules/parent_tools/FamilyCenterActivityGiftRowUtils.tsx");
|
|
|
|
export const getGiftRowDisplayInfo = function getGiftRowDisplayInfo(giftInfo) {
|
|
return { skuId: giftInfo.sku_id, subscriptionPlanId: giftInfo.subscription_plan_id, price: giftInfo.price, gifterUserId: giftInfo.gifter_user_id, claimed: giftInfo.claimed, offeredAt: giftInfo.offered_at, claimedAt: giftInfo.claimed_at };
|
|
};
|
|
export const formatGiftDate = function formatGiftDate(claimedAt) {
|
|
const dateTimeFormat = new Intl.DateTimeFormat(util.intl.currentLocale, { month: "short", day: "numeric" });
|
|
return dateTimeFormat.format(_mod4023.parseISO(claimedAt));
|
|
};
|
|
export const getGiftSubtext = function getGiftSubtext(claimed) {
|
|
({ price, gifterName, offeredAt, claimedAt } = claimed);
|
|
let formatPriceResult = null;
|
|
if (null != price) {
|
|
formatPriceResult = PriceUtils.formatPrice(price.amount, price.currency);
|
|
}
|
|
if (null != formatPriceResult) {
|
|
if (null != gifterName) {
|
|
const intl = util.intl;
|
|
const obj2 = { price: formatPriceResult, username: gifterName };
|
|
let formatToPlainStringResult = intl.formatToPlainString(_modDef2482["o44n/1"], obj2);
|
|
}
|
|
const items = [formatToPlainStringResult, ];
|
|
const intl2 = util.intl;
|
|
const formatToPlainString = intl2.formatToPlainString;
|
|
const tmp11 = _modDef2482;
|
|
if (claimed.claimed) {
|
|
if (claimedAt == null) {
|
|
claimedAt = offeredAt;
|
|
}
|
|
const obj3 = { date: null };
|
|
const _Intl2 = Intl;
|
|
const dateTimeFormat = new Intl.DateTimeFormat(tmp8(1115).intl.currentLocale, { month: "short", day: "numeric" });
|
|
obj3.date = dateTimeFormat.format(tmp8(4023).parseISO(claimedAt));
|
|
let formatToPlainStringResult1 = formatToPlainString(tmp11.kDyllq, obj3);
|
|
const tmp8Result = tmp8(4023);
|
|
} else {
|
|
const obj4 = { date: null };
|
|
const _Intl = Intl;
|
|
const dateTimeFormat1 = new Intl.DateTimeFormat(tmp8(1115).intl.currentLocale, { month: "short", day: "numeric" });
|
|
obj4.date = dateTimeFormat1.format(tmp8(4023).parseISO(offeredAt));
|
|
formatToPlainStringResult1 = formatToPlainString(tmp11.gAG45y, obj4);
|
|
const tmp8Result2 = tmp8(4023);
|
|
}
|
|
items[1] = formatToPlainStringResult1;
|
|
const _Boolean = Boolean;
|
|
const found = items.filter(Boolean);
|
|
return found.join(" \u2022 ");
|
|
}
|
|
formatToPlainStringResult = null;
|
|
if (null != formatPriceResult) {
|
|
formatToPlainStringResult = formatPriceResult;
|
|
}
|
|
};
|