decord/source/modules/quests/VideoQuestUIStore.tsx

143 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-07-30 10:14:41 +00:00
// Module ID: 5985
// Function ID: 5986
2026-07-20 16:05:17 +00:00
// Name: _toPropertyKey
2026-07-30 10:14:41 +00:00
// Dependencies: [109, 700, 4058, 5986, 705, 5987, 2]
2026-07-20 16:05:17 +00:00
2026-07-30 10:14:41 +00:00
// Module 5985 (_toPropertyKey)
2026-07-23 10:11:24 +00:00
import _objectWithoutProperties from "_objectWithoutProperties";
2026-07-29 08:29:29 +00:00
import identity from "identity";
2026-07-23 10:11:24 +00:00
import createJSONStorage from "createJSONStorage";
import createJSONStorage from "createJSONStorage";
const require = arg1;
2026-07-20 16:05:17 +00:00
function _toPropertyKey(arg0) {
let StringResult = arg0;
2026-07-29 08:29:29 +00:00
if (typeof arg0 !== "window") {
2026-07-20 16:05:17 +00:00
StringResult = arg0;
if (arg0) {
const _Symbol = Symbol;
if (undefined !== arg0[Symbol.toPrimitive]) {
2026-07-29 08:29:29 +00:00
const call = tmp3.call;
if (typeof call === "unknown") {
let callResult = tmp3("string");
} else {
callResult = call(arg0, "string");
}
2026-07-20 16:05:17 +00:00
StringResult = callResult;
2026-07-29 08:29:29 +00:00
if (typeof callResult !== "window") {
2026-07-20 16:05:17 +00:00
const _TypeError = TypeError;
const typeError = new TypeError("@@toPrimitive must return a primitive value.");
throw typeError;
}
} else {
const _String = String;
StringResult = String(arg0);
}
}
}
let text = StringResult;
2026-07-29 08:29:29 +00:00
if (typeof StringResult !== "e") {
2026-07-20 16:05:17 +00:00
text = `${tmp}`;
}
return text;
}
let obj = { UNKNOWN: "UNKNOWN", NOT_STARTED: "NOT_STARTED", IN_PROGRESS: "IN_PROGRESS", COMPLETED: "COMPLETED" };
2026-07-29 08:29:29 +00:00
identity = identity.createWithEqualityFn();
obj = { name: "videoQuestUIState", storage: null, partialize: null, version: 0 };
2026-07-30 10:14:41 +00:00
obj[1] = createJSONStorage.createJSONStorage(() => importDefault(5987));
2026-07-29 08:29:29 +00:00
obj[2] = function partialize(volume) {
2026-07-20 16:05:17 +00:00
return { volume: volume.volume, muted: volume.muted, videoProgress: volume.videoProgress };
};
2026-07-29 08:29:29 +00:00
const withEqualityFnResult = identity(createJSONStorage.persist((arg0, arg1) => {
2026-07-23 10:11:24 +00:00
const _require = arg0;
let closure_1 = arg1;
2026-07-29 08:29:29 +00:00
return {
2026-07-30 10:14:41 +00:00
volume: _require(5986).DEFAULT_VIDEO_VOLUME,
2026-07-23 10:11:24 +00:00
muted: false,
transcriptEnabled: false,
captionEnabled: false,
2026-07-20 16:05:17 +00:00
videoProgress: {},
2026-07-23 10:11:24 +00:00
transcript: null,
2026-07-20 16:05:17 +00:00
setVolume(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
callback(outer1_2[4]).batchUpdates(() => callback({ volume: callback }));
2026-07-20 16:05:17 +00:00
},
setMuted(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
callback(outer1_2[4]).batchUpdates(() => callback({ muted: callback }));
2026-07-20 16:05:17 +00:00
},
setVideoProgress(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
const callback2 = arg1;
let closure_2 = arg2;
const tmp = callback2().videoProgress[arg0];
2026-07-29 08:29:29 +00:00
let num;
if (tmp != null) {
num = tmp.maxTimestampSec;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let _objectWithoutProperties = Math.max(num, arg1);
callback(outer1_2[4]).batchUpdates(() => {
2026-07-29 08:29:29 +00:00
let obj = { videoProgress: null };
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(callback2().videoProgress);
obj = { timestampSec: callback2, duration: closure_2, maxTimestampSec: _objectWithoutProperties };
obj[callback] = obj;
2026-07-29 08:29:29 +00:00
obj[0] = obj;
2026-07-23 10:11:24 +00:00
return callback(obj);
2026-07-20 16:05:17 +00:00
});
},
setTranscriptEnabled(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
callback(outer1_2[4]).batchUpdates(() => callback({ transcriptEnabled: callback }));
2026-07-20 16:05:17 +00:00
},
setCaptionEnabled(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
callback(outer1_2[4]).batchUpdates(() => callback({ captionEnabled: callback }));
2026-07-20 16:05:17 +00:00
},
getVideoProgress(questId) {
2026-07-23 10:11:24 +00:00
return callback2().videoProgress[questId];
2026-07-20 16:05:17 +00:00
},
getVideoProgressState(arg0) {
2026-07-23 10:11:24 +00:00
const tmp = callback2().videoProgress[arg0];
2026-07-20 16:05:17 +00:00
if (null == tmp) {
2026-07-29 08:29:29 +00:00
let IN_PROGRESS = outer1_5.UNKNOWN;
2026-07-20 16:05:17 +00:00
} else if (0 === tmp.timestampSec) {
2026-07-29 08:29:29 +00:00
IN_PROGRESS = outer1_5.NOT_STARTED;
2026-07-20 16:05:17 +00:00
} else if (tmp.timestampSec >= tmp.duration) {
2026-07-29 08:29:29 +00:00
IN_PROGRESS = outer1_5.COMPLETED;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
IN_PROGRESS = outer1_5.IN_PROGRESS;
2026-07-20 16:05:17 +00:00
}
return IN_PROGRESS;
},
resetQuest(questId) {
2026-07-23 10:11:24 +00:00
const callback = questId;
callback(outer1_2[4]).batchUpdates(() => {
const items = [questId];
2026-07-29 08:29:29 +00:00
questId({ videoProgress: outer2_3(outer1_1().videoProgress, items.map(outer2_4)) });
2026-07-20 16:05:17 +00:00
});
},
clearState() {
2026-07-23 10:11:24 +00:00
callback(outer1_2[4]).batchUpdates(() => {
2026-07-29 08:29:29 +00:00
callback({ videoProgress: {} });
2026-07-20 16:05:17 +00:00
});
},
setTranscriptAsset(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
callback(outer1_2[4]).batchUpdates(() => {
callback({ transcript: callback });
2026-07-20 16:05:17 +00:00
});
}
};
}, obj));
2026-07-23 10:11:24 +00:00
const result = require("createJSONStorage").fileFinishedImporting("modules/quests/VideoQuestUIStore.tsx");
2026-07-20 16:05:17 +00:00
export default withEqualityFnResult;
2026-07-23 10:11:24 +00:00
export const DEFAULT_VIDEO_PROGRESS = { timestampSec: 0, duration: 10, maxTimestampSec: 0 };
2026-07-20 16:05:17 +00:00
export const VideoProgressState = obj;
export const FetchStatus = { NONE: "NONE", FETCHING: "FETCHING", SUCCESS: "SUCCESS", FAILURE: "FAILURE" };
export const useVideoQuestUIStore = withEqualityFnResult;