decord/alpha/source/modules/checkpoint/CheckpointUtils.tsx
github-actions 97fd043558 chore: update source for alpha 347.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
2026-09-19 06:52:51 +00:00

72 lines
2.7 KiB
TypeScript

// Module ID: 8411
// Function ID: 8412
// Name: CheckpointUtils
// Dependencies: [4785, 7876, 1115, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 2]
// Exports: getCardAssetUrl, getCheckpointPowerBarUnits, getVoiceDurationString
// Module 8411 (CheckpointUtils)
import TimeUtils from "TimeUtils" /* 4785 */;
import notification_center_getTimestampString from "notification_center/getTimestampString" /* 7876 */;
import _modDef8412 from "module_8412" /* 8412 */;
import _modDef8413 from "module_8413" /* 8413 */;
import _modDef8414 from "module_8414" /* 8414 */;
import _modDef8415 from "module_8415" /* 8415 */;
import _modDef8416 from "module_8416" /* 8416 */;
import _modDef8417 from "module_8417" /* 8417 */;
import _modDef8418 from "module_8418" /* 8418 */;
import _modDef8419 from "module_8419" /* 8419 */;
import _modDef8420 from "module_8420" /* 8420 */;
import _modDef8421 from "module_8421" /* 8421 */;
import size from "module_2" /* 2 */;
const items = [TimeUtils.TimeUnits.HOURS, TimeUtils.TimeUnits.MINUTES];
const result = size.fileFinishedImporting("modules/checkpoint/CheckpointUtils.tsx");
export const getVoiceDurationString = function getVoiceDurationString(totalVoiceMinutes) {
const timeAndUnit = TimeUtils.getTimeAndUnit(totalVoiceMinutes, items);
({ time, unit } = timeAndUnit);
const time2 = notification_center_getTimestampString.getAbbreviatedFormatter();
if (null == time) {
const intl3 = tmp(1115).intl;
return intl3.formatToPlainString(time2.minutes, { minutes: 0 });
} else {
const _Math = Math;
const rounded = Math.round(time);
if (unit === tmp(4785).TimeUnits.HOURS) {
const intl2 = tmp(1115).intl;
const obj3 = { hours: rounded };
let formatToPlainStringResult = intl2.formatToPlainString(time2.hours, obj3);
} else {
const intl = tmp(1115).intl;
const obj4 = { minutes: rounded };
formatToPlainStringResult = intl.formatToPlainString(time2.minutes, obj4);
}
return formatToPlainStringResult;
}
};
export const getCardAssetUrl = function getCardAssetUrl(cardId) {
if (0 === cardId) {
return _modDef8412;
} else if (1 === cardId) {
return _modDef8413;
} else if (2 === cardId) {
return _modDef8414;
} else if (3 === cardId) {
return _modDef8415;
} else if (4 === cardId) {
return _modDef8416;
} else if (5 === cardId) {
return _modDef8417;
} else if (6 === cardId) {
return _modDef8418;
} else if (7 === cardId) {
return _modDef8419;
} else if (8 === cardId) {
return _modDef8420;
} else {
return _modDef8421;
}
};
export const getCheckpointPowerBarUnits = function getCheckpointPowerBarUnits(arg0) {
return Math.min(Math.max(Math.round(arg0 / 10), 1), 9);
};