512 lines
17 KiB
TypeScript
512 lines
17 KiB
TypeScript
// Metro module 6008 (f6009).
|
|
import QuestStore from "../QuestStore";
|
|
import { FirstPartyQuestTaskTypes, FirstPartyQuestTaskTypesSets } from "../../../_bundle/Module5040";
|
|
import { floor } from "../../../_bundle/Module12";
|
|
import Durations from "../../../utils/Durations";
|
|
import { captureQuestsException } from "./QuestDataUtils";
|
|
import { isNotNullish } from "../../../utils/GlobalUtils";
|
|
import { $withEnv } from "../../../_hermes/prelude";
|
|
function $mk77595($env) {
|
|
return (a0) => {
|
|
let env25676;
|
|
const r0 = env25676 = {};
|
|
env25676[0] = a0;
|
|
return $env[0].some($mk104843(r0));
|
|
};
|
|
}
|
|
function $mk77596($env) {
|
|
return (a0) => $env[0].config.taskConfigV2.tasks[a0] != null;
|
|
}
|
|
function $mk104843($env) {
|
|
return (a0) => $env[0].config.taskConfigV2.tasks[a0] != null;
|
|
}
|
|
let c3797_0, c3798_0, c3799_0, c3800_0, c3801_0, c3802_0;
|
|
let c3796_5, c3796_6, c3796_7, c3796_8, isQuestProgressingOnConsole, _isPlayOnDesktopTaskType, _getTaskDetailsForType, _parseFirstPartyTaskType;
|
|
let env3797;
|
|
let env3798;
|
|
let env3799;
|
|
let env3800;
|
|
let env3801;
|
|
let env3802;
|
|
const getApplicationIdsByTaskTypes = function getApplicationIdsByTaskTypes(a0, a1) {
|
|
if (a0 == null) {
|
|
return void 0;
|
|
}
|
|
const set = new Set();
|
|
for (const item of a1) {
|
|
const r34 = a0.config.taskConfigV2.tasks[item];
|
|
if (r34 != null && "applications" in r34 && Array.isArray(r34.applications)) {
|
|
for (const application of r34.applications) {
|
|
set.add(application.id);
|
|
}
|
|
}
|
|
}
|
|
return set.size > 0 ? Array.from(set) : void 0;
|
|
};
|
|
isQuestProgressingOnConsole = function isQuestProgressingOnConsole(quest) {
|
|
let r5 = quest.userStatus != null;
|
|
if (r5) {
|
|
const userStatus = quest.userStatus;
|
|
const PLAY_ON_XBOX = FirstPartyQuestTaskTypes.PLAY_ON_XBOX;
|
|
const r1 = userStatus == null;
|
|
let r13 = void 0;
|
|
if (!r1) {
|
|
const r22 = userStatus.progress[PLAY_ON_XBOX];
|
|
r13 = r22 == null ? void 0 : r22.heartbeat?.expiresAt;
|
|
}
|
|
const r2 = r13 == null;
|
|
let r26 = false;
|
|
if (!r2) {
|
|
const r32 = new Date(r13).valueOf();
|
|
const isNaN2 = isNaN(r32);
|
|
r26 = isNaN2 ? !isNaN2 : r32 > Date.now();
|
|
}
|
|
if (!r26) {
|
|
const userStatus2 = quest.userStatus;
|
|
const PLAY_ON_PLAYSTATION = FirstPartyQuestTaskTypes.PLAY_ON_PLAYSTATION;
|
|
const r44 = userStatus2 == null;
|
|
let r45 = void 0;
|
|
if (!r44) {
|
|
const r47 = userStatus2.progress[PLAY_ON_PLAYSTATION];
|
|
r45 = r47 == null ? void 0 : r47.heartbeat?.expiresAt;
|
|
}
|
|
const r51 = r45 == null;
|
|
let r4 = false;
|
|
if (!r51) {
|
|
const r60 = new Date(r45).valueOf();
|
|
const isNaN3 = isNaN(r60);
|
|
r4 = isNaN3 ? !isNaN3 : r60 > Date.now();
|
|
}
|
|
r26 = r4;
|
|
}
|
|
r5 = r26;
|
|
}
|
|
return r5;
|
|
};
|
|
_isPlayOnDesktopTaskType = function _isPlayOnDesktopTaskType(a0) {
|
|
return a0?.type === FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP;
|
|
};
|
|
_getTaskDetailsForType = function _getTaskDetailsForType(a0) {
|
|
let r105;
|
|
const { quest, taskType } = a0;
|
|
let includeTaskTypes = a0.includeTaskTypes;
|
|
if (includeTaskTypes === void 0) {
|
|
includeTaskTypes = FirstPartyQuestTaskTypesSets.ALL;
|
|
}
|
|
const ALL = includeTaskTypes;
|
|
const taskConfigV2 = quest.config.taskConfigV2;
|
|
let taskType2 = taskType;
|
|
if (taskType2 == null) {
|
|
taskType2 = Object.values(taskConfigV2.tasks).filter((item) => ALL.has(item.type))[0]?.type;
|
|
}
|
|
let r39 = taskConfigV2.tasks[taskType2];
|
|
if (r39 == null) {
|
|
r39 = taskConfigV2.tasks[FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP];
|
|
}
|
|
if (r39 == null) {
|
|
const error = new Error(`Quest ${quest.id} has no task matching the include filters`);
|
|
const r184 = Array;
|
|
if (ALL == null) {
|
|
includeTaskTypes = [];
|
|
}
|
|
captureQuestsException(error, {
|
|
tags: {
|
|
source: "_getTaskDetailsForType"
|
|
},
|
|
extra: {
|
|
questId: quest.id,
|
|
taskType,
|
|
includeTaskTypes: r184.from(includeTaskTypes)
|
|
}
|
|
});
|
|
return null;
|
|
}
|
|
const { target: target2, target } = r39;
|
|
const completedAt = quest.userStatus?.completedAt;
|
|
let progressSeconds = target;
|
|
if (completedAt == null) {
|
|
const userStatus = quest.userStatus;
|
|
const r52 = userStatus == null;
|
|
let r53 = void 0;
|
|
if (!r52) {
|
|
const progress = userStatus.progress;
|
|
r53 = progress == null ? void 0 : progress[r39.type];
|
|
}
|
|
let r57 = r53?.value;
|
|
if (r57 == null) {
|
|
r57 = quest.userStatus?.streamProgressSeconds;
|
|
}
|
|
if (r57 == null) {
|
|
r57 = 0;
|
|
}
|
|
let env15354;
|
|
const r63 = env15354 = {};
|
|
env15354[0] = quest;
|
|
if (c3796_8.$env[0].some($mk104843(r63))) {
|
|
let r110 = QuestStore.getOptimisticProgress(quest.id, r39.type);
|
|
if (!(r110 != null && !(r110 < r57))) {
|
|
r110 = r57;
|
|
}
|
|
r105 = r110;
|
|
} else {
|
|
const userStatus2 = quest.userStatus;
|
|
const r69 = userStatus2 == null;
|
|
let r19 = void 0;
|
|
if (!r69) {
|
|
const progress2 = userStatus2.progress;
|
|
const r71 = progress2 == null;
|
|
r19 = void 0;
|
|
if (!r71) {
|
|
const r73 = progress2[r39.type];
|
|
r19 = r73 == null ? void 0 : r73.heartbeat?.lastBeatAt;
|
|
}
|
|
}
|
|
r105 = r57 + (r19 == null ? 0 : isQuestProgressingOnConsole(quest) || QuestStore.isProgressingOnDesktop(quest.id) ? floor((Date.now() - new Date(r19).valueOf()) / Durations.Millis.SECOND, 2) : 0);
|
|
}
|
|
progressSeconds = Math.max(floor(Math.min(0.99 * target, r105), 2), 0);
|
|
}
|
|
const r134 = Object.values(taskConfigV2.tasks).find(_isPlayOnDesktopTaskType);
|
|
const r135 = r134 == null;
|
|
let applications2 = void 0;
|
|
if (!r135) {
|
|
const applications = r134.applications;
|
|
applications2 = applications == null ? void 0 : applications.map((application) => application.id);
|
|
}
|
|
return {
|
|
progressSeconds,
|
|
targetSeconds: target2,
|
|
targetMinutes: Math.ceil(target2 / Durations.Seconds.MINUTE),
|
|
percentComplete: target2 > 0 ? floor(Math.min(progressSeconds / target2, 1), 4) : 0,
|
|
taskType: taskType2,
|
|
applications: applications2
|
|
};
|
|
};
|
|
_parseFirstPartyTaskType = function _parseFirstPartyTaskType(eventName) {
|
|
return FirstPartyQuestTaskTypesSets.ALL.has(eventName) ? eventName : null;
|
|
};
|
|
const r25 = [FirstPartyQuestTaskTypes.PLAY_ON_XBOX, FirstPartyQuestTaskTypes.PLAY_ON_PLAYSTATION];
|
|
const r30 = env3797 = {};
|
|
c3797_0 = r25;
|
|
c3796_5 = $withEnv($mk77595(r30), r30);
|
|
const r35 = [FirstPartyQuestTaskTypes.WATCH_VIDEO];
|
|
const r36 = env3798 = {};
|
|
c3798_0 = r35;
|
|
c3796_6 = $withEnv($mk77595(r36), r36);
|
|
const r42 = [FirstPartyQuestTaskTypes.WATCH_VIDEO_ON_MOBILE];
|
|
const r43 = env3799 = {};
|
|
c3799_0 = r42;
|
|
c3796_7 = $withEnv($mk77595(r43), r43);
|
|
const r49 = [FirstPartyQuestTaskTypes.WATCH_VIDEO, FirstPartyQuestTaskTypes.WATCH_VIDEO_ON_MOBILE];
|
|
const r54 = env3800 = {};
|
|
c3800_0 = r49;
|
|
c3796_8 = $withEnv($mk77595(r54), r54);
|
|
const r60 = [FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP, FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP, FirstPartyQuestTaskTypes.PLAY_ON_PLAYSTATION, FirstPartyQuestTaskTypes.PLAY_ON_XBOX, FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_GAME];
|
|
const r77 = env3801 = {};
|
|
c3801_0 = r60;
|
|
const r12 = [FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_ACTIVITY, FirstPartyQuestTaskTypes.PLAY_ACTIVITY];
|
|
const r86 = env3802 = {};
|
|
c3802_0 = r12;
|
|
export function getAllApplicationIds(a0) {
|
|
if (a0 != null) {
|
|
return getApplicationIdsByTaskTypes(a0, Object.keys(a0.config.taskConfigV2.tasks));
|
|
}
|
|
}
|
|
export function getDesktopApplicationIds(a0) {
|
|
return getApplicationIdsByTaskTypes(a0, [FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP]);
|
|
}
|
|
export function getConsoleApplicationId(a0) {
|
|
const applicationIdsByTaskTypes = getApplicationIdsByTaskTypes(a0, [FirstPartyQuestTaskTypes.PLAY_ON_XBOX, FirstPartyQuestTaskTypes.PLAY_ON_PLAYSTATION]);
|
|
return applicationIdsByTaskTypes == null ? void 0 : applicationIdsByTaskTypes[0];
|
|
}
|
|
export function getPlayActivityApplicationId(a0) {
|
|
const applicationIdsByTaskTypes = getApplicationIdsByTaskTypes(a0, [FirstPartyQuestTaskTypes.PLAY_ACTIVITY]);
|
|
return applicationIdsByTaskTypes == null ? void 0 : applicationIdsByTaskTypes[0];
|
|
}
|
|
export function getInGameApplicationId(a0) {
|
|
const applicationIdsByTaskTypes = getApplicationIdsByTaskTypes(a0, [FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_GAME]);
|
|
return applicationIdsByTaskTypes == null ? void 0 : applicationIdsByTaskTypes[0];
|
|
}
|
|
export function getActivityApplicationId(a0) {
|
|
const applicationIdsByTaskTypes = getApplicationIdsByTaskTypes(a0, [FirstPartyQuestTaskTypes.PLAY_ACTIVITY, FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_ACTIVITY]);
|
|
return applicationIdsByTaskTypes == null ? void 0 : applicationIdsByTaskTypes[0];
|
|
}
|
|
export function getStreamingApplicationId(a0) {
|
|
const applicationIdsByTaskTypes = getApplicationIdsByTaskTypes(a0, [FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP]);
|
|
return applicationIdsByTaskTypes == null ? void 0 : applicationIdsByTaskTypes[0];
|
|
}
|
|
export function hasPlayOnDesktopTask(a0) {
|
|
return a0.quest.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP] != null;
|
|
}
|
|
export function hasStreamOnDesktopTask(a0) {
|
|
return a0.quest.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP] != null;
|
|
}
|
|
export function hasAchievementActivityTask(a0) {
|
|
return a0.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_ACTIVITY] != null;
|
|
}
|
|
export function hasAchievementInGameTask(a0) {
|
|
return a0.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_GAME] != null;
|
|
}
|
|
export function hasPlayActivityTask(a0) {
|
|
return a0.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.PLAY_ACTIVITY] != null;
|
|
}
|
|
export function shouldUsePlayOnDesktopTask(a0) {
|
|
return a0 != null && a0.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP] != null;
|
|
}
|
|
export function hasSomeFirstPartyTasks(a0) {
|
|
let env15350;
|
|
const r0 = env15350 = {};
|
|
env15350[0] = a0;
|
|
return $withEnv($mk77595(r0), r0);
|
|
}
|
|
export function isInGameQuest(a0) {
|
|
let env15351;
|
|
const r1 = env15351 = {};
|
|
env15351[0] = a0;
|
|
return Array.from(FirstPartyQuestTaskTypesSets.IN_GAME).some($mk77596(r1));
|
|
}
|
|
export { c3796_5 as hasSomeConsoleTasks };
|
|
export { c3796_6 as hasWatchVideoOnDesktopTasks };
|
|
export { c3796_7 as hasWatchVideoOnMobileTasks };
|
|
export { c3796_8 as hasWatchVideoTasks };
|
|
export const hasStandaloneGameplayTasks = $withEnv($mk77595(r77), r77);
|
|
export const hasActivityTasks = $withEnv($mk77595(r86), r86);
|
|
export function isVideoQuestForMobilePlatformOnly(a0) {
|
|
let env15355;
|
|
const r7 = env15355 = {};
|
|
env15355[0] = a0;
|
|
let r11 = c3796_7.$env[0].some($mk104843(r7));
|
|
if (r11) {
|
|
let env15356;
|
|
const r15 = env15356 = {};
|
|
env15356[0] = a0;
|
|
r11 = !c3796_6.$env[0].some($mk104843(r15));
|
|
}
|
|
return r11;
|
|
}
|
|
export function isConsoleQuest(a0) {
|
|
let env15352;
|
|
const r5 = env15352 = {};
|
|
env15352[0] = a0;
|
|
return c3796_5.$env[0].some($mk104843(r5));
|
|
}
|
|
export function isDesktopOnlyPlayQuest(a0) {
|
|
let env15357;
|
|
const r4 = env15357 = {};
|
|
env15357[0] = a0;
|
|
const r12 = c3796_5.$env[0].some($mk104843(r4));
|
|
return r12 ? !r12 : a0.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP] != null;
|
|
}
|
|
export { isQuestProgressingOnConsole };
|
|
export function getQuestTaskTypes(a0) {
|
|
return new Set(Object.keys(a0.config.taskConfigV2.tasks));
|
|
}
|
|
export function getDefaultWatchVideoTask(a0) {
|
|
let r20;
|
|
L7: {
|
|
const r11 = a0.taskConfigV2.tasks[FirstPartyQuestTaskTypes.WATCH_VIDEO];
|
|
const r18 = a0.taskConfigV2.tasks[FirstPartyQuestTaskTypes.WATCH_VIDEO_ON_MOBILE];
|
|
if (r11 != null) {
|
|
r20 = r18;
|
|
if (r20 != null) {
|
|
break L7;
|
|
}
|
|
}
|
|
let r21 = r18 == null ? r11 : r18;
|
|
if (r21 == null) {
|
|
r21 = null;
|
|
}
|
|
r20 = r21;
|
|
}
|
|
return r20;
|
|
}
|
|
export function getQuestTaskDetails(a0, a1) {
|
|
let r64, r80, r94;
|
|
let env15358;
|
|
const r5 = env15358 = {};
|
|
env15358[0] = a0;
|
|
if (Array.from(FirstPartyQuestTaskTypesSets.IN_GAME).some($mk77596(r5))) {
|
|
r64 = {
|
|
progressSeconds: 0,
|
|
targetSeconds: 1,
|
|
targetMinutes: 1,
|
|
percentComplete: 0,
|
|
taskType: FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP
|
|
};
|
|
} else {
|
|
let env15359;
|
|
const r27 = env15359 = {};
|
|
env15359[0] = a0;
|
|
if (c3796_5.$env[0].some($mk104843(r27))) {
|
|
r64 = (function _getLatestTaskDetails({ quest, includeTaskTypes = FirstPartyQuestTaskTypesSets.ALL }) {
|
|
const r6 = Object;
|
|
let r30 = quest.userStatus?.progress;
|
|
if (r30 == null) {
|
|
r30 = {};
|
|
}
|
|
for (const item of r6.values(r30).sort((a, b) => {
|
|
let r0;
|
|
const r9 = a == null ? void 0 : a.heartbeat?.lastBeatAt;
|
|
const r8 = b == null ? void 0 : b.heartbeat?.lastBeatAt;
|
|
L27: {
|
|
if (r9 != null && r8 != null) {
|
|
r0 = new Date(r9).valueOf() > new Date(r8).valueOf() ? -1 : 1;
|
|
} else {
|
|
if (r9 == null && r8 == null && a?.updatedAt != null && b?.updatedAt != null) {
|
|
r0 = new Date(a.updatedAt).valueOf() > new Date(b.updatedAt).valueOf() ? -1 : 1;
|
|
break L27;
|
|
}
|
|
r0 = r9 != null ? r8 == null ? -1 : 1 : 1;
|
|
}
|
|
}
|
|
return r0;
|
|
}).filter(isNotNullish)) {
|
|
const r51 = _parseFirstPartyTaskType(item.eventName);
|
|
if (r51 == null) {
|
|
continue;
|
|
}
|
|
if (!(includeTaskTypes == null ? void 0 : includeTaskTypes.has(r51))) {
|
|
continue;
|
|
}
|
|
const r59 = _getTaskDetailsForType({
|
|
quest,
|
|
taskType: r51,
|
|
includeTaskTypes
|
|
});
|
|
if (r59 == null) {
|
|
continue;
|
|
}
|
|
return r59;
|
|
}
|
|
return _getTaskDetailsForType({
|
|
quest,
|
|
includeTaskTypes
|
|
});
|
|
})({
|
|
quest: a0,
|
|
includeTaskTypes: a1 == null ? isQuestProgressingOnConsole(a0) ? FirstPartyQuestTaskTypesSets.CONSOLE : FirstPartyQuestTaskTypesSets.ALL : a1
|
|
});
|
|
} else {
|
|
let env15360;
|
|
const r36 = env15360 = {};
|
|
env15360[0] = a0;
|
|
if (c3796_8.$env[0].some($mk104843(r36))) {
|
|
L23: {
|
|
r80 = {
|
|
quest: a0,
|
|
taskType: null
|
|
};
|
|
const config = a0.config;
|
|
const r86 = config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.WATCH_VIDEO];
|
|
const r15 = config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.WATCH_VIDEO_ON_MOBILE];
|
|
if (r86 != null) {
|
|
r94 = r15;
|
|
if (r94 != null) {
|
|
break L23;
|
|
}
|
|
}
|
|
let r95 = r15 == null ? r86 : r15;
|
|
if (r95 == null) {
|
|
r95 = null;
|
|
}
|
|
r94 = r95;
|
|
}
|
|
r80.taskType = r94?.type;
|
|
r64 = _getTaskDetailsForType(r80);
|
|
} else {
|
|
r64 = a0 != null && a0.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP] != null ? _getTaskDetailsForType({
|
|
quest: a0,
|
|
taskType: FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP
|
|
}) : a0.config.taskConfigV2.tasks[FirstPartyQuestTaskTypes.PLAY_ACTIVITY] != null ? _getTaskDetailsForType({
|
|
quest: a0,
|
|
taskType: FirstPartyQuestTaskTypes.PLAY_ACTIVITY
|
|
}) : _getTaskDetailsForType({
|
|
quest: a0,
|
|
taskType: FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP
|
|
});
|
|
}
|
|
}
|
|
}
|
|
if (r64 != null) {
|
|
return r64;
|
|
}
|
|
let r119 = _getTaskDetailsForType({
|
|
quest: a0
|
|
});
|
|
if (r119 == null) {
|
|
r119 = {
|
|
progressSeconds: 0,
|
|
targetSeconds: 1,
|
|
targetMinutes: 1,
|
|
percentComplete: 0,
|
|
taskType: FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP
|
|
};
|
|
}
|
|
return r119;
|
|
}
|
|
export function getDefaultInGameTask(a0) {
|
|
const tasks = a0.taskConfigV2.tasks;
|
|
let r11 = tasks[FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_ACTIVITY];
|
|
const r16 = tasks[FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_GAME];
|
|
if (r11 == null) {
|
|
r11 = r16;
|
|
}
|
|
if (r11 == null) {
|
|
r11 = null;
|
|
}
|
|
return r11;
|
|
}
|
|
export function getThirdPartyTaskDetails(a0) {
|
|
const tasks = a0.config.taskConfigV2.tasks;
|
|
let r7 = tasks[FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_ACTIVITY];
|
|
const r22 = tasks[FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_GAME];
|
|
if (r7 == null) {
|
|
r7 = r22;
|
|
}
|
|
if (r7 == null) {
|
|
r7 = null;
|
|
}
|
|
if (r7 == null) {
|
|
return null;
|
|
}
|
|
const userStatus = a0.userStatus;
|
|
const r3 = userStatus == null;
|
|
let progress2 = void 0;
|
|
if (!r3) {
|
|
const progress = userStatus.progress;
|
|
progress2 = progress == null ? void 0 : progress[r7.type]?.value;
|
|
}
|
|
if (progress2 == null) {
|
|
progress2 = 0;
|
|
}
|
|
const target = r7.target;
|
|
return {
|
|
title: r7.messages.taskTitle,
|
|
description: r7.messages.taskDescription,
|
|
target: r7.target,
|
|
progress: progress2,
|
|
percentComplete: target > 0 ? floor(Math.min(progress2 / target, 1), 4) : 0
|
|
};
|
|
}
|
|
export function getRemainingTaskTime(a0) {
|
|
const r7 = a0.targetSeconds - a0.progressSeconds;
|
|
return {
|
|
minutes: Math.max(0, Math.floor(r7 / 60)),
|
|
seconds: Math.max(0, Math.floor(r7 % 60))
|
|
};
|
|
}
|
|
export function parseMinutesAndSecondsFromSeconds(a0) {
|
|
return {
|
|
minutes: Math.max(0, Math.floor(a0 / 60)),
|
|
seconds: Math.max(0, Math.floor(a0 % 60))
|
|
};
|
|
}
|
|
export function formatWatchTaskRemainingTime(a0) {
|
|
const r9 = a0.targetSeconds - a0.progressSeconds;
|
|
const r15 = Math.max(0, Math.floor(r9 / 60));
|
|
const r21 = Math.max(0, Math.floor(r9 % 60));
|
|
return `${String(r15).padStart(2, "0")}:${String(r21).padStart(2, "0")}`;
|
|
}
|
|
export function formatWatchTaskTime(a0, a1) {
|
|
return `${String(a0).padStart(2, "0")}:${String(a1).padStart(2, "0")}`;
|
|
}
|