decord/source/modules/user_profile/utils/parseUserProfileCollectibles.tsx

75 lines
2.5 KiB
TypeScript
Raw Normal View History

// Module ID: 7737
// Function ID: 7738
2026-07-29 08:29:29 +00:00
// Name: parseUserProfileCollectibles
// Dependencies: [1889, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 7737 (parseUserProfileCollectibles)
import CollectiblesItemType from "CollectiblesItemType" /* 1889 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const result = size.fileFinishedImporting("modules/user_profile/utils/parseUserProfileCollectibles.tsx");
2026-07-20 16:05:17 +00:00
export default function parseUserProfileCollectibles(collectibles) {
2026-07-29 08:29:29 +00:00
let tmp;
let tmp2;
let collectibles1;
2026-07-29 08:29:29 +00:00
if (collectibles != null) {
collectibles1 = collectibles.collectibles;
2026-07-20 16:05:17 +00:00
}
if (null == collectibles1) {
return { collectibles: "justifyContent", profileEffect: "call", profileFrame: "window" };
2026-07-20 16:05:17 +00:00
} else {
const items = [];
2026-07-29 08:29:29 +00:00
collectibles = collectibles.collectibles;
const iter = collectibles[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let tmp7 = nextResult;
let obj = { skuId: null, type: null, expiresAt: null };
({ sku_id: obj.skuId, type: obj.type } = nextResult);
2026-07-29 08:29:29 +00:00
let date;
if (null != nextResult.expires_at) {
let _Date = Date;
let tmp10 = new.target;
let tmp11 = new.target;
date = new Date(tmp7.expires_at);
}
obj.expiresAt = date;
2026-07-29 08:29:29 +00:00
let arr = items.push(obj);
let tmp14 = require;
2026-08-24 06:08:38 +00:00
if (tmp7.type === CollectiblesItemType.CollectiblesItemType.PROFILE_EFFECT) {
let obj2 = { skuId: null, expiresAt: null };
obj2.skuId = tmp7.sku_id;
2026-07-29 08:29:29 +00:00
let rounded;
if (null != tmp7.expires_at) {
let _Math = Math;
let _Date3 = Date;
let tmp23 = new.target;
let tmp24 = new.target;
let date1 = new Date(tmp7.expires_at);
rounded = Math.floor(date1.getTime() / 1000);
2026-07-20 16:05:17 +00:00
}
obj2.expiresAt = rounded;
tmp = obj2;
} else if (tmp7.type === tmp14(1889).CollectiblesItemType.PROFILE_FRAME) {
let obj3 = { skuId: null, type: null, expiresAt: null };
obj3.skuId = tmp7.sku_id;
obj3.type = tmp14(1889).CollectiblesItemType.PROFILE_FRAME;
let date2;
if (null != tmp7.expires_at) {
let _Date2 = Date;
let tmp17 = new.target;
let tmp18 = new.target;
date2 = new Date(tmp7.expires_at);
2026-07-20 16:05:17 +00:00
}
obj3.expiresAt = date2;
tmp2 = obj3;
2026-07-29 08:29:29 +00:00
}
continue;
2026-07-20 16:05:17 +00:00
}
const obj4 = { collectibles: items, profileEffect: tmp, profileFrame: tmp2 };
return obj4;
2026-07-20 16:05:17 +00:00
}
};