libav-wasm 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -3
- package/build/index.d.ts +5 -14
- package/build/index.js +62 -39
- package/build/utils.d.ts +1 -0
- package/build/{worker.d.ts → worker/index.d.ts} +20 -5
- package/build/worker.js +1572 -1173
- package/package.json +2 -1
- package/build/libav.wasm +0 -0
package/build/worker.js
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
const
|
|
2
|
-
target:
|
|
3
|
-
resolvers:
|
|
4
|
-
filter:
|
|
5
|
-
map:
|
|
6
|
-
key:
|
|
1
|
+
const Na = "osra-message", Wa = ({
|
|
2
|
+
target: c,
|
|
3
|
+
resolvers: u,
|
|
4
|
+
filter: _,
|
|
5
|
+
map: h,
|
|
6
|
+
key: P = Na
|
|
7
7
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
8
|
+
const i = (k) => {
|
|
9
|
+
if (!k.data || typeof k.data != "object" || k.data?.source !== P || _ && !_(k))
|
|
10
10
|
return;
|
|
11
|
-
const { type:
|
|
12
|
-
if (!
|
|
13
|
-
throw new Error(`Osra received a message of type "${String(
|
|
14
|
-
|
|
11
|
+
const { type: D, data: M, port: C } = k.data, E = u[D];
|
|
12
|
+
if (!E)
|
|
13
|
+
throw new Error(`Osra received a message of type "${String(D)}" but no resolver was found for type.`);
|
|
14
|
+
h ? E(...h(M, { event: k, type: D, port: C })) : E(M, { event: k, type: D, port: C });
|
|
15
15
|
};
|
|
16
|
-
return
|
|
17
|
-
listener:
|
|
18
|
-
resolvers:
|
|
16
|
+
return c.addEventListener("message", i), {
|
|
17
|
+
listener: i,
|
|
18
|
+
resolvers: u
|
|
19
19
|
};
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
const { port1:
|
|
25
|
-
return
|
|
20
|
+
}, qt = (c) => !!(globalThis.SharedArrayBuffer && c instanceof globalThis.SharedArrayBuffer), Kt = (c) => globalThis.ArrayBuffer && c instanceof globalThis.ArrayBuffer || globalThis.MessagePort && c instanceof globalThis.MessagePort || globalThis.ReadableStream && c instanceof globalThis.ReadableStream || globalThis.WritableStream && c instanceof globalThis.WritableStream || globalThis.TransformStream && c instanceof globalThis.TransformStream ? !0 : !!(globalThis.ImageBitmap && c instanceof globalThis.ImageBitmap), Zt = (c) => {
|
|
21
|
+
const u = [], _ = (h) => qt(h) ? void 0 : Kt(h) ? u.push(h) : Array.isArray(h) ? h.map(_) : h && typeof h == "object" ? Object.values(h).map(_) : void 0;
|
|
22
|
+
return _(c), u;
|
|
23
|
+
}, Gt = "__proxyFunctionPort__", Ha = (c) => {
|
|
24
|
+
const { port1: u, port2: _ } = new MessageChannel();
|
|
25
|
+
return u.addEventListener("message", async (h) => {
|
|
26
26
|
try {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
} catch (
|
|
30
|
-
|
|
27
|
+
const P = await c(...h.data), i = xe(P), k = Zt(i);
|
|
28
|
+
u.postMessage({ result: i }, { transfer: k });
|
|
29
|
+
} catch (P) {
|
|
30
|
+
u.postMessage({ error: P });
|
|
31
31
|
}
|
|
32
|
-
}),
|
|
33
|
-
},
|
|
34
|
-
Object.entries(
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
}), u.start(), _;
|
|
33
|
+
}, xe = (c) => qt(c) || Kt(c) ? c : typeof c == "function" ? { [Gt]: Ha(c) } : Array.isArray(c) ? c.map(xe) : c && typeof c == "object" ? Object.fromEntries(
|
|
34
|
+
Object.entries(c).map(([u, _]) => [
|
|
35
|
+
u,
|
|
36
|
+
xe(_)
|
|
37
37
|
])
|
|
38
|
-
) :
|
|
39
|
-
const
|
|
40
|
-
|
|
38
|
+
) : c, Ya = (c) => (...u) => new Promise((_, h) => {
|
|
39
|
+
const P = xe(u), i = Zt(P), k = (D) => {
|
|
40
|
+
D.data.error ? h(D.data.error) : _(Xt(D.data.result)), c.removeEventListener("message", k);
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
}),
|
|
44
|
-
Object.entries(
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
c.addEventListener("message", k), c.start(), c.postMessage(P, { transfer: i });
|
|
43
|
+
}), Xt = (c) => qt(c) || Kt(c) ? c : c && typeof c == "object" && c[Gt] ? Ya(c[Gt]) : Array.isArray(c) ? c.map(xe) : c && typeof c == "object" ? Object.fromEntries(
|
|
44
|
+
Object.entries(c).map(([u, _]) => [
|
|
45
|
+
u,
|
|
46
|
+
Xt(_)
|
|
47
47
|
])
|
|
48
|
-
) :
|
|
49
|
-
const { port:
|
|
48
|
+
) : c, ja = (c) => async (u, _) => {
|
|
49
|
+
const { port: h } = _, P = Xt(u);
|
|
50
50
|
try {
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
} catch (
|
|
54
|
-
throw
|
|
51
|
+
const i = await c(P, _), k = xe(i), D = Zt(k);
|
|
52
|
+
return h.postMessage({ result: k }, { transfer: D }), h.close(), i;
|
|
53
|
+
} catch (i) {
|
|
54
|
+
throw h.postMessage({ error: i }), h.close(), i;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
var
|
|
57
|
+
var Qt = {}, za = {
|
|
58
58
|
get exports() {
|
|
59
|
-
return
|
|
59
|
+
return Qt;
|
|
60
60
|
},
|
|
61
|
-
set exports(
|
|
62
|
-
|
|
61
|
+
set exports(c) {
|
|
62
|
+
Qt = c;
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
(function(
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
return function(
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
(function(c, u) {
|
|
66
|
+
var _ = (() => {
|
|
67
|
+
var h = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
|
|
68
|
+
return function(P = {}) {
|
|
69
|
+
var i = P, k, D;
|
|
70
|
+
i.ready = new Promise((e, t) => {
|
|
71
|
+
k = e, D = t;
|
|
72
72
|
}), ["_main", "__embind_initialize_bindings", "_fflush", "___set_stack_limits", "onRuntimeInitialized"].forEach((e) => {
|
|
73
|
-
Object.getOwnPropertyDescriptor(
|
|
74
|
-
get: () =>
|
|
75
|
-
set: () =>
|
|
73
|
+
Object.getOwnPropertyDescriptor(i.ready, e) || Object.defineProperty(i.ready, e, {
|
|
74
|
+
get: () => J("You are getting " + e + " on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),
|
|
75
|
+
set: () => J("You are setting " + e + " on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
|
-
var
|
|
78
|
+
var M = Object.assign({}, i), C = "./this.program", E = (e, t) => {
|
|
79
79
|
throw t;
|
|
80
|
-
},
|
|
81
|
-
if (
|
|
80
|
+
}, O = !0, Y = !1, V = !1, H = !1;
|
|
81
|
+
if (i.ENVIRONMENT)
|
|
82
82
|
throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");
|
|
83
|
-
var
|
|
84
|
-
function
|
|
85
|
-
return
|
|
83
|
+
var W = "";
|
|
84
|
+
function $(e) {
|
|
85
|
+
return i.locateFile ? i.locateFile(e, W) : W + e;
|
|
86
86
|
}
|
|
87
|
-
var
|
|
88
|
-
if (typeof document < "u" && document.currentScript && (
|
|
87
|
+
var N;
|
|
88
|
+
if (typeof document < "u" && document.currentScript && (W = document.currentScript.src), h && (W = h), W.indexOf("blob:") !== 0 ? W = W.substr(0, W.replace(/[?#].*/, "").lastIndexOf("/") + 1) : W = "", !(typeof window == "object" || typeof importScripts == "function"))
|
|
89
89
|
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
90
|
-
var
|
|
91
|
-
Object.assign(
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
e ||
|
|
99
|
-
}
|
|
100
|
-
var
|
|
101
|
-
function
|
|
102
|
-
var e =
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
90
|
+
var U = i.print || console.log.bind(console), T = i.printErr || console.error.bind(console);
|
|
91
|
+
Object.assign(i, M), M = null, Ea(), i.arguments && i.arguments, ve("arguments", "arguments_"), i.thisProgram && (C = i.thisProgram), ve("thisProgram", "thisProgram"), i.quit && (E = i.quit), ve("quit", "quit_"), p(typeof i.memoryInitializerPrefixURL > "u", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"), p(typeof i.pthreadMainPrefixURL > "u", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"), p(typeof i.cdInitializerPrefixURL > "u", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"), p(typeof i.filePackagePrefixURL > "u", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"), p(typeof i.read > "u", "Module.read option was removed (modify read_ in JS)"), p(typeof i.readAsync > "u", "Module.readAsync option was removed (modify readAsync in JS)"), p(typeof i.readBinary > "u", "Module.readBinary option was removed (modify readBinary in JS)"), p(typeof i.setWindowTitle > "u", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"), p(typeof i.TOTAL_MEMORY > "u", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"), ve("read", "read_"), ve("readAsync", "readAsync"), ve("readBinary", "readBinary"), ve("setWindowTitle", "setWindowTitle"), p(!Y, "worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."), p(!V, "node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."), p(!H, "shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");
|
|
92
|
+
var q;
|
|
93
|
+
i.wasmBinary && (q = i.wasmBinary), ve("wasmBinary", "wasmBinary");
|
|
94
|
+
var se = i.noExitRuntime || !0;
|
|
95
|
+
ve("noExitRuntime", "noExitRuntime"), typeof WebAssembly != "object" && J("no native wasm support detected");
|
|
96
|
+
var Se, _e = !1, Ue;
|
|
97
|
+
function p(e, t) {
|
|
98
|
+
e || J("Assertion failed" + (t ? ": " + t : ""));
|
|
99
|
+
}
|
|
100
|
+
var le, re, Fe, rt, y, x, er, tr;
|
|
101
|
+
function rr() {
|
|
102
|
+
var e = Se.buffer;
|
|
103
|
+
i.HEAP8 = le = new Int8Array(e), i.HEAP16 = Fe = new Int16Array(e), i.HEAP32 = y = new Int32Array(e), i.HEAPU8 = re = new Uint8Array(e), i.HEAPU16 = rt = new Uint16Array(e), i.HEAPU32 = x = new Uint32Array(e), i.HEAPF32 = er = new Float32Array(e), i.HEAPF64 = tr = new Float64Array(e);
|
|
104
|
+
}
|
|
105
|
+
p(!i.STACK_SIZE, "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"), p(
|
|
106
106
|
typeof Int32Array < "u" && typeof Float64Array < "u" && Int32Array.prototype.subarray != null && Int32Array.prototype.set != null,
|
|
107
107
|
"JS engine does not provide full typed array support"
|
|
108
|
-
),
|
|
109
|
-
var
|
|
110
|
-
function
|
|
111
|
-
var e =
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
function
|
|
115
|
-
if (!
|
|
116
|
-
var e =
|
|
108
|
+
), p(!i.wasmMemory, "Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"), p(!i.INITIAL_MEMORY, "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");
|
|
109
|
+
var nr;
|
|
110
|
+
function Xr() {
|
|
111
|
+
var e = Je();
|
|
112
|
+
p((e & 3) == 0), e == 0 && (e += 4), x[e >> 2] = 34821223, I(34821223), x[e + 4 >> 2] = 2310721022, I(2310721022), x[0] = 1668509029, I(1668509029);
|
|
113
|
+
}
|
|
114
|
+
function Le() {
|
|
115
|
+
if (!_e) {
|
|
116
|
+
var e = Je();
|
|
117
117
|
e == 0 && (e += 4);
|
|
118
|
-
var t =
|
|
119
|
-
(t != 34821223 || r != 2310721022) &&
|
|
118
|
+
var t = x[e >> 2], r = x[e + 4 >> 2];
|
|
119
|
+
(t != 34821223 || r != 2310721022) && J(`Stack overflow! Stack cookie has been overwritten at ${he(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${he(r)} ${he(t)}`), x[0] != 1668509029 && J("Runtime error: The application has corrupted its heap memory area (address zero)!");
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
(function() {
|
|
@@ -124,268 +124,268 @@ var Ct = {}, ca = {
|
|
|
124
124
|
if (e[0] = 25459, t[0] !== 115 || t[1] !== 99)
|
|
125
125
|
throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
|
|
126
126
|
})();
|
|
127
|
-
var
|
|
128
|
-
function
|
|
129
|
-
return
|
|
130
|
-
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
for (typeof
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
function
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
function
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
function
|
|
144
|
-
if (
|
|
145
|
-
for (typeof
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
function
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
function
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
var
|
|
160
|
-
function
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
clearInterval(
|
|
127
|
+
var wt = [], ir = [], en = [], ar = [], Tt = !1, or = 0;
|
|
128
|
+
function Ct() {
|
|
129
|
+
return se || or > 0;
|
|
130
|
+
}
|
|
131
|
+
function tn() {
|
|
132
|
+
if (i.preRun)
|
|
133
|
+
for (typeof i.preRun == "function" && (i.preRun = [i.preRun]); i.preRun.length; )
|
|
134
|
+
on(i.preRun.shift());
|
|
135
|
+
it(wt);
|
|
136
|
+
}
|
|
137
|
+
function rn() {
|
|
138
|
+
p(!Tt), Tt = !0, Le(), Pn(), it(ir);
|
|
139
|
+
}
|
|
140
|
+
function nn() {
|
|
141
|
+
Le(), it(en);
|
|
142
|
+
}
|
|
143
|
+
function an() {
|
|
144
|
+
if (Le(), i.postRun)
|
|
145
|
+
for (typeof i.postRun == "function" && (i.postRun = [i.postRun]); i.postRun.length; )
|
|
146
|
+
ln(i.postRun.shift());
|
|
147
|
+
it(ar);
|
|
148
|
+
}
|
|
149
|
+
function on(e) {
|
|
150
|
+
wt.unshift(e);
|
|
151
|
+
}
|
|
152
|
+
function sn(e) {
|
|
153
|
+
ir.unshift(e);
|
|
154
|
+
}
|
|
155
|
+
function ln(e) {
|
|
156
|
+
ar.unshift(e);
|
|
157
|
+
}
|
|
158
|
+
p(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), p(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), p(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), p(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");
|
|
159
|
+
var be = 0, Pe = null, Ne = null, We = {};
|
|
160
|
+
function un(e) {
|
|
161
|
+
be++, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (p(!We[e]), We[e] = 1, Pe === null && typeof setInterval < "u" && (Pe = setInterval(() => {
|
|
162
|
+
if (_e) {
|
|
163
|
+
clearInterval(Pe), Pe = null;
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
var t = !1;
|
|
167
|
-
for (var r in
|
|
168
|
-
t || (t = !0,
|
|
169
|
-
t &&
|
|
170
|
-
}, 1e4))) :
|
|
171
|
-
}
|
|
172
|
-
function
|
|
173
|
-
if (
|
|
174
|
-
var t =
|
|
175
|
-
|
|
167
|
+
for (var r in We)
|
|
168
|
+
t || (t = !0, T("still waiting on run dependencies:")), T("dependency: " + r);
|
|
169
|
+
t && T("(end of list)");
|
|
170
|
+
}, 1e4))) : T("warning: run dependency added without ID");
|
|
171
|
+
}
|
|
172
|
+
function cn(e) {
|
|
173
|
+
if (be--, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (p(We[e]), delete We[e]) : T("warning: run dependency removed without ID"), be == 0 && (Pe !== null && (clearInterval(Pe), Pe = null), Ne)) {
|
|
174
|
+
var t = Ne;
|
|
175
|
+
Ne = null, t();
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
|
|
178
|
+
function J(e) {
|
|
179
|
+
i.onAbort && i.onAbort(e), e = "Aborted(" + e + ")", T(e), _e = !0, Ue = 1, e.indexOf("RuntimeError: unreachable") >= 0 && (e += '. "unreachable" may be due to ASYNCIFY_STACK_SIZE not being large enough (try increasing it)');
|
|
180
180
|
var t = new WebAssembly.RuntimeError(e);
|
|
181
|
-
throw
|
|
181
|
+
throw D(t), t;
|
|
182
182
|
}
|
|
183
|
-
var
|
|
183
|
+
var ue = {
|
|
184
184
|
error: function() {
|
|
185
|
-
|
|
185
|
+
J("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM");
|
|
186
186
|
},
|
|
187
187
|
init: function() {
|
|
188
|
-
|
|
188
|
+
ue.error();
|
|
189
189
|
},
|
|
190
190
|
createDataFile: function() {
|
|
191
|
-
|
|
191
|
+
ue.error();
|
|
192
192
|
},
|
|
193
193
|
createPreloadedFile: function() {
|
|
194
|
-
|
|
194
|
+
ue.error();
|
|
195
195
|
},
|
|
196
196
|
createLazyFile: function() {
|
|
197
|
-
|
|
197
|
+
ue.error();
|
|
198
198
|
},
|
|
199
199
|
open: function() {
|
|
200
|
-
|
|
200
|
+
ue.error();
|
|
201
201
|
},
|
|
202
202
|
mkdev: function() {
|
|
203
|
-
|
|
203
|
+
ue.error();
|
|
204
204
|
},
|
|
205
205
|
registerDevice: function() {
|
|
206
|
-
|
|
206
|
+
ue.error();
|
|
207
207
|
},
|
|
208
208
|
analyzePath: function() {
|
|
209
|
-
|
|
209
|
+
ue.error();
|
|
210
210
|
},
|
|
211
211
|
ErrnoError: function() {
|
|
212
|
-
|
|
212
|
+
ue.error();
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
|
-
|
|
216
|
-
var
|
|
217
|
-
function
|
|
218
|
-
return e.startsWith(
|
|
215
|
+
i.FS_createDataFile = ue.createDataFile, i.FS_createPreloadedFile = ue.createPreloadedFile;
|
|
216
|
+
var fn = "data:application/octet-stream;base64,";
|
|
217
|
+
function sr(e) {
|
|
218
|
+
return e.startsWith(fn);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function dn(e) {
|
|
221
221
|
return e.startsWith("file://");
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function A(e, t) {
|
|
224
224
|
return function() {
|
|
225
225
|
var r = e, n = t;
|
|
226
|
-
return t || (n =
|
|
226
|
+
return t || (n = i.asm), p(Tt, "native function `" + r + "` called before runtime initialization"), n[e] || p(n[e], "exported native function `" + r + "` not found"), n[e].apply(null, arguments);
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
var
|
|
230
|
-
|
|
231
|
-
function
|
|
229
|
+
var we;
|
|
230
|
+
we = "libav.wasm", sr(we) || (we = $(we));
|
|
231
|
+
function lr(e) {
|
|
232
232
|
try {
|
|
233
|
-
if (e ==
|
|
234
|
-
return new Uint8Array(
|
|
233
|
+
if (e == we && q)
|
|
234
|
+
return new Uint8Array(q);
|
|
235
235
|
throw "both async and sync fetching of the wasm failed";
|
|
236
236
|
} catch (t) {
|
|
237
|
-
|
|
237
|
+
J(t);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
return !
|
|
240
|
+
function _n(e) {
|
|
241
|
+
return !q && O && typeof fetch == "function" ? fetch(e, { credentials: "same-origin" }).then((t) => {
|
|
242
242
|
if (!t.ok)
|
|
243
243
|
throw "failed to load wasm binary file at '" + e + "'";
|
|
244
244
|
return t.arrayBuffer();
|
|
245
|
-
}).catch(() =>
|
|
245
|
+
}).catch(() => lr(e)) : Promise.resolve().then(() => lr(e));
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
249
|
-
|
|
247
|
+
function ur(e, t, r) {
|
|
248
|
+
return _n(e).then((n) => WebAssembly.instantiate(n, t)).then((n) => n).then(r, (n) => {
|
|
249
|
+
T("failed to asynchronously prepare wasm: " + n), dn(we) && T("warning: Loading from a file URI (" + we + ") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"), J(n);
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
return !e && typeof WebAssembly.instantiateStreaming == "function" && !
|
|
254
|
-
var s = WebAssembly.instantiateStreaming(
|
|
252
|
+
function vn(e, t, r, n) {
|
|
253
|
+
return !e && typeof WebAssembly.instantiateStreaming == "function" && !sr(t) && typeof fetch == "function" ? fetch(t, { credentials: "same-origin" }).then((a) => {
|
|
254
|
+
var s = WebAssembly.instantiateStreaming(a, r);
|
|
255
255
|
return s.then(
|
|
256
256
|
n,
|
|
257
257
|
function(o) {
|
|
258
|
-
return
|
|
258
|
+
return T("wasm streaming compile failed: " + o), T("falling back to ArrayBuffer instantiation"), ur(t, r, n);
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
|
-
}) :
|
|
261
|
+
}) : ur(t, r, n);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function hn() {
|
|
264
264
|
var e = {
|
|
265
|
-
env:
|
|
266
|
-
wasi_snapshot_preview1:
|
|
265
|
+
env: jt,
|
|
266
|
+
wasi_snapshot_preview1: jt
|
|
267
267
|
};
|
|
268
|
-
function t(
|
|
269
|
-
var o =
|
|
270
|
-
return o =
|
|
268
|
+
function t(a, s) {
|
|
269
|
+
var o = a.exports;
|
|
270
|
+
return o = g.instrumentWasmExports(o), i.asm = o, Se = i.asm.memory, p(Se, "memory not found in wasm exports"), rr(), nr = i.asm.__indirect_function_table, p(nr, "table not found in wasm exports"), sn(i.asm.__wasm_call_ctors), cn("wasm-instantiate"), o;
|
|
271
271
|
}
|
|
272
|
-
|
|
273
|
-
var r =
|
|
274
|
-
function n(
|
|
275
|
-
|
|
272
|
+
un("wasm-instantiate");
|
|
273
|
+
var r = i;
|
|
274
|
+
function n(a) {
|
|
275
|
+
p(i === r, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"), r = null, t(a.instance);
|
|
276
276
|
}
|
|
277
|
-
if (
|
|
277
|
+
if (i.instantiateWasm)
|
|
278
278
|
try {
|
|
279
|
-
return
|
|
280
|
-
} catch (
|
|
281
|
-
|
|
279
|
+
return i.instantiateWasm(e, t);
|
|
280
|
+
} catch (a) {
|
|
281
|
+
T("Module.instantiateWasm callback failed with error: " + a), D(a);
|
|
282
282
|
}
|
|
283
|
-
return
|
|
283
|
+
return vn(q, we, e, n).catch(D), {};
|
|
284
284
|
}
|
|
285
|
-
var
|
|
286
|
-
function
|
|
287
|
-
Object.getOwnPropertyDescriptor(
|
|
285
|
+
var ae, Me;
|
|
286
|
+
function ve(e, t) {
|
|
287
|
+
Object.getOwnPropertyDescriptor(i, e) || Object.defineProperty(i, e, {
|
|
288
288
|
configurable: !0,
|
|
289
289
|
get: function() {
|
|
290
|
-
|
|
290
|
+
J("Module." + e + " has been replaced with plain " + t + " (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
Object.getOwnPropertyDescriptor(
|
|
294
|
+
function mn(e) {
|
|
295
|
+
Object.getOwnPropertyDescriptor(i, e) && J("`Module." + e + "` was supplied but `" + e + "` not included in INCOMING_MODULE_JS_API");
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function cr(e) {
|
|
298
298
|
return e === "FS_createPath" || e === "FS_createDataFile" || e === "FS_createPreloadedFile" || e === "FS_unlink" || e === "addRunDependency" || e === "FS_createLazyFile" || e === "FS_createDevice" || e === "removeRunDependency";
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function pn(e, t) {
|
|
301
301
|
typeof globalThis < "u" && Object.defineProperty(globalThis, e, {
|
|
302
302
|
configurable: !0,
|
|
303
303
|
get: function() {
|
|
304
|
-
|
|
304
|
+
fe("`" + e + "` is not longer defined by emscripten. " + t);
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
|
-
|
|
309
|
-
function
|
|
308
|
+
pn("buffer", "Please use HEAP8.buffer or wasmMemory.buffer");
|
|
309
|
+
function gn(e) {
|
|
310
310
|
typeof globalThis < "u" && !Object.getOwnPropertyDescriptor(globalThis, e) && Object.defineProperty(globalThis, e, {
|
|
311
311
|
configurable: !0,
|
|
312
312
|
get: function() {
|
|
313
313
|
var t = "`" + e + "` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line", r = e;
|
|
314
|
-
r.startsWith("_") || (r = "$" + e), t += " (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='" + r + "')",
|
|
314
|
+
r.startsWith("_") || (r = "$" + e), t += " (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='" + r + "')", cr(e) && (t += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"), fe(t);
|
|
315
315
|
}
|
|
316
|
-
}),
|
|
316
|
+
}), fr(e);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
Object.getOwnPropertyDescriptor(
|
|
318
|
+
function fr(e) {
|
|
319
|
+
Object.getOwnPropertyDescriptor(i, e) || Object.defineProperty(i, e, {
|
|
320
320
|
configurable: !0,
|
|
321
321
|
get: function() {
|
|
322
322
|
var t = "'" + e + "' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";
|
|
323
|
-
|
|
323
|
+
cr(e) && (t += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"), J(t);
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
|
-
var
|
|
328
|
-
function
|
|
329
|
-
|
|
327
|
+
var yn = 2 ** 8 - 1, bn = 2 ** 16 - 1, wn = 2 ** 32 - 1, Tn = 2 ** 64 - 1, Cn = -(2 ** (8 - 1)) + 1, En = -(2 ** (16 - 1)) + 1, Sn = -(2 ** (32 - 1)) + 1, Fn = -(2 ** (64 - 1)) + 1;
|
|
328
|
+
function nt(e, t, r, n) {
|
|
329
|
+
p(Number.isInteger(Number(e)), "attempt to write non-integer (" + e + ") into integer heap"), p(e <= n, "value (" + e + ") too large to write as " + t + "-bit value"), p(e >= r, "value (" + e + ") too small to write as " + t + "-bit value");
|
|
330
330
|
}
|
|
331
|
-
var
|
|
332
|
-
function
|
|
331
|
+
var He = (e) => nt(e, 8, Cn, yn), Et = (e) => nt(e, 16, En, bn), I = (e) => nt(e, 32, Sn, wn), dr = (e) => nt(e, 64, Fn, Tn);
|
|
332
|
+
function _r(e) {
|
|
333
333
|
this.name = "ExitStatus", this.message = `Program terminated with exit(${e})`, this.status = e;
|
|
334
334
|
}
|
|
335
|
-
var
|
|
335
|
+
var it = (e) => {
|
|
336
336
|
for (; e.length > 0; )
|
|
337
|
-
e.shift()(
|
|
338
|
-
},
|
|
339
|
-
var e =
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
|
|
337
|
+
e.shift()(i);
|
|
338
|
+
}, he = (e) => (p(typeof e == "number"), "0x" + e.toString(16).padStart(8, "0")), Pn = () => {
|
|
339
|
+
var e = zt(), t = Je();
|
|
340
|
+
Ia(e, t);
|
|
341
|
+
}, fe = (e) => {
|
|
342
|
+
fe.shown || (fe.shown = {}), fe.shown[e] || (fe.shown[e] = 1, T(e));
|
|
343
343
|
};
|
|
344
|
-
function
|
|
344
|
+
function An(e) {
|
|
345
345
|
this.excPtr = e, this.ptr = e - 24, this.set_type = function(t) {
|
|
346
|
-
|
|
346
|
+
x[this.ptr + 4 >> 2] = t;
|
|
347
347
|
}, this.get_type = function() {
|
|
348
|
-
return
|
|
348
|
+
return x[this.ptr + 4 >> 2];
|
|
349
349
|
}, this.set_destructor = function(t) {
|
|
350
|
-
|
|
350
|
+
x[this.ptr + 8 >> 2] = t;
|
|
351
351
|
}, this.get_destructor = function() {
|
|
352
|
-
return
|
|
352
|
+
return x[this.ptr + 8 >> 2];
|
|
353
353
|
}, this.set_caught = function(t) {
|
|
354
|
-
t = t ? 1 : 0,
|
|
354
|
+
t = t ? 1 : 0, le[this.ptr + 12 >> 0] = t, He(t);
|
|
355
355
|
}, this.get_caught = function() {
|
|
356
|
-
return
|
|
356
|
+
return le[this.ptr + 12 >> 0] != 0;
|
|
357
357
|
}, this.set_rethrown = function(t) {
|
|
358
|
-
t = t ? 1 : 0,
|
|
358
|
+
t = t ? 1 : 0, le[this.ptr + 13 >> 0] = t, He(t);
|
|
359
359
|
}, this.get_rethrown = function() {
|
|
360
|
-
return
|
|
360
|
+
return le[this.ptr + 13 >> 0] != 0;
|
|
361
361
|
}, this.init = function(t, r) {
|
|
362
362
|
this.set_adjusted_ptr(0), this.set_type(t), this.set_destructor(r);
|
|
363
363
|
}, this.set_adjusted_ptr = function(t) {
|
|
364
|
-
|
|
364
|
+
x[this.ptr + 16 >> 2] = t;
|
|
365
365
|
}, this.get_adjusted_ptr = function() {
|
|
366
|
-
return
|
|
366
|
+
return x[this.ptr + 16 >> 2];
|
|
367
367
|
}, this.get_exception_ptr = function() {
|
|
368
|
-
var t =
|
|
368
|
+
var t = Aa(this.get_type());
|
|
369
369
|
if (t)
|
|
370
|
-
return
|
|
370
|
+
return x[this.excPtr >> 2];
|
|
371
371
|
var r = this.get_adjusted_ptr();
|
|
372
372
|
return r !== 0 ? r : this.excPtr;
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
var n = new
|
|
377
|
-
n.init(t, r),
|
|
375
|
+
function In(e, t, r) {
|
|
376
|
+
var n = new An(e);
|
|
377
|
+
n.init(t, r), p(!1, "Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.");
|
|
378
378
|
}
|
|
379
|
-
var
|
|
379
|
+
var Dn = (e) => {
|
|
380
380
|
e = e >>> 0;
|
|
381
|
-
var t =
|
|
382
|
-
|
|
383
|
-
},
|
|
384
|
-
for (var n = t + r,
|
|
385
|
-
++
|
|
386
|
-
if (
|
|
387
|
-
return
|
|
388
|
-
for (var s = ""; t <
|
|
381
|
+
var t = zt(), r = Je();
|
|
382
|
+
J(`stack overflow (Attempt to set SP to ${he(e)}, with stack limits [${he(r)} - ${he(t)}]). If you require more stack space build with -sSTACK_SIZE=<bytes>`);
|
|
383
|
+
}, vr = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0, hr = (e, t, r) => {
|
|
384
|
+
for (var n = t + r, a = t; e[a] && !(a >= n); )
|
|
385
|
+
++a;
|
|
386
|
+
if (a - t > 16 && e.buffer && vr)
|
|
387
|
+
return vr.decode(e.subarray(t, a));
|
|
388
|
+
for (var s = ""; t < a; ) {
|
|
389
389
|
var o = e[t++];
|
|
390
390
|
if (!(o & 128)) {
|
|
391
391
|
s += String.fromCharCode(o);
|
|
@@ -396,122 +396,122 @@ var Ct = {}, ca = {
|
|
|
396
396
|
s += String.fromCharCode((o & 31) << 6 | l);
|
|
397
397
|
continue;
|
|
398
398
|
}
|
|
399
|
-
var
|
|
400
|
-
if ((o & 240) == 224 ? o = (o & 15) << 12 | l << 6 |
|
|
399
|
+
var d = e[t++] & 63;
|
|
400
|
+
if ((o & 240) == 224 ? o = (o & 15) << 12 | l << 6 | d : ((o & 248) != 240 && fe("Invalid UTF-8 leading byte " + he(o) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), o = (o & 7) << 18 | l << 12 | d << 6 | e[t++] & 63), o < 65536)
|
|
401
401
|
s += String.fromCharCode(o);
|
|
402
402
|
else {
|
|
403
|
-
var
|
|
404
|
-
s += String.fromCharCode(55296 |
|
|
403
|
+
var f = o - 65536;
|
|
404
|
+
s += String.fromCharCode(55296 | f >> 10, 56320 | f & 1023);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
return s;
|
|
408
|
-
},
|
|
409
|
-
function
|
|
408
|
+
}, St = (e, t) => (p(typeof e == "number"), e ? hr(re, e, t) : "");
|
|
409
|
+
function Mn(e, t, r) {
|
|
410
410
|
return 0;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
|
|
412
|
+
function $n(e, t, r, n) {
|
|
413
|
+
J("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");
|
|
414
414
|
}
|
|
415
|
-
var
|
|
416
|
-
function
|
|
415
|
+
var at = {};
|
|
416
|
+
function Ft(e) {
|
|
417
417
|
for (; e.length; ) {
|
|
418
418
|
var t = e.pop(), r = e.pop();
|
|
419
419
|
r(t);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
function
|
|
423
|
-
return this.fromWireType(
|
|
422
|
+
function Ye(e) {
|
|
423
|
+
return this.fromWireType(y[e >> 2]);
|
|
424
424
|
}
|
|
425
|
-
var
|
|
426
|
-
function
|
|
425
|
+
var $e = {}, Ae = {}, ot = {}, On = 48, Rn = 57;
|
|
426
|
+
function Pt(e) {
|
|
427
427
|
if (e === void 0)
|
|
428
428
|
return "_unknown";
|
|
429
429
|
e = e.replace(/[^a-zA-Z0-9_]/g, "$");
|
|
430
430
|
var t = e.charCodeAt(0);
|
|
431
|
-
return t >=
|
|
431
|
+
return t >= On && t <= Rn ? `_${e}` : e;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
434
|
-
return e =
|
|
433
|
+
function At(e, t) {
|
|
434
|
+
return e = Pt(e), {
|
|
435
435
|
[e]: function() {
|
|
436
436
|
return t.apply(this, arguments);
|
|
437
437
|
}
|
|
438
438
|
}[e];
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
var r =
|
|
440
|
+
function It(e, t) {
|
|
441
|
+
var r = At(t, function(n) {
|
|
442
442
|
this.name = t, this.message = n;
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
` +
|
|
443
|
+
var a = new Error(n).stack;
|
|
444
|
+
a !== void 0 && (this.stack = this.toString() + `
|
|
445
|
+
` + a.replace(/^Error(:[^\n]*)?\n/, ""));
|
|
446
446
|
});
|
|
447
447
|
return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.prototype.toString = function() {
|
|
448
448
|
return this.message === void 0 ? this.name : `${this.name}: ${this.message}`;
|
|
449
449
|
}, r;
|
|
450
450
|
}
|
|
451
|
-
var
|
|
452
|
-
function
|
|
453
|
-
throw new
|
|
451
|
+
var mr = void 0;
|
|
452
|
+
function st(e) {
|
|
453
|
+
throw new mr(e);
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Oe(e, t, r) {
|
|
456
456
|
e.forEach(function(l) {
|
|
457
|
-
|
|
457
|
+
ot[l] = t;
|
|
458
458
|
});
|
|
459
459
|
function n(l) {
|
|
460
|
-
var
|
|
461
|
-
|
|
462
|
-
for (var
|
|
463
|
-
|
|
460
|
+
var d = r(l);
|
|
461
|
+
d.length !== e.length && st("Mismatched type converter count");
|
|
462
|
+
for (var f = 0; f < e.length; ++f)
|
|
463
|
+
me(e[f], d[f]);
|
|
464
464
|
}
|
|
465
|
-
var
|
|
466
|
-
t.forEach((l,
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
var a = new Array(t.length), s = [], o = 0;
|
|
466
|
+
t.forEach((l, d) => {
|
|
467
|
+
Ae.hasOwnProperty(l) ? a[d] = Ae[l] : (s.push(l), $e.hasOwnProperty(l) || ($e[l] = []), $e[l].push(() => {
|
|
468
|
+
a[d] = Ae[l], ++o, o === s.length && n(a);
|
|
469
469
|
}));
|
|
470
|
-
}), s.length === 0 && n(
|
|
470
|
+
}), s.length === 0 && n(a);
|
|
471
471
|
}
|
|
472
|
-
var
|
|
473
|
-
var t =
|
|
474
|
-
delete
|
|
475
|
-
var r = t.rawConstructor, n = t.rawDestructor,
|
|
476
|
-
|
|
472
|
+
var kn = function(e) {
|
|
473
|
+
var t = at[e];
|
|
474
|
+
delete at[e];
|
|
475
|
+
var r = t.rawConstructor, n = t.rawDestructor, a = t.fields, s = a.map((o) => o.getterReturnType).concat(a.map((o) => o.setterArgumentType));
|
|
476
|
+
Oe([e], s, (o) => {
|
|
477
477
|
var l = {};
|
|
478
|
-
return
|
|
479
|
-
var
|
|
480
|
-
l[
|
|
481
|
-
read: (
|
|
482
|
-
|
|
478
|
+
return a.forEach((d, f) => {
|
|
479
|
+
var m = d.fieldName, S = o[f], F = d.getter, R = d.getterContext, z = o[f + a.length], B = d.setter, Q = d.setterContext;
|
|
480
|
+
l[m] = {
|
|
481
|
+
read: (Z) => S.fromWireType(
|
|
482
|
+
F(R, Z)
|
|
483
483
|
),
|
|
484
|
-
write: (
|
|
485
|
-
var
|
|
486
|
-
|
|
484
|
+
write: (Z, v) => {
|
|
485
|
+
var w = [];
|
|
486
|
+
B(Q, Z, z.toWireType(w, v)), Ft(w);
|
|
487
487
|
}
|
|
488
488
|
};
|
|
489
489
|
}), [{
|
|
490
490
|
name: t.name,
|
|
491
|
-
fromWireType: function(
|
|
492
|
-
var
|
|
493
|
-
for (var
|
|
494
|
-
|
|
495
|
-
return n(
|
|
491
|
+
fromWireType: function(d) {
|
|
492
|
+
var f = {};
|
|
493
|
+
for (var m in l)
|
|
494
|
+
f[m] = l[m].read(d);
|
|
495
|
+
return n(d), f;
|
|
496
496
|
},
|
|
497
|
-
toWireType: function(
|
|
498
|
-
for (var
|
|
499
|
-
if (!(
|
|
500
|
-
throw new TypeError(`Missing field: "${
|
|
501
|
-
var
|
|
502
|
-
for (
|
|
503
|
-
l[
|
|
504
|
-
return
|
|
497
|
+
toWireType: function(d, f) {
|
|
498
|
+
for (var m in l)
|
|
499
|
+
if (!(m in f))
|
|
500
|
+
throw new TypeError(`Missing field: "${m}"`);
|
|
501
|
+
var S = r();
|
|
502
|
+
for (m in l)
|
|
503
|
+
l[m].write(S, f[m]);
|
|
504
|
+
return d !== null && d.push(n, S), S;
|
|
505
505
|
},
|
|
506
506
|
argPackAdvance: 8,
|
|
507
|
-
readValueFromPointer:
|
|
507
|
+
readValueFromPointer: Ye,
|
|
508
508
|
destructorFunction: n
|
|
509
509
|
}];
|
|
510
510
|
});
|
|
511
511
|
};
|
|
512
|
-
function
|
|
512
|
+
function xn(e, t, r, n, a) {
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function Dt(e) {
|
|
515
515
|
switch (e) {
|
|
516
516
|
case 1:
|
|
517
517
|
return 0;
|
|
@@ -525,54 +525,54 @@ var Ct = {}, ca = {
|
|
|
525
525
|
throw new TypeError(`Unknown type size: ${e}`);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Un() {
|
|
529
529
|
for (var e = new Array(256), t = 0; t < 256; ++t)
|
|
530
530
|
e[t] = String.fromCharCode(t);
|
|
531
|
-
|
|
531
|
+
pr = e;
|
|
532
532
|
}
|
|
533
|
-
var
|
|
534
|
-
function
|
|
535
|
-
for (var t = "", r = e;
|
|
536
|
-
t +=
|
|
533
|
+
var pr = void 0;
|
|
534
|
+
function X(e) {
|
|
535
|
+
for (var t = "", r = e; re[r]; )
|
|
536
|
+
t += pr[re[r++]];
|
|
537
537
|
return t;
|
|
538
538
|
}
|
|
539
|
-
var
|
|
540
|
-
function
|
|
541
|
-
throw new
|
|
539
|
+
var Re = void 0;
|
|
540
|
+
function L(e) {
|
|
541
|
+
throw new Re(e);
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function me(e, t, r = {}) {
|
|
544
544
|
if (!("argPackAdvance" in t))
|
|
545
545
|
throw new TypeError("registerType registeredInstance requires argPackAdvance");
|
|
546
546
|
var n = t.name;
|
|
547
|
-
if (e ||
|
|
547
|
+
if (e || L(`type "${n}" must have a positive integer typeid pointer`), Ae.hasOwnProperty(e)) {
|
|
548
548
|
if (r.ignoreDuplicateRegistrations)
|
|
549
549
|
return;
|
|
550
|
-
|
|
550
|
+
L(`Cannot register type '${n}' twice`);
|
|
551
551
|
}
|
|
552
|
-
if (
|
|
553
|
-
var
|
|
554
|
-
delete
|
|
552
|
+
if (Ae[e] = t, delete ot[e], $e.hasOwnProperty(e)) {
|
|
553
|
+
var a = $e[e];
|
|
554
|
+
delete $e[e], a.forEach((s) => s());
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function
|
|
558
|
-
var s =
|
|
559
|
-
t =
|
|
557
|
+
function Ln(e, t, r, n, a) {
|
|
558
|
+
var s = Dt(r);
|
|
559
|
+
t = X(t), me(e, {
|
|
560
560
|
name: t,
|
|
561
561
|
fromWireType: function(o) {
|
|
562
562
|
return !!o;
|
|
563
563
|
},
|
|
564
564
|
toWireType: function(o, l) {
|
|
565
|
-
return l ? n :
|
|
565
|
+
return l ? n : a;
|
|
566
566
|
},
|
|
567
567
|
argPackAdvance: 8,
|
|
568
568
|
readValueFromPointer: function(o) {
|
|
569
569
|
var l;
|
|
570
570
|
if (r === 1)
|
|
571
|
-
l =
|
|
571
|
+
l = le;
|
|
572
572
|
else if (r === 2)
|
|
573
|
-
l =
|
|
573
|
+
l = Fe;
|
|
574
574
|
else if (r === 4)
|
|
575
|
-
l =
|
|
575
|
+
l = y;
|
|
576
576
|
else
|
|
577
577
|
throw new TypeError("Unknown boolean type size: " + t);
|
|
578
578
|
return this.fromWireType(l[o >> s]);
|
|
@@ -580,16 +580,16 @@ var Ct = {}, ca = {
|
|
|
580
580
|
destructorFunction: null
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
|
-
function
|
|
584
|
-
if (!(this instanceof
|
|
583
|
+
function Nn(e) {
|
|
584
|
+
if (!(this instanceof Te) || !(e instanceof Te))
|
|
585
585
|
return !1;
|
|
586
|
-
for (var t = this.$$.ptrType.registeredClass, r = this.$$.ptr, n = e.$$.ptrType.registeredClass,
|
|
586
|
+
for (var t = this.$$.ptrType.registeredClass, r = this.$$.ptr, n = e.$$.ptrType.registeredClass, a = e.$$.ptr; t.baseClass; )
|
|
587
587
|
r = t.upcast(r), t = t.baseClass;
|
|
588
588
|
for (; n.baseClass; )
|
|
589
|
-
|
|
590
|
-
return t === n && r ===
|
|
589
|
+
a = n.upcast(a), n = n.baseClass;
|
|
590
|
+
return t === n && r === a;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function Wn(e) {
|
|
593
593
|
return {
|
|
594
594
|
count: e.count,
|
|
595
595
|
deleteScheduled: e.deleteScheduled,
|
|
@@ -600,190 +600,190 @@ var Ct = {}, ca = {
|
|
|
600
600
|
smartPtrType: e.smartPtrType
|
|
601
601
|
};
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function Mt(e) {
|
|
604
604
|
function t(r) {
|
|
605
605
|
return r.$$.ptrType.registeredClass.name;
|
|
606
606
|
}
|
|
607
|
-
|
|
607
|
+
L(t(e) + " instance already deleted");
|
|
608
608
|
}
|
|
609
|
-
var
|
|
610
|
-
function
|
|
609
|
+
var $t = !1;
|
|
610
|
+
function gr(e) {
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function Hn(e) {
|
|
613
613
|
e.smartPtr ? e.smartPtrType.rawDestructor(e.smartPtr) : e.ptrType.registeredClass.rawDestructor(e.ptr);
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function yr(e) {
|
|
616
616
|
e.count.value -= 1;
|
|
617
617
|
var t = e.count.value === 0;
|
|
618
|
-
t &&
|
|
618
|
+
t && Hn(e);
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function br(e, t, r) {
|
|
621
621
|
if (t === r)
|
|
622
622
|
return e;
|
|
623
623
|
if (r.baseClass === void 0)
|
|
624
624
|
return null;
|
|
625
|
-
var n =
|
|
625
|
+
var n = br(e, t, r.baseClass);
|
|
626
626
|
return n === null ? null : r.downcast(n);
|
|
627
627
|
}
|
|
628
|
-
var
|
|
629
|
-
function
|
|
630
|
-
return Object.keys(
|
|
628
|
+
var wr = {};
|
|
629
|
+
function Yn() {
|
|
630
|
+
return Object.keys(Ve).length;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function jn() {
|
|
633
633
|
var e = [];
|
|
634
|
-
for (var t in
|
|
635
|
-
|
|
634
|
+
for (var t in Ve)
|
|
635
|
+
Ve.hasOwnProperty(t) && e.push(Ve[t]);
|
|
636
636
|
return e;
|
|
637
637
|
}
|
|
638
|
-
var
|
|
639
|
-
function
|
|
640
|
-
for (;
|
|
641
|
-
var e =
|
|
638
|
+
var je = [];
|
|
639
|
+
function Ot() {
|
|
640
|
+
for (; je.length; ) {
|
|
641
|
+
var e = je.pop();
|
|
642
642
|
e.$$.deleteScheduled = !1, e.delete();
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
var
|
|
646
|
-
function
|
|
647
|
-
|
|
645
|
+
var ze = void 0;
|
|
646
|
+
function zn(e) {
|
|
647
|
+
ze = e, je.length && ze && ze(Ot);
|
|
648
648
|
}
|
|
649
|
-
function
|
|
650
|
-
|
|
649
|
+
function Vn() {
|
|
650
|
+
i.getInheritedInstanceCount = Yn, i.getLiveInheritedInstances = jn, i.flushPendingDeletes = Ot, i.setDelayFunction = zn;
|
|
651
651
|
}
|
|
652
|
-
var
|
|
653
|
-
function
|
|
654
|
-
for (t === void 0 &&
|
|
652
|
+
var Ve = {};
|
|
653
|
+
function Bn(e, t) {
|
|
654
|
+
for (t === void 0 && L("ptr should not be undefined"); e.baseClass; )
|
|
655
655
|
t = e.upcast(t), e = e.baseClass;
|
|
656
656
|
return t;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
return t =
|
|
658
|
+
function Gn(e, t) {
|
|
659
|
+
return t = Bn(e, t), Ve[t];
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
(!t.ptrType || !t.ptr) &&
|
|
661
|
+
function lt(e, t) {
|
|
662
|
+
(!t.ptrType || !t.ptr) && st("makeClassHandle requires ptr and ptrType");
|
|
663
663
|
var r = !!t.smartPtrType, n = !!t.smartPtr;
|
|
664
|
-
return r !== n &&
|
|
664
|
+
return r !== n && st("Both smartPtrType and smartPtr must be specified"), t.count = { value: 1 }, Be(Object.create(e, {
|
|
665
665
|
$$: {
|
|
666
666
|
value: t
|
|
667
667
|
}
|
|
668
668
|
}));
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function Tr(e) {
|
|
671
671
|
var t = this.getPointee(e);
|
|
672
672
|
if (!t)
|
|
673
673
|
return this.destructor(e), null;
|
|
674
|
-
var r =
|
|
674
|
+
var r = Gn(this.registeredClass, t);
|
|
675
675
|
if (r !== void 0) {
|
|
676
676
|
if (r.$$.count.value === 0)
|
|
677
677
|
return r.$$.ptr = t, r.$$.smartPtr = e, r.clone();
|
|
678
678
|
var n = r.clone();
|
|
679
679
|
return this.destructor(e), n;
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
return this.isSmartPointer ?
|
|
681
|
+
function a() {
|
|
682
|
+
return this.isSmartPointer ? lt(this.registeredClass.instancePrototype, {
|
|
683
683
|
ptrType: this.pointeeType,
|
|
684
684
|
ptr: t,
|
|
685
685
|
smartPtrType: this,
|
|
686
686
|
smartPtr: e
|
|
687
|
-
}) :
|
|
687
|
+
}) : lt(this.registeredClass.instancePrototype, {
|
|
688
688
|
ptrType: this,
|
|
689
689
|
ptr: e
|
|
690
690
|
});
|
|
691
691
|
}
|
|
692
|
-
var s = this.registeredClass.getActualType(t), o =
|
|
692
|
+
var s = this.registeredClass.getActualType(t), o = wr[s];
|
|
693
693
|
if (!o)
|
|
694
|
-
return
|
|
694
|
+
return a.call(this);
|
|
695
695
|
var l;
|
|
696
696
|
this.isConst ? l = o.constPointerType : l = o.pointerType;
|
|
697
|
-
var
|
|
697
|
+
var d = br(
|
|
698
698
|
t,
|
|
699
699
|
this.registeredClass,
|
|
700
700
|
l.registeredClass
|
|
701
701
|
);
|
|
702
|
-
return
|
|
702
|
+
return d === null ? a.call(this) : this.isSmartPointer ? lt(l.registeredClass.instancePrototype, {
|
|
703
703
|
ptrType: l,
|
|
704
|
-
ptr:
|
|
704
|
+
ptr: d,
|
|
705
705
|
smartPtrType: this,
|
|
706
706
|
smartPtr: e
|
|
707
|
-
}) :
|
|
707
|
+
}) : lt(l.registeredClass.instancePrototype, {
|
|
708
708
|
ptrType: l,
|
|
709
|
-
ptr:
|
|
709
|
+
ptr: d
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
|
-
var
|
|
713
|
-
return typeof FinalizationRegistry > "u" ? (
|
|
714
|
-
console.warn(t.leakWarning.stack.replace(/^Error: /, "")),
|
|
715
|
-
}),
|
|
712
|
+
var Be = function(e) {
|
|
713
|
+
return typeof FinalizationRegistry > "u" ? (Be = (t) => t, e) : ($t = new FinalizationRegistry((t) => {
|
|
714
|
+
console.warn(t.leakWarning.stack.replace(/^Error: /, "")), yr(t.$$);
|
|
715
|
+
}), Be = (t) => {
|
|
716
716
|
var r = t.$$, n = !!r.smartPtr;
|
|
717
717
|
if (n) {
|
|
718
|
-
var
|
|
719
|
-
|
|
718
|
+
var a = { $$: r }, s = r.ptrType.registeredClass;
|
|
719
|
+
a.leakWarning = new Error(`Embind found a leaked C++ instance ${s.name} <${he(r.ptr)}>.
|
|
720
720
|
We'll free it automatically in this case, but this functionality is not reliable across various environments.
|
|
721
721
|
Make sure to invoke .delete() manually once you're done with the instance instead.
|
|
722
|
-
Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
722
|
+
Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(a.leakWarning, Tr), $t.register(t, a, t);
|
|
723
723
|
}
|
|
724
724
|
return t;
|
|
725
|
-
},
|
|
725
|
+
}, gr = (t) => $t.unregister(t), Be(e));
|
|
726
726
|
};
|
|
727
|
-
function
|
|
728
|
-
if (this.$$.ptr ||
|
|
727
|
+
function Qn() {
|
|
728
|
+
if (this.$$.ptr || Mt(this), this.$$.preservePointerOnDelete)
|
|
729
729
|
return this.$$.count.value += 1, this;
|
|
730
|
-
var e =
|
|
730
|
+
var e = Be(Object.create(Object.getPrototypeOf(this), {
|
|
731
731
|
$$: {
|
|
732
|
-
value:
|
|
732
|
+
value: Wn(this.$$)
|
|
733
733
|
}
|
|
734
734
|
}));
|
|
735
735
|
return e.$$.count.value += 1, e.$$.deleteScheduled = !1, e;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
738
|
-
this.$$.ptr ||
|
|
737
|
+
function Jn() {
|
|
738
|
+
this.$$.ptr || Mt(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && L("Object already scheduled for deletion"), gr(this), yr(this.$$), this.$$.preservePointerOnDelete || (this.$$.smartPtr = void 0, this.$$.ptr = void 0);
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function qn() {
|
|
741
741
|
return !this.$$.ptr;
|
|
742
742
|
}
|
|
743
|
-
function
|
|
744
|
-
return this.$$.ptr ||
|
|
743
|
+
function Kn() {
|
|
744
|
+
return this.$$.ptr || Mt(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && L("Object already scheduled for deletion"), je.push(this), je.length === 1 && ze && ze(Ot), this.$$.deleteScheduled = !0, this;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
|
|
746
|
+
function Zn() {
|
|
747
|
+
Te.prototype.isAliasOf = Nn, Te.prototype.clone = Qn, Te.prototype.delete = Jn, Te.prototype.isDeleted = qn, Te.prototype.deleteLater = Kn;
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function Te() {
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function Cr(e, t, r) {
|
|
752
752
|
if (e[t].overloadTable === void 0) {
|
|
753
753
|
var n = e[t];
|
|
754
754
|
e[t] = function() {
|
|
755
|
-
return e[t].overloadTable.hasOwnProperty(arguments.length) ||
|
|
755
|
+
return e[t].overloadTable.hasOwnProperty(arguments.length) || L(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`), e[t].overloadTable[arguments.length].apply(this, arguments);
|
|
756
756
|
}, e[t].overloadTable = [], e[t].overloadTable[n.argCount] = n;
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
|
|
759
|
+
function Xn(e, t, r) {
|
|
760
|
+
i.hasOwnProperty(e) ? ((r === void 0 || i[e].overloadTable !== void 0 && i[e].overloadTable[r] !== void 0) && L(`Cannot register public name '${e}' twice`), Cr(i, e, e), i.hasOwnProperty(r) && L(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`), i[e].overloadTable[r] = t) : (i[e] = t, r !== void 0 && (i[e].numArguments = r));
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
this.name = e, this.constructor = t, this.instancePrototype = r, this.rawDestructor = n, this.baseClass =
|
|
762
|
+
function ei(e, t, r, n, a, s, o, l) {
|
|
763
|
+
this.name = e, this.constructor = t, this.instancePrototype = r, this.rawDestructor = n, this.baseClass = a, this.getActualType = s, this.upcast = o, this.downcast = l, this.pureVirtualFunctions = [];
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Rt(e, t, r) {
|
|
766
766
|
for (; t !== r; )
|
|
767
|
-
t.upcast ||
|
|
767
|
+
t.upcast || L(`Expected null or instance of ${r.name}, got an instance of ${t.name}`), e = t.upcast(e), t = t.baseClass;
|
|
768
768
|
return e;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function ti(e, t) {
|
|
771
771
|
if (t === null)
|
|
772
|
-
return this.isReference &&
|
|
773
|
-
t.$$ ||
|
|
774
|
-
var r = t.$$.ptrType.registeredClass, n =
|
|
772
|
+
return this.isReference && L(`null is not a valid ${this.name}`), 0;
|
|
773
|
+
t.$$ || L(`Cannot pass "${ke(t)}" as a ${this.name}`), t.$$.ptr || L(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
774
|
+
var r = t.$$.ptrType.registeredClass, n = Rt(t.$$.ptr, r, this.registeredClass);
|
|
775
775
|
return n;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function ri(e, t) {
|
|
778
778
|
var r;
|
|
779
779
|
if (t === null)
|
|
780
|
-
return this.isReference &&
|
|
781
|
-
t.$$ ||
|
|
780
|
+
return this.isReference && L(`null is not a valid ${this.name}`), this.isSmartPointer ? (r = this.rawConstructor(), e !== null && e.push(this.rawDestructor, r), r) : 0;
|
|
781
|
+
t.$$ || L(`Cannot pass "${ke(t)}" as a ${this.name}`), t.$$.ptr || L(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && t.$$.ptrType.isConst && L(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
|
|
782
782
|
var n = t.$$.ptrType.registeredClass;
|
|
783
|
-
if (r =
|
|
784
|
-
switch (t.$$.smartPtr === void 0 &&
|
|
783
|
+
if (r = Rt(t.$$.ptr, n, this.registeredClass), this.isSmartPointer)
|
|
784
|
+
switch (t.$$.smartPtr === void 0 && L("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
|
|
785
785
|
case 0:
|
|
786
|
-
t.$$.smartPtrType === this ? r = t.$$.smartPtr :
|
|
786
|
+
t.$$.smartPtrType === this ? r = t.$$.smartPtr : L(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
|
|
787
787
|
break;
|
|
788
788
|
case 1:
|
|
789
789
|
r = t.$$.smartPtr;
|
|
@@ -792,207 +792,207 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
792
792
|
if (t.$$.smartPtrType === this)
|
|
793
793
|
r = t.$$.smartPtr;
|
|
794
794
|
else {
|
|
795
|
-
var
|
|
795
|
+
var a = t.clone();
|
|
796
796
|
r = this.rawShare(
|
|
797
797
|
r,
|
|
798
|
-
|
|
799
|
-
|
|
798
|
+
ee.toHandle(function() {
|
|
799
|
+
a.delete();
|
|
800
800
|
})
|
|
801
801
|
), e !== null && e.push(this.rawDestructor, r);
|
|
802
802
|
}
|
|
803
803
|
break;
|
|
804
804
|
default:
|
|
805
|
-
|
|
805
|
+
L("Unsupporting sharing policy");
|
|
806
806
|
}
|
|
807
807
|
return r;
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function ni(e, t) {
|
|
810
810
|
if (t === null)
|
|
811
|
-
return this.isReference &&
|
|
812
|
-
t.$$ ||
|
|
813
|
-
var r = t.$$.ptrType.registeredClass, n =
|
|
811
|
+
return this.isReference && L(`null is not a valid ${this.name}`), 0;
|
|
812
|
+
t.$$ || L(`Cannot pass "${ke(t)}" as a ${this.name}`), t.$$.ptr || L(`Cannot pass deleted object as a pointer of type ${this.name}`), t.$$.ptrType.isConst && L(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);
|
|
813
|
+
var r = t.$$.ptrType.registeredClass, n = Rt(t.$$.ptr, r, this.registeredClass);
|
|
814
814
|
return n;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function ii(e) {
|
|
817
817
|
return this.rawGetPointee && (e = this.rawGetPointee(e)), e;
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function ai(e) {
|
|
820
820
|
this.rawDestructor && this.rawDestructor(e);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function oi(e) {
|
|
823
823
|
e !== null && e.delete();
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
|
|
825
|
+
function si() {
|
|
826
|
+
pe.prototype.getPointee = ii, pe.prototype.destructor = ai, pe.prototype.argPackAdvance = 8, pe.prototype.readValueFromPointer = Ye, pe.prototype.deleteObject = oi, pe.prototype.fromWireType = Tr;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
this.name = e, this.registeredClass = t, this.isReference = r, this.isConst = n, this.isSmartPointer =
|
|
828
|
+
function pe(e, t, r, n, a, s, o, l, d, f, m) {
|
|
829
|
+
this.name = e, this.registeredClass = t, this.isReference = r, this.isConst = n, this.isSmartPointer = a, this.pointeeType = s, this.sharingPolicy = o, this.rawGetPointee = l, this.rawConstructor = d, this.rawShare = f, this.rawDestructor = m, !a && t.baseClass === void 0 ? n ? (this.toWireType = ti, this.destructorFunction = null) : (this.toWireType = ni, this.destructorFunction = null) : this.toWireType = ri;
|
|
830
830
|
}
|
|
831
|
-
function
|
|
832
|
-
|
|
831
|
+
function li(e, t, r) {
|
|
832
|
+
i.hasOwnProperty(e) || st("Replacing nonexistant public symbol"), i[e].overloadTable !== void 0 && r !== void 0 ? i[e].overloadTable[r] = t : (i[e] = t, i[e].argCount = r);
|
|
833
833
|
}
|
|
834
|
-
var
|
|
835
|
-
|
|
836
|
-
var n =
|
|
834
|
+
var ui = (e, t, r) => {
|
|
835
|
+
p("dynCall_" + e in i, `bad function pointer type - dynCall function not found for sig '${e}'`), r && r.length ? p(r.length === e.substring(1).replace(/j/g, "--").length) : p(e.length == 1);
|
|
836
|
+
var n = i["dynCall_" + e];
|
|
837
837
|
return r && r.length ? n.apply(null, [t].concat(r)) : n.call(null, t);
|
|
838
|
-
},
|
|
838
|
+
}, ci = (e, t, r) => ui(e, t, r), fi = (e, t) => {
|
|
839
839
|
var r = [];
|
|
840
840
|
return function() {
|
|
841
|
-
return r.length = 0, Object.assign(r, arguments),
|
|
841
|
+
return r.length = 0, Object.assign(r, arguments), ci(e, t, r);
|
|
842
842
|
};
|
|
843
843
|
};
|
|
844
|
-
function
|
|
845
|
-
e =
|
|
844
|
+
function de(e, t) {
|
|
845
|
+
e = X(e);
|
|
846
846
|
function r() {
|
|
847
|
-
return
|
|
847
|
+
return fi(e, t);
|
|
848
848
|
}
|
|
849
849
|
var n = r();
|
|
850
|
-
return typeof n != "function" &&
|
|
850
|
+
return typeof n != "function" && L(`unknown function pointer with signature ${e}: ${t}`), n;
|
|
851
851
|
}
|
|
852
|
-
var
|
|
853
|
-
function
|
|
854
|
-
var t =
|
|
855
|
-
return
|
|
852
|
+
var Er = void 0;
|
|
853
|
+
function Sr(e) {
|
|
854
|
+
var t = Fa(e), r = X(t);
|
|
855
|
+
return ge(t), r;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function kt(e, t) {
|
|
858
858
|
var r = [], n = {};
|
|
859
|
-
function
|
|
860
|
-
if (!n[s] && !
|
|
861
|
-
if (
|
|
862
|
-
|
|
859
|
+
function a(s) {
|
|
860
|
+
if (!n[s] && !Ae[s]) {
|
|
861
|
+
if (ot[s]) {
|
|
862
|
+
ot[s].forEach(a);
|
|
863
863
|
return;
|
|
864
864
|
}
|
|
865
865
|
r.push(s), n[s] = !0;
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
throw t.forEach(
|
|
869
|
-
}
|
|
870
|
-
function
|
|
871
|
-
|
|
872
|
-
var
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
}),
|
|
868
|
+
throw t.forEach(a), new Er(`${e}: ` + r.map(Sr).join([", "]));
|
|
869
|
+
}
|
|
870
|
+
function di(e, t, r, n, a, s, o, l, d, f, m, S, F) {
|
|
871
|
+
m = X(m), s = de(a, s), l && (l = de(o, l)), f && (f = de(d, f)), F = de(S, F);
|
|
872
|
+
var R = Pt(m);
|
|
873
|
+
Xn(R, function() {
|
|
874
|
+
kt(`Cannot construct ${m} due to unbound types`, [n]);
|
|
875
|
+
}), Oe(
|
|
876
876
|
[e, t, r],
|
|
877
877
|
n ? [n] : [],
|
|
878
|
-
function(
|
|
879
|
-
|
|
880
|
-
var
|
|
881
|
-
n ? (
|
|
882
|
-
var
|
|
883
|
-
if (Object.getPrototypeOf(this) !==
|
|
884
|
-
throw new
|
|
885
|
-
if (
|
|
886
|
-
throw new
|
|
887
|
-
var
|
|
888
|
-
if (
|
|
889
|
-
throw new
|
|
890
|
-
return
|
|
891
|
-
}),
|
|
892
|
-
constructor: { value:
|
|
878
|
+
function(z) {
|
|
879
|
+
z = z[0];
|
|
880
|
+
var B, Q;
|
|
881
|
+
n ? (B = z.registeredClass, Q = B.instancePrototype) : Q = Te.prototype;
|
|
882
|
+
var Z = At(R, function() {
|
|
883
|
+
if (Object.getPrototypeOf(this) !== v)
|
|
884
|
+
throw new Re("Use 'new' to construct " + m);
|
|
885
|
+
if (w.constructor_body === void 0)
|
|
886
|
+
throw new Re(m + " has no accessible constructor");
|
|
887
|
+
var _t = w.constructor_body[arguments.length];
|
|
888
|
+
if (_t === void 0)
|
|
889
|
+
throw new Re(`Tried to invoke ctor of ${m} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(w.constructor_body).toString()}) parameters instead!`);
|
|
890
|
+
return _t.apply(this, arguments);
|
|
891
|
+
}), v = Object.create(Q, {
|
|
892
|
+
constructor: { value: Z }
|
|
893
893
|
});
|
|
894
|
-
|
|
895
|
-
var
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
894
|
+
Z.prototype = v;
|
|
895
|
+
var w = new ei(
|
|
896
|
+
m,
|
|
897
|
+
Z,
|
|
898
|
+
v,
|
|
899
|
+
F,
|
|
900
|
+
B,
|
|
901
901
|
s,
|
|
902
902
|
l,
|
|
903
|
-
|
|
903
|
+
f
|
|
904
904
|
);
|
|
905
|
-
|
|
906
|
-
var
|
|
907
|
-
|
|
908
|
-
|
|
905
|
+
w.baseClass && (w.baseClass.__derivedClasses === void 0 && (w.baseClass.__derivedClasses = []), w.baseClass.__derivedClasses.push(w));
|
|
906
|
+
var te = new pe(
|
|
907
|
+
m,
|
|
908
|
+
w,
|
|
909
909
|
!0,
|
|
910
910
|
!1,
|
|
911
911
|
!1
|
|
912
|
-
),
|
|
913
|
-
|
|
914
|
-
|
|
912
|
+
), K = new pe(
|
|
913
|
+
m + "*",
|
|
914
|
+
w,
|
|
915
915
|
!1,
|
|
916
916
|
!1,
|
|
917
917
|
!1
|
|
918
|
-
),
|
|
919
|
-
|
|
920
|
-
|
|
918
|
+
), Ie = new pe(
|
|
919
|
+
m + " const*",
|
|
920
|
+
w,
|
|
921
921
|
!1,
|
|
922
922
|
!0,
|
|
923
923
|
!1
|
|
924
924
|
);
|
|
925
|
-
return
|
|
926
|
-
pointerType:
|
|
927
|
-
constPointerType:
|
|
928
|
-
},
|
|
925
|
+
return wr[e] = {
|
|
926
|
+
pointerType: K,
|
|
927
|
+
constPointerType: Ie
|
|
928
|
+
}, li(R, Z), [te, K, Ie];
|
|
929
929
|
}
|
|
930
930
|
);
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function Fr(e, t) {
|
|
933
933
|
for (var r = [], n = 0; n < e; n++)
|
|
934
|
-
r.push(
|
|
934
|
+
r.push(x[t + n * 4 >> 2]);
|
|
935
935
|
return r;
|
|
936
936
|
}
|
|
937
|
-
function
|
|
937
|
+
function _i(e, t) {
|
|
938
938
|
if (!(e instanceof Function))
|
|
939
939
|
throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);
|
|
940
|
-
var r =
|
|
940
|
+
var r = At(e.name || "unknownFunctionName", function() {
|
|
941
941
|
});
|
|
942
942
|
r.prototype = e.prototype;
|
|
943
|
-
var n = new r(),
|
|
944
|
-
return
|
|
943
|
+
var n = new r(), a = e.apply(n, t);
|
|
944
|
+
return a instanceof Object ? a : n;
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function ut(e) {
|
|
947
947
|
try {
|
|
948
948
|
return e();
|
|
949
949
|
} catch (t) {
|
|
950
|
-
|
|
950
|
+
J(t);
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
|
-
var
|
|
954
|
-
if (e instanceof
|
|
955
|
-
return
|
|
956
|
-
|
|
957
|
-
},
|
|
958
|
-
|
|
959
|
-
},
|
|
960
|
-
if (
|
|
961
|
-
var r = `program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${
|
|
962
|
-
|
|
953
|
+
var xt = (e) => {
|
|
954
|
+
if (e instanceof _r || e == "unwind")
|
|
955
|
+
return Ue;
|
|
956
|
+
Le(), e instanceof WebAssembly.RuntimeError && Wr() <= 0 && T("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 52428800)"), E(1, e);
|
|
957
|
+
}, vi = (e) => {
|
|
958
|
+
Ue = e, Ct() || (i.onExit && i.onExit(e), _e = !0), E(e, new _r(e));
|
|
959
|
+
}, Pr = (e, t) => {
|
|
960
|
+
if (Ue = e, La(), Ct() && !t) {
|
|
961
|
+
var r = `program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${or}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;
|
|
962
|
+
D(r), T(r);
|
|
963
963
|
}
|
|
964
|
-
|
|
965
|
-
},
|
|
966
|
-
if (!
|
|
964
|
+
vi(e);
|
|
965
|
+
}, hi = Pr, mi = () => {
|
|
966
|
+
if (!Ct())
|
|
967
967
|
try {
|
|
968
|
-
|
|
968
|
+
hi(Ue);
|
|
969
969
|
} catch (e) {
|
|
970
|
-
|
|
970
|
+
xt(e);
|
|
971
971
|
}
|
|
972
|
-
},
|
|
973
|
-
if (
|
|
974
|
-
|
|
972
|
+
}, pi = (e) => {
|
|
973
|
+
if (_e) {
|
|
974
|
+
T("user callback triggered after runtime exited or application aborted. Ignoring.");
|
|
975
975
|
return;
|
|
976
976
|
}
|
|
977
977
|
try {
|
|
978
|
-
e(),
|
|
978
|
+
e(), mi();
|
|
979
979
|
} catch (t) {
|
|
980
|
-
|
|
980
|
+
xt(t);
|
|
981
981
|
}
|
|
982
|
-
},
|
|
982
|
+
}, g = { instrumentWasmImports: function(e) {
|
|
983
983
|
var t = [/^invoke_.*$/, /^fd_sync$/, /^__wasi_fd_sync$/, /^__asyncjs__.*$/, /^emscripten_promise_await$/, /^emscripten_idb_load$/, /^emscripten_idb_store$/, /^emscripten_idb_delete$/, /^emscripten_idb_exists$/, /^emscripten_idb_load_blob$/, /^emscripten_idb_store_blob$/, /^emscripten_sleep$/, /^emscripten_wget$/, /^emscripten_wget_data$/, /^emscripten_scan_registers$/, /^emscripten_lazy_load_code$/, /^_load_secondary_module$/, /^emscripten_fiber_swap$/, /^SDL_Delay$/, /^_emval_await$/];
|
|
984
984
|
for (var r in e)
|
|
985
985
|
(function(n) {
|
|
986
|
-
var
|
|
987
|
-
if (
|
|
988
|
-
var s =
|
|
986
|
+
var a = e[n];
|
|
987
|
+
if (a.sig, typeof a == "function") {
|
|
988
|
+
var s = a.isAsync || t.some((o) => !!n.match(o));
|
|
989
989
|
e[n] = function() {
|
|
990
|
-
var o =
|
|
990
|
+
var o = g.state;
|
|
991
991
|
try {
|
|
992
|
-
return
|
|
992
|
+
return a.apply(null, arguments);
|
|
993
993
|
} finally {
|
|
994
|
-
var l = o ===
|
|
995
|
-
if (
|
|
994
|
+
var l = o === g.State.Normal && g.state === g.State.Disabled, d = n.startsWith("invoke_") && !0;
|
|
995
|
+
if (g.state !== o && !s && !l && !d)
|
|
996
996
|
throw new Error(`import ${n} was not in ASYNCIFY_IMPORTS, but changed the state`);
|
|
997
997
|
}
|
|
998
998
|
};
|
|
@@ -1002,178 +1002,178 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
1002
1002
|
var t = {};
|
|
1003
1003
|
for (var r in e)
|
|
1004
1004
|
(function(n) {
|
|
1005
|
-
var
|
|
1006
|
-
typeof
|
|
1007
|
-
|
|
1005
|
+
var a = e[n];
|
|
1006
|
+
typeof a == "function" ? t[n] = function() {
|
|
1007
|
+
g.exportCallStack.push(n);
|
|
1008
1008
|
try {
|
|
1009
|
-
return
|
|
1009
|
+
return a.apply(null, arguments);
|
|
1010
1010
|
} finally {
|
|
1011
|
-
if (!
|
|
1012
|
-
var s =
|
|
1013
|
-
|
|
1011
|
+
if (!_e) {
|
|
1012
|
+
var s = g.exportCallStack.pop();
|
|
1013
|
+
p(s === n), g.maybeStopUnwind();
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
|
-
} : t[n] =
|
|
1016
|
+
} : t[n] = a;
|
|
1017
1017
|
})(r);
|
|
1018
1018
|
return t;
|
|
1019
1019
|
}, State: { Normal: 0, Unwinding: 1, Rewinding: 2, Disabled: 3 }, state: 0, StackSize: 4096, currData: null, handleSleepReturnValue: 0, exportCallStack: [], callStackNameToId: {}, callStackIdToName: {}, callStackId: 0, asyncPromiseHandlers: null, sleepCallbacks: [], getCallStackId: function(e) {
|
|
1020
|
-
var t =
|
|
1021
|
-
return t === void 0 && (t =
|
|
1020
|
+
var t = g.callStackNameToId[e];
|
|
1021
|
+
return t === void 0 && (t = g.callStackId++, g.callStackNameToId[e] = t, g.callStackIdToName[t] = e), t;
|
|
1022
1022
|
}, maybeStopUnwind: function() {
|
|
1023
|
-
|
|
1023
|
+
g.currData && g.state === g.State.Unwinding && g.exportCallStack.length === 0 && (g.state = g.State.Normal, ut(Ma), typeof Fibers < "u" && Fibers.trampoline());
|
|
1024
1024
|
}, whenDone: function() {
|
|
1025
|
-
return
|
|
1026
|
-
|
|
1025
|
+
return p(g.currData, "Tried to wait for an async operation when none is in progress."), p(!g.asyncPromiseHandlers, "Cannot have multiple async operations in flight at once"), new Promise((e, t) => {
|
|
1026
|
+
g.asyncPromiseHandlers = { resolve: e, reject: t };
|
|
1027
1027
|
});
|
|
1028
1028
|
}, allocateData: function() {
|
|
1029
|
-
var e =
|
|
1030
|
-
return
|
|
1029
|
+
var e = ft(12 + g.StackSize);
|
|
1030
|
+
return g.setDataHeader(e, e + 12, g.StackSize), g.setDataRewindFunc(e), e;
|
|
1031
1031
|
}, setDataHeader: function(e, t, r) {
|
|
1032
|
-
|
|
1032
|
+
y[e >> 2] = t, I(t), y[e + 4 >> 2] = t + r, I(t + r);
|
|
1033
1033
|
}, setDataRewindFunc: function(e) {
|
|
1034
|
-
var t =
|
|
1035
|
-
|
|
1034
|
+
var t = g.exportCallStack[0], r = g.getCallStackId(t);
|
|
1035
|
+
y[e + 8 >> 2] = r, I(r);
|
|
1036
1036
|
}, getDataRewindFunc: function(e) {
|
|
1037
|
-
var t =
|
|
1037
|
+
var t = y[e + 8 >> 2], r = g.callStackIdToName[t], n = i.asm[r];
|
|
1038
1038
|
return n;
|
|
1039
1039
|
}, doRewind: function(e) {
|
|
1040
|
-
var t =
|
|
1040
|
+
var t = g.getDataRewindFunc(e);
|
|
1041
1041
|
return t();
|
|
1042
1042
|
}, handleSleep: function(e) {
|
|
1043
|
-
if (
|
|
1044
|
-
if (
|
|
1043
|
+
if (p(g.state !== g.State.Disabled, "Asyncify cannot be done during or after the runtime exits"), !_e) {
|
|
1044
|
+
if (g.state === g.State.Normal) {
|
|
1045
1045
|
var t = !1, r = !1;
|
|
1046
1046
|
e((n = 0) => {
|
|
1047
|
-
if (
|
|
1048
|
-
|
|
1049
|
-
var
|
|
1047
|
+
if (p(!n || typeof n == "number" || typeof n == "boolean"), !_e && (g.handleSleepReturnValue = n, t = !0, !!r)) {
|
|
1048
|
+
p(!g.exportCallStack.length, "Waking up (starting to rewind) must be done from JS, without compiled code on the stack."), g.state = g.State.Rewinding, ut(() => $a(g.currData)), typeof Browser < "u" && Browser.mainLoop.func && Browser.mainLoop.resume();
|
|
1049
|
+
var a, s = !1;
|
|
1050
1050
|
try {
|
|
1051
|
-
|
|
1052
|
-
} catch (
|
|
1053
|
-
|
|
1051
|
+
a = g.doRewind(g.currData);
|
|
1052
|
+
} catch (d) {
|
|
1053
|
+
a = d, s = !0;
|
|
1054
1054
|
}
|
|
1055
1055
|
var o = !1;
|
|
1056
|
-
if (!
|
|
1057
|
-
var l =
|
|
1058
|
-
l && (
|
|
1056
|
+
if (!g.currData) {
|
|
1057
|
+
var l = g.asyncPromiseHandlers;
|
|
1058
|
+
l && (g.asyncPromiseHandlers = null, (s ? l.reject : l.resolve)(a), o = !0);
|
|
1059
1059
|
}
|
|
1060
1060
|
if (s && !o)
|
|
1061
|
-
throw
|
|
1061
|
+
throw a;
|
|
1062
1062
|
}
|
|
1063
|
-
}), r = !0, t || (
|
|
1063
|
+
}), r = !0, t || (g.state = g.State.Unwinding, g.currData = g.allocateData(), typeof Browser < "u" && Browser.mainLoop.func && Browser.mainLoop.pause(), ut(() => Da(g.currData)));
|
|
1064
1064
|
} else
|
|
1065
|
-
|
|
1066
|
-
return
|
|
1065
|
+
g.state === g.State.Rewinding ? (g.state = g.State.Normal, ut(Oa), ge(g.currData), g.currData = null, g.sleepCallbacks.forEach((n) => pi(n))) : J(`invalid state: ${g.state}`);
|
|
1066
|
+
return g.handleSleepReturnValue;
|
|
1067
1067
|
}
|
|
1068
1068
|
}, handleAsync: function(e) {
|
|
1069
|
-
return
|
|
1069
|
+
return g.handleSleep((t) => {
|
|
1070
1070
|
e().then(t);
|
|
1071
1071
|
});
|
|
1072
1072
|
} };
|
|
1073
|
-
function
|
|
1073
|
+
function Ar(e, t, r, n, a, s) {
|
|
1074
1074
|
var o = t.length;
|
|
1075
|
-
o < 2 &&
|
|
1076
|
-
for (var l = t[1] !== null && r !== null,
|
|
1077
|
-
if (t[
|
|
1078
|
-
|
|
1075
|
+
o < 2 && L("argTypes array size mismatch! Must at least get return value and 'this' types!"), p(!s, "Async bindings are only supported with JSPI.");
|
|
1076
|
+
for (var l = t[1] !== null && r !== null, d = !1, f = 1; f < t.length; ++f)
|
|
1077
|
+
if (t[f] !== null && t[f].destructorFunction === void 0) {
|
|
1078
|
+
d = !0;
|
|
1079
1079
|
break;
|
|
1080
1080
|
}
|
|
1081
|
-
var
|
|
1082
|
-
s && (n =
|
|
1083
|
-
for (var
|
|
1084
|
-
|
|
1085
|
-
var
|
|
1086
|
-
return function ${
|
|
1081
|
+
var m = t[0].name !== "void";
|
|
1082
|
+
s && (n = g.makeAsyncFunction(n));
|
|
1083
|
+
for (var S = "", F = "", f = 0; f < o - 2; ++f)
|
|
1084
|
+
S += (f !== 0 ? ", " : "") + "arg" + f, F += (f !== 0 ? ", " : "") + "arg" + f + "Wired";
|
|
1085
|
+
var R = `
|
|
1086
|
+
return function ${Pt(e)}(${S}) {
|
|
1087
1087
|
if (arguments.length !== ${o - 2}) {
|
|
1088
1088
|
throwBindingError('function ${e} called with ${arguments.length} arguments, expected ${o - 2} args!');
|
|
1089
1089
|
}`;
|
|
1090
|
-
|
|
1090
|
+
d && (R += `var destructors = [];
|
|
1091
1091
|
`);
|
|
1092
|
-
var
|
|
1093
|
-
l && (
|
|
1092
|
+
var z = d ? "destructors" : "null", B = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"], Q = [L, n, a, Ft, t[0], t[1]];
|
|
1093
|
+
l && (R += "var thisWired = classParam.toWireType(" + z + `, this);
|
|
1094
1094
|
`);
|
|
1095
|
-
for (var
|
|
1096
|
-
|
|
1097
|
-
`,
|
|
1098
|
-
if (l && (
|
|
1099
|
-
`,
|
|
1100
|
-
`,
|
|
1101
|
-
|
|
1095
|
+
for (var f = 0; f < o - 2; ++f)
|
|
1096
|
+
R += "var arg" + f + "Wired = argType" + f + ".toWireType(" + z + ", arg" + f + "); // " + t[f + 2].name + `
|
|
1097
|
+
`, B.push("argType" + f), Q.push(t[f + 2]);
|
|
1098
|
+
if (l && (F = "thisWired" + (F.length > 0 ? ", " : "") + F), R += (m || s ? "var rv = " : "") + "invoker(fn" + (F.length > 0 ? ", " : "") + F + `);
|
|
1099
|
+
`, B.push("Asyncify"), Q.push(g), R += "function onDone(" + (m ? "rv" : "") + `) {
|
|
1100
|
+
`, d)
|
|
1101
|
+
R += `runDestructors(destructors);
|
|
1102
1102
|
`;
|
|
1103
1103
|
else
|
|
1104
|
-
for (var
|
|
1105
|
-
var
|
|
1106
|
-
t[
|
|
1107
|
-
`,
|
|
1104
|
+
for (var f = l ? 1 : 2; f < t.length; ++f) {
|
|
1105
|
+
var Z = f === 1 ? "thisWired" : "arg" + (f - 2) + "Wired";
|
|
1106
|
+
t[f].destructorFunction !== null && (R += Z + "_dtor(" + Z + "); // " + t[f].name + `
|
|
1107
|
+
`, B.push(Z + "_dtor"), Q.push(t[f].destructorFunction));
|
|
1108
1108
|
}
|
|
1109
|
-
return
|
|
1109
|
+
return m && (R += `var ret = retType.fromWireType(rv);
|
|
1110
1110
|
return ret;
|
|
1111
|
-
`),
|
|
1112
|
-
`,
|
|
1113
|
-
`,
|
|
1114
|
-
`,
|
|
1115
|
-
}
|
|
1116
|
-
function
|
|
1117
|
-
|
|
1118
|
-
var o =
|
|
1119
|
-
|
|
1111
|
+
`), R += `}
|
|
1112
|
+
`, R += "return Asyncify.currData ? Asyncify.whenDone().then(onDone) : onDone(" + (m ? "rv" : "") + `);
|
|
1113
|
+
`, R += `}
|
|
1114
|
+
`, B.push(R), _i(Function, B).apply(null, Q);
|
|
1115
|
+
}
|
|
1116
|
+
function gi(e, t, r, n, a, s) {
|
|
1117
|
+
p(t > 0);
|
|
1118
|
+
var o = Fr(t, r);
|
|
1119
|
+
a = de(n, a), Oe([], [e], function(l) {
|
|
1120
1120
|
l = l[0];
|
|
1121
|
-
var
|
|
1121
|
+
var d = `constructor ${l.name}`;
|
|
1122
1122
|
if (l.registeredClass.constructor_body === void 0 && (l.registeredClass.constructor_body = []), l.registeredClass.constructor_body[t - 1] !== void 0)
|
|
1123
|
-
throw new
|
|
1123
|
+
throw new Re(`Cannot register multiple constructors with identical number of parameters (${t - 1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
1124
1124
|
return l.registeredClass.constructor_body[t - 1] = () => {
|
|
1125
|
-
|
|
1126
|
-
},
|
|
1127
|
-
return
|
|
1125
|
+
kt(`Cannot construct ${l.name} due to unbound types`, o);
|
|
1126
|
+
}, Oe([], o, function(f) {
|
|
1127
|
+
return f.splice(1, 0, null), l.registeredClass.constructor_body[t - 1] = Ar(d, f, null, a, s), [];
|
|
1128
1128
|
}), [];
|
|
1129
1129
|
});
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1132
|
-
var
|
|
1133
|
-
t =
|
|
1134
|
-
|
|
1135
|
-
var
|
|
1136
|
-
t.startsWith("@@") && (t = Symbol[t.substring(2)]), l &&
|
|
1137
|
-
function
|
|
1138
|
-
|
|
1131
|
+
function yi(e, t, r, n, a, s, o, l, d) {
|
|
1132
|
+
var f = Fr(r, n);
|
|
1133
|
+
t = X(t), s = de(a, s), Oe([], [e], function(m) {
|
|
1134
|
+
m = m[0];
|
|
1135
|
+
var S = `${m.name}.${t}`;
|
|
1136
|
+
t.startsWith("@@") && (t = Symbol[t.substring(2)]), l && m.registeredClass.pureVirtualFunctions.push(t);
|
|
1137
|
+
function F() {
|
|
1138
|
+
kt(`Cannot call ${S} due to unbound types`, f);
|
|
1139
1139
|
}
|
|
1140
|
-
var
|
|
1141
|
-
return
|
|
1142
|
-
var
|
|
1143
|
-
return
|
|
1140
|
+
var R = m.registeredClass.instancePrototype, z = R[t];
|
|
1141
|
+
return z === void 0 || z.overloadTable === void 0 && z.className !== m.name && z.argCount === r - 2 ? (F.argCount = r - 2, F.className = m.name, R[t] = F) : (Cr(R, t, S), R[t].overloadTable[r - 2] = F), Oe([], f, function(B) {
|
|
1142
|
+
var Q = Ar(S, B, m, s, o, d);
|
|
1143
|
+
return R[t].overloadTable === void 0 ? (Q.argCount = r - 2, R[t] = Q) : R[t].overloadTable[r - 2] = Q, [];
|
|
1144
1144
|
}), [];
|
|
1145
1145
|
});
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function bi() {
|
|
1148
1148
|
this.allocated = [void 0], this.freelist = [], this.get = function(e) {
|
|
1149
|
-
return
|
|
1149
|
+
return p(this.allocated[e] !== void 0, `invalid handle: ${e}`), this.allocated[e];
|
|
1150
1150
|
}, this.has = function(e) {
|
|
1151
1151
|
return this.allocated[e] !== void 0;
|
|
1152
1152
|
}, this.allocate = function(e) {
|
|
1153
1153
|
var t = this.freelist.pop() || this.allocated.length;
|
|
1154
1154
|
return this.allocated[t] = e, t;
|
|
1155
1155
|
}, this.free = function(e) {
|
|
1156
|
-
|
|
1156
|
+
p(this.allocated[e] !== void 0), this.allocated[e] = void 0, this.freelist.push(e);
|
|
1157
1157
|
};
|
|
1158
1158
|
}
|
|
1159
|
-
var
|
|
1160
|
-
function
|
|
1161
|
-
e >=
|
|
1159
|
+
var oe = new bi();
|
|
1160
|
+
function Ut(e) {
|
|
1161
|
+
e >= oe.reserved && --oe.get(e).refcount === 0 && oe.free(e);
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1164
|
-
for (var e = 0, t =
|
|
1165
|
-
|
|
1163
|
+
function wi() {
|
|
1164
|
+
for (var e = 0, t = oe.reserved; t < oe.allocated.length; ++t)
|
|
1165
|
+
oe.allocated[t] !== void 0 && ++e;
|
|
1166
1166
|
return e;
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1169
|
-
|
|
1168
|
+
function Ti() {
|
|
1169
|
+
oe.allocated.push(
|
|
1170
1170
|
{ value: void 0 },
|
|
1171
1171
|
{ value: null },
|
|
1172
1172
|
{ value: !0 },
|
|
1173
1173
|
{ value: !1 }
|
|
1174
|
-
),
|
|
1174
|
+
), oe.reserved = oe.allocated.length, i.count_emval_handles = wi;
|
|
1175
1175
|
}
|
|
1176
|
-
var
|
|
1176
|
+
var ee = { toValue: (e) => (e || L("Cannot use deleted val. handle = " + e), oe.get(e).value), toHandle: (e) => {
|
|
1177
1177
|
switch (e) {
|
|
1178
1178
|
case void 0:
|
|
1179
1179
|
return 1;
|
|
@@ -1184,112 +1184,112 @@ return ret;
|
|
|
1184
1184
|
case !1:
|
|
1185
1185
|
return 4;
|
|
1186
1186
|
default:
|
|
1187
|
-
return
|
|
1187
|
+
return oe.allocate({ refcount: 1, value: e });
|
|
1188
1188
|
}
|
|
1189
1189
|
} };
|
|
1190
|
-
function
|
|
1191
|
-
t =
|
|
1190
|
+
function Ci(e, t) {
|
|
1191
|
+
t = X(t), me(e, {
|
|
1192
1192
|
name: t,
|
|
1193
1193
|
fromWireType: function(r) {
|
|
1194
|
-
var n =
|
|
1195
|
-
return
|
|
1194
|
+
var n = ee.toValue(r);
|
|
1195
|
+
return Ut(r), n;
|
|
1196
1196
|
},
|
|
1197
1197
|
toWireType: function(r, n) {
|
|
1198
|
-
return
|
|
1198
|
+
return ee.toHandle(n);
|
|
1199
1199
|
},
|
|
1200
1200
|
argPackAdvance: 8,
|
|
1201
|
-
readValueFromPointer:
|
|
1201
|
+
readValueFromPointer: Ye,
|
|
1202
1202
|
destructorFunction: null
|
|
1203
1203
|
});
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function ke(e) {
|
|
1206
1206
|
if (e === null)
|
|
1207
1207
|
return "null";
|
|
1208
1208
|
var t = typeof e;
|
|
1209
1209
|
return t === "object" || t === "array" || t === "function" ? e.toString() : "" + e;
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function Ei(e, t) {
|
|
1212
1212
|
switch (t) {
|
|
1213
1213
|
case 2:
|
|
1214
1214
|
return function(r) {
|
|
1215
|
-
return this.fromWireType(
|
|
1215
|
+
return this.fromWireType(er[r >> 2]);
|
|
1216
1216
|
};
|
|
1217
1217
|
case 3:
|
|
1218
1218
|
return function(r) {
|
|
1219
|
-
return this.fromWireType(
|
|
1219
|
+
return this.fromWireType(tr[r >> 3]);
|
|
1220
1220
|
};
|
|
1221
1221
|
default:
|
|
1222
1222
|
throw new TypeError("Unknown float type: " + e);
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1226
|
-
var n =
|
|
1227
|
-
t =
|
|
1225
|
+
function Si(e, t, r) {
|
|
1226
|
+
var n = Dt(r);
|
|
1227
|
+
t = X(t), me(e, {
|
|
1228
1228
|
name: t,
|
|
1229
|
-
fromWireType: function(
|
|
1230
|
-
return
|
|
1229
|
+
fromWireType: function(a) {
|
|
1230
|
+
return a;
|
|
1231
1231
|
},
|
|
1232
|
-
toWireType: function(
|
|
1232
|
+
toWireType: function(a, s) {
|
|
1233
1233
|
if (typeof s != "number" && typeof s != "boolean")
|
|
1234
|
-
throw new TypeError(`Cannot convert ${
|
|
1234
|
+
throw new TypeError(`Cannot convert ${ke(s)} to ${this.name}`);
|
|
1235
1235
|
return s;
|
|
1236
1236
|
},
|
|
1237
1237
|
argPackAdvance: 8,
|
|
1238
|
-
readValueFromPointer:
|
|
1238
|
+
readValueFromPointer: Ei(t, n),
|
|
1239
1239
|
destructorFunction: null
|
|
1240
1240
|
});
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function Fi(e, t, r) {
|
|
1243
1243
|
switch (t) {
|
|
1244
1244
|
case 0:
|
|
1245
|
-
return r ? function(
|
|
1246
|
-
return
|
|
1247
|
-
} : function(
|
|
1248
|
-
return
|
|
1245
|
+
return r ? function(a) {
|
|
1246
|
+
return le[a];
|
|
1247
|
+
} : function(a) {
|
|
1248
|
+
return re[a];
|
|
1249
1249
|
};
|
|
1250
1250
|
case 1:
|
|
1251
|
-
return r ? function(
|
|
1252
|
-
return
|
|
1253
|
-
} : function(
|
|
1254
|
-
return
|
|
1251
|
+
return r ? function(a) {
|
|
1252
|
+
return Fe[a >> 1];
|
|
1253
|
+
} : function(a) {
|
|
1254
|
+
return rt[a >> 1];
|
|
1255
1255
|
};
|
|
1256
1256
|
case 2:
|
|
1257
|
-
return r ? function(
|
|
1258
|
-
return
|
|
1259
|
-
} : function(
|
|
1260
|
-
return
|
|
1257
|
+
return r ? function(a) {
|
|
1258
|
+
return y[a >> 2];
|
|
1259
|
+
} : function(a) {
|
|
1260
|
+
return x[a >> 2];
|
|
1261
1261
|
};
|
|
1262
1262
|
default:
|
|
1263
1263
|
throw new TypeError("Unknown integer type: " + e);
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1267
|
-
t =
|
|
1268
|
-
var s =
|
|
1266
|
+
function Pi(e, t, r, n, a) {
|
|
1267
|
+
t = X(t), a === -1 && (a = 4294967295);
|
|
1268
|
+
var s = Dt(r), o = (S) => S;
|
|
1269
1269
|
if (n === 0) {
|
|
1270
1270
|
var l = 32 - 8 * r;
|
|
1271
|
-
o = (
|
|
1271
|
+
o = (S) => S << l >>> l;
|
|
1272
1272
|
}
|
|
1273
|
-
var
|
|
1274
|
-
if (typeof
|
|
1275
|
-
throw new TypeError(`Cannot convert "${
|
|
1276
|
-
if (
|
|
1277
|
-
throw new TypeError(`Passing a number "${
|
|
1278
|
-
},
|
|
1279
|
-
|
|
1280
|
-
return
|
|
1281
|
-
} :
|
|
1282
|
-
return
|
|
1283
|
-
},
|
|
1273
|
+
var d = t.includes("unsigned"), f = (S, F) => {
|
|
1274
|
+
if (typeof S != "number" && typeof S != "boolean")
|
|
1275
|
+
throw new TypeError(`Cannot convert "${ke(S)}" to ${F}`);
|
|
1276
|
+
if (S < n || S > a)
|
|
1277
|
+
throw new TypeError(`Passing a number "${ke(S)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${a}]!`);
|
|
1278
|
+
}, m;
|
|
1279
|
+
d ? m = function(S, F) {
|
|
1280
|
+
return f(F, this.name), F >>> 0;
|
|
1281
|
+
} : m = function(S, F) {
|
|
1282
|
+
return f(F, this.name), F;
|
|
1283
|
+
}, me(e, {
|
|
1284
1284
|
name: t,
|
|
1285
1285
|
fromWireType: o,
|
|
1286
|
-
toWireType:
|
|
1286
|
+
toWireType: m,
|
|
1287
1287
|
argPackAdvance: 8,
|
|
1288
|
-
readValueFromPointer:
|
|
1288
|
+
readValueFromPointer: Fi(t, s, n !== 0),
|
|
1289
1289
|
destructorFunction: null
|
|
1290
1290
|
});
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1292
|
+
function Ai(e, t, r) {
|
|
1293
1293
|
var n = [
|
|
1294
1294
|
Int8Array,
|
|
1295
1295
|
Uint8Array,
|
|
@@ -1299,13 +1299,13 @@ return ret;
|
|
|
1299
1299
|
Uint32Array,
|
|
1300
1300
|
Float32Array,
|
|
1301
1301
|
Float64Array
|
|
1302
|
-
],
|
|
1302
|
+
], a = n[t];
|
|
1303
1303
|
function s(o) {
|
|
1304
1304
|
o = o >> 2;
|
|
1305
|
-
var l =
|
|
1306
|
-
return new
|
|
1305
|
+
var l = x, d = l[o], f = l[o + 1];
|
|
1306
|
+
return new a(l.buffer, f, d);
|
|
1307
1307
|
}
|
|
1308
|
-
r =
|
|
1308
|
+
r = X(r), me(e, {
|
|
1309
1309
|
name: r,
|
|
1310
1310
|
fromWireType: s,
|
|
1311
1311
|
argPackAdvance: 8,
|
|
@@ -1314,14 +1314,14 @@ return ret;
|
|
|
1314
1314
|
ignoreDuplicateRegistrations: !0
|
|
1315
1315
|
});
|
|
1316
1316
|
}
|
|
1317
|
-
var
|
|
1318
|
-
if (
|
|
1317
|
+
var Ir = (e, t, r, n) => {
|
|
1318
|
+
if (p(typeof e == "string"), !(n > 0))
|
|
1319
1319
|
return 0;
|
|
1320
|
-
for (var
|
|
1320
|
+
for (var a = r, s = r + n - 1, o = 0; o < e.length; ++o) {
|
|
1321
1321
|
var l = e.charCodeAt(o);
|
|
1322
1322
|
if (l >= 55296 && l <= 57343) {
|
|
1323
|
-
var
|
|
1324
|
-
l = 65536 + ((l & 1023) << 10) |
|
|
1323
|
+
var d = e.charCodeAt(++o);
|
|
1324
|
+
l = 65536 + ((l & 1023) << 10) | d & 1023;
|
|
1325
1325
|
}
|
|
1326
1326
|
if (l <= 127) {
|
|
1327
1327
|
if (r >= s)
|
|
@@ -1338,165 +1338,165 @@ return ret;
|
|
|
1338
1338
|
} else {
|
|
1339
1339
|
if (r + 3 >= s)
|
|
1340
1340
|
break;
|
|
1341
|
-
l > 1114111 &&
|
|
1341
|
+
l > 1114111 && fe("Invalid Unicode code point " + he(l) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."), t[r++] = 240 | l >> 18, t[r++] = 128 | l >> 12 & 63, t[r++] = 128 | l >> 6 & 63, t[r++] = 128 | l & 63;
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
|
-
return t[r] = 0, r -
|
|
1345
|
-
},
|
|
1344
|
+
return t[r] = 0, r - a;
|
|
1345
|
+
}, Dr = (e, t, r) => (p(typeof r == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), Ir(e, re, t, r)), Lt = (e) => {
|
|
1346
1346
|
for (var t = 0, r = 0; r < e.length; ++r) {
|
|
1347
1347
|
var n = e.charCodeAt(r);
|
|
1348
1348
|
n <= 127 ? t++ : n <= 2047 ? t += 2 : n >= 55296 && n <= 57343 ? (t += 4, ++r) : t += 3;
|
|
1349
1349
|
}
|
|
1350
1350
|
return t;
|
|
1351
1351
|
};
|
|
1352
|
-
function
|
|
1353
|
-
t =
|
|
1352
|
+
function Ii(e, t) {
|
|
1353
|
+
t = X(t);
|
|
1354
1354
|
var r = t === "std::string";
|
|
1355
|
-
|
|
1355
|
+
me(e, {
|
|
1356
1356
|
name: t,
|
|
1357
1357
|
fromWireType: function(n) {
|
|
1358
|
-
var
|
|
1358
|
+
var a = x[n >> 2], s = n + 4, o;
|
|
1359
1359
|
if (r)
|
|
1360
|
-
for (var l = s,
|
|
1361
|
-
var
|
|
1362
|
-
if (
|
|
1363
|
-
var
|
|
1364
|
-
o === void 0 ? o =
|
|
1360
|
+
for (var l = s, d = 0; d <= a; ++d) {
|
|
1361
|
+
var f = s + d;
|
|
1362
|
+
if (d == a || re[f] == 0) {
|
|
1363
|
+
var m = f - l, S = St(l, m);
|
|
1364
|
+
o === void 0 ? o = S : (o += String.fromCharCode(0), o += S), l = f + 1;
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
1367
|
else {
|
|
1368
|
-
for (var
|
|
1369
|
-
|
|
1370
|
-
o =
|
|
1368
|
+
for (var F = new Array(a), d = 0; d < a; ++d)
|
|
1369
|
+
F[d] = String.fromCharCode(re[s + d]);
|
|
1370
|
+
o = F.join("");
|
|
1371
1371
|
}
|
|
1372
|
-
return
|
|
1372
|
+
return ge(n), o;
|
|
1373
1373
|
},
|
|
1374
|
-
toWireType: function(n,
|
|
1375
|
-
|
|
1376
|
-
var s, o = typeof
|
|
1377
|
-
o ||
|
|
1378
|
-
var l =
|
|
1379
|
-
if (
|
|
1380
|
-
|
|
1374
|
+
toWireType: function(n, a) {
|
|
1375
|
+
a instanceof ArrayBuffer && (a = new Uint8Array(a));
|
|
1376
|
+
var s, o = typeof a == "string";
|
|
1377
|
+
o || a instanceof Uint8Array || a instanceof Uint8ClampedArray || a instanceof Int8Array || L("Cannot pass non-string to std::string"), r && o ? s = Lt(a) : s = a.length;
|
|
1378
|
+
var l = ft(4 + s + 1), d = l + 4;
|
|
1379
|
+
if (x[l >> 2] = s, I(s), r && o)
|
|
1380
|
+
Dr(a, d, s + 1);
|
|
1381
1381
|
else if (o)
|
|
1382
|
-
for (var
|
|
1383
|
-
var
|
|
1384
|
-
|
|
1382
|
+
for (var f = 0; f < s; ++f) {
|
|
1383
|
+
var m = a.charCodeAt(f);
|
|
1384
|
+
m > 255 && (ge(d), L("String has UTF-16 code units that do not fit in 8 bits")), re[d + f] = m;
|
|
1385
1385
|
}
|
|
1386
1386
|
else
|
|
1387
|
-
for (var
|
|
1388
|
-
|
|
1389
|
-
return n !== null && n.push(
|
|
1387
|
+
for (var f = 0; f < s; ++f)
|
|
1388
|
+
re[d + f] = a[f];
|
|
1389
|
+
return n !== null && n.push(ge, l), l;
|
|
1390
1390
|
},
|
|
1391
1391
|
argPackAdvance: 8,
|
|
1392
|
-
readValueFromPointer:
|
|
1392
|
+
readValueFromPointer: Ye,
|
|
1393
1393
|
destructorFunction: function(n) {
|
|
1394
|
-
|
|
1394
|
+
ge(n);
|
|
1395
1395
|
}
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
|
-
var
|
|
1399
|
-
|
|
1400
|
-
for (var r = e, n = r >> 1,
|
|
1398
|
+
var Mr = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Di = (e, t) => {
|
|
1399
|
+
p(e % 2 == 0, "Pointer passed to UTF16ToString must be aligned to two bytes!");
|
|
1400
|
+
for (var r = e, n = r >> 1, a = n + t / 2; !(n >= a) && rt[n]; )
|
|
1401
1401
|
++n;
|
|
1402
|
-
if (r = n << 1, r - e > 32 &&
|
|
1403
|
-
return
|
|
1402
|
+
if (r = n << 1, r - e > 32 && Mr)
|
|
1403
|
+
return Mr.decode(re.subarray(e, r));
|
|
1404
1404
|
for (var s = "", o = 0; !(o >= t / 2); ++o) {
|
|
1405
|
-
var l =
|
|
1405
|
+
var l = Fe[e + o * 2 >> 1];
|
|
1406
1406
|
if (l == 0)
|
|
1407
1407
|
break;
|
|
1408
1408
|
s += String.fromCharCode(l);
|
|
1409
1409
|
}
|
|
1410
1410
|
return s;
|
|
1411
|
-
},
|
|
1412
|
-
if (
|
|
1411
|
+
}, Mi = (e, t, r) => {
|
|
1412
|
+
if (p(t % 2 == 0, "Pointer passed to stringToUTF16 must be aligned to two bytes!"), p(typeof r == "number", "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r === void 0 && (r = 2147483647), r < 2)
|
|
1413
1413
|
return 0;
|
|
1414
1414
|
r -= 2;
|
|
1415
|
-
for (var n = t,
|
|
1415
|
+
for (var n = t, a = r < e.length * 2 ? r / 2 : e.length, s = 0; s < a; ++s) {
|
|
1416
1416
|
var o = e.charCodeAt(s);
|
|
1417
|
-
|
|
1417
|
+
Fe[t >> 1] = o, Et(o), t += 2;
|
|
1418
1418
|
}
|
|
1419
|
-
return
|
|
1420
|
-
},
|
|
1421
|
-
|
|
1419
|
+
return Fe[t >> 1] = 0, Et(0), t - n;
|
|
1420
|
+
}, $i = (e) => e.length * 2, Oi = (e, t) => {
|
|
1421
|
+
p(e % 4 == 0, "Pointer passed to UTF32ToString must be aligned to four bytes!");
|
|
1422
1422
|
for (var r = 0, n = ""; !(r >= t / 4); ) {
|
|
1423
|
-
var
|
|
1424
|
-
if (
|
|
1423
|
+
var a = y[e + r * 4 >> 2];
|
|
1424
|
+
if (a == 0)
|
|
1425
1425
|
break;
|
|
1426
|
-
if (++r,
|
|
1427
|
-
var s =
|
|
1426
|
+
if (++r, a >= 65536) {
|
|
1427
|
+
var s = a - 65536;
|
|
1428
1428
|
n += String.fromCharCode(55296 | s >> 10, 56320 | s & 1023);
|
|
1429
1429
|
} else
|
|
1430
|
-
n += String.fromCharCode(
|
|
1430
|
+
n += String.fromCharCode(a);
|
|
1431
1431
|
}
|
|
1432
1432
|
return n;
|
|
1433
|
-
},
|
|
1434
|
-
if (
|
|
1433
|
+
}, Ri = (e, t, r) => {
|
|
1434
|
+
if (p(t % 4 == 0, "Pointer passed to stringToUTF32 must be aligned to four bytes!"), p(typeof r == "number", "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r === void 0 && (r = 2147483647), r < 4)
|
|
1435
1435
|
return 0;
|
|
1436
|
-
for (var n = t,
|
|
1436
|
+
for (var n = t, a = n + r - 4, s = 0; s < e.length; ++s) {
|
|
1437
1437
|
var o = e.charCodeAt(s);
|
|
1438
1438
|
if (o >= 55296 && o <= 57343) {
|
|
1439
1439
|
var l = e.charCodeAt(++s);
|
|
1440
1440
|
o = 65536 + ((o & 1023) << 10) | l & 1023;
|
|
1441
1441
|
}
|
|
1442
|
-
if (
|
|
1442
|
+
if (y[t >> 2] = o, I(o), t += 4, t + 4 > a)
|
|
1443
1443
|
break;
|
|
1444
1444
|
}
|
|
1445
|
-
return
|
|
1446
|
-
},
|
|
1445
|
+
return y[t >> 2] = 0, I(0), t - n;
|
|
1446
|
+
}, ki = (e) => {
|
|
1447
1447
|
for (var t = 0, r = 0; r < e.length; ++r) {
|
|
1448
1448
|
var n = e.charCodeAt(r);
|
|
1449
1449
|
n >= 55296 && n <= 57343 && ++r, t += 4;
|
|
1450
1450
|
}
|
|
1451
1451
|
return t;
|
|
1452
|
-
},
|
|
1453
|
-
r =
|
|
1454
|
-
var n,
|
|
1455
|
-
t === 2 ? (n =
|
|
1452
|
+
}, xi = function(e, t, r) {
|
|
1453
|
+
r = X(r);
|
|
1454
|
+
var n, a, s, o, l;
|
|
1455
|
+
t === 2 ? (n = Di, a = Mi, o = $i, s = () => rt, l = 1) : t === 4 && (n = Oi, a = Ri, o = ki, s = () => x, l = 2), me(e, {
|
|
1456
1456
|
name: r,
|
|
1457
|
-
fromWireType: function(
|
|
1458
|
-
for (var
|
|
1459
|
-
var
|
|
1460
|
-
if (
|
|
1461
|
-
var
|
|
1462
|
-
|
|
1457
|
+
fromWireType: function(d) {
|
|
1458
|
+
for (var f = x[d >> 2], m = s(), S, F = d + 4, R = 0; R <= f; ++R) {
|
|
1459
|
+
var z = d + 4 + R * t;
|
|
1460
|
+
if (R == f || m[z >> l] == 0) {
|
|
1461
|
+
var B = z - F, Q = n(F, B);
|
|
1462
|
+
S === void 0 ? S = Q : (S += String.fromCharCode(0), S += Q), F = z + t;
|
|
1463
1463
|
}
|
|
1464
1464
|
}
|
|
1465
|
-
return
|
|
1465
|
+
return ge(d), S;
|
|
1466
1466
|
},
|
|
1467
|
-
toWireType: function(
|
|
1468
|
-
typeof
|
|
1469
|
-
var
|
|
1470
|
-
return
|
|
1467
|
+
toWireType: function(d, f) {
|
|
1468
|
+
typeof f != "string" && L(`Cannot pass non-string to C++ string type ${r}`);
|
|
1469
|
+
var m = o(f), S = ft(4 + m + t);
|
|
1470
|
+
return x[S >> 2] = m >> l, a(f, S + 4, m + t), d !== null && d.push(ge, S), S;
|
|
1471
1471
|
},
|
|
1472
1472
|
argPackAdvance: 8,
|
|
1473
|
-
readValueFromPointer:
|
|
1474
|
-
destructorFunction: function(
|
|
1475
|
-
|
|
1473
|
+
readValueFromPointer: Ye,
|
|
1474
|
+
destructorFunction: function(d) {
|
|
1475
|
+
ge(d);
|
|
1476
1476
|
}
|
|
1477
1477
|
});
|
|
1478
1478
|
};
|
|
1479
|
-
function
|
|
1480
|
-
|
|
1481
|
-
name:
|
|
1482
|
-
rawConstructor:
|
|
1483
|
-
rawDestructor:
|
|
1479
|
+
function Ui(e, t, r, n, a, s) {
|
|
1480
|
+
at[e] = {
|
|
1481
|
+
name: X(t),
|
|
1482
|
+
rawConstructor: de(r, n),
|
|
1483
|
+
rawDestructor: de(a, s),
|
|
1484
1484
|
fields: []
|
|
1485
1485
|
};
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1488
|
-
|
|
1489
|
-
fieldName:
|
|
1487
|
+
function Li(e, t, r, n, a, s, o, l, d, f) {
|
|
1488
|
+
at[e].fields.push({
|
|
1489
|
+
fieldName: X(t),
|
|
1490
1490
|
getterReturnType: r,
|
|
1491
|
-
getter:
|
|
1491
|
+
getter: de(n, a),
|
|
1492
1492
|
getterContext: s,
|
|
1493
1493
|
setterArgumentType: o,
|
|
1494
|
-
setter:
|
|
1495
|
-
setterContext:
|
|
1494
|
+
setter: de(l, d),
|
|
1495
|
+
setterContext: f
|
|
1496
1496
|
});
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1499
|
-
t =
|
|
1498
|
+
function Ni(e, t) {
|
|
1499
|
+
t = X(t), me(e, {
|
|
1500
1500
|
isVoid: !0,
|
|
1501
1501
|
name: t,
|
|
1502
1502
|
argPackAdvance: 0,
|
|
@@ -1506,140 +1506,140 @@ return ret;
|
|
|
1506
1506
|
}
|
|
1507
1507
|
});
|
|
1508
1508
|
}
|
|
1509
|
-
var
|
|
1510
|
-
function
|
|
1511
|
-
var r =
|
|
1512
|
-
return r === void 0 &&
|
|
1509
|
+
var Wi = !0, Hi = () => Wi;
|
|
1510
|
+
function Nt(e, t) {
|
|
1511
|
+
var r = Ae[e];
|
|
1512
|
+
return r === void 0 && L(t + " has unknown type " + Sr(e)), r;
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1515
|
-
e =
|
|
1516
|
-
var n = [],
|
|
1517
|
-
return
|
|
1514
|
+
function Yi(e, t, r) {
|
|
1515
|
+
e = ee.toValue(e), t = Nt(t, "emval::as");
|
|
1516
|
+
var n = [], a = ee.toHandle(n);
|
|
1517
|
+
return x[r >> 2] = a, t.toWireType(n, e);
|
|
1518
1518
|
}
|
|
1519
|
-
var
|
|
1520
|
-
return
|
|
1519
|
+
var $r = function(e) {
|
|
1520
|
+
return g.handleAsync(() => (e = ee.toValue(e), e.then(ee.toHandle)));
|
|
1521
1521
|
};
|
|
1522
|
-
|
|
1523
|
-
function
|
|
1522
|
+
$r.isAsync = !0;
|
|
1523
|
+
function ji(e, t) {
|
|
1524
1524
|
for (var r = new Array(e), n = 0; n < e; ++n)
|
|
1525
|
-
r[n] =
|
|
1526
|
-
|
|
1525
|
+
r[n] = Nt(
|
|
1526
|
+
x[t + n * 4 >> 2],
|
|
1527
1527
|
"parameter " + n
|
|
1528
1528
|
);
|
|
1529
1529
|
return r;
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1532
|
-
e =
|
|
1533
|
-
for (var
|
|
1534
|
-
var l =
|
|
1531
|
+
function zi(e, t, r, n) {
|
|
1532
|
+
e = ee.toValue(e);
|
|
1533
|
+
for (var a = ji(t, r), s = new Array(t), o = 0; o < t; ++o) {
|
|
1534
|
+
var l = a[o];
|
|
1535
1535
|
s[o] = l.readValueFromPointer(n), n += l.argPackAdvance;
|
|
1536
1536
|
}
|
|
1537
|
-
var
|
|
1538
|
-
return
|
|
1537
|
+
var d = e.apply(void 0, s);
|
|
1538
|
+
return ee.toHandle(d);
|
|
1539
1539
|
}
|
|
1540
|
-
function
|
|
1541
|
-
return e =
|
|
1540
|
+
function Vi(e, t) {
|
|
1541
|
+
return e = ee.toValue(e), t = ee.toValue(t), ee.toHandle(e[t]);
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1544
|
-
e > 4 && (
|
|
1543
|
+
function Bi(e) {
|
|
1544
|
+
e > 4 && (oe.get(e).refcount += 1);
|
|
1545
1545
|
}
|
|
1546
|
-
var
|
|
1547
|
-
function
|
|
1548
|
-
var t =
|
|
1549
|
-
return t === void 0 ?
|
|
1546
|
+
var Gi = {};
|
|
1547
|
+
function Qi(e) {
|
|
1548
|
+
var t = Gi[e];
|
|
1549
|
+
return t === void 0 ? X(e) : t;
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1552
|
-
return
|
|
1551
|
+
function Ji(e) {
|
|
1552
|
+
return ee.toHandle(Qi(e));
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1555
|
-
var t =
|
|
1556
|
-
|
|
1554
|
+
function qi(e) {
|
|
1555
|
+
var t = ee.toValue(e);
|
|
1556
|
+
Ft(t), Ut(e);
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1559
|
-
e =
|
|
1558
|
+
function Ki(e, t) {
|
|
1559
|
+
e = Nt(e, "_emval_take_value");
|
|
1560
1560
|
var r = e.readValueFromPointer(t);
|
|
1561
|
-
return
|
|
1562
|
-
}
|
|
1563
|
-
function
|
|
1564
|
-
return
|
|
1565
|
-
}
|
|
1566
|
-
var
|
|
1567
|
-
var r = new Date(
|
|
1568
|
-
|
|
1569
|
-
var n = Date.UTC(r.getUTCFullYear(), 0, 1, 0, 0, 0, 0),
|
|
1570
|
-
|
|
1571
|
-
},
|
|
1572
|
-
var t =
|
|
1561
|
+
return ee.toHandle(r);
|
|
1562
|
+
}
|
|
1563
|
+
function Or(e) {
|
|
1564
|
+
return x[e >> 2] + y[e + 4 >> 2] * 4294967296;
|
|
1565
|
+
}
|
|
1566
|
+
var Zi = (e, t) => {
|
|
1567
|
+
var r = new Date(Or(e) * 1e3);
|
|
1568
|
+
y[t >> 2] = r.getUTCSeconds(), I(r.getUTCSeconds()), y[t + 4 >> 2] = r.getUTCMinutes(), I(r.getUTCMinutes()), y[t + 8 >> 2] = r.getUTCHours(), I(r.getUTCHours()), y[t + 12 >> 2] = r.getUTCDate(), I(r.getUTCDate()), y[t + 16 >> 2] = r.getUTCMonth(), I(r.getUTCMonth()), y[t + 20 >> 2] = r.getUTCFullYear() - 1900, I(r.getUTCFullYear() - 1900), y[t + 24 >> 2] = r.getUTCDay(), I(r.getUTCDay());
|
|
1569
|
+
var n = Date.UTC(r.getUTCFullYear(), 0, 1, 0, 0, 0, 0), a = (r.getTime() - n) / (1e3 * 60 * 60 * 24) | 0;
|
|
1570
|
+
y[t + 28 >> 2] = a, I(a);
|
|
1571
|
+
}, Ge = (e) => e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0), Xi = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], ea = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Rr = (e) => {
|
|
1572
|
+
var t = Ge(e.getFullYear()), r = t ? Xi : ea, n = r[e.getMonth()] + e.getDate() - 1;
|
|
1573
1573
|
return n;
|
|
1574
|
-
},
|
|
1575
|
-
var r = new Date(
|
|
1576
|
-
|
|
1577
|
-
var n =
|
|
1578
|
-
|
|
1579
|
-
var
|
|
1580
|
-
|
|
1581
|
-
},
|
|
1574
|
+
}, ta = (e, t) => {
|
|
1575
|
+
var r = new Date(Or(e) * 1e3);
|
|
1576
|
+
y[t >> 2] = r.getSeconds(), I(r.getSeconds()), y[t + 4 >> 2] = r.getMinutes(), I(r.getMinutes()), y[t + 8 >> 2] = r.getHours(), I(r.getHours()), y[t + 12 >> 2] = r.getDate(), I(r.getDate()), y[t + 16 >> 2] = r.getMonth(), I(r.getMonth()), y[t + 20 >> 2] = r.getFullYear() - 1900, I(r.getFullYear() - 1900), y[t + 24 >> 2] = r.getDay(), I(r.getDay());
|
|
1577
|
+
var n = Rr(r) | 0;
|
|
1578
|
+
y[t + 28 >> 2] = n, I(n), y[t + 36 >> 2] = -(r.getTimezoneOffset() * 60), I(-(r.getTimezoneOffset() * 60));
|
|
1579
|
+
var a = new Date(r.getFullYear(), 0, 1), s = new Date(r.getFullYear(), 6, 1).getTimezoneOffset(), o = a.getTimezoneOffset(), l = (s != o && r.getTimezoneOffset() == Math.min(o, s)) | 0;
|
|
1580
|
+
y[t + 32 >> 2] = l, I(l);
|
|
1581
|
+
}, ra = (e) => {
|
|
1582
1582
|
var t = new Date(
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1583
|
+
y[e + 20 >> 2] + 1900,
|
|
1584
|
+
y[e + 16 >> 2],
|
|
1585
|
+
y[e + 12 >> 2],
|
|
1586
|
+
y[e + 8 >> 2],
|
|
1587
|
+
y[e + 4 >> 2],
|
|
1588
|
+
y[e >> 2],
|
|
1589
1589
|
0
|
|
1590
|
-
), r =
|
|
1590
|
+
), r = y[e + 32 >> 2], n = t.getTimezoneOffset(), a = new Date(t.getFullYear(), 0, 1), s = new Date(t.getFullYear(), 6, 1).getTimezoneOffset(), o = a.getTimezoneOffset(), l = Math.min(o, s);
|
|
1591
1591
|
if (r < 0)
|
|
1592
|
-
|
|
1592
|
+
y[e + 32 >> 2] = Number(s != o && l == n), I(Number(s != o && l == n));
|
|
1593
1593
|
else if (r > 0 != (l == n)) {
|
|
1594
|
-
var
|
|
1595
|
-
t.setTime(t.getTime() + (
|
|
1594
|
+
var d = Math.max(o, s), f = r > 0 ? l : d;
|
|
1595
|
+
t.setTime(t.getTime() + (f - n) * 6e4);
|
|
1596
1596
|
}
|
|
1597
|
-
|
|
1598
|
-
var
|
|
1599
|
-
return
|
|
1600
|
-
},
|
|
1601
|
-
var t =
|
|
1602
|
-
return r &&
|
|
1603
|
-
},
|
|
1604
|
-
var n = new Date().getFullYear(),
|
|
1605
|
-
|
|
1606
|
-
function
|
|
1607
|
-
var
|
|
1608
|
-
return
|
|
1597
|
+
y[e + 24 >> 2] = t.getDay(), I(t.getDay());
|
|
1598
|
+
var m = Rr(t) | 0;
|
|
1599
|
+
return y[e + 28 >> 2] = m, I(m), y[e >> 2] = t.getSeconds(), I(t.getSeconds()), y[e + 4 >> 2] = t.getMinutes(), I(t.getMinutes()), y[e + 8 >> 2] = t.getHours(), I(t.getHours()), y[e + 12 >> 2] = t.getDate(), I(t.getDate()), y[e + 16 >> 2] = t.getMonth(), I(t.getMonth()), y[e + 20 >> 2] = t.getYear(), I(t.getYear()), t.getTime() / 1e3 | 0;
|
|
1600
|
+
}, kr = (e) => {
|
|
1601
|
+
var t = Lt(e) + 1, r = ft(t);
|
|
1602
|
+
return r && Dr(e, r, t), r;
|
|
1603
|
+
}, na = (e, t, r) => {
|
|
1604
|
+
var n = new Date().getFullYear(), a = new Date(n, 0, 1), s = new Date(n, 6, 1), o = a.getTimezoneOffset(), l = s.getTimezoneOffset(), d = Math.max(o, l);
|
|
1605
|
+
x[e >> 2] = d * 60, I(d * 60), y[t >> 2] = Number(o != l), I(Number(o != l));
|
|
1606
|
+
function f(z) {
|
|
1607
|
+
var B = z.toTimeString().match(/\(([A-Za-z ]+)\)$/);
|
|
1608
|
+
return B ? B[1] : "GMT";
|
|
1609
1609
|
}
|
|
1610
|
-
var
|
|
1611
|
-
l < o ? (
|
|
1612
|
-
},
|
|
1613
|
-
|
|
1610
|
+
var m = f(a), S = f(s), F = kr(m), R = kr(S);
|
|
1611
|
+
l < o ? (x[r >> 2] = F, I(F), x[r + 4 >> 2] = R, I(R)) : (x[r >> 2] = R, I(R), x[r + 4 >> 2] = F, I(F));
|
|
1612
|
+
}, ia = () => {
|
|
1613
|
+
J("native code called abort()");
|
|
1614
1614
|
};
|
|
1615
|
-
function
|
|
1615
|
+
function aa() {
|
|
1616
1616
|
return Date.now();
|
|
1617
1617
|
}
|
|
1618
|
-
var
|
|
1619
|
-
|
|
1620
|
-
var
|
|
1621
|
-
var t =
|
|
1618
|
+
var xr = () => 2147483648, oa = () => xr(), ct;
|
|
1619
|
+
ct = () => performance.now();
|
|
1620
|
+
var sa = (e) => {
|
|
1621
|
+
var t = Se.buffer, r = e - t.byteLength + 65535 >>> 16;
|
|
1622
1622
|
try {
|
|
1623
|
-
return
|
|
1623
|
+
return Se.grow(r), rr(), 1;
|
|
1624
1624
|
} catch (n) {
|
|
1625
|
-
|
|
1625
|
+
T(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${n}`);
|
|
1626
1626
|
}
|
|
1627
|
-
},
|
|
1628
|
-
var t =
|
|
1629
|
-
e = e >>> 0,
|
|
1630
|
-
var r =
|
|
1627
|
+
}, la = (e) => {
|
|
1628
|
+
var t = re.length;
|
|
1629
|
+
e = e >>> 0, p(e > t);
|
|
1630
|
+
var r = xr();
|
|
1631
1631
|
if (e > r)
|
|
1632
|
-
return
|
|
1633
|
-
for (var n = (
|
|
1634
|
-
var s = t * (1 + 0.2 /
|
|
1632
|
+
return T(`Cannot enlarge memory, asked to go up to ${e} bytes, but the limit is ${r} bytes!`), !1;
|
|
1633
|
+
for (var n = (m, S) => m + (S - m % S) % S, a = 1; a <= 4; a *= 2) {
|
|
1634
|
+
var s = t * (1 + 0.2 / a);
|
|
1635
1635
|
s = Math.min(s, e + 100663296);
|
|
1636
|
-
var o = Math.min(r, n(Math.max(e, s), 65536)), l =
|
|
1637
|
-
if (
|
|
1636
|
+
var o = Math.min(r, n(Math.max(e, s), 65536)), l = ct(), d = sa(o), f = ct();
|
|
1637
|
+
if (U(`Heap resize call from ${t} to ${o} took ${f - l} msecs. Success: ${!!d}`), d)
|
|
1638
1638
|
return !0;
|
|
1639
1639
|
}
|
|
1640
|
-
return
|
|
1641
|
-
},
|
|
1642
|
-
if (!
|
|
1640
|
+
return T(`Failed to grow the heap from ${t} bytes to ${o} bytes, not enough memory!`), !1;
|
|
1641
|
+
}, Wt = {}, ua = () => C || "./this.program", Qe = () => {
|
|
1642
|
+
if (!Qe.strings) {
|
|
1643
1643
|
var e = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", t = {
|
|
1644
1644
|
USER: "web_user",
|
|
1645
1645
|
LOGNAME: "web_user",
|
|
@@ -1647,93 +1647,93 @@ return ret;
|
|
|
1647
1647
|
PWD: "/",
|
|
1648
1648
|
HOME: "/home/web_user",
|
|
1649
1649
|
LANG: e,
|
|
1650
|
-
_:
|
|
1650
|
+
_: ua()
|
|
1651
1651
|
};
|
|
1652
|
-
for (var r in
|
|
1653
|
-
|
|
1652
|
+
for (var r in Wt)
|
|
1653
|
+
Wt[r] === void 0 ? delete t[r] : t[r] = Wt[r];
|
|
1654
1654
|
var n = [];
|
|
1655
1655
|
for (var r in t)
|
|
1656
1656
|
n.push(`${r}=${t[r]}`);
|
|
1657
|
-
|
|
1657
|
+
Qe.strings = n;
|
|
1658
1658
|
}
|
|
1659
|
-
return
|
|
1660
|
-
},
|
|
1659
|
+
return Qe.strings;
|
|
1660
|
+
}, ca = (e, t) => {
|
|
1661
1661
|
for (var r = 0; r < e.length; ++r)
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
},
|
|
1662
|
+
p(e.charCodeAt(r) === (e.charCodeAt(r) & 255)), le[t++ >> 0] = e.charCodeAt(r), He(e.charCodeAt(r));
|
|
1663
|
+
le[t >> 0] = 0, He(0);
|
|
1664
|
+
}, fa = (e, t) => {
|
|
1665
1665
|
var r = 0;
|
|
1666
|
-
return
|
|
1666
|
+
return Qe().forEach(function(n, a) {
|
|
1667
1667
|
var s = t + r;
|
|
1668
|
-
|
|
1668
|
+
x[e + a * 4 >> 2] = s, I(s), ca(n, s), r += n.length + 1;
|
|
1669
1669
|
}), 0;
|
|
1670
|
-
},
|
|
1671
|
-
var r =
|
|
1672
|
-
|
|
1670
|
+
}, da = (e, t) => {
|
|
1671
|
+
var r = Qe();
|
|
1672
|
+
x[e >> 2] = r.length, I(r.length);
|
|
1673
1673
|
var n = 0;
|
|
1674
|
-
return r.forEach(function(
|
|
1675
|
-
n +=
|
|
1676
|
-
}),
|
|
1677
|
-
},
|
|
1678
|
-
|
|
1679
|
-
},
|
|
1680
|
-
var r = 0, n = 0,
|
|
1674
|
+
return r.forEach(function(a) {
|
|
1675
|
+
n += a.length + 1;
|
|
1676
|
+
}), x[t >> 2] = n, I(n), 0;
|
|
1677
|
+
}, _a = (e) => {
|
|
1678
|
+
J("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM");
|
|
1679
|
+
}, va = (e, t) => {
|
|
1680
|
+
var r = 0, n = 0, a = 0;
|
|
1681
1681
|
{
|
|
1682
|
-
|
|
1682
|
+
p(e == 0 || e == 1 || e == 2);
|
|
1683
1683
|
var s = 2;
|
|
1684
|
-
e == 0 ? r = 2 : (e == 1 || e == 2) && (r = 64),
|
|
1684
|
+
e == 0 ? r = 2 : (e == 1 || e == 2) && (r = 64), a = 1;
|
|
1685
1685
|
}
|
|
1686
|
-
return
|
|
1687
|
-
},
|
|
1688
|
-
|
|
1689
|
-
},
|
|
1690
|
-
var r =
|
|
1691
|
-
|
|
1692
|
-
},
|
|
1693
|
-
|
|
1694
|
-
},
|
|
1695
|
-
for (var
|
|
1696
|
-
var o =
|
|
1686
|
+
return le[t >> 0] = s, He(s), Fe[t + 2 >> 1] = a, Et(a), Me = [r >>> 0, (ae = r, +Math.abs(ae) >= 1 ? ae > 0 ? +Math.floor(ae / 4294967296) >>> 0 : ~~+Math.ceil((ae - +(~~ae >>> 0)) / 4294967296) >>> 0 : 0)], y[t + 8 >> 2] = Me[0], y[t + 12 >> 2] = Me[1], dr(r), Me = [n >>> 0, (ae = n, +Math.abs(ae) >= 1 ? ae > 0 ? +Math.floor(ae / 4294967296) >>> 0 : ~~+Math.ceil((ae - +(~~ae >>> 0)) / 4294967296) >>> 0 : 0)], y[t + 16 >> 2] = Me[0], y[t + 20 >> 2] = Me[1], dr(n), 0;
|
|
1687
|
+
}, ha = (e, t, r, n) => {
|
|
1688
|
+
J("fd_read called without SYSCALLS_REQUIRE_FILESYSTEM");
|
|
1689
|
+
}, ma = (e, t, r, n, a) => 70, Ht = [null, [], []], Yt = (e, t) => {
|
|
1690
|
+
var r = Ht[e];
|
|
1691
|
+
p(r), t === 0 || t === 10 ? ((e === 1 ? U : T)(hr(r, 0)), r.length = 0) : r.push(t);
|
|
1692
|
+
}, pa = () => {
|
|
1693
|
+
Pa(0), Ht[1].length && Yt(1, 10), Ht[2].length && Yt(2, 10);
|
|
1694
|
+
}, ga = (e, t, r, n) => {
|
|
1695
|
+
for (var a = 0, s = 0; s < r; s++) {
|
|
1696
|
+
var o = x[t >> 2], l = x[t + 4 >> 2];
|
|
1697
1697
|
t += 8;
|
|
1698
|
-
for (var
|
|
1699
|
-
|
|
1700
|
-
|
|
1698
|
+
for (var d = 0; d < l; d++)
|
|
1699
|
+
Yt(e, re[o + d]);
|
|
1700
|
+
a += l;
|
|
1701
1701
|
}
|
|
1702
|
-
return
|
|
1703
|
-
},
|
|
1702
|
+
return x[n >> 2] = a, I(a), 0;
|
|
1703
|
+
}, ya = (e, t) => {
|
|
1704
1704
|
for (var r = 0, n = 0; n <= t; r += e[n++])
|
|
1705
1705
|
;
|
|
1706
1706
|
return r;
|
|
1707
|
-
},
|
|
1707
|
+
}, Ur = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Lr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ba = (e, t) => {
|
|
1708
1708
|
for (var r = new Date(e.getTime()); t > 0; ) {
|
|
1709
|
-
var n =
|
|
1709
|
+
var n = Ge(r.getFullYear()), a = r.getMonth(), s = (n ? Ur : Lr)[a];
|
|
1710
1710
|
if (t > s - r.getDate())
|
|
1711
|
-
t -= s - r.getDate() + 1, r.setDate(1),
|
|
1711
|
+
t -= s - r.getDate() + 1, r.setDate(1), a < 11 ? r.setMonth(a + 1) : (r.setMonth(0), r.setFullYear(r.getFullYear() + 1));
|
|
1712
1712
|
else
|
|
1713
1713
|
return r.setDate(r.getDate() + t), r;
|
|
1714
1714
|
}
|
|
1715
1715
|
return r;
|
|
1716
1716
|
};
|
|
1717
|
-
function
|
|
1718
|
-
var n = r > 0 ? r :
|
|
1719
|
-
return t && (
|
|
1720
|
-
}
|
|
1721
|
-
var
|
|
1722
|
-
|
|
1723
|
-
},
|
|
1724
|
-
var
|
|
1725
|
-
tm_sec:
|
|
1726
|
-
tm_min:
|
|
1727
|
-
tm_hour:
|
|
1728
|
-
tm_mday:
|
|
1729
|
-
tm_mon:
|
|
1730
|
-
tm_year:
|
|
1731
|
-
tm_wday:
|
|
1732
|
-
tm_yday:
|
|
1733
|
-
tm_isdst:
|
|
1734
|
-
tm_gmtoff:
|
|
1735
|
-
tm_zone:
|
|
1736
|
-
}, o =
|
|
1717
|
+
function wa(e, t, r) {
|
|
1718
|
+
var n = r > 0 ? r : Lt(e) + 1, a = new Array(n), s = Ir(e, a, 0, a.length);
|
|
1719
|
+
return t && (a.length = s), a;
|
|
1720
|
+
}
|
|
1721
|
+
var Ta = (e, t) => {
|
|
1722
|
+
p(e.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"), le.set(e, t);
|
|
1723
|
+
}, Ca = (e, t, r, n) => {
|
|
1724
|
+
var a = y[n + 40 >> 2], s = {
|
|
1725
|
+
tm_sec: y[n >> 2],
|
|
1726
|
+
tm_min: y[n + 4 >> 2],
|
|
1727
|
+
tm_hour: y[n + 8 >> 2],
|
|
1728
|
+
tm_mday: y[n + 12 >> 2],
|
|
1729
|
+
tm_mon: y[n + 16 >> 2],
|
|
1730
|
+
tm_year: y[n + 20 >> 2],
|
|
1731
|
+
tm_wday: y[n + 24 >> 2],
|
|
1732
|
+
tm_yday: y[n + 28 >> 2],
|
|
1733
|
+
tm_isdst: y[n + 32 >> 2],
|
|
1734
|
+
tm_gmtoff: y[n + 36 >> 2],
|
|
1735
|
+
tm_zone: a ? St(a) : ""
|
|
1736
|
+
}, o = St(r), l = {
|
|
1737
1737
|
"%c": "%a %b %d %H:%M:%S %Y",
|
|
1738
1738
|
"%D": "%m/%d/%y",
|
|
1739
1739
|
"%F": "%Y-%m-%d",
|
|
@@ -1763,180 +1763,180 @@ return ret;
|
|
|
1763
1763
|
"%OW": "%W",
|
|
1764
1764
|
"%Oy": "%y"
|
|
1765
1765
|
};
|
|
1766
|
-
for (var
|
|
1767
|
-
o = o.replace(new RegExp(
|
|
1768
|
-
var
|
|
1769
|
-
function
|
|
1770
|
-
for (var
|
|
1771
|
-
|
|
1772
|
-
return
|
|
1766
|
+
for (var d in l)
|
|
1767
|
+
o = o.replace(new RegExp(d, "g"), l[d]);
|
|
1768
|
+
var f = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
1769
|
+
function S(v, w, te) {
|
|
1770
|
+
for (var K = typeof v == "number" ? v.toString() : v || ""; K.length < w; )
|
|
1771
|
+
K = te[0] + K;
|
|
1772
|
+
return K;
|
|
1773
1773
|
}
|
|
1774
|
-
function
|
|
1775
|
-
return
|
|
1774
|
+
function F(v, w) {
|
|
1775
|
+
return S(v, w, "0");
|
|
1776
1776
|
}
|
|
1777
|
-
function
|
|
1778
|
-
function
|
|
1779
|
-
return
|
|
1777
|
+
function R(v, w) {
|
|
1778
|
+
function te(Ie) {
|
|
1779
|
+
return Ie < 0 ? -1 : Ie > 0 ? 1 : 0;
|
|
1780
1780
|
}
|
|
1781
|
-
var
|
|
1782
|
-
return (
|
|
1781
|
+
var K;
|
|
1782
|
+
return (K = te(v.getFullYear() - w.getFullYear())) === 0 && (K = te(v.getMonth() - w.getMonth())) === 0 && (K = te(v.getDate() - w.getDate())), K;
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1785
|
-
switch (
|
|
1784
|
+
function z(v) {
|
|
1785
|
+
switch (v.getDay()) {
|
|
1786
1786
|
case 0:
|
|
1787
|
-
return new Date(
|
|
1787
|
+
return new Date(v.getFullYear() - 1, 11, 29);
|
|
1788
1788
|
case 1:
|
|
1789
|
-
return
|
|
1789
|
+
return v;
|
|
1790
1790
|
case 2:
|
|
1791
|
-
return new Date(
|
|
1791
|
+
return new Date(v.getFullYear(), 0, 3);
|
|
1792
1792
|
case 3:
|
|
1793
|
-
return new Date(
|
|
1793
|
+
return new Date(v.getFullYear(), 0, 2);
|
|
1794
1794
|
case 4:
|
|
1795
|
-
return new Date(
|
|
1795
|
+
return new Date(v.getFullYear(), 0, 1);
|
|
1796
1796
|
case 5:
|
|
1797
|
-
return new Date(
|
|
1797
|
+
return new Date(v.getFullYear() - 1, 11, 31);
|
|
1798
1798
|
case 6:
|
|
1799
|
-
return new Date(
|
|
1799
|
+
return new Date(v.getFullYear() - 1, 11, 30);
|
|
1800
1800
|
}
|
|
1801
1801
|
}
|
|
1802
|
-
function
|
|
1803
|
-
var
|
|
1804
|
-
return
|
|
1802
|
+
function B(v) {
|
|
1803
|
+
var w = ba(new Date(v.tm_year + 1900, 0, 1), v.tm_yday), te = new Date(w.getFullYear(), 0, 4), K = new Date(w.getFullYear() + 1, 0, 4), Ie = z(te), _t = z(K);
|
|
1804
|
+
return R(Ie, w) <= 0 ? R(_t, w) <= 0 ? w.getFullYear() + 1 : w.getFullYear() : w.getFullYear() - 1;
|
|
1805
1805
|
}
|
|
1806
|
-
var
|
|
1807
|
-
"%a": (
|
|
1808
|
-
"%A": (
|
|
1809
|
-
"%b": (
|
|
1810
|
-
"%B": (
|
|
1811
|
-
"%C": (
|
|
1812
|
-
var
|
|
1813
|
-
return
|
|
1806
|
+
var Q = {
|
|
1807
|
+
"%a": (v) => f[v.tm_wday].substring(0, 3),
|
|
1808
|
+
"%A": (v) => f[v.tm_wday],
|
|
1809
|
+
"%b": (v) => m[v.tm_mon].substring(0, 3),
|
|
1810
|
+
"%B": (v) => m[v.tm_mon],
|
|
1811
|
+
"%C": (v) => {
|
|
1812
|
+
var w = v.tm_year + 1900;
|
|
1813
|
+
return F(w / 100 | 0, 2);
|
|
1814
1814
|
},
|
|
1815
|
-
"%d": (
|
|
1816
|
-
"%e": (
|
|
1817
|
-
"%g": (
|
|
1818
|
-
"%G": (
|
|
1819
|
-
"%H": (
|
|
1820
|
-
"%I": (
|
|
1821
|
-
var
|
|
1822
|
-
return
|
|
1815
|
+
"%d": (v) => F(v.tm_mday, 2),
|
|
1816
|
+
"%e": (v) => S(v.tm_mday, 2, " "),
|
|
1817
|
+
"%g": (v) => B(v).toString().substring(2),
|
|
1818
|
+
"%G": (v) => B(v),
|
|
1819
|
+
"%H": (v) => F(v.tm_hour, 2),
|
|
1820
|
+
"%I": (v) => {
|
|
1821
|
+
var w = v.tm_hour;
|
|
1822
|
+
return w == 0 ? w = 12 : w > 12 && (w -= 12), F(w, 2);
|
|
1823
1823
|
},
|
|
1824
|
-
"%j": (
|
|
1825
|
-
"%m": (
|
|
1826
|
-
"%M": (
|
|
1824
|
+
"%j": (v) => F(v.tm_mday + ya(Ge(v.tm_year + 1900) ? Ur : Lr, v.tm_mon - 1), 3),
|
|
1825
|
+
"%m": (v) => F(v.tm_mon + 1, 2),
|
|
1826
|
+
"%M": (v) => F(v.tm_min, 2),
|
|
1827
1827
|
"%n": () => `
|
|
1828
1828
|
`,
|
|
1829
|
-
"%p": (
|
|
1830
|
-
"%S": (
|
|
1829
|
+
"%p": (v) => v.tm_hour >= 0 && v.tm_hour < 12 ? "AM" : "PM",
|
|
1830
|
+
"%S": (v) => F(v.tm_sec, 2),
|
|
1831
1831
|
"%t": () => " ",
|
|
1832
|
-
"%u": (
|
|
1833
|
-
"%U": (
|
|
1834
|
-
var
|
|
1835
|
-
return
|
|
1832
|
+
"%u": (v) => v.tm_wday || 7,
|
|
1833
|
+
"%U": (v) => {
|
|
1834
|
+
var w = v.tm_yday + 7 - v.tm_wday;
|
|
1835
|
+
return F(Math.floor(w / 7), 2);
|
|
1836
1836
|
},
|
|
1837
|
-
"%V": (
|
|
1838
|
-
var
|
|
1839
|
-
if ((
|
|
1840
|
-
if (
|
|
1841
|
-
var
|
|
1842
|
-
|
|
1837
|
+
"%V": (v) => {
|
|
1838
|
+
var w = Math.floor((v.tm_yday + 7 - (v.tm_wday + 6) % 7) / 7);
|
|
1839
|
+
if ((v.tm_wday + 371 - v.tm_yday - 2) % 7 <= 2 && w++, w) {
|
|
1840
|
+
if (w == 53) {
|
|
1841
|
+
var K = (v.tm_wday + 371 - v.tm_yday) % 7;
|
|
1842
|
+
K != 4 && (K != 3 || !Ge(v.tm_year)) && (w = 1);
|
|
1843
1843
|
}
|
|
1844
1844
|
} else {
|
|
1845
|
-
|
|
1846
|
-
var
|
|
1847
|
-
(
|
|
1845
|
+
w = 52;
|
|
1846
|
+
var te = (v.tm_wday + 7 - v.tm_yday - 1) % 7;
|
|
1847
|
+
(te == 4 || te == 5 && Ge(v.tm_year % 400 - 1)) && w++;
|
|
1848
1848
|
}
|
|
1849
|
-
return
|
|
1849
|
+
return F(w, 2);
|
|
1850
1850
|
},
|
|
1851
|
-
"%w": (
|
|
1852
|
-
"%W": (
|
|
1853
|
-
var
|
|
1854
|
-
return
|
|
1851
|
+
"%w": (v) => v.tm_wday,
|
|
1852
|
+
"%W": (v) => {
|
|
1853
|
+
var w = v.tm_yday + 7 - (v.tm_wday + 6) % 7;
|
|
1854
|
+
return F(Math.floor(w / 7), 2);
|
|
1855
1855
|
},
|
|
1856
|
-
"%y": (
|
|
1857
|
-
"%Y": (
|
|
1858
|
-
"%z": (
|
|
1859
|
-
var
|
|
1860
|
-
return
|
|
1856
|
+
"%y": (v) => (v.tm_year + 1900).toString().substring(2),
|
|
1857
|
+
"%Y": (v) => v.tm_year + 1900,
|
|
1858
|
+
"%z": (v) => {
|
|
1859
|
+
var w = v.tm_gmtoff, te = w >= 0;
|
|
1860
|
+
return w = Math.abs(w) / 60, w = w / 60 * 100 + w % 60, (te ? "+" : "-") + String("0000" + w).slice(-4);
|
|
1861
1861
|
},
|
|
1862
|
-
"%Z": (
|
|
1862
|
+
"%Z": (v) => v.tm_zone,
|
|
1863
1863
|
"%%": () => "%"
|
|
1864
1864
|
};
|
|
1865
1865
|
o = o.replace(/%%/g, "\0\0");
|
|
1866
|
-
for (var
|
|
1867
|
-
o.includes(
|
|
1866
|
+
for (var d in Q)
|
|
1867
|
+
o.includes(d) && (o = o.replace(new RegExp(d, "g"), Q[d](s)));
|
|
1868
1868
|
o = o.replace(/\0\0/g, "%");
|
|
1869
|
-
var
|
|
1870
|
-
return
|
|
1869
|
+
var Z = wa(o, !1);
|
|
1870
|
+
return Z.length > t ? 0 : (Ta(Z, e), Z.length - 1);
|
|
1871
1871
|
};
|
|
1872
|
-
|
|
1873
|
-
function
|
|
1874
|
-
|
|
1875
|
-
}
|
|
1876
|
-
var
|
|
1877
|
-
__cxa_throw:
|
|
1878
|
-
__handle_stack_overflow:
|
|
1879
|
-
__syscall_fcntl64:
|
|
1880
|
-
__syscall_openat:
|
|
1881
|
-
_embind_finalize_value_object:
|
|
1882
|
-
_embind_register_bigint:
|
|
1883
|
-
_embind_register_bool:
|
|
1884
|
-
_embind_register_class:
|
|
1885
|
-
_embind_register_class_constructor:
|
|
1886
|
-
_embind_register_class_function:
|
|
1887
|
-
_embind_register_emval:
|
|
1888
|
-
_embind_register_float:
|
|
1889
|
-
_embind_register_integer:
|
|
1890
|
-
_embind_register_memory_view:
|
|
1891
|
-
_embind_register_std_string:
|
|
1892
|
-
_embind_register_std_wstring:
|
|
1893
|
-
_embind_register_value_object:
|
|
1894
|
-
_embind_register_value_object_field:
|
|
1895
|
-
_embind_register_void:
|
|
1896
|
-
_emscripten_get_now_is_monotonic:
|
|
1897
|
-
_emval_as:
|
|
1898
|
-
_emval_await:
|
|
1899
|
-
_emval_call:
|
|
1900
|
-
_emval_decref:
|
|
1901
|
-
_emval_get_property:
|
|
1902
|
-
_emval_incref:
|
|
1903
|
-
_emval_new_cstring:
|
|
1904
|
-
_emval_run_destructors:
|
|
1905
|
-
_emval_take_value:
|
|
1906
|
-
_gmtime_js:
|
|
1907
|
-
_localtime_js:
|
|
1908
|
-
_mktime_js:
|
|
1909
|
-
_tzset_js:
|
|
1910
|
-
abort:
|
|
1911
|
-
emscripten_date_now:
|
|
1912
|
-
emscripten_get_heap_max:
|
|
1913
|
-
emscripten_get_now:
|
|
1914
|
-
emscripten_resize_heap:
|
|
1915
|
-
environ_get:
|
|
1916
|
-
environ_sizes_get:
|
|
1917
|
-
fd_close:
|
|
1918
|
-
fd_fdstat_get:
|
|
1919
|
-
fd_read:
|
|
1920
|
-
fd_seek:
|
|
1921
|
-
fd_write:
|
|
1922
|
-
strftime:
|
|
1872
|
+
mr = i.InternalError = It(Error, "InternalError"), Un(), Re = i.BindingError = It(Error, "BindingError"), Zn(), Vn(), si(), Er = i.UnboundTypeError = It(Error, "UnboundTypeError"), Ti();
|
|
1873
|
+
function Ea() {
|
|
1874
|
+
mn("fetchSettings");
|
|
1875
|
+
}
|
|
1876
|
+
var jt = {
|
|
1877
|
+
__cxa_throw: In,
|
|
1878
|
+
__handle_stack_overflow: Dn,
|
|
1879
|
+
__syscall_fcntl64: Mn,
|
|
1880
|
+
__syscall_openat: $n,
|
|
1881
|
+
_embind_finalize_value_object: kn,
|
|
1882
|
+
_embind_register_bigint: xn,
|
|
1883
|
+
_embind_register_bool: Ln,
|
|
1884
|
+
_embind_register_class: di,
|
|
1885
|
+
_embind_register_class_constructor: gi,
|
|
1886
|
+
_embind_register_class_function: yi,
|
|
1887
|
+
_embind_register_emval: Ci,
|
|
1888
|
+
_embind_register_float: Si,
|
|
1889
|
+
_embind_register_integer: Pi,
|
|
1890
|
+
_embind_register_memory_view: Ai,
|
|
1891
|
+
_embind_register_std_string: Ii,
|
|
1892
|
+
_embind_register_std_wstring: xi,
|
|
1893
|
+
_embind_register_value_object: Ui,
|
|
1894
|
+
_embind_register_value_object_field: Li,
|
|
1895
|
+
_embind_register_void: Ni,
|
|
1896
|
+
_emscripten_get_now_is_monotonic: Hi,
|
|
1897
|
+
_emval_as: Yi,
|
|
1898
|
+
_emval_await: $r,
|
|
1899
|
+
_emval_call: zi,
|
|
1900
|
+
_emval_decref: Ut,
|
|
1901
|
+
_emval_get_property: Vi,
|
|
1902
|
+
_emval_incref: Bi,
|
|
1903
|
+
_emval_new_cstring: Ji,
|
|
1904
|
+
_emval_run_destructors: qi,
|
|
1905
|
+
_emval_take_value: Ki,
|
|
1906
|
+
_gmtime_js: Zi,
|
|
1907
|
+
_localtime_js: ta,
|
|
1908
|
+
_mktime_js: ra,
|
|
1909
|
+
_tzset_js: na,
|
|
1910
|
+
abort: ia,
|
|
1911
|
+
emscripten_date_now: aa,
|
|
1912
|
+
emscripten_get_heap_max: oa,
|
|
1913
|
+
emscripten_get_now: ct,
|
|
1914
|
+
emscripten_resize_heap: la,
|
|
1915
|
+
environ_get: fa,
|
|
1916
|
+
environ_sizes_get: da,
|
|
1917
|
+
fd_close: _a,
|
|
1918
|
+
fd_fdstat_get: va,
|
|
1919
|
+
fd_read: ha,
|
|
1920
|
+
fd_seek: ma,
|
|
1921
|
+
fd_write: ga,
|
|
1922
|
+
strftime: Ca
|
|
1923
1923
|
};
|
|
1924
|
-
|
|
1925
|
-
var
|
|
1926
|
-
|
|
1927
|
-
var
|
|
1928
|
-
return (
|
|
1929
|
-
},
|
|
1930
|
-
return (
|
|
1931
|
-
},
|
|
1932
|
-
return (
|
|
1933
|
-
},
|
|
1934
|
-
return (
|
|
1935
|
-
},
|
|
1936
|
-
|
|
1937
|
-
var
|
|
1938
|
-
|
|
1939
|
-
var
|
|
1924
|
+
g.instrumentWasmImports(jt), hn();
|
|
1925
|
+
var ge = A("free"), ft = A("malloc"), Sa = i._main = A("main"), Fa = A("__getTypeName");
|
|
1926
|
+
i.__embind_initialize_bindings = A("_embind_initialize_bindings");
|
|
1927
|
+
var Pa = i._fflush = A("fflush"), Nr = function() {
|
|
1928
|
+
return (Nr = i.asm.emscripten_stack_init).apply(null, arguments);
|
|
1929
|
+
}, zt = function() {
|
|
1930
|
+
return (zt = i.asm.emscripten_stack_get_base).apply(null, arguments);
|
|
1931
|
+
}, Je = function() {
|
|
1932
|
+
return (Je = i.asm.emscripten_stack_get_end).apply(null, arguments);
|
|
1933
|
+
}, Wr = function() {
|
|
1934
|
+
return (Wr = i.asm.emscripten_stack_get_current).apply(null, arguments);
|
|
1935
|
+
}, Aa = A("__cxa_is_pointer_type"), Ia = i.___set_stack_limits = A("__set_stack_limits");
|
|
1936
|
+
i.dynCall_viiii = A("dynCall_viiii"), i.dynCall_dd = A("dynCall_dd"), i.dynCall_ii = A("dynCall_ii"), i.dynCall_vii = A("dynCall_vii"), i.dynCall_iii = A("dynCall_iii"), i.dynCall_iiii = A("dynCall_iiii"), i.dynCall_jiji = A("dynCall_jiji"), i.dynCall_ijiii = A("dynCall_ijiii"), i.dynCall_iiiiiii = A("dynCall_iiiiiii"), i.dynCall_vi = A("dynCall_vi"), i.dynCall_viiiiii = A("dynCall_viiiiii"), i.dynCall_viiiii = A("dynCall_viiiii"), i.dynCall_iiiiii = A("dynCall_iiiiii"), i.dynCall_viii = A("dynCall_viii"), i.dynCall_viiiiiiii = A("dynCall_viiiiiiii"), i.dynCall_viiiiiiiiii = A("dynCall_viiiiiiiiii"), i.dynCall_viiiiiiiii = A("dynCall_viiiiiiiii"), i.dynCall_v = A("dynCall_v"), i.dynCall_iiiii = A("dynCall_iiiii"), i.dynCall_viiiiiii = A("dynCall_viiiiiii"), i.dynCall_viiiiiiiiiiii = A("dynCall_viiiiiiiiiiii"), i.dynCall_viiiiiiiiiiiiii = A("dynCall_viiiiiiiiiiiiii"), i.dynCall_viiiiiiiiiii = A("dynCall_viiiiiiiiiii"), i.dynCall_viifi = A("dynCall_viifi"), i.dynCall_fiii = A("dynCall_fiii"), i.dynCall_viidi = A("dynCall_viidi"), i.dynCall_viiiiiifi = A("dynCall_viiiiiifi"), i.dynCall_viiiifii = A("dynCall_viiiifii"), i.dynCall_fii = A("dynCall_fii"), i.dynCall_iiiji = A("dynCall_iiiji"), i.dynCall_i = A("dynCall_i"), i.dynCall_dii = A("dynCall_dii"), i.dynCall_viid = A("dynCall_viid"), i.dynCall_iidiiii = A("dynCall_iidiiii");
|
|
1937
|
+
var Da = A("asyncify_start_unwind"), Ma = A("asyncify_stop_unwind"), $a = A("asyncify_start_rewind"), Oa = A("asyncify_stop_rewind");
|
|
1938
|
+
i._ff_h264_cabac_tables = 145716;
|
|
1939
|
+
var Ra = [
|
|
1940
1940
|
"zeroMemory",
|
|
1941
1941
|
"inetPton4",
|
|
1942
1942
|
"inetNtop4",
|
|
@@ -2091,8 +2091,8 @@ return ret;
|
|
|
2091
2091
|
"emval_allocateDestructors",
|
|
2092
2092
|
"emval_addMethodCaller"
|
|
2093
2093
|
];
|
|
2094
|
-
|
|
2095
|
-
var
|
|
2094
|
+
Ra.forEach(gn);
|
|
2095
|
+
var ka = [
|
|
2096
2096
|
"run",
|
|
2097
2097
|
"addOnPreRun",
|
|
2098
2098
|
"addOnInit",
|
|
@@ -2302,125 +2302,524 @@ return ret;
|
|
|
2302
2302
|
"emval_methodCallers",
|
|
2303
2303
|
"emval_registeredMethods"
|
|
2304
2304
|
];
|
|
2305
|
-
|
|
2306
|
-
var
|
|
2307
|
-
|
|
2308
|
-
|
|
2305
|
+
ka.forEach(fr);
|
|
2306
|
+
var dt;
|
|
2307
|
+
Ne = function e() {
|
|
2308
|
+
dt || Hr(), dt || (Ne = e);
|
|
2309
2309
|
};
|
|
2310
|
-
function
|
|
2311
|
-
|
|
2312
|
-
var e =
|
|
2310
|
+
function xa() {
|
|
2311
|
+
p(be == 0, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'), p(wt.length == 0, "cannot call main when preRun functions remain to be called");
|
|
2312
|
+
var e = Sa, t = 0, r = 0;
|
|
2313
2313
|
try {
|
|
2314
2314
|
var n = e(t, r);
|
|
2315
|
-
return
|
|
2316
|
-
} catch (
|
|
2317
|
-
return
|
|
2315
|
+
return Pr(n, !0), n;
|
|
2316
|
+
} catch (a) {
|
|
2317
|
+
return xt(a);
|
|
2318
2318
|
}
|
|
2319
2319
|
}
|
|
2320
|
-
function
|
|
2321
|
-
|
|
2320
|
+
function Ua() {
|
|
2321
|
+
Nr(), Xr();
|
|
2322
2322
|
}
|
|
2323
|
-
function
|
|
2324
|
-
if (
|
|
2323
|
+
function Hr() {
|
|
2324
|
+
if (be > 0 || (Ua(), tn(), be > 0))
|
|
2325
2325
|
return;
|
|
2326
2326
|
function e() {
|
|
2327
|
-
|
|
2327
|
+
dt || (dt = !0, i.calledRun = !0, !_e && (rn(), nn(), k(i), i.onRuntimeInitialized && i.onRuntimeInitialized(), Yr && xa(), an()));
|
|
2328
2328
|
}
|
|
2329
|
-
|
|
2329
|
+
i.setStatus ? (i.setStatus("Running..."), setTimeout(function() {
|
|
2330
2330
|
setTimeout(function() {
|
|
2331
|
-
|
|
2331
|
+
i.setStatus("");
|
|
2332
2332
|
}, 1), e();
|
|
2333
|
-
}, 1)) : e(),
|
|
2333
|
+
}, 1)) : e(), Le();
|
|
2334
2334
|
}
|
|
2335
|
-
function
|
|
2336
|
-
var e =
|
|
2337
|
-
|
|
2335
|
+
function La() {
|
|
2336
|
+
var e = U, t = T, r = !1;
|
|
2337
|
+
U = T = (n) => {
|
|
2338
2338
|
r = !0;
|
|
2339
2339
|
};
|
|
2340
2340
|
try {
|
|
2341
|
-
|
|
2341
|
+
pa();
|
|
2342
2342
|
} catch {
|
|
2343
2343
|
}
|
|
2344
|
-
|
|
2344
|
+
U = e, T = t, r && (fe("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc."), fe("(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)"));
|
|
2345
2345
|
}
|
|
2346
|
-
if (
|
|
2347
|
-
for (typeof
|
|
2348
|
-
|
|
2349
|
-
var
|
|
2350
|
-
return
|
|
2346
|
+
if (i.preInit)
|
|
2347
|
+
for (typeof i.preInit == "function" && (i.preInit = [i.preInit]); i.preInit.length > 0; )
|
|
2348
|
+
i.preInit.pop()();
|
|
2349
|
+
var Yr = !0;
|
|
2350
|
+
return i.noInitialRun && (Yr = !1), Hr(), P.ready;
|
|
2351
2351
|
};
|
|
2352
2352
|
})();
|
|
2353
|
-
|
|
2354
|
-
})(
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2357
|
-
|
|
2353
|
+
c.exports = _;
|
|
2354
|
+
})(za);
|
|
2355
|
+
const Va = Qt;
|
|
2356
|
+
var Jt = {}, Ba = {
|
|
2357
|
+
get exports() {
|
|
2358
|
+
return Jt;
|
|
2359
|
+
},
|
|
2360
|
+
set exports(c) {
|
|
2361
|
+
Jt = c;
|
|
2362
|
+
}
|
|
2363
|
+
};
|
|
2364
|
+
(function(c) {
|
|
2365
|
+
var u = Object.prototype.hasOwnProperty, _ = "~";
|
|
2366
|
+
function h() {
|
|
2367
|
+
}
|
|
2368
|
+
Object.create && (h.prototype = /* @__PURE__ */ Object.create(null), new h().__proto__ || (_ = !1));
|
|
2369
|
+
function P(M, C, E) {
|
|
2370
|
+
this.fn = M, this.context = C, this.once = E || !1;
|
|
2371
|
+
}
|
|
2372
|
+
function i(M, C, E, O, Y) {
|
|
2373
|
+
if (typeof E != "function")
|
|
2374
|
+
throw new TypeError("The listener must be a function");
|
|
2375
|
+
var V = new P(E, O || M, Y), H = _ ? _ + C : C;
|
|
2376
|
+
return M._events[H] ? M._events[H].fn ? M._events[H] = [M._events[H], V] : M._events[H].push(V) : (M._events[H] = V, M._eventsCount++), M;
|
|
2377
|
+
}
|
|
2378
|
+
function k(M, C) {
|
|
2379
|
+
--M._eventsCount === 0 ? M._events = new h() : delete M._events[C];
|
|
2380
|
+
}
|
|
2381
|
+
function D() {
|
|
2382
|
+
this._events = new h(), this._eventsCount = 0;
|
|
2383
|
+
}
|
|
2384
|
+
D.prototype.eventNames = function() {
|
|
2385
|
+
var C = [], E, O;
|
|
2386
|
+
if (this._eventsCount === 0)
|
|
2387
|
+
return C;
|
|
2388
|
+
for (O in E = this._events)
|
|
2389
|
+
u.call(E, O) && C.push(_ ? O.slice(1) : O);
|
|
2390
|
+
return Object.getOwnPropertySymbols ? C.concat(Object.getOwnPropertySymbols(E)) : C;
|
|
2391
|
+
}, D.prototype.listeners = function(C) {
|
|
2392
|
+
var E = _ ? _ + C : C, O = this._events[E];
|
|
2393
|
+
if (!O)
|
|
2394
|
+
return [];
|
|
2395
|
+
if (O.fn)
|
|
2396
|
+
return [O.fn];
|
|
2397
|
+
for (var Y = 0, V = O.length, H = new Array(V); Y < V; Y++)
|
|
2398
|
+
H[Y] = O[Y].fn;
|
|
2399
|
+
return H;
|
|
2400
|
+
}, D.prototype.listenerCount = function(C) {
|
|
2401
|
+
var E = _ ? _ + C : C, O = this._events[E];
|
|
2402
|
+
return O ? O.fn ? 1 : O.length : 0;
|
|
2403
|
+
}, D.prototype.emit = function(C, E, O, Y, V, H) {
|
|
2404
|
+
var W = _ ? _ + C : C;
|
|
2405
|
+
if (!this._events[W])
|
|
2406
|
+
return !1;
|
|
2407
|
+
var $ = this._events[W], N = arguments.length, U, T;
|
|
2408
|
+
if ($.fn) {
|
|
2409
|
+
switch ($.once && this.removeListener(C, $.fn, void 0, !0), N) {
|
|
2410
|
+
case 1:
|
|
2411
|
+
return $.fn.call($.context), !0;
|
|
2412
|
+
case 2:
|
|
2413
|
+
return $.fn.call($.context, E), !0;
|
|
2414
|
+
case 3:
|
|
2415
|
+
return $.fn.call($.context, E, O), !0;
|
|
2416
|
+
case 4:
|
|
2417
|
+
return $.fn.call($.context, E, O, Y), !0;
|
|
2418
|
+
case 5:
|
|
2419
|
+
return $.fn.call($.context, E, O, Y, V), !0;
|
|
2420
|
+
case 6:
|
|
2421
|
+
return $.fn.call($.context, E, O, Y, V, H), !0;
|
|
2422
|
+
}
|
|
2423
|
+
for (T = 1, U = new Array(N - 1); T < N; T++)
|
|
2424
|
+
U[T - 1] = arguments[T];
|
|
2425
|
+
$.fn.apply($.context, U);
|
|
2426
|
+
} else {
|
|
2427
|
+
var q = $.length, se;
|
|
2428
|
+
for (T = 0; T < q; T++)
|
|
2429
|
+
switch ($[T].once && this.removeListener(C, $[T].fn, void 0, !0), N) {
|
|
2430
|
+
case 1:
|
|
2431
|
+
$[T].fn.call($[T].context);
|
|
2432
|
+
break;
|
|
2433
|
+
case 2:
|
|
2434
|
+
$[T].fn.call($[T].context, E);
|
|
2435
|
+
break;
|
|
2436
|
+
case 3:
|
|
2437
|
+
$[T].fn.call($[T].context, E, O);
|
|
2438
|
+
break;
|
|
2439
|
+
case 4:
|
|
2440
|
+
$[T].fn.call($[T].context, E, O, Y);
|
|
2441
|
+
break;
|
|
2442
|
+
default:
|
|
2443
|
+
if (!U)
|
|
2444
|
+
for (se = 1, U = new Array(N - 1); se < N; se++)
|
|
2445
|
+
U[se - 1] = arguments[se];
|
|
2446
|
+
$[T].fn.apply($[T].context, U);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
return !0;
|
|
2450
|
+
}, D.prototype.on = function(C, E, O) {
|
|
2451
|
+
return i(this, C, E, O, !1);
|
|
2452
|
+
}, D.prototype.once = function(C, E, O) {
|
|
2453
|
+
return i(this, C, E, O, !0);
|
|
2454
|
+
}, D.prototype.removeListener = function(C, E, O, Y) {
|
|
2455
|
+
var V = _ ? _ + C : C;
|
|
2456
|
+
if (!this._events[V])
|
|
2457
|
+
return this;
|
|
2458
|
+
if (!E)
|
|
2459
|
+
return k(this, V), this;
|
|
2460
|
+
var H = this._events[V];
|
|
2461
|
+
if (H.fn)
|
|
2462
|
+
H.fn === E && (!Y || H.once) && (!O || H.context === O) && k(this, V);
|
|
2463
|
+
else {
|
|
2464
|
+
for (var W = 0, $ = [], N = H.length; W < N; W++)
|
|
2465
|
+
(H[W].fn !== E || Y && !H[W].once || O && H[W].context !== O) && $.push(H[W]);
|
|
2466
|
+
$.length ? this._events[V] = $.length === 1 ? $[0] : $ : k(this, V);
|
|
2467
|
+
}
|
|
2468
|
+
return this;
|
|
2469
|
+
}, D.prototype.removeAllListeners = function(C) {
|
|
2470
|
+
var E;
|
|
2471
|
+
return C ? (E = _ ? _ + C : C, this._events[E] && k(this, E)) : (this._events = new h(), this._eventsCount = 0), this;
|
|
2472
|
+
}, D.prototype.off = D.prototype.removeListener, D.prototype.addListener = D.prototype.on, D.prefixed = _, D.EventEmitter = D, c.exports = D;
|
|
2473
|
+
})(Ba);
|
|
2474
|
+
const Ga = Jt;
|
|
2475
|
+
class Kr extends Error {
|
|
2476
|
+
constructor(u) {
|
|
2477
|
+
super(u), this.name = "TimeoutError";
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
let Qa = class extends Error {
|
|
2481
|
+
constructor(u) {
|
|
2482
|
+
super(), this.name = "AbortError", this.message = u;
|
|
2483
|
+
}
|
|
2484
|
+
};
|
|
2485
|
+
const jr = (c) => globalThis.DOMException === void 0 ? new Qa(c) : new DOMException(c), zr = (c) => {
|
|
2486
|
+
const u = c.reason === void 0 ? jr("This operation was aborted.") : c.reason;
|
|
2487
|
+
return u instanceof Error ? u : jr(u);
|
|
2488
|
+
};
|
|
2489
|
+
function Ja(c, u, _, h) {
|
|
2490
|
+
let P;
|
|
2491
|
+
const i = new Promise((k, D) => {
|
|
2492
|
+
if (typeof u != "number" || Math.sign(u) !== 1)
|
|
2493
|
+
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${u}\``);
|
|
2494
|
+
if (u === Number.POSITIVE_INFINITY) {
|
|
2495
|
+
k(c);
|
|
2496
|
+
return;
|
|
2497
|
+
}
|
|
2498
|
+
if (h = {
|
|
2499
|
+
customTimers: { setTimeout, clearTimeout },
|
|
2500
|
+
...h
|
|
2501
|
+
}, h.signal) {
|
|
2502
|
+
const { signal: M } = h;
|
|
2503
|
+
M.aborted && D(zr(M)), M.addEventListener("abort", () => {
|
|
2504
|
+
D(zr(M));
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
P = h.customTimers.setTimeout.call(void 0, () => {
|
|
2508
|
+
if (typeof _ == "function") {
|
|
2509
|
+
try {
|
|
2510
|
+
k(_());
|
|
2511
|
+
} catch (E) {
|
|
2512
|
+
D(E);
|
|
2513
|
+
}
|
|
2514
|
+
return;
|
|
2515
|
+
}
|
|
2516
|
+
const M = typeof _ == "string" ? _ : `Promise timed out after ${u} milliseconds`, C = _ instanceof Error ? _ : new Kr(M);
|
|
2517
|
+
typeof c.cancel == "function" && c.cancel(), D(C);
|
|
2518
|
+
}, u), (async () => {
|
|
2519
|
+
try {
|
|
2520
|
+
k(await c);
|
|
2521
|
+
} catch (M) {
|
|
2522
|
+
D(M);
|
|
2523
|
+
} finally {
|
|
2524
|
+
h.customTimers.clearTimeout.call(void 0, P);
|
|
2525
|
+
}
|
|
2526
|
+
})();
|
|
2527
|
+
});
|
|
2528
|
+
return i.clear = () => {
|
|
2529
|
+
clearTimeout(P), P = void 0;
|
|
2530
|
+
}, i;
|
|
2531
|
+
}
|
|
2532
|
+
function qa(c, u, _) {
|
|
2533
|
+
let h = 0, P = c.length;
|
|
2534
|
+
for (; P > 0; ) {
|
|
2535
|
+
const i = Math.trunc(P / 2);
|
|
2536
|
+
let k = h + i;
|
|
2537
|
+
_(c[k], u) <= 0 ? (h = ++k, P -= i + 1) : P = i;
|
|
2538
|
+
}
|
|
2539
|
+
return h;
|
|
2540
|
+
}
|
|
2541
|
+
var De = globalThis && globalThis.__classPrivateFieldGet || function(c, u, _, h) {
|
|
2542
|
+
if (_ === "a" && !h)
|
|
2543
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
2544
|
+
if (typeof u == "function" ? c !== u || !h : !u.has(c))
|
|
2545
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2546
|
+
return _ === "m" ? h : _ === "a" ? h.call(c) : h ? h.value : u.get(c);
|
|
2547
|
+
}, ye;
|
|
2548
|
+
class Ka {
|
|
2549
|
+
constructor() {
|
|
2550
|
+
ye.set(this, []);
|
|
2551
|
+
}
|
|
2552
|
+
enqueue(u, _) {
|
|
2553
|
+
_ = {
|
|
2554
|
+
priority: 0,
|
|
2555
|
+
..._
|
|
2556
|
+
};
|
|
2557
|
+
const h = {
|
|
2558
|
+
priority: _.priority,
|
|
2559
|
+
run: u
|
|
2560
|
+
};
|
|
2561
|
+
if (this.size && De(this, ye, "f")[this.size - 1].priority >= _.priority) {
|
|
2562
|
+
De(this, ye, "f").push(h);
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
const P = qa(De(this, ye, "f"), h, (i, k) => k.priority - i.priority);
|
|
2566
|
+
De(this, ye, "f").splice(P, 0, h);
|
|
2567
|
+
}
|
|
2568
|
+
dequeue() {
|
|
2569
|
+
const u = De(this, ye, "f").shift();
|
|
2570
|
+
return u?.run;
|
|
2571
|
+
}
|
|
2572
|
+
filter(u) {
|
|
2573
|
+
return De(this, ye, "f").filter((_) => _.priority === u.priority).map((_) => _.run);
|
|
2574
|
+
}
|
|
2575
|
+
get size() {
|
|
2576
|
+
return De(this, ye, "f").length;
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
ye = /* @__PURE__ */ new WeakMap();
|
|
2580
|
+
var j = globalThis && globalThis.__classPrivateFieldSet || function(c, u, _, h, P) {
|
|
2581
|
+
if (h === "m")
|
|
2582
|
+
throw new TypeError("Private method is not writable");
|
|
2583
|
+
if (h === "a" && !P)
|
|
2584
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
2585
|
+
if (typeof u == "function" ? c !== u || !P : !u.has(c))
|
|
2586
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2587
|
+
return h === "a" ? P.call(c, _) : P ? P.value = _ : u.set(c, _), _;
|
|
2588
|
+
}, b = globalThis && globalThis.__classPrivateFieldGet || function(c, u, _, h) {
|
|
2589
|
+
if (_ === "a" && !h)
|
|
2590
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
2591
|
+
if (typeof u == "function" ? c !== u || !h : !u.has(c))
|
|
2592
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2593
|
+
return _ === "m" ? h : _ === "a" ? h.call(c) : h ? h.value : u.get(c);
|
|
2594
|
+
}, G, Ze, Xe, Ee, yt, et, vt, ce, Ke, ne, ht, ie, tt, Ce, mt, Vr, Br, Zr, Gr, Qr, Jr, pt, Vt, Bt, bt, gt;
|
|
2595
|
+
const Za = new Kr();
|
|
2596
|
+
class Xa extends Error {
|
|
2597
|
+
}
|
|
2598
|
+
class eo extends Ga {
|
|
2599
|
+
constructor(u) {
|
|
2600
|
+
var _, h, P, i;
|
|
2601
|
+
if (super(), G.add(this), Ze.set(this, void 0), Xe.set(this, void 0), Ee.set(this, 0), yt.set(this, void 0), et.set(this, void 0), vt.set(this, 0), ce.set(this, void 0), Ke.set(this, void 0), ne.set(this, void 0), ht.set(this, void 0), ie.set(this, 0), tt.set(this, void 0), Ce.set(this, void 0), mt.set(this, void 0), Object.defineProperty(this, "timeout", {
|
|
2602
|
+
enumerable: !0,
|
|
2603
|
+
configurable: !0,
|
|
2604
|
+
writable: !0,
|
|
2605
|
+
value: void 0
|
|
2606
|
+
}), u = {
|
|
2607
|
+
carryoverConcurrencyCount: !1,
|
|
2608
|
+
intervalCap: Number.POSITIVE_INFINITY,
|
|
2609
|
+
interval: 0,
|
|
2610
|
+
concurrency: Number.POSITIVE_INFINITY,
|
|
2611
|
+
autoStart: !0,
|
|
2612
|
+
queueClass: Ka,
|
|
2613
|
+
...u
|
|
2614
|
+
}, !(typeof u.intervalCap == "number" && u.intervalCap >= 1))
|
|
2615
|
+
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(h = (_ = u.intervalCap) === null || _ === void 0 ? void 0 : _.toString()) !== null && h !== void 0 ? h : ""}\` (${typeof u.intervalCap})`);
|
|
2616
|
+
if (u.interval === void 0 || !(Number.isFinite(u.interval) && u.interval >= 0))
|
|
2617
|
+
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(i = (P = u.interval) === null || P === void 0 ? void 0 : P.toString()) !== null && i !== void 0 ? i : ""}\` (${typeof u.interval})`);
|
|
2618
|
+
j(this, Ze, u.carryoverConcurrencyCount, "f"), j(this, Xe, u.intervalCap === Number.POSITIVE_INFINITY || u.interval === 0, "f"), j(this, yt, u.intervalCap, "f"), j(this, et, u.interval, "f"), j(this, ne, new u.queueClass(), "f"), j(this, ht, u.queueClass, "f"), this.concurrency = u.concurrency, this.timeout = u.timeout, j(this, mt, u.throwOnTimeout === !0, "f"), j(this, Ce, u.autoStart === !1, "f");
|
|
2619
|
+
}
|
|
2620
|
+
get concurrency() {
|
|
2621
|
+
return b(this, tt, "f");
|
|
2622
|
+
}
|
|
2623
|
+
set concurrency(u) {
|
|
2624
|
+
if (!(typeof u == "number" && u >= 1))
|
|
2625
|
+
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${u}\` (${typeof u})`);
|
|
2626
|
+
j(this, tt, u, "f"), b(this, G, "m", bt).call(this);
|
|
2627
|
+
}
|
|
2628
|
+
async add(u, _ = {}) {
|
|
2629
|
+
return new Promise((h, P) => {
|
|
2630
|
+
const i = async () => {
|
|
2631
|
+
var k, D, M;
|
|
2632
|
+
j(this, ie, (D = b(this, ie, "f"), D++, D), "f"), j(this, Ee, (M = b(this, Ee, "f"), M++, M), "f");
|
|
2633
|
+
try {
|
|
2634
|
+
if (!((k = _.signal) === null || k === void 0) && k.aborted) {
|
|
2635
|
+
P(new Xa("The task was aborted."));
|
|
2636
|
+
return;
|
|
2637
|
+
}
|
|
2638
|
+
const E = await (this.timeout === void 0 && _.timeout === void 0 ? u({ signal: _.signal }) : Ja(Promise.resolve(u({ signal: _.signal })), _.timeout === void 0 ? this.timeout : _.timeout, () => {
|
|
2639
|
+
(_.throwOnTimeout === void 0 ? b(this, mt, "f") : _.throwOnTimeout) && P(Za);
|
|
2640
|
+
}));
|
|
2641
|
+
h(E), this.emit("completed", E);
|
|
2642
|
+
} catch (C) {
|
|
2643
|
+
P(C), this.emit("error", C);
|
|
2644
|
+
}
|
|
2645
|
+
b(this, G, "m", Zr).call(this);
|
|
2646
|
+
};
|
|
2647
|
+
b(this, ne, "f").enqueue(i, _), b(this, G, "m", pt).call(this), this.emit("add");
|
|
2648
|
+
});
|
|
2649
|
+
}
|
|
2650
|
+
async addAll(u, _) {
|
|
2651
|
+
return Promise.all(u.map(async (h) => this.add(h, _)));
|
|
2652
|
+
}
|
|
2653
|
+
start() {
|
|
2654
|
+
return b(this, Ce, "f") ? (j(this, Ce, !1, "f"), b(this, G, "m", bt).call(this), this) : this;
|
|
2655
|
+
}
|
|
2656
|
+
pause() {
|
|
2657
|
+
j(this, Ce, !0, "f");
|
|
2658
|
+
}
|
|
2659
|
+
clear() {
|
|
2660
|
+
j(this, ne, new (b(this, ht, "f"))(), "f");
|
|
2661
|
+
}
|
|
2662
|
+
async onEmpty() {
|
|
2663
|
+
b(this, ne, "f").size !== 0 && await b(this, G, "m", gt).call(this, "empty");
|
|
2664
|
+
}
|
|
2665
|
+
async onSizeLessThan(u) {
|
|
2666
|
+
b(this, ne, "f").size < u || await b(this, G, "m", gt).call(this, "next", () => b(this, ne, "f").size < u);
|
|
2667
|
+
}
|
|
2668
|
+
async onIdle() {
|
|
2669
|
+
b(this, ie, "f") === 0 && b(this, ne, "f").size === 0 || await b(this, G, "m", gt).call(this, "idle");
|
|
2670
|
+
}
|
|
2671
|
+
get size() {
|
|
2672
|
+
return b(this, ne, "f").size;
|
|
2673
|
+
}
|
|
2674
|
+
sizeBy(u) {
|
|
2675
|
+
return b(this, ne, "f").filter(u).length;
|
|
2676
|
+
}
|
|
2677
|
+
get pending() {
|
|
2678
|
+
return b(this, ie, "f");
|
|
2679
|
+
}
|
|
2680
|
+
get isPaused() {
|
|
2681
|
+
return b(this, Ce, "f");
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
Ze = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakSet(), Vr = function() {
|
|
2685
|
+
return b(this, Xe, "f") || b(this, Ee, "f") < b(this, yt, "f");
|
|
2686
|
+
}, Br = function() {
|
|
2687
|
+
return b(this, ie, "f") < b(this, tt, "f");
|
|
2688
|
+
}, Zr = function() {
|
|
2689
|
+
var u;
|
|
2690
|
+
j(this, ie, (u = b(this, ie, "f"), u--, u), "f"), b(this, G, "m", pt).call(this), this.emit("next");
|
|
2691
|
+
}, Gr = function() {
|
|
2692
|
+
this.emit("empty"), b(this, ie, "f") === 0 && this.emit("idle");
|
|
2693
|
+
}, Qr = function() {
|
|
2694
|
+
b(this, G, "m", Bt).call(this), b(this, G, "m", Vt).call(this), j(this, Ke, void 0, "f");
|
|
2695
|
+
}, Jr = function() {
|
|
2696
|
+
const u = Date.now();
|
|
2697
|
+
if (b(this, ce, "f") === void 0) {
|
|
2698
|
+
const _ = b(this, vt, "f") - u;
|
|
2699
|
+
if (_ < 0)
|
|
2700
|
+
j(this, Ee, b(this, Ze, "f") ? b(this, ie, "f") : 0, "f");
|
|
2701
|
+
else
|
|
2702
|
+
return b(this, Ke, "f") === void 0 && j(this, Ke, setTimeout(() => {
|
|
2703
|
+
b(this, G, "m", Qr).call(this);
|
|
2704
|
+
}, _), "f"), !0;
|
|
2705
|
+
}
|
|
2706
|
+
return !1;
|
|
2707
|
+
}, pt = function() {
|
|
2708
|
+
if (b(this, ne, "f").size === 0)
|
|
2709
|
+
return b(this, ce, "f") && clearInterval(b(this, ce, "f")), j(this, ce, void 0, "f"), b(this, G, "m", Gr).call(this), !1;
|
|
2710
|
+
if (!b(this, Ce, "f")) {
|
|
2711
|
+
const u = !b(this, G, "a", Jr);
|
|
2712
|
+
if (b(this, G, "a", Vr) && b(this, G, "a", Br)) {
|
|
2713
|
+
const _ = b(this, ne, "f").dequeue();
|
|
2714
|
+
return _ ? (this.emit("active"), _(), u && b(this, G, "m", Vt).call(this), !0) : !1;
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
return !1;
|
|
2718
|
+
}, Vt = function() {
|
|
2719
|
+
b(this, Xe, "f") || b(this, ce, "f") !== void 0 || (j(this, ce, setInterval(() => {
|
|
2720
|
+
b(this, G, "m", Bt).call(this);
|
|
2721
|
+
}, b(this, et, "f")), "f"), j(this, vt, Date.now() + b(this, et, "f"), "f"));
|
|
2722
|
+
}, Bt = function() {
|
|
2723
|
+
b(this, Ee, "f") === 0 && b(this, ie, "f") === 0 && b(this, ce, "f") && (clearInterval(b(this, ce, "f")), j(this, ce, void 0, "f")), j(this, Ee, b(this, Ze, "f") ? b(this, ie, "f") : 0, "f"), b(this, G, "m", bt).call(this);
|
|
2724
|
+
}, bt = function() {
|
|
2725
|
+
for (; b(this, G, "m", pt).call(this); )
|
|
2726
|
+
;
|
|
2727
|
+
}, gt = async function(u, _) {
|
|
2728
|
+
return new Promise((h) => {
|
|
2729
|
+
const P = () => {
|
|
2730
|
+
_ && !_() || (this.off(u, P), h());
|
|
2731
|
+
};
|
|
2732
|
+
this.on(u, P);
|
|
2733
|
+
});
|
|
2734
|
+
};
|
|
2735
|
+
const qr = (c) => Va({
|
|
2736
|
+
locateFile: (u) => `${c}${u.replace("/dist", "")}`,
|
|
2737
|
+
printErr: (u) => u.includes("Timestamps are unset in a packet") || u.includes("Read error at pos.") ? void 0 : console.error(u)
|
|
2358
2738
|
});
|
|
2359
|
-
let
|
|
2360
|
-
const
|
|
2361
|
-
|
|
2362
|
-
let
|
|
2363
|
-
const
|
|
2739
|
+
let qe;
|
|
2740
|
+
const to = ja(async ({ publicPath: c, length: u, bufferSize: _, randomRead: h, streamRead: P, clearStream: i, write: k, attachment: D, subtitle: M }) => {
|
|
2741
|
+
qe || (qe = await qr(c));
|
|
2742
|
+
let C = new Uint8Array(0), E, O, Y;
|
|
2743
|
+
const V = () => {
|
|
2744
|
+
Y || (Y = new Promise((N, U) => {
|
|
2745
|
+
E = N, O = U;
|
|
2746
|
+
}));
|
|
2747
|
+
}, H = () => new qe.Remuxer({
|
|
2364
2748
|
promise: Promise.resolve(),
|
|
2365
|
-
length:
|
|
2366
|
-
bufferSize:
|
|
2367
|
-
error: (
|
|
2368
|
-
console.log("worker error",
|
|
2369
|
-
},
|
|
2370
|
-
subtitle: (F, M, z, ...H) => {
|
|
2371
|
-
ce(F, M, z, ...H);
|
|
2372
|
-
},
|
|
2373
|
-
attachment: (F, M, z) => {
|
|
2374
|
-
const H = new Uint8Array(z), A = H.buffer.slice(H.byteOffset, H.byteOffset + H.byteLength);
|
|
2375
|
-
U(F, M, A);
|
|
2749
|
+
length: u,
|
|
2750
|
+
bufferSize: _,
|
|
2751
|
+
error: (N, U) => {
|
|
2752
|
+
console.log("worker error", N, U);
|
|
2376
2753
|
},
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
return {
|
|
2380
|
-
...z,
|
|
2381
|
-
value: new Uint8Array(z.value ?? [])
|
|
2382
|
-
};
|
|
2754
|
+
subtitle: (N, U, T, ...q) => {
|
|
2755
|
+
M(N, U, T, ...q);
|
|
2383
2756
|
},
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
return await P(z, M);
|
|
2757
|
+
attachment: (N, U, T) => {
|
|
2758
|
+
const q = new Uint8Array(T), se = q.buffer.slice(q.byteOffset, q.byteOffset + q.byteLength);
|
|
2759
|
+
D(N, U, se);
|
|
2388
2760
|
},
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2761
|
+
streamRead: async (N) => Promise.race([
|
|
2762
|
+
new Promise((U) => {
|
|
2763
|
+
$.on("add", function T() {
|
|
2764
|
+
$.size !== 0 && (U(void 0), $.off("add", T));
|
|
2765
|
+
});
|
|
2766
|
+
}).then(() => ({
|
|
2767
|
+
buffer: void 0,
|
|
2768
|
+
done: !1,
|
|
2769
|
+
cancelled: !0
|
|
2770
|
+
})),
|
|
2771
|
+
P(Number(N)).then(({ buffer: U, done: T, cancelled: q }) => ({
|
|
2772
|
+
buffer: U ? new Uint8Array(U) : void 0,
|
|
2773
|
+
done: T,
|
|
2774
|
+
cancelled: q
|
|
2775
|
+
}))
|
|
2776
|
+
]),
|
|
2777
|
+
clearStream: () => i(),
|
|
2778
|
+
randomRead: async (N, U) => h(Number(N), U).then((T) => ({
|
|
2779
|
+
buffer: T ? new Uint8Array(T) : void 0,
|
|
2780
|
+
done: !1,
|
|
2781
|
+
cancelled: !1
|
|
2782
|
+
})),
|
|
2783
|
+
write: (N) => {
|
|
2784
|
+
const U = new Uint8Array(C.byteLength + N.byteLength);
|
|
2785
|
+
U.set(C), U.set(new Uint8Array(N), C.byteLength), C = U;
|
|
2392
2786
|
},
|
|
2393
|
-
flush: async (
|
|
2394
|
-
const
|
|
2395
|
-
|
|
2787
|
+
flush: async (N, U, T, q) => {
|
|
2788
|
+
const se = Number(N), Se = Number(U);
|
|
2789
|
+
if (!C.byteLength)
|
|
2790
|
+
return !0;
|
|
2791
|
+
if (!E)
|
|
2792
|
+
throw new Error("No readResultPromiseResolve on libav flush");
|
|
2793
|
+
return E({
|
|
2396
2794
|
isHeader: !1,
|
|
2397
|
-
offset:
|
|
2398
|
-
buffer:
|
|
2399
|
-
pos:
|
|
2400
|
-
pts:
|
|
2401
|
-
duration:
|
|
2402
|
-
}),
|
|
2795
|
+
offset: se,
|
|
2796
|
+
buffer: C.buffer,
|
|
2797
|
+
pos: Se,
|
|
2798
|
+
pts: T,
|
|
2799
|
+
duration: q
|
|
2800
|
+
}), E = void 0, O = void 0, Y = void 0, C = new Uint8Array(0), !1;
|
|
2801
|
+
},
|
|
2802
|
+
exit: () => {
|
|
2803
|
+
const N = O;
|
|
2804
|
+
E = void 0, O = void 0, Y = void 0, N?.(new Error("exit"));
|
|
2403
2805
|
}
|
|
2404
2806
|
});
|
|
2405
|
-
let
|
|
2807
|
+
let W = H();
|
|
2808
|
+
const $ = new eo({ concurrency: 1 });
|
|
2406
2809
|
return {
|
|
2407
|
-
init: async () => (
|
|
2408
|
-
K = F, xe = M;
|
|
2409
|
-
}), ee.init(), pe),
|
|
2810
|
+
init: async () => (C = new Uint8Array(0), qe = await qr(c), W = H(), V(), W.init(), Y),
|
|
2410
2811
|
destroy: () => {
|
|
2411
|
-
|
|
2812
|
+
W.destroy(), W = void 0, qe = void 0, C = new Uint8Array(0);
|
|
2412
2813
|
},
|
|
2413
|
-
seek: (
|
|
2414
|
-
read: () => (
|
|
2415
|
-
|
|
2416
|
-
}), ee.read(), pe),
|
|
2417
|
-
getInfo: () => ee.getInfo()
|
|
2814
|
+
seek: (N) => $.add(() => W.seek(N)),
|
|
2815
|
+
read: () => $.add(() => (V(), W.read(), Y)),
|
|
2816
|
+
getInfo: () => W.getInfo()
|
|
2418
2817
|
};
|
|
2419
|
-
}),
|
|
2420
|
-
init:
|
|
2818
|
+
}), ro = {
|
|
2819
|
+
init: to
|
|
2421
2820
|
};
|
|
2422
|
-
|
|
2821
|
+
Wa({
|
|
2423
2822
|
target: globalThis,
|
|
2424
|
-
resolvers:
|
|
2823
|
+
resolvers: ro
|
|
2425
2824
|
});
|
|
2426
2825
|
globalThis.postMessage("init");
|