// This code implements the `-sMODULARIZE` settings by taking the generated // JS program code (INNER_JS_CODE) and wrapping it in a factory function. // Single threaded MINIMAL_RUNTIME programs do not need access to // document.currentScript, so a simple export declaration is enough. var loadVosklet = (() => { // When MODULARIZE this JS may be executed later, // after document.currentScript is gone, so we save it. // In EXPORT_ES6 mode we can just use 'import.meta.url'. var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined; return async function(moduleArg = {}) { var moduleRtn; var k = moduleArg, aa = "em-ww" == globalThis.name, ba = "object" == typeof window, ca = "undefined" != typeof WorkerGlobalScope, da = "object" == typeof process && process.la?.node && "renderer" != process.type, ea = !ba && !da && !ca; if (ba) { var l = []; globalThis.m = l; let a = caches.open("Vosklet"), b = URL.createObjectURL(new Blob(["(", (() => { registerProcessor("VoskletTransferer", class extends AudioWorkletProcessor { constructor(e) { super(); this.m = 0; this.L = e.processorOptions[0]; this.H = new Float32Array(this.L); } process(e) { e[0][0] && (this.H.set(e[0][0], this.m), this.m += 128, this.m >= this.L && (this.m = 0, this.port.postMessage(this.H, [this.H.buffer]), this.H = new Float32Array(this.L))); return !0; } }); }).toString(), ")()"], {type:"text/javascript"})); class c extends EventTarget { constructor() { super(); l.push(this); } delete() { this.C.delete(); } static ca(e) { return 2 <= e.length && 31 === e[0] && 139 === e[1]; } static H(e) { return 262 < e.length && 117 === e[257] && 115 === e[258] && 116 === e[259] && 97 === e[260] && 114 === e[261]; } static async L(e) { const f = new DecompressionStream("gzip"); e = (new Response(e)).body.pipeThrough(f); return await (new Response(e)).arrayBuffer(); } static async m(e, f, g, h) { let n = new c(), v = new Promise((z, A) => { n.addEventListener("", C => { C.detail ? A(C.detail) : (h && (n.findWord = P => n.C.findWord(P)), z(n)); }, {once:!0}); }); const p = await caches.open("Vosklet"); f = f + "?" + g; let w = await p.match(f); if (w) { var u = await w.arrayBuffer(); 0 !== u.byteLength && c.H(new Uint8Array(u)) || (await p.delete(f), u = null); } if (!u) { u = await fetch(e, {cache:"no-store"}); if (!u.ok) { throw "Unable to fetch model, status: " + u.status; } u = await u.arrayBuffer(); e = new Uint8Array(u); if (0 === e.byteLength) { throw "Vosklet: Modell-Download ergab 0 Bytes."; } c.ca(e) && (u = await c.L(u), e = new Uint8Array(u)); if (!c.H(e)) { throw "Vosklet: Modell ist kein g\u00fcltiges USTAR/TAR."; } await p.put(f, new Response(u, {headers:{"Content-Type":"application/x-tar", "X-Vosklet-Format":"tar", "X-Vosklet-Model-Id":String(g)}})); } g = fa(u.byteLength); (q(), r).set(new Uint8Array(u), g); n.C = new k.CommonModel(l.length - 1, h, g, u.byteLength); return v; } } class d extends EventTarget { constructor() { super(); l.push(this); this.acceptWaveform = e => { let f = fa(4 * e.length); (q(), ha).set(e, f / 4); return this.C.acceptWaveform(f, e.length); }; } delete() { this.C.delete(); } static async m(e, f, g, h, n) { let v = new d(), p = new Promise((w, u) => { v.addEventListener("", z => { z.detail ? u(z.detail) : w(v); }, {once:!0}); }); switch(g) { case 1: v.C = new k.Recognizer(l.length - 1, f, e); break; case 2: v.C = new k.Recognizer(l.length - 1, f, e, n); break; default: v.C = new k.Recognizer(l.length - 1, f, e, h, 0); } return p; } } k = {getModelCache:() => a, cleanUp:async() => { for (let e of l) { await e.delete(); } URL.revokeObjectURL(b); }, createTransferer:async(e, f) => { await e.audioWorklet.addModule(b); return new AudioWorkletNode(e, "VoskletTransferer", {channelCountMode:"explicit", numberOfInputs:1, numberOfOutputs:0, channelCount:1, processorOptions:[f]}); }, createModel:(e, f, g) => c.m(e, f, g, !0), createSpkModel:(e, f, g) => c.m(e, f, g, !1), createRecognizer:(e, f) => d.m(e.C, f, 1), createRecognizerWithGrm:(e, f, g) => d.m(e.C, f, 3, g, null), createRecognizerWithSpkModel:(e, f, g) => d.m(e.C, f, 2, null, g.C)}; } ca && (_scriptName = self.location.href); var ia = "", ja, ka; if (ea) { if ("object" == typeof process && process.la?.node && "renderer" != process.type || "object" == typeof window || "undefined" != typeof WorkerGlobalScope) { throw 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?)"); } } else if (ba || ca) { try { ia = (new URL(".", _scriptName)).href; } catch { } if ("object" != typeof window && "undefined" == typeof WorkerGlobalScope) { throw 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?)"); } ca && (ka = a => { var b = new XMLHttpRequest(); b.open("GET", a, !1); b.responseType = "arraybuffer"; b.send(null); return new Uint8Array(b.response); }); ja = async a => { t(!la(a), "readAsync does not work with file:// URLs"); a = await fetch(a, {credentials:"same-origin"}); if (a.ok) { return a.arrayBuffer(); } throw Error(a.status + " : " + a.url); }; } else { throw Error("environment detection error"); } var ma = console.log.bind(console), x = console.error.bind(console); t(!da, "node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."); t(!ea, "shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."); "object" != typeof WebAssembly && x("no native wasm support detected"); var oa = !1; function t(a, b) { a || y("Assertion failed" + (b ? ": " + b : "")); } var la = a => a.startsWith("file://"); function pa() { var a = qa(); t(0 == (a & 3)); 0 == a && (a += 4); (q(), B)[a >> 2] = 34821223; (q(), B)[a + 4 >> 2] = 2310721022; (q(), B)[0] = 1668509029; } function ra() { if (!oa) { var a = qa(); 0 == a && (a += 4); var b = (q(), B)[a >> 2], c = (q(), B)[a + 4 >> 2]; 34821223 == b && 2310721022 == c || y(`Stack overflow! Stack cookie has been overwritten at ${sa(a)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${sa(c)} ${sa(b)}`); 1668509029 != (q(), B)[0] && y("Runtime error: The application has corrupted its heap memory area (address zero)!"); } } var ta = new Int16Array(1), ua = new Int8Array(ta.buffer); ta[0] = 25459; if (115 !== ua[0] || 99 !== ua[1]) { throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"; } function D(a) { return () => t(!1, `call to '${a}' via reference taken before Wasm module initialization`); } function E(a) { Object.getOwnPropertyDescriptor(k, a) && y(`\`Module.${a}\` was supplied but \`${a}\` not included in INCOMING_MODULE_JS_API`); } function va(a) { Object.getOwnPropertyDescriptor(k, a) || Object.defineProperty(k, a, {configurable:!0, get() { var b = `'${a}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`; "FS_createPath" !== a && "FS_createDataFile" !== a && "FS_createPreloadedFile" !== a && "FS_preloadFile" !== a && "FS_unlink" !== a && "addRunDependency" !== a && "removeRunDependency" !== a || (b += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"); y(b); }}); } function q() { F.buffer != wa.buffer && xa(); } var ya, za, Aa, G; aa && (onmessage = a => { onmessage = null; G = a = a.data; F = a.ra; xa(); Aa(a.ma); a.ma = a.oa = 0; }); var F, wa, r, Ba, I, J, B, ha, Ca, Da, Ea, Fa = !1; function xa() { var a = F.buffer; wa = new Int8Array(a); Ba = new Int16Array(a); r = new Uint8Array(a); I = new Uint16Array(a); J = new Int32Array(a); B = new Uint32Array(a); ha = new Float32Array(a); Ca = new Float64Array(a); Da = new BigInt64Array(a); Ea = new BigUint64Array(a); } t("undefined" != typeof Int32Array && "undefined" !== typeof Float64Array && void 0 != Int32Array.prototype.subarray && void 0 != Int32Array.prototype.set, "JS engine does not provide full typed array support"); function Ga() { t(!Fa); Fa = !0; aa ? (t(G), t(G.sa), t(0 == G.ja % 16), t(0 == G.ka % 16), Ha(G.ja, G.ka), pa(), Ia(), removeEventListener("message", Ja), Ka = Ka.forEach(La), addEventListener("message", La)) : (ra(), K.__wasm_call_ctors()); } var Ma = 0, Na = null, Oa = {}, L = null; function Pa() { Ma++; t("wasm-instantiate", "addRunDependency requires an ID"); t(!Oa["wasm-instantiate"]); Oa["wasm-instantiate"] = 1; null === L && "undefined" != typeof setInterval && (L = setInterval(() => { if (oa) { clearInterval(L), L = null; } else { var a = !1, b; for (b in Oa) { a || (a = !0, x("still waiting on run dependencies:")), x(`dependency: ${b}`); } a && x("(end of list)"); } }, 1e4)); } function y(a) { a = "Aborted(" + a + ")"; x(a); oa = !0; a = new WebAssembly.RuntimeError(a); za?.(a); throw a; } function Qa() { y("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"); } function M(a, b) { return (...c) => { t(Fa, `native function \`${a}\` called before runtime initialization`); var d = K[a]; t(d, `exported native function \`${a}\` not found`); t(c.length <= b, `native function \`${a}\` called with ${c.length} args but expects ${b}`); return d(...c); }; } var Ta; async function Ua(a) { try { var b = await ja(a); return new Uint8Array(b); } catch { } if (ka) { a = ka(a); } else { throw "both async and sync fetching of the wasm failed"; } return a; } async function Va(a, b) { try { var c = await Ua(a); return await WebAssembly.instantiate(c, b); } catch (d) { x(`failed to asynchronously prepare wasm: ${d}`), la(Ta) && x(`warning: Loading from a file URI (${Ta}) 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`), y(d); } } async function Wa(a) { var b = Ta; try { var c = fetch(b, {credentials:"same-origin"}); return await WebAssembly.instantiateStreaming(c, a); } catch (d) { x(`wasm streaming compile failed: ${d}`), x("falling back to ArrayBuffer instantiation"); } return Va(b, a); } function Xa() { Ya = {__assert_fail:Za, __cxa_throw:$a, _abort_js:ab, _embind_register_bigint:bb, _embind_register_bool:cb, _embind_register_class:db, _embind_register_class_constructor:eb, _embind_register_class_function:fb, _embind_register_emval:gb, _embind_register_enum:hb, _embind_register_enum_value:ib, _embind_register_float:jb, _embind_register_function:kb, _embind_register_integer:lb, _embind_register_memory_view:mb, _embind_register_std_string:nb, _embind_register_std_wstring:ob, _embind_register_void:pb, _tzset_js:qb, _wasmfs_copy_preloaded_file_data:rb, _wasmfs_get_num_preloaded_dirs:sb, _wasmfs_get_num_preloaded_files:tb, _wasmfs_get_preloaded_child_path:ub, _wasmfs_get_preloaded_file_mode:vb, _wasmfs_get_preloaded_file_size:wb, _wasmfs_get_preloaded_parent_path:xb, _wasmfs_get_preloaded_path_name:yb, _wasmfs_stdin_get_char:zb, clock_time_get:Ab, emscripten_console_error:Bb, emscripten_console_log:Cb, emscripten_console_warn:Db, emscripten_date_now:Eb, emscripten_err:Fb, emscripten_get_heap_max:Gb, emscripten_get_now:Ib, emscripten_out:Jb, emscripten_resize_heap:Kb, environ_get:Lb, environ_sizes_get:Mb, exit:Nb, fireEv:Ob, memory:F, random_get:Pb}; return {env:Ya, wasi_snapshot_preview1:Ya}; } class Qb { name="ExitStatus"; constructor(a) { this.message = `Program terminated with exit(${a})`; this.status = a; } } var Ka = [], Nb = (a, b) => { Rb(); b || (b = `program exited (with status: ${a}), but keepRuntimeAlive() is set (counter=${0}) 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)`, za?.(b), x(b)); throw new Qb(a); }, Tb = a => { if (oa) { x("user callback triggered after runtime exited or application aborted. Ignoring."); } else { try { a(); } catch (b) { if (a = b, !(a instanceof Qb || "unwind" == a)) { throw ra(), a instanceof WebAssembly.RuntimeError && 0 >= Sb() && x("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)"), a; } } } }, Ub = [], Vb, Wb = a => { var b = Ub[a]; b || (Ub[a] = b = Vb.get(a)); t(Vb.get(a) == b, "JavaScript-side Wasm function table mirror is out of date!"); return b; }, La = a => { let b = a.data, c = b._wsc; c && Tb(() => Wb(c)(...b.x)); }, Ja = a => { Ka.push(a); }, sa = a => { t("number" === typeof a); return "0x" + (a >>> 0).toString(16).padStart(8, "0"); }, N = a => { N.S || (N.S = {}); N.S[a] || (N.S[a] = 1, x(a)); }, Xb = new TextDecoder(), Yb = (a, b, c, d) => { c = b + c; if (d) { return c; } for (; a[b] && !(b >= c);) { ++b; } return b; }, O = (a, b, c) => { t("number" == typeof a, `UTF8ToString expects a number (got ${typeof a})`); if (!a) { return ""; } b = Yb((q(), r), a, b, c); return Xb.decode((q(), r).slice(a, b)); }, Za = (a, b, c, d) => y(`Assertion failed: ${O(a)}, at: ` + [b ? O(b) : "unknown filename", c, d ? O(d) : "unknown function"]); class Zb { constructor(a) { this.i = a - 24; } } var $b = 0, $a = (a, b, c) => { a = new Zb(a); (q(), B)[a.i + 16 >> 2] = 0; (q(), B)[a.i + 4 >> 2] = b; (q(), B)[a.i + 8 >> 2] = c; $b++; t(!1, "Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch."); }, ab = () => y("native code called abort()"), Q = a => { for (var b = "";;) { var c = (q(), r)[a++]; if (!c) { return b; } b += String.fromCharCode(c); } }, ac = {}, R = {}, bc = {}, S = class extends Error { constructor(a) { super(a); this.name = "BindingError"; } }, cc = a => { throw new S(a); }; function dc(a, b, c = {}) { var d = b.name; if (!a) { throw new S(`type "${d}" must have a positive integer typeid pointer`); } if (R.hasOwnProperty(a)) { if (c.aa) { return; } throw new S(`Cannot register type '${d}' twice`); } R[a] = b; delete bc[a]; ac.hasOwnProperty(a) && (b = ac[a], delete ac[a], b.forEach(e => e())); } function T(a, b, c = {}) { return dc(a, b, c); } var ec = (a, b, c) => { switch(b) { case 1: return c ? d => (q(), wa)[d] : d => (q(), r)[d]; case 2: return c ? d => (q(), Ba)[d >> 1] : d => (q(), I)[d >> 1]; case 4: return c ? d => (q(), J)[d >> 2] : d => (q(), B)[d >> 2]; case 8: return c ? d => (q(), Da)[d >> 3] : d => (q(), Ea)[d >> 3]; default: throw new TypeError(`invalid integer width (${b}): ${a}`); } }, U = a => { if (null === a) { return "null"; } var b = typeof a; return "object" === b || "array" === b || "function" === b ? a.toString() : "" + a; }, fc = (a, b, c, d) => { if (b < c || b > d) { throw new TypeError(`Passing a number "${U(b)}" from JS side to C/C++ side to an argument of type "${a}", which is outside the valid range [${c}, ${d}]!`); } }, bb = (a, b, c, d, e) => { b = Q(b); const f = 0n === d; let g = h => h; if (f) { const h = 8 * c; g = n => BigInt.asUintN(h, n); e = g(e); } T(a, {name:b, j:g, B:(h, n) => { if ("number" == typeof n) { n = BigInt(n); } else if ("bigint" != typeof n) { throw new TypeError(`Cannot convert "${U(n)}" to ${this.name}`); } fc(b, n, d, e); return n; }, D:ec(b, c, !f), v:null}); }, cb = (a, b, c, d) => { b = Q(b); T(a, {name:b, j:function(e) { return !!e; }, B:function(e, f) { return f ? c : d; }, D:function(e) { return this.j((q(), r)[e]); }, v:null}); }, gc = a => { throw new S(a.g.l.h.name + " instance already deleted"); }, hc = !1, ic = () => { }, jc = (a, b, c) => { if (b === c) { return a; } if (void 0 === c.u) { return null; } a = jc(a, b, c.u); return null === a ? null : c.X(a); }, kc = {}, lc = {}, mc = (a, b) => { if (void 0 === b) { throw new S("ptr should not be undefined"); } for (; a.u;) { b = a.N(b), a = a.u; } return lc[b]; }, nc = class extends Error { constructor(a) { super(a); this.name = "InternalError"; } }, pc = (a, b) => { if (!b.l || !b.i) { throw new nc("makeClassHandle requires ptr and ptrType"); } if (!!b.A !== !!b.s) { throw new nc("Both smartPtrType and smartPtr must be specified"); } b.count = {value:1}; return oc(Object.create(a, {g:{value:b, writable:!0}})); }; function qc(a) { function b() { return this.P ? pc(this.h.I, {l:this.ea, i:c, A:this, s:a}) : pc(this.h.I, {l:this, i:a}); } var c = this.$(a); if (!c) { return this.U(a), null; } var d = mc(this.h, c); if (void 0 !== d) { if (0 === d.g.count.value) { return d.g.i = c, d.g.s = a, d.clone(); } d = d.clone(); this.U(a); return d; } d = this.h.Z(c); d = kc[d]; if (!d) { return b.call(this); } d = this.O ? d.W : d.pointerType; var e = jc(c, this.h, d.h); return null === e ? b.call(this) : this.P ? pc(d.h.I, {l:d, i:e, A:this, s:a}) : pc(d.h.I, {l:d, i:e}); } var oc = a => { if ("undefined" === typeof FinalizationRegistry) { return oc = b => b, a; } hc = new FinalizationRegistry(b => { console.warn(b.da); b = b.g; --b.count.value; 0 === b.count.value && (b.s ? b.A.F(b.s) : b.l.h.F(b.i)); }); oc = b => { var c = b.g; if (c.s) { var d = {g:c}; c = Error(`Embind found a leaked C++ instance ${c.l.h.name} <${sa(c.i)}>.\n` + "We'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"); "captureStackTrace" in Error && Error.captureStackTrace(c, qc); d.da = c.stack.replace(/^Error: /, ""); hc.register(b, d, b); } return b; }; ic = b => { hc.unregister(b); }; return oc(a); }, rc = []; function sc() { } var tc = (a, b) => Object.defineProperty(b, "name", {value:a}), uc = (a, b, c) => { if (void 0 === a[b].o) { var d = a[b]; a[b] = function(...e) { if (!a[b].o.hasOwnProperty(e.length)) { throw new S(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${a[b].o})!`); } return a[b].o[e.length].apply(this, e); }; a[b].o = []; a[b].o[d.J] = d; } }, vc = (a, b, c) => { if (k.hasOwnProperty(a)) { if (void 0 === c || void 0 !== k[a].o && void 0 !== k[a].o[c]) { throw new S(`Cannot register public name '${a}' twice`); } uc(k, a, a); if (k[a].o.hasOwnProperty(c)) { throw new S(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`); } k[a].o[c] = b; } else { k[a] = b, k[a].J = c; } }, wc = a => { t("string" === typeof a); a = a.replace(/[^a-zA-Z0-9_]/g, "$"); var b = a.charCodeAt(0); return 48 <= b && 57 >= b ? `_${a}` : a; }; function xc(a, b, c, d, e, f, g, h) { this.name = a; this.constructor = b; this.I = c; this.F = d; this.u = e; this.Z = f; this.N = g; this.X = h; this.fa = []; } var yc = (a, b, c) => { for (; b !== c;) { if (!b.N) { throw new S(`Expected null or instance of ${c.name}, got an instance of ${b.name}`); } a = b.N(a); b = b.u; } return a; }; function zc(a, b) { if (null === b) { if (this.R) { throw new S(`null is not a valid ${this.name}`); } return 0; } if (!b.g) { throw new S(`Cannot pass "${U(b)}" as a ${this.name}`); } if (!b.g.i) { throw new S(`Cannot pass deleted object as a pointer of type ${this.name}`); } return yc(b.g.i, b.g.l.h, this.h); } function Ac(a, b) { if (null === b) { if (this.R) { throw new S(`null is not a valid ${this.name}`); } if (this.P) { var c = this.ga(); null !== a && a.push(this.F, c); return c; } return 0; } if (!b || !b.g) { throw new S(`Cannot pass "${U(b)}" as a ${this.name}`); } if (!b.g.i) { throw new S(`Cannot pass deleted object as a pointer of type ${this.name}`); } if (!this.O && b.g.l.O) { throw new S(`Cannot convert argument of type ${b.g.A ? b.g.A.name : b.g.l.name} to parameter type ${this.name}`); } c = yc(b.g.i, b.g.l.h, this.h); if (this.P) { if (void 0 === b.g.s) { throw new S("Passing raw pointer to smart pointer is illegal"); } switch(this.ia) { case 0: if (b.g.A === this) { c = b.g.s; } else { throw new S(`Cannot convert argument of type ${b.g.A ? b.g.A.name : b.g.l.name} to parameter type ${this.name}`); } break; case 1: c = b.g.s; break; case 2: if (b.g.A === this) { c = b.g.s; } else { var d = b.clone(); c = this.ha(c, Bc(() => d["delete"]())); null !== a && a.push(this.F, c); } break; default: throw new S("Unsupporting sharing policy"); } } return c; } function Cc(a, b) { if (null === b) { if (this.R) { throw new S(`null is not a valid ${this.name}`); } return 0; } if (!b.g) { throw new S(`Cannot pass "${U(b)}" as a ${this.name}`); } if (!b.g.i) { throw new S(`Cannot pass deleted object as a pointer of type ${this.name}`); } if (b.g.l.O) { throw new S(`Cannot convert argument of type ${b.g.l.name} to parameter type ${this.name}`); } return yc(b.g.i, b.g.l.h, this.h); } function Dc(a) { return this.j((q(), B)[a >> 2]); } function Ec(a, b, c, d, e, f, g, h, n, v, p) { this.name = a; this.h = b; this.R = c; this.O = d; this.P = e; this.ea = f; this.ia = g; this.V = h; this.ga = n; this.ha = v; this.F = p; e || void 0 !== b.u ? this.B = Ac : (this.B = d ? zc : Cc, this.v = null); } var Fc = (a, b, c) => { if (!k.hasOwnProperty(a)) { throw new nc("Replacing nonexistent public symbol"); } void 0 !== k[a].o && void 0 !== c ? k[a].o[c] = b : (k[a] = b, k[a].J = c); }, V = (a, b, c = !1) => { t(!c, "Async bindings are only supported with JSPI."); a = Q(a); c = Wb(b); if ("function" != typeof c) { throw new S(`unknown function pointer with signature ${a}: ${b}`); } return c; }; class Gc extends Error { } var Ic = a => { a = Hc(a); var b = Q(a); W(a); return b; }, Jc = (a, b) => { function c(f) { e[f] || R[f] || (bc[f] ? bc[f].forEach(c) : (d.push(f), e[f] = !0)); } var d = [], e = {}; b.forEach(c); throw new Gc(`${a}: ` + d.map(Ic).join([", "])); }, Kc = (a, b, c) => { function d(h) { h = c(h); if (h.length !== a.length) { throw new nc("Mismatched type converter count"); } for (var n = 0; n < a.length; ++n) { T(a[n], h[n]); } } a.forEach(h => bc[h] = b); var e = Array(b.length), f = [], g = 0; b.forEach((h, n) => { R.hasOwnProperty(h) ? e[n] = R[h] : (f.push(h), ac.hasOwnProperty(h) || (ac[h] = []), ac[h].push(() => { e[n] = R[h]; ++g; g === f.length && d(e); })); }); 0 === f.length && d(e); }, db = (a, b, c, d, e, f, g, h, n, v, p, w, u) => { p = Q(p); f = V(e, f); h &&= V(g, h); v &&= V(n, v); u = V(w, u); var z = wc(p); vc(z, function() { Jc(`Cannot construct ${p} due to unbound types`, [d]); }); Kc([a, b, c], d ? [d] : [], A => { A = A[0]; if (d) { var C = A.h; var P = C.I; } else { P = sc.prototype; } A = tc(p, function(...Ra) { if (Object.getPrototypeOf(this) !== Sa) { throw new S(`Use 'new' to construct ${p}`); } if (void 0 === H.G) { throw new S(`${p} has no accessible constructor`); } var Hb = H.G[Ra.length]; if (void 0 === Hb) { throw new S(`Tried to invoke ctor of ${p} with invalid number of parameters (${Ra.length}) - expected (${Object.keys(H.G).toString()}) parameters instead!`); } return Hb.apply(this, Ra); }); var Sa = Object.create(P, {constructor:{value:A}}); A.prototype = Sa; var H = new xc(p, A, Sa, u, C, f, h, v); if (H.u) { var na; (na = H.u).T ?? (na.T = []); H.u.T.push(H); } C = new Ec(p, H, !0, !1, !1); na = new Ec(p + "*", H, !1, !1, !1); P = new Ec(p + " const*", H, !1, !0, !1); kc[a] = {pointerType:na, W:P}; Fc(z, A); return [C, na, P]; }); }, Lc = (a, b) => { for (var c = [], d = 0; d < a; d++) { c.push((q(), B)[b + 4 * d >> 2]); } return c; }, Mc = a => { for (; a.length;) { var b = a.pop(); a.pop()(b); } }; function Nc(a) { for (var b = 1; b < a.length; ++b) { if (null !== a[b] && void 0 === a[b].v) { return !0; } } return !1; } function Oc(a, b, c, d, e) { (a < b || a > c) && e(`function ${d} called with ${a} arguments, expected ${b == c ? b : `${b} to ${c}`}`); } function Pc(a, b, c, d, e, f) { var g = b.length; if (2 > g) { throw new S("argTypes array size mismatch! Must at least get return value and 'this' types!"); } t(!f, "Async bindings are only supported with JSPI."); var h = null !== b[1] && null !== c, n = Nc(b); c = !b[0].ba; var v = g - 2; var p = b.length - 2; for (var w = b.length - 1; 2 <= w && b[w].optional; --w) { p--; } w = b[0]; var u = b[1]; d = [a, cc, d, e, Mc, w.j.bind(w), u?.B.bind(u)]; for (e = 2; e < g; ++e) { w = b[e], d.push(w.B.bind(w)); } if (!n) { for (e = h ? 1 : 2; e < b.length; ++e) { null !== b[e].v && d.push(b[e].v); } } d.push(Oc, p, v); n = Nc(b); v = b.length - 2; p = []; e = ["fn"]; h && e.push("thisWired"); for (g = 0; g < v; ++g) { p.push(`arg${g}`), e.push(`arg${g}Wired`); } p = p.join(","); e = e.join(","); p = `return function (${p}) {\n` + "checkArgCount(arguments.length, minArgs, maxArgs, humanName, throwBindingError);\n"; n && (p += "var destructors = [];\n"); u = n ? "destructors" : "null"; w = "humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" "); h && (p += `var thisWired = toClassParamWire(${u}, this);\n`); for (g = 0; g < v; ++g) { var z = `toArg${g}Wire`; p += `var arg${g}Wired = ${z}(${u}, arg${g});\n`; w.push(z); } p += (c || f ? "var rv = " : "") + `invoker(${e});\n`; if (n) { p += "runDestructors(destructors);\n"; } else { for (g = h ? 1 : 2; g < b.length; ++g) { f = 1 === g ? "thisWired" : "arg" + (g - 2) + "Wired", null !== b[g].v && (p += `${f}_dtor(${f});\n`, w.push(`${f}_dtor`)); } } c && (p += "var ret = fromRetWire(rv);\nreturn ret;\n"); p += "}\n"; w.push("checkArgCount", "minArgs", "maxArgs"); p = `if (arguments.length !== ${w.length}){ throw new Error(humanName + "Expected ${w.length} closure arguments " + arguments.length + " given."); }\n${p}`; b = (new Function(w, p))(...d); return tc(a, b); } var eb = (a, b, c, d, e, f) => { t(0 < b); var g = Lc(b, c); e = V(d, e); Kc([], [a], h => { h = h[0]; var n = `constructor ${h.name}`; void 0 === h.h.G && (h.h.G = []); if (void 0 !== h.h.G[b - 1]) { throw new S(`Cannot register multiple constructors with identical number of parameters (${b - 1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`); } h.h.G[b - 1] = () => { Jc(`Cannot construct ${h.name} due to unbound types`, g); }; Kc([], g, v => { v.splice(1, 0, null); h.h.G[b - 1] = Pc(n, v, null, e, f); return []; }); return []; }); }, Qc = a => { a = a.trim(); const b = a.indexOf("("); if (-1 === b) { return a; } t(a.endsWith(")"), "Parentheses for argument names should match."); return a.slice(0, b); }, fb = (a, b, c, d, e, f, g, h, n) => { var v = Lc(c, d); b = Q(b); b = Qc(b); f = V(e, f, n); Kc([], [a], p => { function w() { Jc(`Cannot call ${u} due to unbound types`, v); } p = p[0]; var u = `${p.name}.${b}`; b.startsWith("@@") && (b = Symbol[b.substring(2)]); h && p.h.fa.push(b); var z = p.h.I, A = z[b]; void 0 === A || void 0 === A.o && A.className !== p.name && A.J === c - 2 ? (w.J = c - 2, w.className = p.name, z[b] = w) : (uc(z, b, u), z[b].o[c - 2] = w); Kc([], v, C => { C = Pc(u, C, p, f, g, n); void 0 === z[b].o ? (C.J = c - 2, z[b] = C) : z[b].o[c - 2] = C; return []; }); return []; }); }, Rc = [], X = [0, 1, , 1, null, 1, !0, 1, !1, 1], Bc = a => { switch(a) { case void 0: return 2; case null: return 4; case !0: return 6; case !1: return 8; default: const b = Rc.pop() || X.length; X[b] = a; X[b + 1] = 1; return b; } }, Sc = {name:"emscripten::val", j:a => { if (!a) { throw new S(`Cannot use deleted val. handle = ${a}`); } t(2 === a || void 0 !== X[a] && 0 === a % 2, `invalid handle: ${a}`); var b = X[a]; 9 < a && 0 === --X[a + 1] && (t(void 0 !== X[a], "Decref for unallocated handle."), X[a] = void 0, Rc.push(a)); return b; }, B:(a, b) => Bc(b), D:Dc, v:null}, gb = a => T(a, Sc), Tc = (a, b, c) => { switch(b) { case 1: return c ? function(d) { return this.j((q(), wa)[d]); } : function(d) { return this.j((q(), r)[d]); }; case 2: return c ? function(d) { return this.j((q(), Ba)[d >> 1]); } : function(d) { return this.j((q(), I)[d >> 1]); }; case 4: return c ? function(d) { return this.j((q(), J)[d >> 2]); } : function(d) { return this.j((q(), B)[d >> 2]); }; default: throw new TypeError(`invalid integer width (${b}): ${a}`); } }, hb = (a, b, c, d) => { function e() { } b = Q(b); e.values = {}; T(a, {name:b, constructor:e, j:function(f) { return this.constructor.values[f]; }, B:(f, g) => g.value, D:Tc(b, c, d), v:null}); vc(b, e); }, Uc = a => { var b = R[a]; if (void 0 === b) { throw a = `${"enum"} has unknown type ${Ic(a)}`, new S(a); } return b; }, ib = (a, b, c) => { var d = Uc(a); b = Q(b); a = d.constructor; d = Object.create(d.constructor.prototype, {value:{value:c}, constructor:{value:tc(`${d.name}_${b}`, function() { })}}); a.values[c] = d; a[b] = d; }, Vc = (a, b) => { switch(b) { case 4: return function(c) { return this.j((q(), ha)[c >> 2]); }; case 8: return function(c) { return this.j((q(), Ca)[c >> 3]); }; default: throw new TypeError(`invalid float width (${b}): ${a}`); } }, jb = (a, b, c) => { b = Q(b); T(a, {name:b, j:d => d, B:(d, e) => { if ("number" != typeof e && "boolean" != typeof e) { throw new TypeError(`Cannot convert ${U(e)} to ${this.name}`); } return e; }, D:Vc(b, c), v:null}); }, kb = (a, b, c, d, e, f, g) => { var h = Lc(b, c); a = Q(a); a = Qc(a); e = V(d, e, g); vc(a, function() { Jc(`Cannot call ${a} due to unbound types`, h); }, b - 1); Kc([], h, n => { Fc(a, Pc(a, [n[0], null].concat(n.slice(1)), null, e, f, g), b - 1); return []; }); }, lb = (a, b, c, d, e) => { b = Q(b); let f = h => h; if (0 === d) { var g = 32 - 8 * c; f = h => h << g >>> g; e = f(e); } T(a, {name:b, j:f, B:(h, n) => { if ("number" != typeof n && "boolean" != typeof n) { throw new TypeError(`Cannot convert "${U(n)}" to ${b}`); } fc(b, n, d, e); return n; }, D:ec(b, c, 0 !== d), v:null}); }, mb = (a, b, c) => { function d(f) { var g = (q(), B)[f >> 2]; f = (q(), B)[f + 4 >> 2]; return new e((q(), wa).buffer, f, g); } var e = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array][b]; c = Q(c); T(a, {name:c, j:d, D:d}, {aa:!0}); }, Wc = (a, b, c, d) => { t("string" === typeof a, `stringToUTF8Array expects a string (got ${typeof a})`); if (!(0 < d)) { return 0; } var e = c; d = c + d - 1; for (var f = 0; f < a.length; ++f) { var g = a.codePointAt(f); if (127 >= g) { if (c >= d) { break; } b[c++] = g; } else if (2047 >= g) { if (c + 1 >= d) { break; } b[c++] = 192 | g >> 6; b[c++] = 128 | g & 63; } else if (65535 >= g) { if (c + 2 >= d) { break; } b[c++] = 224 | g >> 12; b[c++] = 128 | g >> 6 & 63; b[c++] = 128 | g & 63; } else { if (c + 3 >= d) { break; } 1114111 < g && N("Invalid Unicode code point " + sa(g) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."); b[c++] = 240 | g >> 18; b[c++] = 128 | g >> 12 & 63; b[c++] = 128 | g >> 6 & 63; b[c++] = 128 | g & 63; f++; } } b[c] = 0; return c - e; }, Y = (a, b, c) => { t("number" == typeof c, "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); return Wc(a, (q(), r), b, c); }, Z = a => { for (var b = 0, c = 0; c < a.length; ++c) { var d = a.charCodeAt(c); 127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3; } return b; }, nb = (a, b) => { b = Q(b); T(a, {name:b, j(c) { var d = (q(), B)[c >> 2]; d = O(c + 4, d, !0); W(c); return d; }, B(c, d) { d instanceof ArrayBuffer && (d = new Uint8Array(d)); var e = "string" == typeof d; if (!(e || ArrayBuffer.isView(d) && 1 == d.BYTES_PER_ELEMENT)) { throw new S("Cannot pass non-string to std::string"); } var f = e ? Z(d) : d.length; var g = fa(4 + f + 1), h = g + 4; (q(), B)[g >> 2] = f; e ? Y(d, h, f + 1) : (q(), r).set(d, h); null !== c && c.push(W, g); return g; }, D:Dc, v(c) { W(c); }}); }, Xc = new TextDecoder("utf-16le"), Yc = (a, b, c) => { t(0 == a % 2, "Pointer passed to UTF16ToString must be aligned to two bytes!"); a >>= 1; b = Yb((q(), I), a, b / 2, c); return Xc.decode((q(), I).buffer instanceof ArrayBuffer ? (q(), I).subarray(a, b) : (q(), I).slice(a, b)); }, Zc = (a, b, c) => { t(0 == b % 2, "Pointer passed to stringToUTF16 must be aligned to two bytes!"); t("number" == typeof c, "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); c ??= 2147483647; if (2 > c) { return 0; } c -= 2; var d = b; c = c < 2 * a.length ? c / 2 : a.length; for (var e = 0; e < c; ++e) { var f = a.charCodeAt(e); (q(), Ba)[b >> 1] = f; b += 2; } (q(), Ba)[b >> 1] = 0; return b - d; }, $c = a => 2 * a.length, ad = (a, b, c) => { t(0 == a % 4, "Pointer passed to UTF32ToString must be aligned to four bytes!"); var d = ""; a >>= 2; for (var e = 0; !(e >= b / 4); e++) { var f = (q(), B)[a + e]; if (!f && !c) { break; } d += String.fromCodePoint(f); } return d; }, bd = (a, b, c) => { t(0 == b % 4, "Pointer passed to stringToUTF32 must be aligned to four bytes!"); t("number" == typeof c, "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); c ??= 2147483647; if (4 > c) { return 0; } var d = b; c = d + c - 4; for (var e = 0; e < a.length; ++e) { var f = a.codePointAt(e); 65535 < f && e++; (q(), J)[b >> 2] = f; b += 4; if (b + 4 > c) { break; } } (q(), J)[b >> 2] = 0; return b - d; }, cd = a => { for (var b = 0, c = 0; c < a.length; ++c) { 65535 < a.codePointAt(c) && c++, b += 4; } return b; }, ob = (a, b, c) => { c = Q(c); if (2 === b) { var d = Yc; var e = Zc; var f = $c; } else { t(4 === b, "only 2-byte and 4-byte strings are currently supported"), d = ad, e = bd, f = cd; } T(a, {name:c, j:g => { var h = (q(), B)[g >> 2]; h = d(g + 4, h * b, !0); W(g); return h; }, B:(g, h) => { if ("string" != typeof h) { throw new S(`Cannot pass non-string to C++ string type ${c}`); } var n = f(h), v = fa(4 + n + b); (q(), B)[v >> 2] = n / b; e(h, v + 4, n + b); null !== g && g.push(W, v); return v; }, D:Dc, v(g) { W(g); }}); }, pb = (a, b) => { b = Q(b); T(a, {ba:!0, name:b, j:() => { }, B:() => { }}); }, qb = (a, b, c, d) => { var e = (new Date()).getFullYear(), f = (new Date(e, 0, 1)).getTimezoneOffset(); e = (new Date(e, 6, 1)).getTimezoneOffset(); var g = Math.max(f, e); (q(), B)[a >> 2] = 60 * g; (q(), J)[b >> 2] = Number(f != e); b = h => { var n = Math.abs(h); return `UTC${0 <= h ? "-" : "+"}${String(Math.floor(n / 60)).padStart(2, "0")}${String(n % 60).padStart(2, "0")}`; }; a = b(f); b = b(e); t(a); t(b); t(16 >= Z(a), `timezone name truncated to fit in TZNAME_MAX (${a})`); t(16 >= Z(b), `timezone name truncated to fit in TZNAME_MAX (${b})`); e < f ? (Y(a, c, 17), Y(b, d, 17)) : (Y(a, d, 17), Y(b, c, 17)); }, rb = (a, b) => (q(), r).set(dd[a].Y, b), ed = [], sb = () => ed.length, dd = [], tb = () => dd.length, ub = (a, b) => { a = ed[a].na; Y(a, b, Z(a) + 1); }, vb = a => dd[a].mode, wb = a => dd[a].Y.length, xb = (a, b) => { a = ed[a].pa; Y(a, b, Z(a) + 1); }, yb = (a, b) => { a = dd[a].qa; Y(a, b, Z(a) + 1); }, fd = [], zb = () => { a: { if (!fd.length) { var a = null; "undefined" != typeof window && "function" == typeof window.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n")); if (!a) { var b = null; break a; } b = Array(Z(a) + 1); a = Wc(a, b, 0, b.length); b.length = a; fd = b; } b = fd.shift(); } return "number" === typeof b ? b : -1; }, Ib = () => performance.now(), Eb = () => Date.now(), gd = 1; function Ab(a, b, c) { if (!(0 <= a && 3 >= a)) { return 28; } if (0 === a) { a = Date.now(); } else if (gd) { a = performance.now(); } else { return 52; } a = Math.round(1E6 * a); (q(), Da)[c >> 3] = BigInt(a); return 0; } var Bb = a => { t("number" == typeof a); console.error(O(a)); }, Cb = a => { t("number" == typeof a); console.log(O(a)); }, Db = a => { t("number" == typeof a); console.warn(O(a)); }, Fb = a => x(O(a)), Gb = () => 2147483648, Jb = a => ma(O(a)), Kb = a => { var b = (q(), r).length; a >>>= 0; if (a <= b) { return !1; } if (2147483648 < a) { return x(`Cannot enlarge memory, requested ${a} bytes, but the limit is ${2147483648} bytes!`), !1; } for (var c = 1; 4 >= c; c *= 2) { var d = b * (1 + .2 / c); d = Math.min(d, a + 100663296); var e = Math, f = e.min; d = Math.max(a, d); t(65536, "alignment argument is required"); e = f.call(e, 2147483648, 65536 * Math.ceil(d / 65536)); a: { f = e; d = F.buffer.byteLength; try { F.grow((f - d + 65535) / 65536 | 0); xa(); var g = 1; break a; } catch (h) { x(`growMemory: Attempted to grow heap from ${d} bytes to ${f} bytes, but got error: ${h}`); } g = void 0; } if (g) { return !0; } } x(`Failed to grow the heap from ${b} bytes to ${e} bytes, not enough memory!`); return !1; }, hd = {}, kd = () => { if (!jd) { var a = {USER:"web_user", LOGNAME:"web_user", PATH:"/", PWD:"/", HOME:"/home/web_user", LANG:("object" == typeof navigator && navigator.language || "C").replace("-", "_") + ".UTF-8", _:"./this.program"}, b; for (b in hd) { void 0 === hd[b] ? delete a[b] : a[b] = hd[b]; } var c = []; for (b in a) { c.push(`${b}=${a[b]}`); } jd = c; } return jd; }, jd, Lb = (a, b) => { var c = 0, d = 0, e; for (e of kd()) { var f = b + c; (q(), B)[a + d >> 2] = f; c += Y(e, f, Infinity) + 1; d += 4; } return 0; }, Mb = (a, b) => { var c = kd(); (q(), B)[a >> 2] = c.length; a = 0; for (var d of c) { a += Z(d) + 1; } (q(), B)[b >> 2] = a; return 0; }, ld = () => a => a.set(crypto.getRandomValues(new Uint8Array(a.byteLength))), md = a => { (md = ld())(a); }, Pb = (a, b) => { md((q(), r).subarray(a, a + b)); return 0; }; (() => { let a = sc.prototype; Object.assign(a, {isAliasOf:function(c) { if (!(this instanceof sc && c instanceof sc)) { return !1; } var d = this.g.l.h, e = this.g.i; c.g = c.g; var f = c.g.l.h; for (c = c.g.i; d.u;) { e = d.N(e), d = d.u; } for (; f.u;) { c = f.N(c), f = f.u; } return d === f && e === c; }, clone:function() { this.g.i || gc(this); if (this.g.M) { return this.g.count.value += 1, this; } var c = oc, d = Object, e = d.create, f = Object.getPrototypeOf(this), g = this.g; c = c(e.call(d, f, {g:{value:{count:g.count, K:g.K, M:g.M, i:g.i, l:g.l, s:g.s, A:g.A}}})); c.g.count.value += 1; c.g.K = !1; return c; }, ["delete"]() { this.g.i || gc(this); if (this.g.K && !this.g.M) { throw new S("Object already scheduled for deletion"); } ic(this); var c = this.g; --c.count.value; 0 === c.count.value && (c.s ? c.A.F(c.s) : c.l.h.F(c.i)); this.g.M || (this.g.s = void 0, this.g.i = void 0); }, isDeleted:function() { return !this.g.i; }, deleteLater:function() { this.g.i || gc(this); if (this.g.K && !this.g.M) { throw new S("Object already scheduled for deletion"); } rc.push(this); this.g.K = !0; return this; }}); const b = Symbol.dispose; b && (a[b] = a["delete"]); })(); Object.assign(Ec.prototype, {$(a) { this.V && (a = this.V(a)); return a; }, U(a) { this.F?.(a); }, D:Dc, j:qc}); t(10 === X.length); aa || (k.wasmMemory ? F = k.wasmMemory : (t(!0, "INITIAL_MEMORY should be larger than STACK_SIZE, was 330301440! (STACK_SIZE=65536)"), F = new WebAssembly.Memory({initial:5040, maximum:32768, shared:!0})), xa()); k.FS_createDataFile = function() { Qa(); }; k.FS_createPreloadedFile = function() { Qa(); }; E("ENVIRONMENT"); E("GL_MAX_TEXTURE_IMAGE_UNITS"); E("SDL_canPlayWithWebAudio"); E("SDL_numSimultaneouslyQueuedBuffers"); E("INITIAL_MEMORY"); E("arguments"); E("buffer"); E("canvas"); E("doNotCaptureKeyboard"); E("dynamicLibraries"); E("elementPointerLock"); E("extraStackTrace"); E("forcedAspectRatio"); E("keyboardListeningElement"); E("freePreloadedMediaOnUse"); E("loadSplitModule"); E("locateFile"); E("logReadFiles"); E("mainScriptUrlOrBlob"); E("mem"); E("monitorRunDependencies"); E("noExitRuntime"); E("noInitialRun"); E("onAbort"); E("onCustomMessage"); E("onExit"); E("onFree"); E("onFullScreen"); E("onMalloc"); E("onRealloc"); E("onRuntimeInitialized"); E("postMainLoop"); E("postRun"); E("preInit"); E("preMainLoop"); E("preRun"); E("preinitializedWebGLContext"); E("preloadPlugins"); E("print"); E("printErr"); E("setStatus"); E("statusMessage"); E("stderr"); E("stdin"); E("stdout"); E("thisProgram"); E("wasmBinary"); E("websocket"); E("fetchSettings"); t("undefined" == typeof k.memoryInitializerPrefixURL, "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); t("undefined" == typeof k.pthreadMainPrefixURL, "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); t("undefined" == typeof k.cdInitializerPrefixURL, "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); t("undefined" == typeof k.filePackagePrefixURL, "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); t("undefined" == typeof k.read, "Module.read option was removed"); t("undefined" == typeof k.readAsync, "Module.readAsync option was removed (modify readAsync in JS)"); t("undefined" == typeof k.readBinary, "Module.readBinary option was removed (modify readBinary in JS)"); t("undefined" == typeof k.setWindowTitle, "Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"); t("undefined" == typeof k.TOTAL_MEMORY, "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); t("undefined" == typeof k.ENVIRONMENT, "Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"); t("undefined" == typeof k.STACK_SIZE, "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"); "writeI53ToI64 writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling readI53FromI64 readI53FromU64 convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 stackSave stackRestore stackAlloc getTempRet0 setTempRet0 zeroMemory withStackSave strError inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr readEmAsmArgs jstoi_q autoResumeAudioContext getDynCaller dynCall runtimeKeepalivePush runtimeKeepalivePop asyncLoad asmjsMangle mmapAlloc HandleAllocator getNativeTypeSize getUniqueRunDependency addOnPreRun addOnInit addOnPostCtor addOnPreMain addOnExit addOnPostRun STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS ccall cwrap convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction UTF8ArrayToString intArrayToString stringToAscii stringToNewUTF8 stringToUTF8OnStack writeArrayToMemory registerKeyEventCallback maybeCStringToJsString findEventTarget getBoundingClientRect fillMouseEventData registerMouseEventCallback registerWheelEventCallback registerUiEventCallback registerFocusEventCallback fillDeviceOrientationEventData registerDeviceOrientationEventCallback fillDeviceMotionEventData registerDeviceMotionEventCallback screenOrientation fillOrientationChangeEventData registerOrientationChangeEventCallback fillFullscreenChangeEventData registerFullscreenChangeEventCallback JSEvents_requestFullscreen JSEvents_resizeCanvasForFullscreen registerRestoreOldStyle hideEverythingExceptGivenElement restoreHiddenElements setLetterbox softFullscreenResizeWebGLRenderTarget doRequestFullscreen fillPointerlockChangeEventData registerPointerlockChangeEventCallback registerPointerlockErrorEventCallback requestPointerLock fillVisibilityChangeEventData registerVisibilityChangeEventCallback registerTouchEventCallback fillGamepadEventData registerGamepadEventCallback registerBeforeUnloadEventCallback fillBatteryEventData registerBatteryEventCallback setCanvasElementSize getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation flush_NO_FILESYSTEM wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags safeSetTimeout setImmediateWrapped safeRequestAnimationFrame clearImmediateWrapped registerPostMainLoop registerPreMainLoop getPromise makePromise idsToPromises makePromiseCallback findMatchingCatch Browser_asyncPrepareDataCounter isLeapYear ydayFromDate arraySum addDays FS_createPreloadedFile FS_preloadFile FS_modeStringToFlags FS_getMode FS_unlink FS_createDataFile FS_mknod FS_create FS_writeFile FS_mkdir FS_mkdirTree wasmfsNodeConvertNodeCode wasmfsTry wasmfsNodeFixStat wasmfsNodeLstat wasmfsNodeFstat FileSystemAsyncAccessHandle wasmfsOPFSCreateAsyncAccessHandle wasmfsOPFSProxyFinish wasmfsOPFSGetOrCreateFile wasmfsOPFSGetOrCreateDir _wasmWorkersID _wasmWorkerPostFunction1 _wasmWorkerPostFunction2 _wasmWorkerPostFunction3 getFunctionArgsName createJsInvokerSignature PureVirtualError registerInheritedInstance unregisterInheritedInstance getInheritedInstanceCount getLiveInheritedInstances setDelayFunction validateThis count_emval_handles getStringOrSymbol emval_get_global emval_returnValue emval_lookupTypes emval_addMethodCaller".split(" ").forEach(function(a) { va(a); }); "run addRunDependency removeRunDependency out err callMain abort wasmMemory wasmExports HEAPF32 HEAPF64 HEAP8 HEAPU8 HEAP16 HEAPU16 HEAP32 HEAPU32 HEAP64 HEAPU64 writeStackCookie checkStackCookie INT53_MAX INT53_MIN bigintToI53Checked ptrToString exitJS getHeapMax growMemory ENV ERRNO_CODES DNS Protocols Sockets timers warnOnce readEmAsmArgsArray getExecutableName handleException keepRuntimeAlive callUserCallback maybeExit alignMemory wasmTable noExitRuntime freeTableIndexes functionsInTableMap setValue getValue PATH PATH_FS UTF8Decoder UTF8ToString stringToUTF8Array stringToUTF8 lengthBytesUTF8 intArrayFromString AsciiToString UTF16Decoder UTF16ToString stringToUTF16 lengthBytesUTF16 UTF32ToString stringToUTF32 lengthBytesUTF32 JSEvents specialHTMLTargets findCanvasEventTarget currentFullscreenStrategy restoreOldWindowedStyle UNWIND_CACHE ExitStatus getEnvStrings checkWasiClock initRandomFill randomFill emSetImmediate emClearImmediate_deps emClearImmediate promiseMap uncaughtExceptionCount exceptionLast exceptionCaught ExceptionInfo Browser requestFullscreen requestFullScreen setCanvasSize getUserMedia createContext getPreloadedImageData__data wget MONTH_DAYS_REGULAR MONTH_DAYS_LEAP MONTH_DAYS_REGULAR_CUMULATIVE MONTH_DAYS_LEAP_CUMULATIVE preloadPlugins FS_stdin_getChar_buffer FS_stdin_getChar FS_createPath FS_createDevice FS_readFile MEMFS wasmFSPreloadedFiles wasmFSPreloadedDirs wasmFSPreloadingFlushed wasmFSDevices wasmFSDeviceStreams FS wasmFS$JSMemoryFiles wasmFS$backends wasmFS$JSMemoryRanges wasmfsNodeIsWindows wasmfsOPFSDirectoryHandles wasmfsOPFSFileHandles wasmfsOPFSAccessHandles wasmfsOPFSBlobs _wasmWorkers _wasmWorkerDelayedMessageQueue _wasmWorkerAppendToQueue _wasmWorkerRunPostMessage _wasmWorkerInitializeRuntime InternalError BindingError throwInternalError throwBindingError registeredTypes awaitingDependencies typeDependencies tupleRegistrations structRegistrations sharedRegisterType whenDependentTypesAreResolved getTypeName getFunctionName heap32VectorToArray requireRegisteredType usesDestructorStack checkArgCount getRequiredArgCount createJsInvoker UnboundTypeError EmValType EmValOptionalType throwUnboundTypeError ensureOverloadTable exposePublicSymbol replacePublicSymbol createNamedFunction embindRepr registeredInstances getBasestPointer getInheritedInstance registeredPointers registerType integerReadValueFromPointer enumReadValueFromPointer floatReadValueFromPointer assertIntegerRange readPointer runDestructors craftInvokerFunction embind__requireFunction genericPointerToWireType constNoSmartPtrRawPointerToWireType nonConstNoSmartPtrRawPointerToWireType init_RegisteredPointer RegisteredPointer RegisteredPointer_fromWireType runDestructor releaseClassHandle finalizationRegistry detachFinalizer_deps detachFinalizer attachFinalizer makeClassHandle init_ClassHandle ClassHandle throwInstanceAlreadyDeleted deletionQueue flushPendingDeletes delayFunction RegisteredClass shallowCopyInternalPointer downcastPointer upcastPointer char_0 char_9 makeLegalFunctionName emval_freelist emval_handles emval_symbols Emval emval_methodCallers".split(" ").forEach(va); function Ob(a, b) { b = b ? O(b) : null; const c = globalThis.m && globalThis.m[a]; c ? c.dispatchEvent(new CustomEvent("", {detail:b})) : console.error("fireEv: unknown object index", a); } var W = D("_free"), fa = D("_malloc"), Hc = D("___getTypeName"), Ia = D("__embind_initialize_bindings"), qa = D("_emscripten_stack_get_end"), nd = D("_emscripten_stack_init"), Sb = D("_emscripten_stack_get_current"), Ha = D("__emscripten_wasm_worker_initialize"), od = D("_wasmfs_flush"), Ya, K = await (async function() { function a(d) { K = d.exports; Vb = K.__indirect_function_table; t(Vb, "table not found in wasm exports"); d = K; W = M("free", 1); fa = M("malloc", 1); Hc = M("__getTypeName", 1); Ia = M("_embind_initialize_bindings", 0); qa = d.emscripten_stack_get_end; nd = d.emscripten_stack_init; Sb = d.emscripten_stack_get_current; Ha = M("_emscripten_wasm_worker_initialize", 2); od = M("wasmfs_flush", 0); Ma--; t("wasm-instantiate", "removeRunDependency requires an ID"); t(Oa["wasm-instantiate"]); delete Oa["wasm-instantiate"]; 0 == Ma && (null !== L && (clearInterval(L), L = null), Na && (d = Na, Na = null, d())); return K; } Pa(); var b = k, c = Xa(); if (k.instantiateWasm) { return new Promise((d, e) => { try { k.instantiateWasm(c, (f, g) => { d(a(f, g)); }); } catch (f) { x(`Module.instantiateWasm callback failed with error: ${f}`), e(f); } }); } if (aa) { return new Promise(d => { Aa = e => { var f = new WebAssembly.Instance(e, Xa()); d(a(f, e)); }; }); } Ta ??= ia + "Vosklet.wasm"; return function(d) { t(k === b, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); b = null; return a(d.instance, d.module); }(await Wa(c)); }()), pd; function qd() { 0 < Ma ? Na = qd : aa ? (ya?.(k), Ga()) : (nd(), pa(), 0 < Ma ? Na = qd : (t(!pd), pd = !0, k.calledRun = !0, oa || (Ga(), ya?.(k), t(!k._main, 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'), ra()), ra())); } function Rb() { var a = ma, b = x, c = !1; ma = x = () => { c = !0; }; try { od(); } catch (d) { } ma = a; x = b; c && (N("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc."), N("(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)")); } qd(); Fa ? moduleRtn = k : moduleRtn = new Promise((a, b) => { ya = a; za = b; }); for (const a of Object.keys(k)) { a in moduleArg || Object.defineProperty(moduleArg, a, {configurable:!0, get() { y(`Access to module property ('${a}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`); }}); } ; return moduleRtn; }; })(); // Export using a UMD style export, or ES6 exports if selected if (typeof exports === 'object' && typeof module === 'object') { module.exports = loadVosklet; // This default export looks redundant, but it allows TS to import this // commonjs style module. module.exports.default = loadVosklet; } else if (typeof define === 'function' && define['amd']) define([], () => loadVosklet); // Same as above for for WASM_WORKERS // Normally this detection is done when the module is itself run but // when running in MODULARIZE mode we need use this to know if we should // run the module constructor on startup (true only for pthreads). var isWW = globalThis.self?.name == 'em-ww'; // In order to support both web and node we also need to detect node here. isWW && loadVosklet();