Benutzer:Amir/common.js
Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.
- Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
- Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
- Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
var g = {}; var aa = "object" == typeof window, h = "undefined" != typeof WorkerGlobalScope, m = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node && "renderer" != process.type, ba = !aa && !m && !h, n = h && self.name?.startsWith("em-pthread"); if (m) { var ca = require("worker_threads"); global.Worker = ca.Worker; n = (h = !ca.$b) && "em-pthread" == ca.workerData; } var da = Object.assign({}, g), ea = "./this.program", ha = (a, b) => { throw b; }, ia = "undefined" != typeof document ? document.currentScript?.src : void 0; m ? ia = __filename : h && (ia = self.location.href); var q = "", ja, ka; if (m) { if ("undefined" == typeof process || !process.release || "node" !== process.release.name) { 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?)"); } var la = process.versions.node, ma = la.split(".").slice(0, 3); ma = 10000 * ma[0] + 100 * ma[1] + 1 * ma[2].split("-")[0]; if (160000 > ma) { throw Error("This emscripten-generated code requires node v16.0.0 (detected v" + la + ")"); } var fs = require("fs"), na = require("path"); q = __dirname + "/"; ka = a => { a = oa(a) ? new URL(a) : na.normalize(a); a = fs.readFileSync(a); t(a.buffer); return a; }; ja = a => { a = oa(a) ? new URL(a) : na.normalize(a); return new Promise((b, c) => { fs.readFile(a, void 0, (d, e) => { d ? c(d) : b(e.buffer); }); }); }; !g.thisProgram && 1 < process.argv.length && (ea = process.argv[1].replace(/\\/g, "/")); process.argv.slice(2); "undefined" != typeof module && (module.exports = g); ha = (a, b) => { process.exitCode = a; throw b; }; } else if (ba) { if ("object" == typeof process && "function" === typeof require || "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 (aa || h) { h ? q = self.location.href : "undefined" != typeof document && document.currentScript && (q = document.currentScript.src); q = q.startsWith("blob:") ? "" : q.substr(0, q.replace(/[?#].*/, "").lastIndexOf("/") + 1); 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?)"); } m || (h && (ka = a => { var b = new XMLHttpRequest(); b.open("GET", a, !1); b.responseType = "arraybuffer"; b.send(null); return new Uint8Array(b.response); }), ja = a => oa(a) ? new Promise((b, c) => { var d = new XMLHttpRequest(); d.open("GET", a, !0); d.responseType = "arraybuffer"; d.onload = () => { 200 == d.status || 0 == d.status && d.response ? b(d.response) : c(d.status); }; d.onerror = c; d.send(null); }) : fetch(a, {credentials:"same-origin"}).then(b => b.ok ? b.arrayBuffer() : Promise.reject(Error(b.status + " : " + b.url)))); } else { throw Error("environment detection error"); } var pa = console.log.bind(console), qa = console.error.bind(console); m && (pa = (...a) => fs.writeSync(1, a.join(" ") + "\n"), qa = (...a) => fs.writeSync(2, a.join(" ") + "\n")); var u = g.print || pa, v = g.printErr || qa; Object.assign(g, da); da = null; Object.getOwnPropertyDescriptor(g, "fetchSettings") && w("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API"); x("arguments", "arguments_"); g.thisProgram && (ea = g.thisProgram); x("thisProgram", "thisProgram"); t("undefined" == typeof g.memoryInitializerPrefixURL, "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); t("undefined" == typeof g.pthreadMainPrefixURL, "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); t("undefined" == typeof g.cdInitializerPrefixURL, "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); t("undefined" == typeof g.filePackagePrefixURL, "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); t("undefined" == typeof g.read, "Module.read option was removed"); t("undefined" == typeof g.readAsync, "Module.readAsync option was removed (modify readAsync in JS)"); t("undefined" == typeof g.readBinary, "Module.readBinary option was removed (modify readBinary in JS)"); t("undefined" == typeof g.setWindowTitle, "Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"); t("undefined" == typeof g.TOTAL_MEMORY, "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); x("asm", "wasmExports"); x("readAsync", "readAsync"); x("readBinary", "readBinary"); x("setWindowTitle", "setWindowTitle"); t(aa || h || m, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); t(!ba, "shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."); var ra = g.wasmBinary; x("wasmBinary", "wasmBinary"); "object" != typeof WebAssembly && v("no native wasm support detected"); var z, sa, A = !1, ta; function t(a, b) { a || w("Assertion failed" + (b ? ": " + b : "")); } var C, ua, va, D, F, G, H, xa; function ya() { var a = z.buffer; g.HEAP8 = C = new Int8Array(a); g.HEAP16 = va = new Int16Array(a); g.HEAPU8 = ua = new Uint8Array(a); g.HEAPU16 = new Uint16Array(a); g.HEAP32 = D = new Int32Array(a); g.HEAPU32 = F = new Uint32Array(a); g.HEAPF32 = G = new Float32Array(a); g.HEAPF64 = xa = new Float64Array(a); g.HEAP64 = H = new BigInt64Array(a); g.HEAPU64 = new BigUint64Array(a); } var za = 0; if (n) { var Aa; if (m) { var Ba = ca.parentPort; Ba.on("message", c => onmessage({data:c})); Object.assign(globalThis, {self:global, postMessage:c => Ba.postMessage(c),}); } var Ca = !1; function a(...c) { c = c.join(" "); m ? fs.writeSync(2, c + "\n") : console.error(c); } g.printErr || (v = a); Da = a; self.alert = function(...c) { postMessage({s:"alert", text:c.join(" "), nb:I()}); }; self.onunhandledrejection = c => { throw c.reason || c; }; function b(c) { try { var d = c.data, e = d.s; if ("load" === e) { za = d.la; let f = []; self.onmessage = k => f.push(k); self.startWorker = () => { postMessage({s:"loaded"}); for (let k of f) { b(k); } self.onmessage = b; }; for (const k of d.Sa) { if (!g[k] || g[k].proxy) { g[k] = (...l) => { postMessage({s:"callHandler", Ra:k, args:l}); }, "print" == k && (u = g[k]), "printErr" == k && (v = g[k]); } } z = d.sb; ya(); Aa(d.tb); } else if ("run" === e) { t(d.o); Ea(d.o); Fa(d.o, 0, 0, 1, 0, 0); Ga(); Ha(d.o); Ca ||= !0; try { Ia(d.kb, d.S); } catch (f) { if ("unwind" != f) { throw f; } } } else { "setimmediate" !== d.target && ("checkMailbox" === e ? Ca && Ma() : e && (v(`worker: received unknown command ${e}`), v(d))); } } catch (f) { throw v(`worker: onmessage() captured an uncaught exception: ${f}`), f?.stack && v(f.stack), Na(), f; } } self.onmessage = b; } t(!g.STACK_SIZE, "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"); 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"); if (!n) { if (g.wasmMemory) { z = g.wasmMemory; } else { var Oa = g.INITIAL_MEMORY || 2147483648; x("INITIAL_MEMORY", "INITIAL_MEMORY"); t(52428800 <= Oa, "INITIAL_MEMORY should be larger than STACK_SIZE, was " + Oa + "! (STACK_SIZE=52428800)"); z = new WebAssembly.Memory({initial:Oa / 65536, maximum:Oa / 65536, shared:!0,}); } ya(); } var Pa = [], Qa = [], Ra = [], Sa = [], Ta = !1; function Ua() { t(!Ta); Ta = !0; if (!n) { if (!g.noFSInit && !Va) { t(!Va, "FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"); Va = !0; a ??= g.stdin; c ??= g.stdout; b ??= g.stderr; a ? J("stdin", a) : Wa("/dev/tty", "/dev/stdin"); c ? J("stdout", null, c) : Wa("/dev/tty", "/dev/stdout"); b ? J("stderr", null, b) : Wa("/dev/tty1", "/dev/stderr"); var a = Xa("/dev/stdin", 0); var b = Xa("/dev/stdout", 1); var c = Xa("/dev/stderr", 1); t(0 === a.fd, `invalid handle for stdin (${a.fd})`); t(1 === b.fd, `invalid handle for stdout (${b.fd})`); t(2 === c.fd, `invalid handle for stderr (${c.fd})`); } Ya = !1; Za(Qa); } } t(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); t(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); t(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); t(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); var K = 0, $a = null, ab = null, bb = {}; function cb(a) { K++; g.monitorRunDependencies?.(K); a ? (t(!bb[a]), bb[a] = 1, null === $a && "undefined" != typeof setInterval && ($a = setInterval(() => { if (A) { clearInterval($a), $a = null; } else { var b = !1, c; for (c in bb) { b || (b = !0, v("still waiting on run dependencies:")), v(`dependency: ${c}`); } b && v("(end of list)"); } }, 10000))) : v("warning: run dependency added without ID"); } function db(a) { K--; g.monitorRunDependencies?.(K); a ? (t(bb[a]), delete bb[a]) : v("warning: run dependency removed without ID"); 0 == K && (null !== $a && (clearInterval($a), $a = null), ab && (a = ab, ab = null, a())); } function w(a) { g.onAbort?.(a); a = "Aborted(" + a + ")"; v(a); A = !0; 0 <= a.indexOf("RuntimeError: unreachable") && (a += '. "unreachable" may be due to ASYNCIFY_STACK_SIZE not being large enough (try increasing it)'); throw new WebAssembly.RuntimeError(a); } var eb = a => a.startsWith("data:application/octet-stream;base64,"), oa = a => a.startsWith("file://"); function L(a, b) { return (...c) => { t(Ta, `native function \`${a}\` called before runtime initialization`); var d = M[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 fb; function gb(a) { if (a == fb && ra) { return new Uint8Array(ra); } if (ka) { return ka(a); } throw "both async and sync fetching of the wasm failed"; } function hb(a) { return ra ? Promise.resolve().then(() => gb(a)) : ja(a).then(b => new Uint8Array(b), () => gb(a)); } function ib(a, b, c) { return hb(a).then(d => WebAssembly.instantiate(d, b)).then(c, d => { v(`failed to asynchronously prepare wasm: ${d}`); oa(fb) && v(`warning: Loading from a file URI (${fb}) 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`); w(d); }); } function jb(a, b) { var c = fb; ra || "function" != typeof WebAssembly.instantiateStreaming || eb(c) || oa(c) || m || "function" != typeof fetch ? ib(c, a, b) : fetch(c, {credentials:"same-origin"}).then(d => WebAssembly.instantiateStreaming(d, a).then(b, function(e) { v(`wasm streaming compile failed: ${e}`); v("falling back to ArrayBuffer instantiation"); return ib(c, a, b); })); } function kb() { lb = {SDL_Flip:mb, SDL_GetError:nb, SDL_GetTicks:ob, SDL_Init:pb, SDL_LockSurface:qb, SDL_PollEvent:rb, SDL_Quit:sb, SDL_SetVideoMode:tb, SDL_UnlockSurface:ub, __assert_fail:vb, __pthread_create_js:wb, _abort_js:xb, _emscripten_get_now_is_monotonic:yb, _emscripten_init_main_thread_js:zb, _emscripten_notify_mailbox_postmessage:Ab, _emscripten_receive_on_main_thread_js:Bb, _emscripten_thread_cleanup:Cb, _emscripten_thread_mailbox_await:Ha, _emscripten_thread_set_strongref:Db, _tzset_js:Eb, emscripten_check_blocking_allowed:Fb, emscripten_date_now:Gb, emscripten_exit_with_live_runtime:Hb, emscripten_get_now:Ib, emscripten_num_logical_cores:Jb, emscripten_resize_heap:Kb, emscripten_runtime_keepalive_check:Lb, emscripten_set_main_loop:Mb, emscripten_sleep:Nb, environ_get:Ob, environ_sizes_get:Pb, exit:Qb, fd_close:Rb, fd_read:Sb, fd_seek:Tb, fd_write:Ub, memory:z}; lb.Ia || (lb.Ia = !0, Vb()); return {env:lb, wasi_snapshot_preview1:lb,}; } var Wb = new Int16Array(1), Xb = new Int8Array(Wb.buffer); Wb[0] = 25459; if (115 !== Xb[0] || 99 !== Xb[1]) { throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"; } if (g.ENVIRONMENT) { throw Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"); } function x(a, b) { Object.getOwnPropertyDescriptor(g, a) || Object.defineProperty(g, a, {configurable:!0, get() { w(`\`Module.${a}\` has been replaced by \`${b}\`` + " (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)"); }}); } function Yb(a) { return "FS_createPath" === a || "FS_createDataFile" === a || "FS_createPreloadedFile" === a || "FS_unlink" === a || "addRunDependency" === a || "FS_createLazyFile" === a || "FS_createDevice" === a || "removeRunDependency" === a; } function Zb(a, b) { "undefined" == typeof globalThis || Object.getOwnPropertyDescriptor(globalThis, a) || Object.defineProperty(globalThis, a, {configurable:!0, get() { b(); }}); } function $b(a, b) { Zb(a, () => { N(`\`${a}\` is not longer defined by emscripten. ${b}`); }); } $b("buffer", "Please use HEAP8.buffer or wasmMemory.buffer"); $b("asm", "Please use wasmExports instead"); function ac(a) { n || Object.getOwnPropertyDescriptor(g, a) || Object.defineProperty(g, a, {configurable:!0, get() { var b = `'${a}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`; Yb(a) && (b += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"); w(b); }}); } function Da(...a) { m && fs ? fs.writeSync(2, a.join(" ") + "\n") : console.warn(...a); } class bc { name="ExitStatus"; constructor(a) { this.message = `Program terminated with exit(${a})`; this.status = a; } } var cc = a => { a.terminate(); a.onmessage = b => { v(`received "${b.data.s}" command from terminated worker: ${a.la}`); }; }, gc = a => { t(!n, "Internal Error! cleanupThread() can only ever be called from main application thread!"); t(a, "Internal Error! Null pthread_ptr in cleanupThread!"); a = dc[a]; t(a); var b = a.o; delete dc[b]; O.push(a); ec.splice(ec.indexOf(a), 1); a.o = 0; m && a.unref(); fc(b); }, jc = a => { t(!n, "Internal Error! spawnThread() can only ever be called from main application thread!"); t(a.o, "Internal error, no pthread ptr!"); 0 == O.length && (hc(), ic(O[0])); var b = O.pop(); if (!b) { return 6; } t(!b.o, "Internal error!"); ec.push(b); dc[a.o] = b; b.o = a.o; var c = {s:"run", kb:a.jb, S:a.S, o:a.o,}; m && b.unref(); b.postMessage(c, a.Ga); return 0; }, Q = 0, Lb = () => kc || 0 < Q, R = (a, b, ...c) => { for (var d = 2 * c.length, e = lc(), f = mc(8 * d), k = f >> 3, l = 0; l < c.length; l++) { var r = c[l]; "bigint" == typeof r ? (H[k + 2 * l] = 1n, H[k + 2 * l + 1] = r) : (H[k + 2 * l] = 0n, xa[k + 2 * l + 1] = r); } a = nc(a, 0, d, f, b); oc(e); return a; }; function pc(a) { if (n) { return R(0, 1, a); } ta = a; if (!(kc || 0 < Q)) { t(!n, "Internal Error! terminateAllThreads() can only ever be called from main application thread!"); for (var b of ec) { cc(b); } for (b of O) { cc(b); } O = []; ec = []; dc = {}; g.onExit?.(a); A = !0; } ha(a, new bc(a)); } var qc = a => { a instanceof bc || "unwind" == a || ha(1, a); }; function rc(a) { if (n) { return R(1, 0, a); } t(0 < Q); --Q; Qb(a); } var Qb = (a, b) => { ta = a; sc(); if (n) { throw t(!b), rc(a), "unwind"; } (kc || 0 < Q) && !b && v(`program exited (with status: ${a}), but keepRuntimeAlive() is set (counter=${Q}) 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)`); pc(a); }, tc = a => { t("number" === typeof a); return "0x" + (a >>> 0).toString(16).padStart(8, "0"); }, O = [], ec = [], uc = [], dc = {}, vc = 1; function wc() { for (var a = navigator.hardwareConcurrency; a--;) { hc(); } Pa.unshift(() => { cb("loading-workers"); xc(() => db("loading-workers")); }); } function Ga() { uc.forEach(a => a()); } var ic = a => new Promise(b => { a.onmessage = f => { f = f.data; var k = f.s; if (f.$ && f.$ != I()) { var l = dc[f.$]; l ? l.postMessage(f, f.Ga) : v(`Internal error! Worker sent a message "${k}" to target pthread ${f.$}, but that thread no longer exists!`); } else { if ("checkMailbox" === k) { Ma(); } else if ("spawnThread" === k) { jc(f); } else if ("cleanupThread" === k) { gc(f.mb); } else if ("loaded" === k) { a.loaded = !0, m && !a.o && a.unref(), b(a); } else if ("alert" === k) { alert(`Thread ${f.nb}: ${f.text}`); } else if ("setimmediate" === f.target) { a.postMessage(f); } else if ("callHandler" === k) { g[f.Ra](...f.args); } else { k && v(`worker sent an unknown command ${k}`); } } }; a.onerror = f => { var k = "worker sent an error!"; a.o && (k = `Pthread ${tc(a.o)} sent an error!`); v(`${k} ${f.filename}:${f.lineno}: ${f.message}`); throw f; }; m && (a.on("message", f => a.onmessage({data:f})), a.on("error", f => a.onerror(f))); t(z instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); t(sa instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); var c = [], d = ["onExit", "onAbort", "print", "printErr",], e; for (e of d) { g.propertyIsEnumerable(e) && c.push(e); } a.la = vc++; a.postMessage({s:"load", Sa:c, sb:z, tb:sa, workerID:a.la,}); }); function xc(a) { n ? a() : Promise.all(O.map(ic)).then(a); } function hc() { var a = {workerData:"em-pthread", name:"em-pthread-" + vc,}; var b = ia; g.mainScriptUrlOrBlob && (b = g.mainScriptUrlOrBlob, "string" != typeof b && (b = URL.createObjectURL(b))); a = new Worker(b, a); O.push(a); } var Za = a => { for (; 0 < a.length;) { a.shift()(g); } }, Ea = a => { var b = F[a + 52 >> 2]; a = b - F[a + 56 >> 2]; t(0 != b); t(0 != a); t(b > a, "stackHigh must be higher then stackLow"); yc(b, a); oc(b); }, Ia = (a, b) => { kc = Q = 0; a = zc(a, b); kc || 0 < Q ? ta = a : Ac(a); }, kc = g.noExitRuntime || !0, N = a => { N.ja || (N.ja = {}); N.ja[a] || (N.ja[a] = 1, m && (a = "warning: " + a), v(a)); }, Bc = (a, b) => { for (var c = 0, d = a.length - 1; 0 <= d; d--) { var e = a[d]; "." === e ? a.splice(d, 1) : ".." === e ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--); } if (b) { for (; c; c--) { a.unshift(".."); } } return a; }, Cc = a => { var b = "/" === a.charAt(0), c = "/" === a.substr(-1); (a = Bc(a.split("/").filter(d => !!d), !b).join("/")) || b || (a = "."); a && c && (a += "/"); return (b ? "/" : "") + a; }, Dc = a => { var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1); a = b[0]; b = b[1]; if (!a && !b) { return "."; } b &&= b.substr(0, b.length - 1); return a + b; }, Ec = a => { if ("/" === a) { return "/"; } a = Cc(a); a = a.replace(/\/$/, ""); var b = a.lastIndexOf("/"); return -1 === b ? a : a.substr(b + 1); }, Fc = () => { if (!(kc || 0 < Q)) { try { n ? Ac(ta) : Qb(ta); } catch (a) { qc(a); } } }, Gc = a => { if (A) { v("user callback triggered after runtime exited or application aborted. Ignoring."); } else { try { a(), Fc(); } catch (b) { qc(b); } } }, Hc = (a, b) => { Q += 1; return setTimeout(() => { t(0 < Q); --Q; Gc(a); }, b); }, Ic = g.preloadPlugins || [], Jc = !1, Kc = !1, Lc = []; function Mc() { function a() { Kc = document.pointerLockElement === g.canvas || document.mozPointerLockElement === g.canvas || document.webkitPointerLockElement === g.canvas || document.msPointerLockElement === g.canvas; } if (!Nc) { Nc = !0; Ic.push({canHandle:function(c) { return !g.noImageDecoding && /\.(jpg|jpeg|png|bmp|webp)$/i.test(c); }, handle:function(c, d, e, f) { var k = new Blob([c], {type:Oc(d)}); k.size !== c.length && (k = new Blob([(new Uint8Array(c)).buffer], {type:Oc(d)})); var l = URL.createObjectURL(k); t("string" == typeof l, "createObjectURL must return a url as a string"); var r = new Image(); r.onload = () => { t(r.complete, `Image ${d} could not be decoded`); var p = document.createElement("canvas"); p.width = r.width; p.height = r.height; p.getContext("2d").drawImage(r, 0, 0); URL.revokeObjectURL(l); e?.(c); }; r.onerror = () => { v(`Image ${l} could not be decoded`); f?.(); }; r.src = l; }}); Ic.push({canHandle:function(c) { return !g.noAudioDecoding && c.substr(-4) in {".ogg":1, ".wav":1, ".mp3":1}; }, handle:function(c, d, e) { function f() { k || (k = !0, e?.(c)); } var k = !1, l = URL.createObjectURL(new Blob([c], {type:Oc(d)})); t("string" == typeof l, "createObjectURL must return a url as a string"); var r = new Audio(); r.addEventListener("canplaythrough", () => f(r), !1); r.onerror = function() { if (!k) { v(`warning: browser could not fully decode audio ${d}, trying slower base64 approach`); for (var p = "", y = 0, B = 0, E = 0; E < c.length; E++) { for (y = y << 8 | c[E], B += 8; 6 <= B;) { var wa = y >> B - 6 & 63; B -= 6; p += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[wa]; } } 2 == B ? (p += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(y & 3) << 4], p += "==") : 4 == B && (p += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(y & 15) << 2], p += "="); r.src = "data:audio/x-" + d.substr(-3) + ";base64," + p; f(r); } }; r.src = l; Hc(() => { f(r); }, 10000); }}); var b = g.canvas; b && (b.requestPointerLock = b.requestPointerLock || b.mozRequestPointerLock || b.webkitRequestPointerLock || b.msRequestPointerLock || (() => { }), b.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock || document.msExitPointerLock || (() => { }), b.exitPointerLock = b.exitPointerLock.bind(document), document.addEventListener("pointerlockchange", a, !1), document.addEventListener("mozpointerlockchange", a, !1), document.addEventListener("webkitpointerlockchange", a, !1), document.addEventListener("mspointerlockchange", a, !1), g.elementPointerLock && b.addEventListener("click", c => { !Kc && g.canvas.requestPointerLock && (g.canvas.requestPointerLock(), c.preventDefault()); }, !1)); } } function Pc(a, b, c, d) { if (b && g.ctx && a == g.canvas) { return g.ctx; } var e; if (b) { var f = {antialias:!1, alpha:!1, ab:1,}; if (d) { for (var k in d) { f[k] = d[k]; } } if ("undefined" != typeof Qc && (e = Rc(a, f))) { var l = Sc[e].aa; } } else { l = a.getContext("2d"); } if (!l) { return null; } c && (b || t("undefined" == typeof Tc, "cannot set in module if GLctx is used, but we are a non-GL context that would replace it"), g.ctx = l, b && (Uc = Sc[e], g.ctx = Tc = Uc?.aa), Lc.forEach(r => r()), Mc()); return l; } var Vc = !1, Wc = void 0, Xc = void 0; function Yc() { if (!Jc) { return !1; } (document.exitFullscreen || document.cancelFullScreen || document.mozCancelFullScreen || document.msExitFullscreen || document.webkitCancelFullScreen || (() => { })).apply(document, []); return !0; } function Oc(a) { return {jpg:"image/jpeg", jpeg:"image/jpeg", png:"image/png", bmp:"image/bmp", ogg:"audio/ogg", wav:"audio/wav", mp3:"audio/mpeg"}[a.substr(a.lastIndexOf(".") + 1)]; } function Zc(a) { switch(a.type) { case "DOMMouseScroll": var b = a.detail / 3; break; case "mousewheel": b = a.wheelDelta / 120; break; case "wheel": b = a.deltaY; switch(a.deltaMode) { case 0: b /= 100; break; case 1: b /= 3; break; case 2: b *= 80; break; default: throw "unrecognized mouse wheel delta mode: " + a.deltaMode; }break; default: throw "unrecognized mouse wheel event: " + a.type; } return b; } var $c = 0, ad = 0, bd = 0, cd = 0, dd = {}, ed = {}; function fd(a, b) { var c = g.canvas.getBoundingClientRect(), d = g.canvas.width, e = g.canvas.height, f = "undefined" != typeof window.scrollX ? window.scrollX : window.pageXOffset, k = "undefined" != typeof window.scrollY ? window.scrollY : window.pageYOffset; t("undefined" != typeof f && "undefined" != typeof k, "Unable to retrieve scroll position, mouse positions likely broken."); a -= f + c.left; b -= k + c.top; a *= d / c.width; b *= e / c.height; return {x:a, y:b}; } function gd(a) { if (Kc) { "mousemove" != a.type && "mozMovementX" in a ? bd = cd = 0 : (bd = a.movementX || a.mozMovementX || a.webkitMovementX || 0, cd = a.movementY || a.mozMovementY || a.webkitMovementY || 0), $c += bd, ad += cd; } else { if ("touchstart" === a.type || "touchend" === a.type || "touchmove" === a.type) { var b = a.M; if (void 0 !== b) { var c = fd(b.pageX, b.pageY); if ("touchstart" === a.type) { ed[b.identifier] = c, dd[b.identifier] = c; } else if ("touchend" === a.type || "touchmove" === a.type) { (a = dd[b.identifier]) || (a = c), ed[b.identifier] = a, dd[b.identifier] = c; } } } else { const {x:d, y:e} = fd(a.pageX, a.pageY); bd = d - $c; cd = e - ad; $c = d; ad = e; } } } var hd = []; function jd() { var a = g.canvas; hd.forEach(b => b(a.width, a.height)); } function kd(a, b, c) { ld(g.canvas, a, b); c || jd(); } function ld(a, b, c) { b && c ? (a.wb = b, a.Ta = c) : (b = a.wb, c = a.Ta); var d = b, e = c; g.forcedAspectRatio && 0 < g.forcedAspectRatio && (d / e < g.forcedAspectRatio ? d = Math.round(e * g.forcedAspectRatio) : e = Math.round(d / g.forcedAspectRatio)); if ((document.fullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.webkitFullscreenElement || document.webkitCurrentFullScreenElement) === a.parentNode && "undefined" != typeof screen) { var f = Math.min(screen.width / d, screen.height / e); d = Math.round(d * f); e = Math.round(e * f); } Xc ? (a.width != d && (a.width = d), a.height != e && (a.height = e), "undefined" != typeof a.style && (a.style.removeProperty("width"), a.style.removeProperty("height"))) : (a.width != b && (a.width = b), a.height != c && (a.height = c), "undefined" != typeof a.style && (d != b || e != c ? (a.style.setProperty("width", d + "px", "important"), a.style.setProperty("height", e + "px", "important")) : (a.style.removeProperty("width"), a.style.removeProperty("height")))); } var Nc; function ob() { return n ? R(2, 1) : Date.now() - S.startTime | 0; } function qb(a) { if (n) { return R(3, 1, a); } var b = S.J[a]; b.locked++; if (1 < b.locked) { return 0; } b.buffer || (b.buffer = md(b.width * b.height * 4), F[a + 20 >> 2] = b.buffer); F[a + 20 >> 2] = b.buffer; if (a == S.screen && g.qc && b.image) { return 0; } if (S.K.qa) { if (b.image || (b.image = b.D.createImageData(b.width, b.height)), !S.K.ga) { return; } } else { b.image = b.D.getImageData(0, 0, b.width, b.height); } if (a == S.screen && S.K.ga) { a = b.image.data; for (var c = a.length, d = 0; d < c / 4; d++) { a[4 * d + 3] = 255; } } if (S.K.Na && !S.K.qa) { if (b.wa(2097152)) { throw "CopyOnLock is not supported for SDL_LockSurface with SDL_HWPALETTE flag set" + Error().stack; } ua.set(b.image.data, b.buffer); } return 0; } var wd = (a, b) => { nd = a; od = b; if (pd) { if (qd || (Q += 1, qd = !0), 0 == a) { T = function() { setTimeout(rd, Math.max(0, sd + b - (performance.timeOrigin + performance.now())) | 0); }, td = "timeout"; } else if (1 == a) { T = function() { ud(rd); }, td = "rAF"; } else if (2 == a) { if ("undefined" == typeof vd) { if ("undefined" == typeof setImmediate) { var c = []; addEventListener("message", d => { if ("setimmediate" === d.data || "setimmediate" === d.data.target) { d.stopPropagation(), c.shift()(); } }, !0); vd = d => { c.push(d); if (h) { let e; (e = g).setImmediates ?? (e.setImmediates = []); g.setImmediates.push(d); postMessage({target:"setimmediate"}); } else { postMessage("setimmediate", "*"); } }; } else { vd = setImmediate; } } T = function() { vd(rd); }; td = "immediate"; } } else { v("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."); } }, Ib = () => performance.timeOrigin + performance.now(), Fd = (a, b, c, d, e) => { function f() { return k < xd ? (t(0 < Q), --Q, Fc(), !1) : !0; } t(!pd, "emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."); pd = a; yd = d; var k = xd; qd = !1; rd = function() { if (!A) { if (0 < zd.length) { var l = zd.shift(); l.Ub(l.S); if (Ad) { var r = Ad, p = 0 == r % 1 ? r - 1 : Math.floor(r); Ad = l.Kb ? p : (8 * r + (p + 0.5)) / 9; } g.setStatus && (l = g.statusMessage || "Please wait...", r = Ad ?? 0, p = Bd.Qb ?? 0, r ? r < p ? g.setStatus("{message} ({expected - remaining}/{expected})") : g.setStatus(l) : g.setStatus("")); f() && setTimeout(rd, 0); } else { if (f()) { if (Cd = Cd + 1 | 0, 1 == nd && 1 < od && 0 != Cd % od) { T(); } else { 0 == nd && (sd = performance.timeOrigin + performance.now()); "timeout" === td && g.ctx && (N("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"), td = ""); a: { if (!A) { for (l of Dd) { if (!1 === l()) { break a; } } Gc(a); for (r of Ed) { r(); } } } f() && T(); } } } } }; e || (b && 0 < b ? wd(0, 1000.0 / b) : wd(1, 1), T()); if (c) { throw "unwind"; } }, qd = !1, T = null, td = "", xd = 0, pd = null, yd = 0, nd = 0, od = 0, Cd = 0, zd = [], Dd = [], Ed = []; function Gd() { T = null; xd++; } function Hd() { xd++; var a = nd, b = od, c = pd; pd = null; Fd(c, 0, !1, yd, !0); wd(a, b); T(); } var Id = 0; function ud(a) { if ("function" == typeof requestAnimationFrame) { requestAnimationFrame(a); } else { var b = Date.now(); if (0 === Id) { Id = b + 1000 / 60; } else { for (; b + 2 >= Id;) { Id += 1000 / 60; } } setTimeout(a, Math.max(Id - b, 0)); } } var Bd = {}, sd, rd, vd, Ad, Jd = 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; }, Kd = (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 k = a.charCodeAt(f); if (55296 <= k && 57343 >= k) { var l = a.charCodeAt(++f); k = 65536 + ((k & 1023) << 10) | l & 1023; } if (127 >= k) { if (c >= d) { break; } b[c++] = k; } else { if (2047 >= k) { if (c + 1 >= d) { break; } b[c++] = 192 | k >> 6; } else { if (65535 >= k) { if (c + 2 >= d) { break; } b[c++] = 224 | k >> 12; } else { if (c + 3 >= d) { break; } 1114111 < k && N("Invalid Unicode code point " + tc(k) + " 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 | k >> 18; b[c++] = 128 | k >> 12 & 63; } b[c++] = 128 | k >> 6 & 63; } b[c++] = 128 | k & 63; } } b[c] = 0; return c - e; }; function Ld(a, b) { var c = Array(Jd(a) + 1); a = Kd(a, c, 0, c.length); b && (c.length = a); return c; } function Md(a) { return {x:D[a >> 2], y:D[a + 4 >> 2], w:D[a + 8 >> 2], m:D[a + 12 >> 2]}; } function Nd(a, b, c) { var d = c & 134217729, e = c & 2097152, f = c & 67108864, k = md(60), l = md(44), r = e ? 1 : 4; e = 0; d || f || (e = md(a * b * 4)); D[k >> 2] = c; F[k + 4 >> 2] = l; D[k + 8 >> 2] = a; D[k + 12 >> 2] = b; D[k + 16 >> 2] = a * r; F[k + 20 >> 2] = e; D[k + 36 >> 2] = 0; D[k + 40 >> 2] = 0; D[k + 44 >> 2] = g.canvas.width; D[k + 48 >> 2] = g.canvas.height; D[k + 56 >> 2] = 1; D[l >> 2] = -2042224636; D[l + 4 >> 2] = 0; C[l + 8] = 8 * r; C[l + 9] = r; D[l + 12 >> 2] = 255; D[l + 16 >> 2] = 65280; D[l + 20 >> 2] = 16711680; D[l + 24 >> 2] = 4278190080; S.R = S.R || f; d = g.canvas; f = Pc(d, f, !0, {antialias:0 != S.P[13] && 1 < S.P[14], depth:0 < S.P[6], stencil:0 < S.P[7], alpha:0 < S.P[3]}); S.J[k] = {width:a, height:b, canvas:d, D:f, lb:k, buffer:e, hb:l, alpha:255, flags:c, locked:0, qb:!0, source:"screen", wa:p => c & p}; return k; } function Od() { var a = S.screen, b = a + 56, c = D[b >> 2]; 1 < c ? D[b >> 2] = c - 1 : (b = S.J[a], !b.qb && b.canvas && S.La.push(b.canvas), b.buffer && Pd(b.buffer), Pd(b.hb), Pd(a), S.J[a] = null, a === S.screen && (S.screen = null)); } function Qd(a) { var b = a.keyCode; 65 <= b && 90 >= b ? b += 32 : (b = S.Za[b] || (128 > b ? b : 0), 2 === a.location && 1248 <= b && 1251 >= b && (b += 4)); return b; } function Rd(a) { if (S.va & 512 && S.Ya) { for (var b in S.ea) { var c = b - 1; var d = S.getGamepads(); c = d.length > c && 0 <= c ? d[c] : null; d = S.ea[b]; if ("undefined" == typeof c) { break; } if (null === c) { break; } if ("number" != typeof c.timestamp || c.timestamp != d.timestamp || !c.timestamp) { var e; for (e = 0; e < c.buttons.length; e++) { var f = Sd(c.buttons[e]); f !== d.buttons[e] && S.events.push({type:f ? "joystick_button_down" : "joystick_button_up", Xa:b, index:b - 1, button:e}); } for (e = 0; e < c.axes.length; e++) { c.axes[e] !== d.axes[e] && S.events.push({type:"joystick_axis_motion", Xa:b, index:b - 1, axis:e, value:c.axes[e]}); } d = b; e = Array(c.buttons.length); for (f = 0; f < c.buttons.length; f++) { e[f] = Sd(c.buttons[f]); } S.ea[d] = {buttons:e, axes:c.axes.slice(0), timestamp:c.timestamp, index:c.index, id:c.id}; } } } if (a) { for (; 0 < S.events.length;) { a: { d = void 0; c = S.events.shift(); b = a; if ("number" == typeof c) { Td(b, c, 28), Pd(c); } else { switch(S.handleEvent(c), c.type) { case "keydown": case "keyup": e = "keydown" === c.type; f = Qd(c); if (!f) { b = !1; break a; } 1024 <= f ? d = f - 1024 : d = S.ib[f] || f; D[b >> 2] = S.i[c.type]; C[b + 8] = e ? 1 : 0; C[b + 9] = 0; D[b + 12 >> 2] = d; D[b + 16 >> 2] = f; va[b + 20 >> 1] = S.Aa; D[b + 24 >> 2] = c.$a || f; break; case "keypress": D[b >> 2] = S.i[c.type]; c = Ld(String.fromCharCode(c.charCode)); for (d = 0; d < c.length; ++d) { C[b + (8 + d)] = c[d]; } break; case "mousedown": case "mouseup": case "mousemove": "mousemove" != c.type ? (e = "mousedown" === c.type, D[b >> 2] = S.i[c.type], D[b + 4 >> 2] = 0, D[b + 8 >> 2] = 0, D[b + 12 >> 2] = 0, C[b + 16] = c.button + 1, C[b + 17] = e ? 1 : 0, D[b + 20 >> 2] = $c, D[b + 24 >> 2] = ad) : (D[b >> 2] = S.i[c.type], D[b + 4 >> 2] = 0, D[b + 8 >> 2] = 0, D[b + 12 >> 2] = 0, D[b + 16 >> 2] = S.N, D[b + 20 >> 2] = $c, D[b + 24 >> 2] = ad, D[b + 28 >> 2] = bd, D[b + 32 >> 2] = cd); break; case "wheel": D[b >> 2] = S.i[c.type]; D[b + 16 >> 2] = c.deltaX; D[b + 20 >> 2] = c.deltaY; break; case "touchstart": case "touchend": case "touchmove": d = c.M; if (!dd[d.identifier]) { break; } var k = g.canvas.width, l = g.canvas.height; e = dd[d.identifier].x / k; f = dd[d.identifier].y / l; k = e - ed[d.identifier].x / k; l = f - ed[d.identifier].y / l; void 0 === d.deviceID && (d.U = S.Ha); if (0 === k && 0 === l && "touchmove" === c.type) { b = !1; break a; } D[b >> 2] = S.i[c.type]; D[b + 4 >> 2] = ob(); H[b + 8 >> 3] = BigInt(d.U); H[b + 16 >> 3] = BigInt(d.identifier); G[b + 24 >> 2] = e; G[b + 28 >> 2] = f; G[b + 32 >> 2] = k; G[b + 36 >> 2] = l; G[b + 40 >> 2] = void 0 !== d.force ? d.force : "touchend" == c.type ? 0 : 1; break; case "unload": D[b >> 2] = S.i[c.type]; break; case "resize": D[b >> 2] = S.i[c.type]; D[b + 4 >> 2] = c.w; D[b + 8 >> 2] = c.m; break; case "joystick_button_up": case "joystick_button_down": d = "joystick_button_up" === c.type ? 0 : 1; D[b >> 2] = S.i[c.type]; C[b + 4] = c.index; C[b + 5] = c.button; C[b + 6] = d; break; case "joystick_axis_motion": D[b >> 2] = S.i[c.type]; C[b + 4] = c.index; C[b + 5] = c.axis; c = c.value; c = Math.min(1, Math.max(c, -1)); D[b + 8 >> 2] = Math.ceil(32767.5 * (c + 1) - 32768); break; case "focus": D[b >> 2] = S.i[c.type]; D[b + 4 >> 2] = 0; C[b + 8] = 12; break; case "blur": D[b >> 2] = S.i[c.type]; D[b + 4 >> 2] = 0; C[b + 8] = 13; break; case "visibilitychange": d = c.visible ? 1 : 2; D[b >> 2] = S.i[c.type]; D[b + 4 >> 2] = 0; C[b + 8] = d; break; default: throw "Unhandled SDL event: " + c.type; } } b = void 0; } if (!1 !== b) { return 1; } } return 0; } return 0 < S.events.length; } function Sd(a) { return "object" == typeof a ? a.pressed : 0 < a; } var S = {K:{width:320, height:200, Na:!0, qa:!1, ga:!0,}, version:null, J:{}, La:[], events:[], fonts:[null], Ab:[null], pc:[null], Da:{audio:null, volume:1,}, hc:22050, fc:32784, ic:2, ec:1024, Hb:0, R:!1, P:{0:3, 1:3, 2:2, 3:0, 4:0, 5:1, 6:16, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:1, 16:0, 17:0, 18:0,}, H:null, da:{}, na:!1, xa:!1, Fa:!1, unicode:!1, ob:null, audio:null, startTime:null, va:0, N:0, Aa:0, C:[0, 0, 0], i:{}, Ha:0, ra:null, Pa:null, sa:0, Za:{16:1249, 17:1248, 18:1250, 20:1081, 33:1099, 34:1102, 35:1101, 36:1098, 37:1104, 38:1106, 39:1103, 40:1105, 44:316, 45:1097, 46:127, 91:1251, 93:1125, 96:1122, 97:1113, 98:1114, 99:1115, 100:1116, 101:1117, 102:1118, 103:1119, 104:1120, 105:1121, 106:1109, 107:1111, 109:1110, 110:1123, 111:1108, 112:1082, 113:1083, 114:1084, 115:1085, 116:1086, 117:1087, 118:1088, 119:1089, 120:1090, 121:1091, 122:1092, 123:1093, 124:1128, 125:1129, 126:1130, 127:1131, 128:1132, 129:1133, 130:1134, 131:1135, 132:1136, 133:1137, 134:1138, 135:1139, 144:1107, 160:94, 161:33, 162:34, 163:35, 164:36, 165:37, 166:38, 167:95, 168:40, 169:41, 170:42, 171:43, 172:124, 173:45, 174:123, 175:125, 176:126, 181:127, 182:129, 183:128, 188:44, 190:46, 191:47, 192:96, 219:91, 220:92, 221:93, 222:39, 224:1251,}, ib:{8:42, 9:43, 13:40, 27:41, 32:44, 35:204, 39:53, 44:54, 46:55, 47:56, 48:39, 49:30, 50:31, 51:32, 52:33, 53:34, 54:35, 55:36, 56:37, 57:38, 58:203, 59:51, 61:46, 91:47, 92:49, 93:48, 96:52, 97:4, 98:5, 99:6, 100:7, 101:8, 102:9, 103:10, 104:11, 105:12, 106:13, 107:14, 108:15, 109:16, 110:17, 111:18, 112:19, 113:20, 114:21, 115:22, 116:23, 117:24, 118:25, 119:26, 120:27, 121:28, 122:29, 127:76, 305:224, 308:226, 316:70,}, Ib(a) { -2042224636 != D[a >> 2] && N("Unsupported pixel format!"); }, cc(a) { a = D[a >> 2]; return "rgb(" + (a & 255) + "," + (a >> 8 & 255) + "," + (a >> 16 & 255) + ")"; }, dc(a) { a = D[a >> 2]; return "rgba(" + (a & 255) + "," + (a >> 8 & 255) + "," + (a >> 16 & 255) + "," + (a >> 24 & 255) / 255 + ")"; }, uc:a => "rgba(" + (a & 255) + "," + (a >> 8 & 255) + "," + (a >> 16 & 255) + "," + (a >>> 24) / 255 + ")", vc:(a, b, c, d) => "rgba(" + (a & 255) + "," + (b & 255) + "," + (c & 255) + "," + (d & 255) / 255 + ")", wc:(a, b, c, d) => a | b << 8 | c << 16 | d << 24, Bb(a, b, c, d, e) { a = S.J[a]; var f = S.J[c], k, l; b ? k = Md(b) : k = {x:0, y:0, w:a.width, m:a.height}; d ? l = Md(d) : l = {x:0, y:0, w:a.width, m:a.height}; if (f.Ma) { b = e && 0 !== k.w ? k.w / l.w : 1; var r = e && 0 !== k.m ? k.m / l.m : 1, p = f.Ma, y = Math.max(p.x, l.x), B = Math.max(p.y, l.y); l = {x:y, y:B, w:Math.max(y, Math.min(p.x + p.w, l.x + l.w)) - y, m:Math.max(B, Math.min(p.y + p.m, l.y + l.m)) - B}; k.w = l.w * b; k.m = l.m * r; d && (b = l, D[d >> 2] = b.x, D[d + 4 >> 2] = b.y, D[d + 8 >> 2] = b.w, D[d + 12 >> 2] = b.m); } e ? (d = l.w, e = l.m) : (d = k.w, e = k.m); if (0 === k.w || 0 === k.m || 0 === d || 0 === e) { return 0; } b = f.D.globalAlpha; f.D.globalAlpha = a.alpha / 255; f.D.drawImage(a.canvas, k.x, k.y, k.w, k.m, l.x, l.y, d, e); f.D.globalAlpha = b; c != S.screen && (N("WARNING: copying canvas data to memory for compatibility"), qb(c), f.locked--); return 0; }, V:{}, Z:null, B(a) { function b() { for (var k of Object.values(S.da)) { S.events.push({type:"keyup", keyCode:k,}); } } switch(a.type) { case "touchstart": case "touchmove": a.preventDefault(); var c = []; if ("touchstart" === a.type) { for (var d = 0; d < a.touches.length; d++) { var e = a.touches[d]; 1 != S.V[e.identifier] && (S.V[e.identifier] = !0, c.push(e)); } } else { c = a.touches; } if (d = c[0]) { "touchstart" == a.type && (S.C[0] = 1); switch(a.type) { case "touchstart": var f = "mousedown"; break; case "touchmove": f = "mousemove"; } f = {type:f, button:0, pageX:d.clientX, pageY:d.clientY}; S.events.push(f); } for (d = 0; d < c.length; d++) { e = c[d], S.events.push({type:a.type, M:e}); } break; case "touchend": a.preventDefault(); for (d = 0; d < a.changedTouches.length; d++) { e = a.changedTouches[d], !0 === S.V[e.identifier] && delete S.V[e.identifier]; } f = {type:"mouseup", button:0, pageX:a.changedTouches[0].clientX, pageY:a.changedTouches[0].clientY}; S.C[0] = 0; S.events.push(f); for (d = 0; d < a.changedTouches.length; d++) { e = a.changedTouches[d], S.events.push({type:"touchend", M:e}); } break; case "DOMMouseScroll": case "mousewheel": case "wheel": c = -Zc(a); c = 0 == c ? 0 : 0 < c ? Math.max(c, 1) : Math.min(c, -1); f = (0 < c ? 4 : 5) - 1; S.events.push({type:"mousedown", button:f, pageX:a.pageX, pageY:a.pageY}); S.events.push({type:"mouseup", button:f, pageX:a.pageX, pageY:a.pageY}); S.events.push({type:"wheel", deltaX:0, deltaY:c}); a.preventDefault(); break; case "mousemove": if (1 === S.C[0] && S.events.push({type:"touchmove", M:{identifier:0, U:-1, pageX:a.pageX, pageY:a.pageY}}), Kc && ("mozMovementX" in a && (a.movementX = a.mozMovementX, a.movementY = a.mozMovementY), 0 == a.movementX && 0 == a.movementY)) { a.preventDefault(); return; } case "keydown": case "keyup": case "keypress": case "mousedown": case "mouseup": "keydown" === a.type && (S.unicode || S.Fa) && "Backspace" != a.key && "Tab" != a.key || a.preventDefault(); if ("mousedown" == a.type) { S.C[a.button] = 1, S.events.push({type:"touchstart", M:{identifier:0, U:-1, pageX:a.pageX, pageY:a.pageY}}); } else if ("mouseup" == a.type) { if (!S.C[a.button]) { return; } S.events.push({type:"touchend", M:{identifier:0, U:-1, pageX:a.pageX, pageY:a.pageY}}); S.C[a.button] = 0; } if ("keydown" === a.type || "mousedown" === a.type) { S.na = !0; } else if ("keyup" === a.type || "mouseup" === a.type) { S.xa && (g.requestFullscreen(!0, !0), S.xa = !1), S.na = !1; } "keypress" === a.type && S.Z ? (S.Z.$a = a.charCode, S.Z = null) : "keydown" === a.type && (S.Z = a); ("keypress" !== a.type || S.Fa) && S.events.push(a); break; case "mouseout": for (d = 0; 3 > d; d++) { S.C[d] && (S.events.push({type:"mouseup", button:d, pageX:a.pageX, pageY:a.pageY}), S.C[d] = 0); } a.preventDefault(); break; case "focus": S.events.push(a); a.preventDefault(); break; case "blur": S.events.push(a); b(); a.preventDefault(); break; case "visibilitychange": S.events.push({type:"visibilitychange", visible:!document.hidden}); b(); a.preventDefault(); break; case "unload": rd && (S.events.push(a), rd()); return; case "resize": S.events.push(a), a.preventDefault && a.preventDefault(); } 10000 <= S.events.length && (v("SDL event queue full, dropping events"), S.events = S.events.slice(0, 10000)); if (S.ra) { for (; Rd(S.sa);) { dynCall_iii(S.ra, S.Pa, S.sa); } } }, handleEvent(a) { if (!a.Qa) { switch(a.Qa = !0, a.type) { case "touchstart": case "touchend": case "touchmove": gd(a); break; case "keydown": case "keyup": var b = "keydown" === a.type, c = Qd(a); if (!c) { break; } C[S.H + c] = b; S.Aa = (C[S.H + 1248] ? 64 : 0) | (C[S.H + 1249] ? 1 : 0) | (C[S.H + 1250] ? 256 : 0) | (C[S.H + 1252] ? 128 : 0) | (C[S.H + 1253] ? 2 : 0) | (C[S.H + 1254] ? 512 : 0); b ? S.da[c] = a.keyCode : delete S.da[c]; break; case "mousedown": case "mouseup": "mousedown" == a.type ? S.N |= 1 << a.button : "mouseup" == a.type && (S.N &= ~(1 << a.button)); case "mousemove": gd(a); } } }, Pb(a, b) { var c = a.name; "'" != c.charAt(0) && '"' != c.charAt(0) && (c = '"' + c + '"'); a = a.size + "px " + c + ", serif"; c = S.ob; t(c, "TTF_Init must have been called"); c.font = a; return c.measureText(b).width | 0; }, yb(a) { if (!(S.fa && S.fa >= a && 0 != a)) { S.fa = a; S.channels = []; for (var b = 0; b < a; b++) { S.channels[b] = {audio:null, volume:1.0}; } } }, rc(a, b) { if (!a) { return 0; } var c = 128 * a.volume; if (-1 != b && (a.volume = Math.min(Math.max(b, 0), 128) / 128, a.audio)) { try { a.audio.volume = a.volume, a.audio.ub && (a.audio.ub.gain.value = a.volume); } catch (d) { v(`setGetVolume failed to set audio volume: ${d}`); } } return c; }, sc(a, b, c, d) { a && a.audio && a.audio.vb && a.audio.vb.setPosition(b, c, d); }, mc(a) { if (a) { if (a.ka) { try { a.Lb = (S.T.currentTime - a.startTime) % a.oc.xc.Nb.duration, a.ka.onended = void 0, a.ka.stop(0), a.ka = void 0; } catch (b) { v(`pauseWebAudio failed: ${b}`); } } a.paused = !0; } }, kc() { S.T || ("undefined" != typeof AudioContext ? S.T = new AudioContext() : "undefined" != typeof webkitAudioContext && (S.T = new webkitAudioContext())); }, yc:() => !!S.T, Tb(a, b, c) { for (var d = S.audio, e = d.channels, f = 0; f < e; ++f) { var k = c.getChannelData(f); if (k.length != b) { throw "Web Audio output buffer length mismatch! Destination size: " + k.length + " samples vs expected " + b + " samples!"; } if (32784 == d.format) { for (var l = 0; l < b; ++l) { k[l] = va[a + 2 * (l * e + f) >> 1] / 32768; } } else if (8 == d.format) { for (l = 0; l < b; ++l) { var r = C[a + (l * e + f)]; k[l] = (0 <= r ? r - 128 : r + 128) / 128; } } else if (33056 == d.format) { for (l = 0; l < b; ++l) { k[l] = G[a + 4 * (l * e + f) >> 2]; } } else { throw "Invalid SDL audio format " + d.format + "!"; } } }, Mb(a) { Da("dumping surface " + [a.lb, a.source, a.width, a.height]); for (var b = a.D.getImageData(0, 0, a.width, a.height).data, c = Math.min(a.width, a.height), d = 0; d < c; d++) { Da(" diagonal " + d + ":" + [b[d * a.width * 4 + 4 * d], b[d * a.width * 4 + 4 * d + 1], b[d * a.width * 4 + 4 * d + 2], b[d * a.width * 4 + 4 * d + 3]]); } }, Ya:1, ea:{}, bc:{}, getGamepads() { var a = navigator.getGamepads || navigator.ac || navigator.Wb || navigator.F || navigator.webkitGetGamepads; return void 0 !== a ? a.apply(navigator) : []; },}, mb = () => { }, Ud = (a, b, c) => { t("number" == typeof c, "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); Kd(a, ua, b, c); }; function nb() { if (n) { return R(4, 1); } if (!S.errorMessage) { var a = S, b = Jd("unknown SDL-emscripten error") + 1, c = md(b); c && Ud("unknown SDL-emscripten error", c, b); a.errorMessage = c; } return S.errorMessage; } function pb(a) { if (n) { return R(5, 1, a); } S.startTime = Date.now(); S.va = a; g.doNotCaptureKeyboard || (a = g.keyboardListeningElement || document, a.addEventListener("keydown", S.B), a.addEventListener("keyup", S.B), a.addEventListener("keypress", S.B), window.addEventListener("focus", S.B), window.addEventListener("blur", S.B), document.addEventListener("visibilitychange", S.B)); window.addEventListener("unload", S.B); S.H = Vd(65536, 1); S.i.keydown = 768; S.i.keyup = 769; S.i.keypress = 771; S.i.mousedown = 1025; S.i.mouseup = 1026; S.i.mousemove = 1024; S.i.wheel = 1027; S.i.touchstart = 1792; S.i.touchend = 1793; S.i.touchmove = 1794; S.i.unload = 256; S.i.resize = 28673; S.i.visibilitychange = 512; S.i.focus = 512; S.i.blur = 512; S.i.joystick_axis_motion = 1536; S.i.joystick_button_down = 1539; S.i.joystick_button_up = 1540; return 0; } function rb(a) { return n ? R(6, 1, a) : Rd(a); } function Wd() { if (n) { return R(7, 1); } for (var a = 0; a < S.fa; ++a) { var b = S.channels[a]; b.audio && (b.audio.pause(), b.audio = void 0); } S.Da.audio?.pause(); S.Da.audio = void 0; } var sb = () => { Wd(); u("SDL_Quit called (and ignored)"); }, Tc, Xd = a => { var b = a.getExtension("ANGLE_instanced_arrays"); b && (a.vertexAttribDivisor = (c, d) => b.vertexAttribDivisorANGLE(c, d), a.drawArraysInstanced = (c, d, e, f) => b.drawArraysInstancedANGLE(c, d, e, f), a.drawElementsInstanced = (c, d, e, f, k) => b.drawElementsInstancedANGLE(c, d, e, f, k)); }, Yd = a => { var b = a.getExtension("OES_vertex_array_object"); b && (a.createVertexArray = () => b.createVertexArrayOES(), a.deleteVertexArray = c => b.deleteVertexArrayOES(c), a.bindVertexArray = c => b.bindVertexArrayOES(c), a.isVertexArray = c => b.isVertexArrayOES(c)); }, Zd = a => { var b = a.getExtension("WEBGL_draw_buffers"); b && (a.drawBuffers = (c, d) => b.drawBuffersWEBGL(c, d)); }, $d = a => { var b = "ANGLE_instanced_arrays EXT_blend_minmax EXT_disjoint_timer_query EXT_frag_depth EXT_shader_texture_lod EXT_sRGB OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_depth_texture WEBGL_draw_buffers EXT_clip_control EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_polygon_offset_clamp EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode".split(" "); return (a.getSupportedExtensions() || []).filter(c => b.includes(c)); }, ae = "undefined" != typeof TextDecoder ? new TextDecoder() : void 0, be = (a, b = 0) => { for (var c = b + NaN, d = b; a[d] && !(d >= c);) { ++d; } if (16 < d - b && a.buffer && ae) { return ae.decode(a.buffer instanceof ArrayBuffer ? a.subarray(b, d) : a.slice(b, d)); } for (c = ""; b < d;) { var e = a[b++]; if (e & 128) { var f = a[b++] & 63; if (192 == (e & 224)) { c += String.fromCharCode((e & 31) << 6 | f); } else { var k = a[b++] & 63; 224 == (e & 240) ? e = (e & 15) << 12 | f << 6 | k : (240 != (e & 248) && N("Invalid UTF-8 leading byte " + tc(e) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), e = (e & 7) << 18 | f << 12 | k << 6 | a[b++] & 63); 65536 > e ? c += String.fromCharCode(e) : (e -= 65536, c += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023)); } } else { c += String.fromCharCode(e); } } return c; }, ce = a => { t("number" == typeof a, `UTF8ToString expects a number (got ${typeof a})`); return a ? be(ua, a) : ""; }, Sc = {}, Rc = (a, b) => { a.F || (a.F = a.getContext, a.getContext = function(d, e) { e = a.F(d, e); return "webgl" == d == e instanceof WebGLRenderingContext ? e : null; }); var c = a.getContext("webgl", b); return c ? de(c, b) : 0; }, de = (a, b) => { var c = md(8); F[c + 4 >> 2] = I(); var d = {handle:c, attributes:b, version:b.ab, aa:a}; a.canvas && (a.canvas.xb = d); Sc[c] = d; ("undefined" == typeof b.Oa || b.Oa) && ee(d); return c; }, ee = a => { a ||= Uc; if (!a.Ua) { a.Ua = !0; var b = a.aa; b.jc = b.getExtension("WEBGL_multi_draw"); b.Sb = b.getExtension("EXT_polygon_offset_clamp"); b.Rb = b.getExtension("EXT_clip_control"); b.zc = b.getExtension("WEBGL_polygon_mode"); Xd(b); Yd(b); Zd(b); b.Ob = b.getExtension("EXT_disjoint_timer_query"); $d(b).forEach(c => { c.includes("lose_context") || c.includes("debug") || b.getExtension(c); }); } }, Qc = {}, Uc; function tb(a, b, c, d) { if (n) { return R(8, 1, a, b, c, d); } "touchstart touchend touchmove mousedown mouseup mousemove mousewheel wheel mouseout DOMMouseScroll".split(" ").forEach(e => g.canvas.addEventListener(e, S.B, !0)); c = g.canvas; 0 == a && 0 == b && (a = c.width, b = c.height); S.Ja || (S.Ja = !0, hd.push((e, f) => { S.Ea || S.B({type:"resize", w:e, m:f}); })); S.Ea = !0; kd(a, b); S.Ea = !1; S.screen && (Od(), t(!S.screen)); S.R && (d |= 67108864); S.screen = Nd(a, b, d); return S.screen; } function ub(a) { if (n) { return R(9, 1, a); } t(!S.R); var b = S.J[a]; if (b.locked && !(0 < --b.locked)) { if (b.wa(2097152)) { if (b.colors) { var c = g.canvas.width; a = c - 0; var d = g.canvas.height - 0, e = b.buffer; b.image.pa || (b.image.pa = new Uint32Array(b.image.data.buffer)); for (var f = b.image.pa, k = b.Jb, l = 0; l < d; ++l) { for (var r = l * c, p = 0; p < a; ++p) { f[r + p] = k[ua[e + (r + p)]]; } } } } else if (b.colors) { for (d = g.canvas.width, e = g.canvas.height, f = b.buffer, c = b.image.data, k = b.colors, l = 0; l < e; l++) { r = l * d * 4; for (p = 0; p < d; p++) { a = 4 * ua[f++]; var y = r + 4 * p; c[y] = k[a]; c[y + 1] = k[a + 1]; c[y + 2] = k[a + 2]; } f += 3 * d; } } else { if (c = b.image.data, d = b.buffer, t(0 == d % 4, "Invalid buffer offset: " + d), e = d >> 2, f = 0, k = a == S.screen, "undefined" != typeof CanvasPixelArray && c instanceof CanvasPixelArray) { for (d = c.length; f < d;) { a = D[e], c[f] = a & 255, c[f + 1] = a >> 8 & 255, c[f + 2] = a >> 16 & 255, c[f + 3] = k ? 255 : a >> 24 & 255, e++, f += 4; } } else { if (a = new Uint32Array(c.buffer), k && S.K.ga) { if (d = a.length, a.set(D.subarray(e, e + d)), c = new Uint8Array(c.buffer), a = 3, e = a + 4 * d, 0 == d % 8) { for (; a < e;) { c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0; } } else { for (; a < e;) { c[a] = 255, a = a + 4 | 0; } } } else { a.set(D.subarray(e, e + a.length)); } } } b.D.putImageData(b.image, 0, 0); } } var vb = (a, b, c, d) => w(`Assertion failed: ${ce(a)}, at: ` + [b ? ce(b) : "unknown filename", c, d ? ce(d) : "unknown function"]); function fe(a, b, c, d) { return n ? R(10, 1, a, b, c, d) : wb(a, b, c, d); } var wb = (a, b, c, d) => { if ("undefined" == typeof SharedArrayBuffer) { return Da("pthread_create: environment does not support SharedArrayBuffer, pthreads are not available"), 6; } var e = []; if (n && 0 === e.length) { return fe(a, b, c, d); } a = {jb:c, o:a, S:d, Ga:e,}; return n ? (a.s = "spawnThread", postMessage(a, e), 0) : jc(a); }, xb = () => w("native code called abort()"), yb = () => 1, zb = a => { Fa(a, !h, 1, !aa, 52428800, !1,); Ga(); }, Ha = a => { if ("function" === typeof Atomics.rb) { var b = Atomics.rb(D, a >> 2, a); t(b.async); b.value.then(Ma); Atomics.store(D, a + 128 >> 2, 1); } }, Ma = () => { var a = I(); a && (Ha(a), Gc(ge)); }, Ab = (a, b) => { a == b ? setTimeout(Ma) : n ? postMessage({$:a, s:"checkMailbox"}) : (b = dc[a]) ? b.postMessage({s:"checkMailbox"}) : v(`Cannot send message to thread with ID ${a}, unknown thread ID!`); }, he = [], Bb = (a, b, c, d, e) => { d /= 2; he.length = d; c = e >> 3; for (e = 0; e < d; e++) { he[e] = H[c + 2 * e] ? H[c + 2 * e + 1] : xa[c + 2 * e + 1]; } t(!b); c = ie[a]; t(!(a && b)); t(c.length == d, "Call args mismatch in _emscripten_receive_on_main_thread_js"); a = c(...he); t("bigint" != typeof a); return a; }, Cb = a => { n ? postMessage({s:"cleanupThread", mb:a}) : gc(a); }, Db = a => { m && dc[a].ref(); }, Eb = (a, b, c, d) => { var e = (new Date()).getFullYear(), f = (new Date(e, 0, 1)).getTimezoneOffset(); e = (new Date(e, 6, 1)).getTimezoneOffset(); F[a >> 2] = 60 * Math.max(f, e); D[b >> 2] = Number(f != e); b = k => { var l = Math.abs(k); return `UTC${0 <= k ? "-" : "+"}${String(Math.floor(l / 60)).padStart(2, "0")}${String(l % 60).padStart(2, "0")}`; }; a = b(f); b = b(e); t(a); t(b); t(16 >= Jd(a), `timezone name truncated to fit in TZNAME_MAX (${a})`); t(16 >= Jd(b), `timezone name truncated to fit in TZNAME_MAX (${b})`); e < f ? (Ud(a, c, 17), Ud(b, d, 17)) : (Ud(a, d, 17), Ud(b, c, 17)); }, Fb = () => { m || h || N("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"); }, Gb = () => Date.now(), Hb = () => { Q += 1; throw "unwind"; }, Jb = () => m ? require("os").cpus().length : navigator.hardwareConcurrency, Kb = a => { w(`Cannot enlarge memory arrays to size ${a >>> 0} bytes (OOM). Either (1) compile with -sINITIAL_MEMORY=X with X higher than the current value ${C.length}, (2) compile with -sALLOW_MEMORY_GROWTH which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -sABORTING_MALLOC=0`); }, Mb = (a, b, c) => { Fd(() => dynCall_v(a), b, c); }, Nb = a => je(b => Hc(b, a)); Nb.Va = !0; var ke = {}, me = () => { if (!le) { var a = {USER:"web_user", LOGNAME:"web_user", PATH:"/", PWD:"/", HOME:"/home/web_user", LANG:("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _:ea || "./this.program"}, b; for (b in ke) { void 0 === ke[b] ? delete a[b] : a[b] = ke[b]; } var c = []; for (b in a) { c.push(`${b}=${a[b]}`); } le = c; } return le; }, le; function Ob(a, b) { if (n) { return R(11, 1, a, b); } var c = 0; me().forEach((d, e) => { var f = b + c; e = F[a + 4 * e >> 2] = f; for (f = 0; f < d.length; ++f) { t(d.charCodeAt(f) === (d.charCodeAt(f) & 255)), C[e++] = d.charCodeAt(f); } C[e] = 0; c += d.length + 1; }); return 0; } function Pb(a, b) { if (n) { return R(12, 1, a, b); } var c = me(); F[a >> 2] = c.length; var d = 0; c.forEach(e => d += e.length + 1); F[b >> 2] = d; return 0; } var ne = () => { if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) { return c => (c.set(crypto.getRandomValues(new Uint8Array(c.byteLength))), c); } if (m) { try { var a = require("crypto"); if (a.randomFillSync) { return c => a.randomFillSync(c); } var b = a.randomBytes; return c => (c.set(b(c.byteLength)), c); } catch (c) { } } w("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };"); }, oe = a => (oe = ne())(a), pe = (...a) => { for (var b = "", c = !1, d = a.length - 1; -1 <= d && !c; d--) { c = 0 <= d ? a[d] : "/"; if ("string" != typeof c) { throw new TypeError("Arguments to path.resolve must be strings"); } if (!c) { return ""; } b = c + "/" + b; c = "/" === c.charAt(0); } b = Bc(b.split("/").filter(e => !!e), !c).join("/"); return (c ? "/" : "") + b || "."; }, qe = [], re = []; function se(a, b) { re[a] = {input:[], output:[], L:b}; te(a, ue); } var ue = {open(a) { var b = re[a.node.rdev]; if (!b) { throw new U(43); } a.tty = b; a.seekable = !1; }, close(a) { a.tty.L.fsync(a.tty); }, fsync(a) { a.tty.L.fsync(a.tty); }, read(a, b, c, d) { if (!a.tty || !a.tty.L.ua) { throw new U(60); } for (var e = 0, f = 0; f < d; f++) { try { var k = a.tty.L.ua(a.tty); } catch (l) { throw new U(29); } if (void 0 === k && 0 === e) { throw new U(6); } if (null === k || void 0 === k) { break; } e++; b[c + f] = k; } e && (a.node.timestamp = Date.now()); return e; }, write(a, b, c, d) { if (!a.tty || !a.tty.L.ha) { throw new U(60); } try { for (var e = 0; e < d; e++) { a.tty.L.ha(a.tty, b[c + e]); } } catch (f) { throw new U(29); } d && (a.node.timestamp = Date.now()); return e; },}, ve = {ua() { a: { if (!qe.length) { var a = null; if (m) { var b = Buffer.alloc(256), c = 0, d = process.stdin.fd; try { c = fs.readSync(d, b, 0, 256); } catch (e) { if (e.toString().includes("EOF")) { c = 0; } else { throw e; } } 0 < c && (a = b.slice(0, c).toString("utf-8")); } else { "undefined" != typeof window && "function" == typeof window.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n")); } if (!a) { a = null; break a; } qe = Ld(a, !0); } a = qe.shift(); } return a; }, ha(a, b) { null === b || 10 === b ? (u(be(a.output)), a.output = []) : 0 != b && a.output.push(b); }, fsync(a) { a.output && 0 < a.output.length && (u(be(a.output)), a.output = []); }, Xb() { return {Eb:25856, Gb:5, Db:191, Fb:35387, Cb:[3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]}; }, Yb() { return 0; }, Zb() { return [24, 80]; },}, we = {ha(a, b) { null === b || 10 === b ? (v(be(a.output)), a.output = []) : 0 != b && a.output.push(b); }, fsync(a) { a.output && 0 < a.output.length && (v(be(a.output)), a.output = []); },}; function xe(a, b) { var c = a.h ? a.h.length : 0; c >= b || (b = Math.max(b, c * (1048576 > c ? 2.0 : 1.125) >>> 0), 0 != c && (b = Math.max(b, 256)), c = a.h, a.h = new Uint8Array(b), 0 < a.l && a.h.set(c.subarray(0, a.l), 0)); } var V = {u:null, A() { return V.createNode(null, "/", 16895, 0); }, createNode(a, b, c, d) { if (24576 === (c & 61440) || 4096 === (c & 61440)) { throw new U(63); } V.u || (V.u = {dir:{node:{G:V.g.G, v:V.g.v, lookup:V.g.lookup, X:V.g.X, rename:V.g.rename, unlink:V.g.unlink, rmdir:V.g.rmdir, readdir:V.g.readdir, symlink:V.g.symlink}, stream:{I:V.j.I}}, file:{node:{G:V.g.G, v:V.g.v}, stream:{I:V.j.I, read:V.j.read, write:V.j.write, ma:V.j.ma, za:V.j.za, Ca:V.j.Ca}}, link:{node:{G:V.g.G, v:V.g.v, readlink:V.g.readlink}, stream:{}}, oa:{node:{G:V.g.G, v:V.g.v}, stream:ye}}); c = ze(a, b, c, d); 16384 === (c.mode & 61440) ? (c.g = V.u.dir.node, c.j = V.u.dir.stream, c.h = {}) : 32768 === (c.mode & 61440) ? (c.g = V.u.file.node, c.j = V.u.file.stream, c.l = 0, c.h = null) : 40960 === (c.mode & 61440) ? (c.g = V.u.link.node, c.j = V.u.link.stream) : 8192 === (c.mode & 61440) && (c.g = V.u.oa.node, c.j = V.u.oa.stream); c.timestamp = Date.now(); a && (a.h[b] = c, a.timestamp = c.timestamp); return c; }, Vb(a) { return a.h ? a.h.subarray ? a.h.subarray(0, a.l) : new Uint8Array(a.h) : new Uint8Array(0); }, g:{G(a) { var b = {}; b.dev = 8192 === (a.mode & 61440) ? a.id : 1; b.ino = a.id; b.mode = a.mode; b.nlink = 1; b.uid = 0; b.gid = 0; b.rdev = a.rdev; 16384 === (a.mode & 61440) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.l : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0; b.atime = new Date(a.timestamp); b.mtime = new Date(a.timestamp); b.ctime = new Date(a.timestamp); b.Ka = 4096; b.blocks = Math.ceil(b.size / b.Ka); return b; }, v(a, b) { void 0 !== b.mode && (a.mode = b.mode); void 0 !== b.timestamp && (a.timestamp = b.timestamp); if (void 0 !== b.size && (b = b.size, a.l != b)) { if (0 == b) { a.h = null, a.l = 0; } else { var c = a.h; a.h = new Uint8Array(b); c && a.h.set(c.subarray(0, Math.min(b, a.l))); a.l = b; } } }, lookup() { throw new U(44); }, X(a, b, c, d) { return V.createNode(a, b, c, d); }, rename(a, b, c) { if (16384 === (a.mode & 61440)) { try { var d = Ae(b, c); } catch (f) { } if (d) { for (var e in d.h) { throw new U(55); } } } delete a.parent.h[a.name]; a.parent.timestamp = Date.now(); a.name = c; b.h[c] = a; b.timestamp = a.parent.timestamp; }, unlink(a, b) { delete a.h[b]; a.timestamp = Date.now(); }, rmdir(a, b) { var c = Ae(a, b), d; for (d in c.h) { throw new U(55); } delete a.h[b]; a.timestamp = Date.now(); }, readdir(a) { var b = [".", ".."], c; for (c of Object.keys(a.h)) { b.push(c); } return b; }, symlink(a, b, c) { a = V.createNode(a, b, 41471, 0); a.link = c; return a; }, readlink(a) { if (40960 !== (a.mode & 61440)) { throw new U(28); } return a.link; },}, j:{read(a, b, c, d, e) { var f = a.node.h; if (e >= a.node.l) { return 0; } a = Math.min(a.node.l - e, d); t(0 <= a); if (8 < a && f.subarray) { b.set(f.subarray(e, e + a), c); } else { for (d = 0; d < a; d++) { b[c + d] = f[e + d]; } } return a; }, write(a, b, c, d, e, f) { t(!(b instanceof ArrayBuffer)); if (!d) { return 0; } a = a.node; a.timestamp = Date.now(); if (b.subarray && (!a.h || a.h.subarray)) { if (f) { return t(0 === e, "canOwn must imply no weird position inside the file"), a.h = b.subarray(c, c + d), a.l = d; } if (0 === a.l && 0 === e) { return a.h = b.slice(c, c + d), a.l = d; } if (e + d <= a.l) { return a.h.set(b.subarray(c, c + d), e), d; } } xe(a, e + d); if (a.h.subarray && b.subarray) { a.h.set(b.subarray(c, c + d), e); } else { for (f = 0; f < d; f++) { a.h[e + f] = b[c + f]; } } a.l = Math.max(a.l, e + d); return d; }, I(a, b, c) { 1 === c ? b += a.position : 2 === c && 32768 === (a.node.mode & 61440) && (b += a.node.l); if (0 > b) { throw new U(28); } return b; }, ma(a, b, c) { xe(a.node, b + c); a.node.l = Math.max(a.node.l, b + c); }, za(a, b, c, d, e) { if (32768 !== (a.node.mode & 61440)) { throw new U(43); } a = a.node.h; if (e & 2 || !a || a.buffer !== C.buffer) { d = !0; w("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported"); e = void 0; if (!e) { throw new U(48); } if (a) { if (0 < c || c + b < a.length) { a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b); } C.set(a, e); } } else { d = !1, e = a.byteOffset; } return {nc:e, zb:d}; }, Ca(a, b, c, d) { V.j.write(a, b, 0, d, c, !1); return 0; },},}, Be = (a, b) => { var c = 0; a && (c |= 365); b && (c |= 146); return c; }, Ce = {EPERM:63, ENOENT:44, ESRCH:71, EINTR:27, EIO:29, ENXIO:60, E2BIG:1, ENOEXEC:45, EBADF:8, ECHILD:12, EAGAIN:6, EWOULDBLOCK:6, ENOMEM:48, EACCES:2, EFAULT:21, ENOTBLK:105, EBUSY:10, EEXIST:20, EXDEV:75, ENODEV:43, ENOTDIR:54, EISDIR:31, EINVAL:28, ENFILE:41, EMFILE:33, ENOTTY:59, ETXTBSY:74, EFBIG:22, ENOSPC:51, ESPIPE:70, EROFS:69, EMLINK:34, EPIPE:64, EDOM:18, ERANGE:68, ENOMSG:49, EIDRM:24, ECHRNG:106, EL2NSYNC:156, EL3HLT:107, EL3RST:108, ELNRNG:109, EUNATCH:110, ENOCSI:111, EL2HLT:112, EDEADLK:16, ENOLCK:46, EBADE:113, EBADR:114, EXFULL:115, ENOANO:104, EBADRQC:103, EBADSLT:102, EDEADLOCK:16, EBFONT:101, ENOSTR:100, ENODATA:116, ETIME:117, ENOSR:118, ENONET:119, ENOPKG:120, EREMOTE:121, ENOLINK:47, EADV:122, ESRMNT:123, ECOMM:124, EPROTO:65, EMULTIHOP:36, EDOTDOT:125, EBADMSG:9, ENOTUNIQ:126, EBADFD:127, EREMCHG:128, ELIBACC:129, ELIBBAD:130, ELIBSCN:131, ELIBMAX:132, ELIBEXEC:133, ENOSYS:52, ENOTEMPTY:55, ENAMETOOLONG:37, ELOOP:32, EOPNOTSUPP:138, EPFNOSUPPORT:139, ECONNRESET:15, ENOBUFS:42, EAFNOSUPPORT:5, EPROTOTYPE:67, ENOTSOCK:57, ENOPROTOOPT:50, ESHUTDOWN:140, ECONNREFUSED:14, EADDRINUSE:3, ECONNABORTED:13, ENETUNREACH:40, ENETDOWN:38, ETIMEDOUT:73, EHOSTDOWN:142, EHOSTUNREACH:23, EINPROGRESS:26, EALREADY:7, EDESTADDRREQ:17, EMSGSIZE:35, EPROTONOSUPPORT:66, ESOCKTNOSUPPORT:137, EADDRNOTAVAIL:4, ENETRESET:39, EISCONN:30, ENOTCONN:53, ETOOMANYREFS:141, EUSERS:136, EDQUOT:19, ESTALE:72, ENOTSUP:138, ENOMEDIUM:148, EILSEQ:25, EOVERFLOW:61, ECANCELED:11, ENOTRECOVERABLE:56, EOWNERDEAD:62, ESTRPIPE:135,}, De = null, Ee = {}, Fe = [], Ge = 1, He = null, Va = !1, Ya = !0, U = class extends Error { name="ErrnoError"; constructor(a) { super(Ta ? ce(Ie(a)) : ""); this.O = a; for (var b in Ce) { if (Ce[b] === a) { this.code = b; break; } } } }, Je = {}, Ke = class { F={}; node=null; get object() { return this.node; } set object(a) { this.node = a; } get flags() { return this.F.flags; } set flags(a) { this.F.flags = a; } get position() { return this.F.position; } set position(a) { this.F.position = a; } }, Le = class { g={}; j={}; Y=null; constructor(a, b, c, d) { a ||= this; this.parent = a; this.A = a.A; this.id = Ge++; this.name = b; this.mode = c; this.rdev = d; } get read() { return 365 === (this.mode & 365); } set read(a) { a ? this.mode |= 365 : this.mode &= -366; } get write() { return 146 === (this.mode & 146); } set write(a) { a ? this.mode |= 146 : this.mode &= -147; } }; function W(a, b = {}) { a = pe(a); if (!a) { return {path:"", node:null}; } b = Object.assign({ta:!0, ia:0}, b); if (8 < b.ia) { throw new U(32); } a = a.split("/").filter(k => !!k); for (var c = De, d = "/", e = 0; e < a.length; e++) { var f = e === a.length - 1; if (f && b.parent) { break; } c = Ae(c, a[e]); d = Cc(d + "/" + a[e]); c.Y && (!f || f && b.ta) && (c = c.Y.root); if (!f || b.W) { for (f = 0; 40960 === (c.mode & 61440);) { if (c = Me(d), d = pe(Dc(d), c), c = W(d, {ia:b.ia + 1}).node, 40 < f++) { throw new U(32); } } } } return {path:d, node:c}; } function Ne(a, b) { for (var c = 0, d = 0; d < b.length; d++) { c = (c << 5) - c + b.charCodeAt(d) | 0; } return (a + c >>> 0) % He.length; } function Ae(a, b) { var c = 16384 === (a.mode & 61440) ? (c = Oe(a, "x")) ? c : a.g.lookup ? 0 : 2 : 54; if (c) { throw new U(c); } for (c = He[Ne(a.id, b)]; c; c = c.cb) { var d = c.name; if (c.parent.id === a.id && d === b) { return c; } } return a.g.lookup(a, b); } function ze(a, b, c, d) { t("object" == typeof a); a = new Le(a, b, c, d); b = Ne(a.parent.id, a.name); a.cb = He[b]; return He[b] = a; } function Pe(a) { var b = ["r", "w", "rw"][a & 3]; a & 512 && (b += "w"); return b; } function Oe(a, b) { if (Ya) { return 0; } if (!b.includes("r") || a.mode & 292) { if (b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73)) { return 2; } } else { return 2; } return 0; } function Qe(a, b) { try { return Ae(a, b), 20; } catch (c) { } return Oe(a, "wx"); } function Re(a) { a = Fe[a]; if (!a) { throw new U(8); } return a; } var ye = {open(a) { a.j = Ee[a.node.rdev].j; a.j.open?.(a); }, I() { throw new U(70); },}; function te(a, b) { Ee[a] = {j:b}; } function Se(a, b) { if ("string" == typeof a) { throw a; } var c = "/" === b, d = !b; if (c && De) { throw new U(10); } if (!c && !d) { var e = W(b, {ta:!1}); b = e.path; e = e.node; if (e.Y) { throw new U(10); } if (16384 !== (e.mode & 61440)) { throw new U(54); } } b = {type:a, lc:{}, Ba:b, bb:[]}; a = a.A(b); a.A = b; b.root = a; c ? De = a : e && (e.Y = b, e.A && e.A.bb.push(b)); } function Te(a, b, c) { var d = W(a, {parent:!0}).node; a = Ec(a); if (!a || "." === a || ".." === a) { throw new U(28); } var e = Qe(d, a); if (e) { throw new U(e); } if (!d.g.X) { throw new U(63); } return d.g.X(d, a, b, c); } function X(a) { return Te(a, 16895, 0); } function Ue(a, b, c) { "undefined" == typeof c && (c = b, b = 438); Te(a, b | 8192, c); } function Wa(a, b) { if (!pe(a)) { throw new U(44); } var c = W(b, {parent:!0}).node; if (!c) { throw new U(44); } b = Ec(b); var d = Qe(c, b); if (d) { throw new U(d); } if (!c.g.symlink) { throw new U(63); } c.g.symlink(c, b, a); } function Me(a) { a = W(a).node; if (!a) { throw new U(44); } if (!a.g.readlink) { throw new U(28); } return a.g.readlink(a); } function Xa(a, b) { var c = 438; if ("" === a) { throw new U(44); } if ("string" == typeof b) { var d = {r:0, "r+":2, w:577, "w+":578, a:1089, "a+":1090,}[b]; if ("undefined" == typeof d) { throw Error(`Unknown file open mode: ${b}`); } b = d; } c = b & 64 ? c & 4095 | 32768 : 0; if ("object" == typeof a) { var e = a; } else { a = Cc(a); try { e = W(a, {W:!(b & 131072)}).node; } catch (k) { } } d = !1; if (b & 64) { if (e) { if (b & 128) { throw new U(20); } } else { e = Te(a, c, 0), d = !0; } } if (!e) { throw new U(44); } 8192 === (e.mode & 61440) && (b &= -513); if (b & 65536 && 16384 !== (e.mode & 61440)) { throw new U(54); } if (!d && (c = e ? 40960 === (e.mode & 61440) ? 32 : 16384 === (e.mode & 61440) && ("r" !== Pe(b) || b & 512) ? 31 : Oe(e, Pe(b)) : 44)) { throw new U(c); } if (b & 512 && !d) { c = e; c = "string" == typeof c ? W(c, {W:!0}).node : c; if (!c.g.v) { throw new U(63); } if (16384 === (c.mode & 61440)) { throw new U(31); } if (32768 !== (c.mode & 61440)) { throw new U(28); } if (d = Oe(c, "w")) { throw new U(d); } c.g.v(c, {size:0, timestamp:Date.now()}); } b &= -131713; a: { for (c = e;;) { if (c === c.parent) { c = c.A.Ba; var f = f ? "/" !== c[c.length - 1] ? `${c}/${f}` : c + f : c; break a; } f = f ? `${c.name}/${f}` : c.name; c = c.parent; } } e = {node:e, path:f, flags:b, seekable:!0, position:0, j:e.j, pb:[], error:!1}; f = -1; t(-1 <= f); e = Object.assign(new Ke(), e); if (-1 == f) { a: { for (f = 0; 4096 >= f; f++) { if (!Fe[f]) { break a; } } throw new U(33); } } e.fd = f; Fe[f] = e; e.j.open && e.j.open(e); !g.logReadFiles || b & 1 || a in Je || (Je[a] = 1); return e; } function Ve(a, b, c) { if (null === a.fd) { throw new U(8); } if (!a.seekable || !a.j.I) { throw new U(70); } if (0 != c && 1 != c && 2 != c) { throw new U(28); } a.position = a.j.I(a, b, c); a.pb = []; } function J(a, b, c) { a = Cc("/dev/" + a); var d = Be(!!b, !!c); J.ya ?? (J.ya = 64); var e = J.ya++ << 8 | 0; te(e, {open(f) { f.seekable = !1; }, close() { c?.buffer?.length && c(10); }, read(f, k, l, r) { for (var p = 0, y = 0; y < r; y++) { try { var B = b(); } catch (E) { throw new U(29); } if (void 0 === B && 0 === p) { throw new U(6); } if (null === B || void 0 === B) { break; } p++; k[l + y] = B; } p && (f.node.timestamp = Date.now()); return p; }, write(f, k, l, r) { for (var p = 0; p < r; p++) { try { c(k[l + p]); } catch (y) { throw new U(29); } } r && (f.node.timestamp = Date.now()); return p; }}); Ue(a, d, e); } var We = {}; function Rb(a) { if (n) { return R(13, 1, a); } try { var b = Re(a); if (null === b.fd) { throw new U(8); } b.ba && (b.ba = null); try { b.j.close && b.j.close(b); } catch (c) { throw c; } finally { Fe[b.fd] = null; } b.fd = null; return 0; } catch (c) { if ("undefined" == typeof We || "ErrnoError" !== c.name) { throw c; } return c.O; } } function Sb(a, b, c, d) { if (n) { return R(14, 1, a, b, c, d); } try { a: { var e = Re(a); a = b; for (var f, k = b = 0; k < c; k++) { var l = F[a >> 2], r = F[a + 4 >> 2]; a += 8; var p = e, y = l, B = r, E = f, wa = C; t(0 <= y); if (0 > B || 0 > E) { throw new U(28); } if (null === p.fd) { throw new U(8); } if (1 === (p.flags & 2097155)) { throw new U(8); } if (16384 === (p.node.mode & 61440)) { throw new U(31); } if (!p.j.read) { throw new U(28); } var Ja = "undefined" != typeof E; if (!Ja) { E = p.position; } else if (!p.seekable) { throw new U(70); } var Ka = p.j.read(p, wa, y, B, E); Ja || (p.position += Ka); var P = Ka; if (0 > P) { var La = -1; break a; } b += P; if (P < r) { break; } "undefined" != typeof f && (f += P); } La = b; } F[d >> 2] = La; return 0; } catch (fa) { if ("undefined" == typeof We || "ErrnoError" !== fa.name) { throw fa; } return fa.O; } } function Tb(a, b, c, d) { if (n) { return R(15, 1, a, b, c, d); } b = -9007199254740992 > b || 9007199254740992 < b ? NaN : Number(b); try { if (isNaN(b)) { return 61; } var e = Re(a); Ve(e, b, c); H[d >> 3] = BigInt(e.position); e.ba && 0 === b && 0 === c && (e.ba = null); return 0; } catch (f) { if ("undefined" == typeof We || "ErrnoError" !== f.name) { throw f; } return f.O; } } function Ub(a, b, c, d) { if (n) { return R(16, 1, a, b, c, d); } try { a: { var e = Re(a); a = b; for (var f, k = b = 0; k < c; k++) { var l = F[a >> 2], r = F[a + 4 >> 2]; a += 8; var p = e, y = l, B = r, E = f, wa = C; t(0 <= y); if (0 > B || 0 > E) { throw new U(28); } if (null === p.fd) { throw new U(8); } if (0 === (p.flags & 2097155)) { throw new U(8); } if (16384 === (p.node.mode & 61440)) { throw new U(31); } if (!p.j.write) { throw new U(28); } p.seekable && p.flags & 1024 && Ve(p, 0, 2); var Ja = "undefined" != typeof E; if (!Ja) { E = p.position; } else if (!p.seekable) { throw new U(70); } var Ka = p.j.write(p, wa, y, B, E, void 0); Ja || (p.position += Ka); var P = Ka; if (0 > P) { var La = -1; break a; } b += P; if (P < r) { break; } "undefined" != typeof f && (f += P); } La = b; } F[d >> 2] = La; return 0; } catch (fa) { if ("undefined" == typeof We || "ErrnoError" !== fa.name) { throw fa; } return fa.O; } } var Xe = a => { try { a(); } catch (b) { w(b); } }; function Vb() { var a = lb, b = /^(invoke_.*|__asyncjs__.*)$/; for (let [c, d] of Object.entries(a)) { if ("function" == typeof d) { let e = d.Va || b.test(c); a[c] = (...f) => { var k = Y; try { return d(...f); } finally { f = k === Ye && Y === Ze; var l = c.startsWith("invoke_") && !0; if (Y !== k && !e && !f && !l) { throw Error(`import ${c} was not in ASYNCIFY_IMPORTS, but changed the state`); } } }; } } } function $e() { var a = M, b = {}; for (let [c, d] of Object.entries(a)) { b[c] = "function" == typeof d ? (...e) => { af.push(c); try { return d(...e); } finally { A || (e = af.pop(), t(e === c), Z && 1 === Y && 0 === af.length && (Y = Ye, Q += 1, Xe(bf), "undefined" != typeof Fibers && Fibers.tc())); } } : d; } return b; } var Ye = 0, Ze = 3, Y = 0, Z = null, cf = 0, af = [], df = {}, ef = {}, ff = 0, gf = null, hf = []; function jf() { var a = md(4108), b = a + 12; F[a >> 2] = b; F[a + 4 >> 2] = b + 4096; b = af[0]; var c = df[b]; void 0 === c && (c = ff++, df[b] = c, ef[c] = b); D[a + 8 >> 2] = c; return a; } function kf() { var a = M[ef[D[Z + 8 >> 2]]]; t(0 < Q); --Q; return a(); } function je(a) { t(Y !== Ze, "Asyncify cannot be done during or after the runtime exits"); if (!A) { if (Y === Ye) { var b = !1, c = !1; a((d = 0) => { t(!d || "number" == typeof d || "boolean" == typeof d); if (!A && (cf = d, b = !0, c)) { t(!af.length, "Waking up (starting to rewind) must be done from JS, without compiled code on the stack."); Y = 2; Xe(() => lf(Z)); "undefined" != typeof Bd && pd && Hd(); d = !1; try { var e = kf(); } catch (l) { e = l, d = !0; } var f = !1; if (!Z) { var k = gf; k && (gf = null, (d ? k.reject : k.resolve)(e), f = !0); } if (d && !f) { throw e; } } }); c = !0; b || (Y = 1, Z = jf(), "undefined" != typeof Bd && pd && Gd(), Xe(() => mf(Z))); } else { 2 === Y ? (Y = Ye, Xe(nf), Pd(Z), Z = null, hf.forEach(Gc)) : w(`invalid state: ${Y}`); } return cf; } } (function() { var a = Da; Da = (...b) => { var c = 0; Ta && "undefined" != typeof I && (c = I()); c = `w:${za},t:${tc(c)}: `; return a(c + b.join(" ")); }; })(); n || wc(); g.requestFullscreen = function(a, b) { function c() { Jc = !1; var f = d.parentNode; (document.fullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.webkitFullscreenElement || document.webkitCurrentFullScreenElement) === f ? (d.exitFullscreen = Yc, Wc && d.requestPointerLock(), Jc = !0, Xc ? ("undefined" != typeof S && (D[S.screen >> 2] = F[S.screen >> 2] | 8388608), ld(g.canvas), jd()) : ld(d)) : (f.parentNode.insertBefore(d, f), f.parentNode.removeChild(f), Xc ? ("undefined" != typeof S && (D[S.screen >> 2] = F[S.screen >> 2] & -8388609), ld(g.canvas), jd()) : ld(d)); g.onFullScreen?.(Jc); g.onFullscreen?.(Jc); } Wc = a; Xc = b; "undefined" == typeof Wc && (Wc = !0); "undefined" == typeof Xc && (Xc = !1); var d = g.canvas; Vc || (Vc = !0, document.addEventListener("fullscreenchange", c, !1), document.addEventListener("mozfullscreenchange", c, !1), document.addEventListener("webkitfullscreenchange", c, !1), document.addEventListener("MSFullscreenChange", c, !1)); var e = document.createElement("div"); d.parentNode.insertBefore(e, d); e.appendChild(d); e.requestFullscreen = e.requestFullscreen || e.mozRequestFullScreen || e.msRequestFullscreen || (e.webkitRequestFullscreen ? () => e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : null) || (e.webkitRequestFullScreen ? () => e.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT) : null); e.requestFullscreen(); }; g.requestFullScreen = function() { w("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)"); }; g.setCanvasSize = kd; g.getUserMedia = function(a) { let b; (b = window).getUserMedia || (b.getUserMedia = navigator.getUserMedia || navigator.mozGetUserMedia); window.getUserMedia(a); }; g.createContext = Pc; g.requestAnimationFrame = ud; g.pauseMainLoop = Gd; g.resumeMainLoop = Hd; g.preMainLoop && Dd.push(g.preMainLoop); g.postMainLoop && Ed.push(g.postMainLoop); He = Array(4096); Se(V, "/"); X("/tmp"); X("/home"); X("/home/web_user"); (function() { X("/dev"); te(259, {read:() => 0, write:(d, e, f, k) => k, I:() => 0,}); Ue("/dev/null", 259); se(1280, ve); se(1536, we); Ue("/dev/tty", 1280); Ue("/dev/tty1", 1536); var a = new Uint8Array(1024), b = 0, c = () => { 0 === b && (b = oe(a).byteLength); return a[--b]; }; J("random", c); J("urandom", c); X("/dev/shm"); X("/dev/shm/tmp"); })(); (function() { X("/proc"); var a = X("/proc/self"); X("/proc/self/fd"); Se({A() { var b = ze(a, "fd", 16895, 73); b.g = {lookup(c, d) { var e = Re(+d); c = {parent:null, A:{Ba:"fake"}, g:{readlink:() => e.path},}; return c.parent = c; }}; return b; }}, "/proc/self/fd"); })(); var ie = [pc, rc, ob, qb, nb, pb, rb, Wd, tb, ub, fe, Ob, Pb, Rb, Sb, Tb, Ub], lb, M = function() { function a(d, e) { M = d.exports; M = $e(); uc.push(M._emscripten_tls_init); Qa.unshift(M.__wasm_call_ctors); sa = e; db("wasm-instantiate"); return M; } cb("wasm-instantiate"); var b = g, c = kb(); if (g.instantiateWasm) { try { return g.instantiateWasm(c, a); } catch (d) { return v(`Module.instantiateWasm callback failed with error: ${d}`), !1; } } if (n) { return new Promise(d => { Aa = e => { var f = new WebAssembly.Instance(e, kb()); a(f, e); d(); }; }); } fb ??= eb("/wiki/images/3/35/Dive.wasm") ? "/wiki/images/3/35/Dive.wasm" : g.locateFile ? g.locateFile("/wiki/images/3/35/Dive.wasm", q) : q + "/wiki/images/3/35/Dive.wasm"; jb(c, function(d) { t(g === b, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); b = null; a(d.instance, d.module); }); return {}; }(); g._main = L("main", 2); var I = () => (I = M.pthread_self)(), of = g.__emscripten_proxy_main = L("_emscripten_proxy_main", 2), Td = L("memcpy", 3), Fa = L("_emscripten_thread_init", 6), Na = L("_emscripten_thread_crashed", 0), pf = L("fflush", 1), md = L("malloc", 1), Pd = L("free", 1), nc = L("_emscripten_run_on_main_thread_js", 5), fc = L("_emscripten_thread_free_data", 1), Ac = L("_emscripten_thread_exit", 1), Ie = L("strerror", 1), ge = L("_emscripten_check_mailbox", 0), Vd = L("calloc", 2), yc = (a, b) => (yc = M.emscripten_stack_set_limits)(a, b), oc = a => (oc = M._emscripten_stack_restore)(a), mc = a => (mc = M._emscripten_stack_alloc)(a), lc = () => (lc = M.emscripten_stack_get_current)(), zc = g.dynCall_ii = L("dynCall_ii", 2), dynCall_vi = g.dynCall_vi = L("dynCall_vi", 2), dynCall_v = g.dynCall_v = L("dynCall_v", 1), dynCall_vii = g.dynCall_vii = L("dynCall_vii", 3); g.dynCall_iiii = L("dynCall_iiii", 4); g.dynCall_jiji = L("dynCall_jiji", 4); g.dynCall_iidiiii = L("dynCall_iidiiii", 7); g.dynCall_viijii = L("dynCall_viijii", 6); g.dynCall_viiii = L("dynCall_viiii", 5); var dynCall_iii = g.dynCall_iii = L("dynCall_iii", 3); g.dynCall_iiiii = L("dynCall_iiiii", 5); g.dynCall_iiiiii = L("dynCall_iiiiii", 6); g.dynCall_iiiiiiiii = L("dynCall_iiiiiiiii", 9); g.dynCall_iiiiiii = L("dynCall_iiiiiii", 7); g.dynCall_iiiiij = L("dynCall_iiiiij", 6); g.dynCall_iiiiid = L("dynCall_iiiiid", 6); g.dynCall_iiiiijj = L("dynCall_iiiiijj", 7); g.dynCall_iiiiiiii = L("dynCall_iiiiiiii", 8); g.dynCall_iiiiiijj = L("dynCall_iiiiiijj", 8); g.dynCall_viiiiii = L("dynCall_viiiiii", 7); g.dynCall_viiiii = L("dynCall_viiiii", 6); var mf = L("asyncify_start_unwind", 1), bf = L("asyncify_stop_unwind", 0), lf = L("asyncify_start_rewind", 1), nf = L("asyncify_stop_rewind", 0); "writeI53ToI64 writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling readI53FromI64 readI53FromU64 convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 getTempRet0 setTempRet0 growMemory inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr emscriptenLog readEmAsmArgs jstoi_q listenOnce autoResumeAudioContext dynCallLegacy getDynCaller dynCall asmjsMangle HandleAllocator getNativeTypeSize STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS getCFunc ccall cwrap uleb128Encode generateFuncType convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction reallyNegative unSign strLen reSign formatString intArrayToString AsciiToString UTF16ToString stringToUTF16 lengthBytesUTF16 UTF32ToString stringToUTF32 lengthBytesUTF32 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 battery registerBatteryEventCallback setCanvasElementSizeCallingThread setCanvasElementSizeMainThread setCanvasElementSize getCanvasSizeCallingThread getCanvasSizeMainThread getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation checkWasiClock wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags setImmediateWrapped safeRequestAnimationFrame clearImmediateWrapped polyfillSetImmediate registerPostMainLoop registerPreMainLoop getPromise makePromise idsToPromises makePromiseCallback ExceptionInfo findMatchingCatch Browser_asyncPrepareDataCounter isLeapYear ydayFromDate arraySum addDays getSocketFromFD getSocketAddress FS_unlink FS_mkdirTree _setNetworkCallback heapObjectForWebGLType toTypedArrayIndex emscriptenWebGLGet computeUnpackAlignedImageSize colorChannelsInGlTextureFormat emscriptenWebGLGetTexPixelData emscriptenWebGLGetUniform webglGetUniformLocation webglPrepareUniformLocationsBeforeFirstUse webglGetLeftBracePos emscriptenWebGLGetVertexAttrib __glGetActiveAttribOrUniform writeGLArray emscripten_webgl_destroy_context_before_on_calling_thread registerWebGlEventCallback ALLOC_NORMAL ALLOC_STACK allocate writeStringToMemory writeAsciiToMemory setErrNo demangle stackTrace".split(" ").forEach(function(a) { Zb(a, () => { var b = `\`${a}\` 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`, c = a; c.startsWith("_") || (c = "$" + a); b += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${c}')`; Yb(a) && (b += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"); N(b); }); ac(a); }); "run addOnPreRun addOnInit addOnPreMain addOnExit addOnPostRun addRunDependency removeRunDependency out err callMain abort wasmMemory wasmExports INT53_MAX INT53_MIN bigintToI53Checked stackSave stackRestore stackAlloc ptrToString zeroMemory exitJS getHeapMax abortOnCannotGrowMemory ENV ERRNO_CODES strError DNS Protocols Sockets timers warnOnce readEmAsmArgsArray jstoi_s getExecutableName handleException keepRuntimeAlive runtimeKeepalivePush runtimeKeepalivePop callUserCallback maybeExit asyncLoad alignMemory mmapAlloc wasmTable noExitRuntime sigToWasmTypes freeTableIndexes functionsInTableMap setValue getValue PATH PATH_FS UTF8Decoder UTF8ArrayToString UTF8ToString stringToUTF8Array stringToUTF8 lengthBytesUTF8 intArrayFromString stringToAscii UTF16Decoder stringToNewUTF8 JSEvents specialHTMLTargets findCanvasEventTarget currentFullscreenStrategy restoreOldWindowedStyle UNWIND_CACHE ExitStatus getEnvStrings doReadv doWritev initRandomFill randomFill safeSetTimeout promiseMap uncaughtExceptionCount exceptionLast exceptionCaught Browser getPreloadedImageData__data wget MONTH_DAYS_REGULAR MONTH_DAYS_LEAP MONTH_DAYS_REGULAR_CUMULATIVE MONTH_DAYS_LEAP_CUMULATIVE SYSCALLS preloadPlugins FS_createPreloadedFile FS_modeStringToFlags FS_getMode FS_stdin_getChar_buffer FS_stdin_getChar FS_createPath FS_createDevice FS_readFile FS FS_createDataFile FS_createLazyFile MEMFS TTY PIPEFS SOCKFS tempFixedLengthArray miniTempWebGLFloatBuffers miniTempWebGLIntBuffers webgl_enable_ANGLE_instanced_arrays webgl_enable_OES_vertex_array_object webgl_enable_WEBGL_draw_buffers webgl_enable_WEBGL_multi_draw webgl_enable_EXT_polygon_offset_clamp webgl_enable_EXT_clip_control webgl_enable_WEBGL_polygon_mode GL AL GLUT EGL GLEW IDBStore runAndAbortIfError Asyncify Fibers SDL SDL_gfx allocateUTF8 allocateUTF8OnStack print printErr PThread terminateWorker cleanupThread registerTLSInit spawnThread exitOnMainThread proxyToMainThread proxiedJSCallArgs invokeEntryPoint checkMailbox".split(" ").forEach(ac); var qf; ab = function rf() { qf || sf(); qf || (ab = rf); }; function sf() { function a() { if (!qf && (qf = !0, g.calledRun = !0, !A)) { Ua(); n || Za(Ra); g.onRuntimeInitialized?.(); if (tf) { t(0 == K, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'); t(0 == Pa.length, "cannot call main when preRun functions remain to be called"); Q += 1; try { var b = of(0, 0); Qb(b, !0); } catch (c) { qc(c); } } if (!n) { if (g.postRun) { for ("function" == typeof g.postRun && (g.postRun = [g.postRun]); g.postRun.length;) { b = g.postRun.shift(), Sa.unshift(b); } } Za(Sa); } } } if (!(0 < K)) { if (n) { Ua(), startWorker(g); } else { t(!n); if (g.preRun) { for ("function" == typeof g.preRun && (g.preRun = [g.preRun]); g.preRun.length;) { Pa.unshift(g.preRun.shift()); } } Za(Pa); 0 < K || (g.setStatus ? (g.setStatus("Running..."), setTimeout(() => { setTimeout(() => g.setStatus(""), 1); a(); }, 1)) : a()); } } } function sc() { var a = u, b = v, c = !1; u = v = () => { c = !0; }; try { pf(0), ["stdout", "stderr"].forEach(d => { d = "/dev/" + d; try { var e = W(d, {W:!0}); d = e.path; } catch (k) { } var f = {Wa:!1, exists:!1, error:0, name:null, path:null, object:null, eb:!1, gb:null, fb:null}; try { e = W(d, {parent:!0}), f.eb = !0, f.gb = e.path, f.fb = e.node, f.name = Ec(d), e = W(d, {W:!0}), f.exists = !0, f.path = e.path, f.object = e.node, f.name = e.node.name, f.Wa = "/" === e.path; } catch (k) { f.error = k.O; } f && re[f.object.rdev]?.output?.length && (c = !0); }); } catch (d) { } u = a; v = 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."); } if (g.preInit) { for ("function" == typeof g.preInit && (g.preInit = [g.preInit]); 0 < g.preInit.length;) { g.preInit.pop()(); } } var tf = !0; g.noInitialRun && (tf = !1); sf();