decord/source/modules/message_previews/RemoteFetchData.tsx
2026-08-13 07:00:46 +00:00

171 lines
4.7 KiB
TypeScript

// Module ID: 14630
// Function ID: 14631
// Name: FetchStatus
// Dependencies: [5, 2]
// Module 14630 (FetchStatus)
import asyncGeneratorStep from "asyncGeneratorStep";
let obj = { Pending: 0, [0]: "Pending", Fetching: 1, [1]: "Fetching" };
const result = require("set").fileFinishedImporting("modules/message_previews/RemoteFetchData.tsx");
class RemoteFetchData {
constructor() {
obj = Object.create(new.target.prototype);
set = new Set();
obj[0] = set;
set1 = new Set();
obj[1] = set1;
return obj;
}
}
const prototype = RemoteFetchData.prototype;
prototype["empty"] = function empty() {
return 0 === this.pending.size && 0 === this.fetching.size;
};
prototype["status"] = function status(arg0) {
const pending = this.pending;
if (pending.has(arg0)) {
let Pending = obj.Pending;
} else {
const fetching = this.fetching;
Pending = null;
if (fetching.has(arg0)) {
Pending = obj.Fetching;
}
}
return Pending;
};
prototype["addWant"] = function addWant(arg0) {
const fetching = this.fetching;
if (!fetching.has(arg0)) {
const pending = this.pending;
pending.add(arg0);
}
};
prototype["removeWant"] = function removeWant(channel_id) {
const pending = this.pending;
pending.delete(channel_id);
const fetching = this.fetching;
fetching.delete(channel_id);
};
prototype["nextWants"] = function nextWants(arg0) {
const items = [...this.pending];
items.length = Math.min(arg0, items.length);
return items;
};
prototype["markFetching"] = function markFetching(outer1_0) {
const self = this;
const iter = outer1_0[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let pending = self.pending;
let deleteResult = pending.delete(nextResult);
let fetching = self.fetching;
let addResult = fetching.add(nextResult);
continue;
}
};
prototype["markCompleted"] = function markCompleted(asyncGeneratorStep) {
const self = this;
const iter = asyncGeneratorStep[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let pending = self.pending;
let deleteResult = pending.delete(nextResult);
let fetching = self.fetching;
let deleteResult1 = fetching.delete(nextResult);
continue;
}
};
prototype["markFailed"] = function markFailed(asyncGeneratorStep) {
const self = this;
const iter = asyncGeneratorStep[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let pending = self.pending;
let addResult = pending.add(nextResult);
let fetching = self.fetching;
let deleteResult = fetching.delete(nextResult);
continue;
}
};
prototype["try"] = function try(nextWantsResult, arg1) {
const callback = nextWantsResult;
let closure_1 = arg1;
const self = this;
return 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 {
return { value: "HermesInternal", done: null };
}
} 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 closure_1 = tmp3;
let asyncGeneratorStep = tmp7;
asyncGeneratorStep = undefined;
let c3 = 1;
outer1_2.markFetching(outer1_0);
c4 = 2;
c5 = 1;
const obj1 = { value: null, done: false };
obj1[0] = outer1_1();
return obj1;
}
} else if (1 === tmp7) {
c3 = 0;
closure_1 = closure_2;
closure_2.markFailed(asyncGeneratorStep);
throw closure_1;
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 0;
c5 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
asyncGeneratorStep = arg1;
closure_2.markCompleted(asyncGeneratorStep);
c3 = 0;
c5 = 3;
obj = { value: null, done: true };
obj[0] = asyncGeneratorStep;
return obj;
}
} catch (tmp25) {
closure_2 = tmp25;
if (tmp4 === c3) {
c5 = tmp2;
throw tmp25;
} else {
c4 = tmp;
}
}
}
})();
};
export const FetchStatus = obj;
export { RemoteFetchData };