decord/source/modules/checkpoint/CheckpointUtils.tsx

65 lines
2.3 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 8027
// Function ID: 8028
2026-07-20 16:05:17 +00:00
// Name: items
2026-08-05 07:35:12 +00:00
// Dependencies: [4330, 6997, 1236, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 8037, 2]
2026-07-20 16:05:17 +00:00
// Exports: getCardAssetUrl, getCheckpointPowerBarUnits, getVoiceDurationString
2026-08-05 07:35:12 +00:00
// Module 8027 (items)
2026-07-23 10:11:24 +00:00
const items = [require("sleep").TimeUnits.HOURS, require("sleep").TimeUnits.MINUTES];
const result = require("getSystemLocale").fileFinishedImporting("modules/checkpoint/CheckpointUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getVoiceDurationString = function getVoiceDurationString(totalVoiceMinutes) {
2026-07-29 08:29:29 +00:00
let time;
let unit;
2026-08-05 07:35:12 +00:00
let obj = require(4330) /* sleep */;
2026-07-20 16:05:17 +00:00
const timeAndUnit = obj.getTimeAndUnit(totalVoiceMinutes, items);
2026-07-29 08:29:29 +00:00
({ time, unit } = timeAndUnit);
2026-08-05 07:35:12 +00:00
const abbreviatedFormatter = require(6997) /* getDurationString */.getAbbreviatedFormatter();
2026-07-20 16:05:17 +00:00
if (null == time) {
2026-07-29 08:29:29 +00:00
const intl3 = tmp(1236).intl;
return intl3.formatToPlainString(abbreviatedFormatter.minutes, { minutes: 0 });
2026-07-20 16:05:17 +00:00
} else {
const _Math = Math;
const rounded = Math.round(time);
2026-08-05 07:35:12 +00:00
if (unit === tmp(4330).TimeUnits.HOURS) {
2026-07-29 08:29:29 +00:00
const intl2 = tmp(1236).intl;
obj = { hours: null };
obj[0] = rounded;
2026-07-20 16:05:17 +00:00
let formatToPlainStringResult = intl2.formatToPlainString(abbreviatedFormatter.hours, obj);
} else {
2026-07-29 08:29:29 +00:00
const intl = tmp(1236).intl;
obj = { minutes: null };
obj[0] = rounded;
formatToPlainStringResult = intl.formatToPlainString(abbreviatedFormatter.minutes, obj);
2026-07-20 16:05:17 +00:00
}
return formatToPlainStringResult;
}
2026-08-05 07:35:12 +00:00
const obj2 = require(6997) /* getDurationString */;
2026-07-20 16:05:17 +00:00
};
export const getCardAssetUrl = function getCardAssetUrl(cardId) {
if (0 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8028);
2026-07-20 16:05:17 +00:00
} else if (1 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8029);
2026-07-20 16:05:17 +00:00
} else if (2 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8030);
2026-07-20 16:05:17 +00:00
} else if (3 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8031);
2026-07-20 16:05:17 +00:00
} else if (4 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8032);
2026-07-20 16:05:17 +00:00
} else if (5 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8033);
2026-07-20 16:05:17 +00:00
} else if (6 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8034);
2026-07-20 16:05:17 +00:00
} else if (7 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8035);
2026-07-20 16:05:17 +00:00
} else if (8 === cardId) {
2026-08-05 07:35:12 +00:00
return importDefault(8036);
2026-07-20 16:05:17 +00:00
} else {
2026-08-05 07:35:12 +00:00
return importDefault(8037);
2026-07-20 16:05:17 +00:00
}
};
export const getCheckpointPowerBarUnits = function getCheckpointPowerBarUnits(arg0) {
return Math.min(Math.max(Math.round(arg0 / 10), 1), 9);
};