decord/source/utils/LazyAPIPromise.tsx

128 lines
3.5 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 8955
// Function ID: 8956
2026-07-20 16:05:17 +00:00
// Name: useLazyAPIPromise
2026-08-08 06:10:11 +00:00
// Dependencies: [5, 32, 19, 4202, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-08 06:10:11 +00:00
// Module 8955 (useLazyAPIPromise)
2026-07-23 10:11:24 +00:00
import asyncGeneratorStep from "asyncGeneratorStep";
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("noop").fileFinishedImporting("utils/LazyAPIPromise.tsx");
2026-07-20 16:05:17 +00:00
export default function useLazyAPIPromise(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-28 08:39:19 +00:00
function _execFn() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback(function*() {
if (c5 === 2) {
c5 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-08 06:10:11 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2;
if (0 === c4) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let aPIError = tmp3;
let closure_0 = tmp7;
closure_0 = undefined;
aPIError = undefined;
outer1_2(true);
v0(null);
v0 = 1;
c4 = 2;
c5 = 1;
const obj1 = { value: null, done: false };
obj1[0] = outer1_0();
return obj1;
}
} else if (1 === tmp7) {
v0 = 0;
aPIError = new outer1_0(outer1_1[3]).APIError(callback);
if (aPIError != null) {
tmp25(aPIError);
}
v0(outer1_1);
callback(false);
c5 = 3;
return { value: null, done: true };
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 0;
c5 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
closure_0 = arg1;
callback(false);
v0(null);
v0 = 0;
c5 = 3;
obj = { value: null, done: true };
obj[0] = closure_0;
return obj;
}
} catch (tmp41) {
callback = tmp41;
if (tmp4 === v0) {
c5 = tmp2;
throw tmp41;
} else {
c4 = tmp;
}
}
}
});
const _execFn = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp = callback(_execFn.useState(false), 2);
2026-07-23 10:11:24 +00:00
let asyncGeneratorStep = tmp[1];
2026-07-20 16:05:17 +00:00
const tmp2 = callback(_execFn.useState(null), 2);
2026-07-23 10:11:24 +00:00
callback = tmp2[1];
2026-07-20 16:05:17 +00:00
const items = [
function execFn() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _execFn.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
},
{ loading: tmp[0], error: tmp2[0] }
];
return items;
};