69 lines
3.8 KiB
TypeScript
69 lines
3.8 KiB
TypeScript
/* Metro module 13417; source: modules/parent_tools/FamilyCenterActivityGiftRowUtils.tsx; dependencies: [1244, 3381, 5137, 2224, 2] */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as Module03381Module from '../../by-id/module-03381.js'; /* Metro dependency 3381 */
|
|
|
|
function _fun102085(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13607:6, offset: 0x0222bd2e, size: 135 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const formatGiftDate2 = formatGiftDate;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/FamilyCenterActivityGiftRowUtils.tsx');
|
|
exports.getGiftRowDisplayInfo = function(a0) {
|
|
return {skuId: a0.sku_id, subscriptionPlanId: a0.subscription_plan_id, price: a0.price,
|
|
gifterUserId: a0.gifter_user_id, claimed: a0.claimed, offeredAt: a0.offered_at, claimedAt: a0.claimed_at};
|
|
};
|
|
exports.formatGiftDate = formatGiftDate2;
|
|
exports.getGiftSubtext = getGiftSubtext;
|
|
function formatGiftDate(a0) { // fn#102086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13607:111, offset: 0x0222bdb5, size: 121 bytes, params: 2, frame: 16
|
|
const Intl = global.Intl;
|
|
const DateTimeFormat = Intl.DateTimeFormat;
|
|
const dateTimeFormat = new DateTimeFormat((IndexNativeModule).intl.currentLocale,
|
|
{'month': 'short', 'day': 'numeric'});
|
|
const format = dateTimeFormat.format;
|
|
return Reflect.apply(format, dateTimeFormat, [Module03381Module.parseISO(a0)]);
|
|
}
|
|
|
|
function getGiftSubtext({claimed, price, gifterName, offeredAt, claimedAt}) { // fn#102088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13607:560, offset: 0x0222be83, size: 361 bytes, params: 2, frame: 22
|
|
var r8;
|
|
var r0;
|
|
var moduleValue;
|
|
const intl = (IndexNativeModule).intl;
|
|
var gAG45y;
|
|
var object;
|
|
var kDyllq;
|
|
var object2;
|
|
let value = null;
|
|
if (value != price) {
|
|
moduleValue = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
r8 = moduleValue.formatPrice(price.amount, price.currency);
|
|
} else {
|
|
r8 = value;
|
|
}
|
|
const items2 = [value == r8 ? value != r8 ? r8 : value : value != gifterName ? intl.formatToPlainString((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['o44n/1'],
|
|
{price: r8, username: gifterName}) : value != r8 ? r8 : value];
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const defaultImport = importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */;
|
|
if (claimed) {
|
|
kDyllq = defaultImport.kDyllq;
|
|
object2 = {};
|
|
object2.date = formatGiftDate(value == claimedAt ? offeredAt : claimedAt);
|
|
value = Reflect.apply(formatToPlainString, intl, [kDyllq, object2]);
|
|
r0 = value;
|
|
} else {
|
|
gAG45y = defaultImport.gAG45y;
|
|
object = {};
|
|
object.date = formatGiftDate(offeredAt);
|
|
r0 = Reflect.apply(formatToPlainString, intl, [gAG45y, object]);
|
|
}
|
|
items2[1] = r0;
|
|
const filter = items2.filter;
|
|
const Boolean = global.Boolean;
|
|
return Reflect.apply(filter, items2, [Boolean]).join(' • ');
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun102085, 13417, [1244, 3381, 5137, 2224,
|
|
2]) /* metro module 13417, dependencies: [1244, 3381, 5137, 2224, 2] */;
|