moorhen 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/baby-gru/CootWorker.js +1 -1
- package/baby-gru/CootWorker.ts +27 -1
- package/baby-gru/wasm/RDKit_minimal.js +1 -0
- package/baby-gru/wasm/RDKit_minimal.wasm +0 -0
- package/baby-gru/wasm/moorhen.js +1 -1
- package/baby-gru/wasm/moorhen.wasm +0 -0
- package/baby-gru/wasm/moorhen.worker.js +1 -1
- package/baby-gru/wasm/web_example.js +1 -1
- package/baby-gru/wasm/web_example.wasm +0 -0
- package/moorhen.js +14 -14
- package/package.json +8 -5
- package/types/libcoot.d.ts +16 -0
- package/types/main.d.ts +132 -3
- package/types/mgWebGL.d.ts +8 -0
- package/types/moorhen.d.ts +9 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
var createCCP4Module=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e||=__filename),function(r={}){function t(){return $.buffer!=L.buffer&&q(),L}function n(){return $.buffer!=L.buffer&&q(),W}function o(){return $.buffer!=L.buffer&&q(),j}function a(){return $.buffer!=L.buffer&&q(),U}function i(){return $.buffer!=L.buffer&&q(),B}function s(){return $.buffer!=L.buffer&&q(),z}function l(){return $.buffer!=L.buffer&&q(),G}var c,u,d=r;d.ready=new Promise(((e,r)=>{c=e,u=r})),["__emscripten_thread_init","__emscripten_thread_exit","__emscripten_thread_crashed","__emscripten_thread_mailbox_await","__emscripten_tls_init","_pthread_self","checkMailbox","__embind_initialize_bindings","establishStackSpace","invokeEntryPoint","PThread","getExceptionMessage","$incrementExceptionRefcount","$decrementExceptionRefcount","___indirect_function_table","___set_stack_limits","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(d.ready,e)||Object.defineProperty(d.ready,e,{get:()=>de("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>de("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var f=Object.assign({},d),p="./this.program",m=(e,r)=>{throw r},h="object"==typeof window,v="function"==typeof importScripts,g="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y=!h&&!g&&!v;if(d.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var _,w,E,b=d.ENVIRONMENT_IS_PTHREAD||!1,T="";function k(e){return d.locateFile?d.locateFile(e,T):T+e}if(g){if("undefined"==typeof process||!process.release||"node"!==process.release.name)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var S=process.versions.node,P=S.split(".").slice(0,3);if((P=1e4*P[0]+100*P[1]+1*P[2].split("-")[0])<16e4)throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+S+")");var A=require("fs"),C=require("path");T=v?C.dirname(T)+"/":__dirname+"/",_=(e,r)=>(e=ve(e)?new URL(e):C.normalize(e),A.readFileSync(e,r?void 0:"utf8")),E=e=>{var r=_(e,!0);return r.buffer||(r=new Uint8Array(r)),Y(r.buffer),r},w=(e,r,t,n=!0)=>{e=ve(e)?new URL(e):C.normalize(e),A.readFile(e,n?void 0:"utf8",((e,o)=>{e?t(e):r(n?o.buffer:o)}))},!d.thisProgram&&process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),m=(e,r)=>{throw process.exitCode=e,r},global.Worker=require("worker_threads").Worker}else if(y){if("object"==typeof process&&"function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(_=read),E=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let r=read(e,"binary");return Y("object"==typeof r),r},w=(e,r,t)=>{setTimeout((()=>r(E(e))))},"undefined"==typeof clearTimeout&&(globalThis.clearTimeout=e=>{}),"undefined"==typeof setTimeout&&(globalThis.setTimeout=e=>"function"==typeof e?e():de()),"undefined"!=typeof scriptArgs&&scriptArgs,"function"==typeof quit&&(m=(e,r)=>{throw setTimeout((()=>{if(!(r instanceof Me)){let e=r;r&&"object"==typeof r&&r.stack&&(e=[r,r.stack]),R(`exiting due to exception: ${e}`)}quit(e)})),r}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!h&&!v)throw new Error("environment detection error");if(v?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),e&&(T=e),T=T.startsWith("blob:")?"":T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1),"object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");g||(_=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},v&&(E=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),w=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)})}g&&"undefined"==typeof performance&&(global.performance=require("perf_hooks").performance);var F=console.log.bind(console),D=console.error.bind(console);g&&(F=(...e)=>A.writeSync(1,e.join(" ")+"\n"),D=(...e)=>A.writeSync(2,e.join(" ")+"\n"));var O,M,$,I,N=d.print||F,R=d.printErr||D;Object.assign(d,f),f=null,O="fetchSettings",Object.getOwnPropertyDescriptor(d,O)&&de(`\`Module.${O}\` was supplied but \`${O}\` not included in INCOMING_MODULE_JS_API`),d.arguments&&d.arguments,be("arguments","arguments_"),d.thisProgram&&(p=d.thisProgram),be("thisProgram","thisProgram"),d.quit&&(m=d.quit),be("quit","quit_"),Y(void 0===d.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),Y(void 0===d.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),Y(void 0===d.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),Y(void 0===d.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),Y(void 0===d.read,"Module.read option was removed (modify read_ in JS)"),Y(void 0===d.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),Y(void 0===d.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),Y(void 0===d.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),Y(void 0===d.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),be("asm","wasmExports"),be("read","read_"),be("readAsync","readAsync"),be("readBinary","readBinary"),be("setWindowTitle","setWindowTitle"),Y(h||v||g,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"),Y(!y,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."),d.wasmBinary&&(M=d.wasmBinary),be("wasmBinary","wasmBinary"),"object"!=typeof WebAssembly&&de("no native wasm support detected");var x,L,W,j,U,B,z,H,G,V=!1;function Y(e,r){e||de("Assertion failed"+(r?": "+r:""))}function q(){var e=$.buffer;d.HEAP8=L=new Int8Array(e),d.HEAP16=j=new Int16Array(e),d.HEAPU8=W=new Uint8Array(e),d.HEAPU16=U=new Uint16Array(e),d.HEAP32=B=new Int32Array(e),d.HEAPU32=z=new Uint32Array(e),d.HEAPF32=H=new Float32Array(e),d.HEAPF64=G=new Float64Array(e)}Y(!d.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),Y("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support");var K=d.INITIAL_MEMORY||16777216;if(be("INITIAL_MEMORY","INITIAL_MEMORY"),Y(K>=5242880,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+K+"! (STACK_SIZE=5242880)"),b)$=d.wasmMemory;else if(d.wasmMemory)$=d.wasmMemory;else if(!(($=new WebAssembly.Memory({initial:K/65536,maximum:32768,shared:!0})).buffer instanceof SharedArrayBuffer))throw R("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),g&&R("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");function J(){var e=Cn();Y(0==(3&e)),0==e&&(e+=4),s()[e>>2]=34821223,Fe(34821223),s()[e+4>>2]=2310721022,Fe(2310721022),s()[0]=1668509029,Fe(1668509029)}function X(){if(!V){var e=Cn();0==e&&(e+=4);var r=s()[e>>2],t=s()[e+4>>2];34821223==r&&2310721022==t||de(`Stack overflow! Stack cookie has been overwritten at ${Be(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${Be(t)} ${Be(r)}`),1668509029!=s()[0]&&de("Runtime error: The application has corrupted its heap memory area (address zero)!")}}q(),Y((K=$.buffer.byteLength)%65536==0),function(){var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,115!==r[0]||99!==r[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var Z=[],Q=[],ee=[],re=!1;function te(){Y(!re),re=!0,b||(X(),or(),d.noFSInit||kr.init.initialized||kr.init(),kr.ignorePermissions=!1,vr.init(),Ge(Q))}function ne(e){Z.unshift(e)}Y(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),Y(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),Y(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),Y(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 oe=0,ae=null,ie=null,se={};function le(e){for(var r=e;;){if(!se[e])return e;e=r+Math.random()}}function ce(e){oe++,d.monitorRunDependencies?.(oe),e?(Y(!se[e]),se[e]=1,null===ae&&"undefined"!=typeof setInterval&&(ae=setInterval((()=>{if(V)return clearInterval(ae),void(ae=null);var e=!1;for(var r in se)e||(e=!0,R("still waiting on run dependencies:")),R(`dependency: ${r}`);e&&R("(end of list)")}),1e4))):R("warning: run dependency added without ID")}function ue(e){if(oe--,d.monitorRunDependencies?.(oe),e?(Y(se[e]),delete se[e]):R("warning: run dependency removed without ID"),0==oe&&(null!==ae&&(clearInterval(ae),ae=null),ie)){var r=ie;ie=null,r()}}function de(e){d.onAbort?.(e),R(e="Aborted("+e+")"),V=!0,x=1;var r=new WebAssembly.RuntimeError(e);throw u(r),r}var fe,pe,me,he=e=>e.startsWith("data:application/octet-stream;base64,"),ve=e=>e.startsWith("file://");function ge(e){return function(){Y(re,`native function \`${e}\` called before runtime initialization`);var r=_n[e];return Y(r,`exported native function \`${e}\` not found`),r.apply(null,arguments)}}class ye extends Error{}class _e extends ye{constructor(e){super(e),this.excPtr=e;const r=Qe(e);this.name=r[0],this.message=r[1]}}function we(e){if(e==fe&&M)return new Uint8Array(M);if(E)return E(e);throw"both async and sync fetching of the wasm failed"}function Ee(e,r,t){return function(e){if(!M&&(h||v)){if("function"==typeof fetch&&!ve(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw`failed to load wasm binary file at '${e}'`;return r.arrayBuffer()})).catch((()=>we(e)));if(w)return new Promise(((r,t)=>{w(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>we(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{R(`failed to asynchronously prepare wasm: ${e}`),ve(fe)&&R(`warning: Loading from a file URI (${fe}) 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`),de(e)}))}function be(e,r,t=!0){Object.getOwnPropertyDescriptor(d,e)||Object.defineProperty(d,e,{configurable:!0,get(){de(`\`Module.${e}\` has been replaced by \`${r}\``+(t?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function Te(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function ke(e,r){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){ar(`\`${e}\` is not longer defined by emscripten. ${r}`)}})}function Se(e){Object.getOwnPropertyDescriptor(d,e)||Object.defineProperty(d,e,{configurable:!0,get(){var r=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Te(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),de(r)}})}function Pe(e,r,t,n){Y(Number.isInteger(Number(e)),`attempt to write non-integer (${e}) into integer heap`),Y(e<=n,`value (${e}) too large to write as ${r}-bit value`),Y(e>=t,`value (${e}) too small to write as ${r}-bit value`)}he(fe="web_example.wasm")||(fe=k(fe)),ke("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),ke("asm","Please use wasmExports instead");var Ae=e=>Pe(e,8,-127,255),Ce=e=>Pe(e,16,-32767,65535),Fe=e=>Pe(e,32,-2147483647,4294967295),De=e=>Pe(e,64,-0x8000000000000000,0x10000000000000000);function Oe(e){g?A.writeSync(2,Array.from(arguments).join(" ")+"\n"):console.warn.apply(console,arguments)}function Me(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var $e=e=>{e.terminate(),e.onmessage=r=>{var t=r.data.cmd;R(`received "${t}" command from terminated worker: ${e.workerID}`)}},Ie=e=>{Y(!b,"Internal Error! cleanupThread() can only ever be called from main application thread!"),Y(e,"Internal Error! Null pthread_ptr in cleanupThread!");var r=He.pthreads[e];Y(r),He.returnWorkerToPool(r)},Ne=0,Re=()=>nr||Ne>0,xe=e=>{var r=xn(),t=e();return Ln(r),t},Le=(e,r)=>(Y(e==e>>>0||e==(0|e)),Y(r===(0|r)),r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN),We=function(e,r){var t=arguments.length-2,n=arguments;return xe((()=>{for(var o=t,a=Wn(8*o),i=a>>3,s=0;s<t;s++){var c=n[2+s];l()[i+s]=c}return Fn(e,o,a,r)}))};function je(e){if(b)return We(0,1,e);x=e,Re()||(He.terminateAllThreads(),d.onExit?.(e),V=!0),m(e,new Me(e))}var Ue=(e,r)=>{if(x=e,function(){var e=N,r=R,t=!1;N=R=e=>{t=!0};try{Tn(0),["stdout","stderr"].forEach((function(e){var r=kr.analyzePath("/dev/"+e);if(r){var n=r.object.rdev,o=vr.ttys[n];o?.output?.length&&(t=!0)}}))}catch(e){}N=e,R=r,t&&ar("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.")}(),b)throw Y(!r),Ze(e),"unwind";if(Re()&&!r){var t=`program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${Ne}) 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)`;u(t),R(t)}je(e)},Be=e=>(Y("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),ze=e=>{if(e instanceof Me||"unwind"==e)return x;X(),e instanceof WebAssembly.RuntimeError&&jn()<=0&&R("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 5242880)"),m(1,e)},He={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},nextWorkerID:1,debugInit(){var e=Oe;Oe=r=>{return e((t=0,re&&void 0!==En&&(t=En()),"w:"+(d.workerID||0)+",t:"+Be(t)+": "+r));var t}},init(){He.debugInit(),b?He.initWorker():He.initMainThread()},initMainThread(){ne((()=>{ce("loading-workers"),He.loadWasmModuleToAllWorkers((()=>ue("loading-workers")))}))},initWorker(){nr=!1},setExitStatus:e=>x=e,terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var e of(Y(!b,"Internal Error! terminateAllThreads() can only ever be called from main application thread!"),He.runningWorkers))$e(e);for(var e of He.unusedWorkers)$e(e);He.unusedWorkers=[],He.runningWorkers=[],He.pthreads=[]},returnWorkerToPool:e=>{var r=e.pthread_ptr;delete He.pthreads[r],He.unusedWorkers.push(e),He.runningWorkers.splice(He.runningWorkers.indexOf(e),1),e.pthread_ptr=0,Dn(r)},receiveObjectTransfer(e){},threadInitTLS(){He.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:r=>new Promise((t=>{r.onmessage=e=>{var n=e.data,o=n.cmd;if(n.targetThread&&n.targetThread!=En()){var a=He.pthreads[n.targetThread];a?a.postMessage(n,n.transferList):R(`Internal error! Worker sent a message "${o}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else{var i;"checkMailbox"===o?Vt():"spawnThread"===o?(e=>{Y(!b,"Internal Error! spawnThread() can only ever be called from main application thread!"),Y(e.pthread_ptr,"Internal error, no pthread ptr!");var r=He.getNewWorker();if(!r)return 6;Y(!r.pthread_ptr,"Internal error!"),He.runningWorkers.push(r),He.pthreads[e.pthread_ptr]=r,r.pthread_ptr=e.pthread_ptr;var t={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};g&&r.unref(),r.postMessage(t,e.transferList)})(n):"cleanupThread"===o?Ie(n.thread):"killThread"===o?(e=>{Y(!b,"Internal Error! killThread() can only ever be called from main application thread!"),Y(e,"Internal Error! Null pthread_ptr in killThread!");var r=He.pthreads[e];delete He.pthreads[e],$e(r),Dn(e),He.runningWorkers.splice(He.runningWorkers.indexOf(r),1),r.pthread_ptr=0})(n.thread):"cancelThread"===o?(i=n.thread,Y(!b,"Internal Error! cancelThread() can only ever be called from main application thread!"),Y(i,"Internal Error! Null pthread_ptr in cancelThread!"),He.pthreads[i].postMessage({cmd:"cancel"})):"loaded"===o?(r.loaded=!0,t(r)):"alert"===o?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?r.postMessage(n):"callHandler"===o?d[n.handler](...n.args):o&&R(`worker sent an unknown command ${o}`)}},r.onerror=e=>{var t="worker sent an error!";throw r.pthread_ptr&&(t=`Pthread ${Be(r.pthread_ptr)} sent an error!`),R(`${t} ${e.filename}:${e.lineno}: ${e.message}`),e},g&&(r.on("message",(e=>r.onmessage({data:e}))),r.on("error",(e=>r.onerror(e)))),Y($ instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!"),Y(I instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");var n=[];for(var o of["onExit","onAbort","print","printErr"])d.hasOwnProperty(o)&&n.push(o);r.workerID=He.nextWorkerID++,r.postMessage({cmd:"load",handlers:n,urlOrBlob:d.mainScriptUrlOrBlob||e,wasmMemory:$,wasmModule:I,workerID:r.workerID})})),loadWasmModuleToAllWorkers(e){e()},allocateUnusedWorker(){var e,r=k("web_example.worker.js");e=new Worker(r),He.unusedWorkers.push(e)},getNewWorker:()=>(0==He.unusedWorkers.length&&(g||R("Tried to spawn a new thread, but the thread pool is exhausted.\nThis might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.\nIf you want to increase the pool size, use setting `-sPTHREAD_POOL_SIZE=...`.\nIf you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting `-sPTHREAD_POOL_SIZE_STRICT=2`."),He.allocateUnusedWorker(),He.loadWasmModuleToWorker(He.unusedWorkers[0])),He.unusedWorkers.pop())};d.PThread=He;var Ge=e=>{for(;e.length>0;)e.shift()(d)},Ve=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Ye=(e,r,t,n)=>{if(Y("string"==typeof e,`stringToUTF8Array expects a string (got ${typeof e})`),!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;s>1114111&&ar("Invalid Unicode code point "+Be(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o},qe=(e,r,t)=>(Y("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Ye(e,n(),r,t)),Ke="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,Je=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Ke)return Ke.decode(e.buffer instanceof SharedArrayBuffer?e.slice(r,o):e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var l=63&e[r++];if(224==(240&i)?i=(15&i)<<12|s<<6|l:(240!=(248&i)&&ar("Invalid UTF-8 leading byte "+Be(i)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),i=(7&i)<<18|s<<12|l<<6|63&e[r++]),i<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},Xe=(e,r)=>(Y("number"==typeof e,`UTF8ToString expects a number (got ${typeof e})`),e?Je(n(),e,r):"");function Ze(e){if(b)return We(1,0,e);Ue(e)}d.establishStackSpace=()=>{var e=En(),r=s()[e+52>>2],t=r-s()[e+56>>2];Y(0!=r),Y(0!=t),Y(r>t,"stackHigh must be higher then stackLow"),Rn(r,t),or(),Ln(r),J()};var Qe=e=>(e=>xe((()=>{var r=Wn(4),t=Wn(4);zn(e,r,t);var n,o=s()[r>>2],a=s()[t>>2],i=Xe(o);return bn(o),a&&(n=Xe(a),bn(a)),[i,n]})))(e);d.getExceptionMessage=Qe;var er,rr=[],tr=e=>{var r=rr[e];return r||(e>=rr.length&&(rr.length=e+1),rr[e]=r=er.get(e)),Y(er.get(e)==r,"JavaScript-side Wasm function table mirror is out of date!"),r};d.invokeEntryPoint=(e,r)=>{var t=tr(e)(r);X(),function(e){Re()?He.setExitStatus(e):On(e)}(t)};var nr=d.noExitRuntime||!0,or=()=>{var e=An(),r=Cn();Vn(e,r)},ar=e=>{ar.shown||={},ar.shown[e]||(ar.shown[e]=1,g&&(e="warning: "+e),R(e))},ir=[],sr=0,lr=0;class cr{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){s()[this.ptr+4>>2]=e}get_type(){return s()[this.ptr+4>>2]}set_destructor(e){s()[this.ptr+8>>2]=e}get_destructor(){return s()[this.ptr+8>>2]}set_caught(e){e=e?1:0,t()[this.ptr+12>>0]=e,Ae(e)}get_caught(){return 0!=t()[this.ptr+12>>0]}set_rethrown(e){e=e?1:0,t()[this.ptr+13>>0]=e,Ae(e)}get_rethrown(){return 0!=t()[this.ptr+13>>0]}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){s()[this.ptr+16>>2]=e}get_adjusted_ptr(){return s()[this.ptr+16>>2]}get_exception_ptr(){if(Gn(this.get_type()))return s()[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var ur=e=>{var r=lr?.excPtr;if(!r)return In(0),0;var t=new cr(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return In(0),r;for(var o in e){var a=e[o];if(0===a||a===n)break;var i=t.ptr+16;if(Hn(a,n,i))return In(a),r}return In(n),r},dr={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=dr.isAbs(e),t="/"===e.substr(-1);return(e=dr.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=dr.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=dr.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return dr.normalize(e.join("/"))},join2:(e,r)=>dr.normalize(e+"/"+r)},fr=e=>(fr=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>(e.set(crypto.getRandomValues(new Uint8Array(e.byteLength))),e);if(g)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}de("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 } };")})())(e),pr={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:kr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=dr.isAbs(n)}return(r?"/":"")+(e=dr.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=pr.resolve(e).substr(1),r=pr.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},mr=[];function hr(e,r,t){var n=t>0?t:Ve(e)+1,o=new Array(n),a=Ye(e,o,0,o.length);return r&&(o.length=a),o}var vr={ttys:[],init(){},shutdown(){},register(e,r){vr.ttys[e]={input:[],output:[],ops:r},kr.registerDevice(e,vr.stream_ops)},stream_ops:{open(e){var r=vr.ttys[e.node.rdev];if(!r)throw new kr.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new kr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new kr.ErrnoError(29)}if(void 0===s&&0===a)throw new kr.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new kr.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new kr.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!mr.length){var e=null;if(g){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=A.readSync(n,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;mr=hr(e,!0)}return mr.shift()})(),put_char(e,r){null===r||10===r?(N(Je(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(N(Je(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(R(Je(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(R(Je(e.output,0)),e.output=[])}}},gr=e=>{e=((e,r)=>(Y(r,"alignment argument is required"),Math.ceil(e/r)*r))(e,65536);var r=kn(65536,e);return r?((e,r)=>(n().fill(0,e,e+r),e))(r,e):0},yr={ops_table:null,mount:e=>yr.createNode(null,"/",16895,0),createNode(e,r,t,n){if(kr.isBlkdev(t)||kr.isFIFO(t))throw new kr.ErrnoError(63);yr.ops_table||={dir:{node:{getattr:yr.node_ops.getattr,setattr:yr.node_ops.setattr,lookup:yr.node_ops.lookup,mknod:yr.node_ops.mknod,rename:yr.node_ops.rename,unlink:yr.node_ops.unlink,rmdir:yr.node_ops.rmdir,readdir:yr.node_ops.readdir,symlink:yr.node_ops.symlink},stream:{llseek:yr.stream_ops.llseek}},file:{node:{getattr:yr.node_ops.getattr,setattr:yr.node_ops.setattr},stream:{llseek:yr.stream_ops.llseek,read:yr.stream_ops.read,write:yr.stream_ops.write,allocate:yr.stream_ops.allocate,mmap:yr.stream_ops.mmap,msync:yr.stream_ops.msync}},link:{node:{getattr:yr.node_ops.getattr,setattr:yr.node_ops.setattr,readlink:yr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:yr.node_ops.getattr,setattr:yr.node_ops.setattr},stream:kr.chrdev_stream_ops}};var o=kr.createNode(e,r,t,n);return kr.isDir(o.mode)?(o.node_ops=yr.ops_table.dir.node,o.stream_ops=yr.ops_table.dir.stream,o.contents={}):kr.isFile(o.mode)?(o.node_ops=yr.ops_table.file.node,o.stream_ops=yr.ops_table.file.stream,o.usedBytes=0,o.contents=null):kr.isLink(o.mode)?(o.node_ops=yr.ops_table.link.node,o.stream_ops=yr.ops_table.link.stream):kr.isChrdev(o.mode)&&(o.node_ops=yr.ops_table.chrdev.node,o.stream_ops=yr.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=kr.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,kr.isDir(e.mode)?r.size=4096:kr.isFile(e.mode)?r.size=e.usedBytes:kr.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&yr.resizeFileStorage(e,r.size)},lookup(e,r){throw kr.genericErrors[44]},mknod:(e,r,t,n)=>yr.createNode(e,r,t,n),rename(e,r,t){if(kr.isDir(e.mode)){var n;try{n=kr.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new kr.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=kr.lookupNode(e,r);for(var n in t.contents)throw new kr.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=yr.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!kr.isLink(e.mode))throw new kr.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(Y(i>=0),i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,n,o,a,i){if(Y(!(r instanceof ArrayBuffer)),r.buffer===t().buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return Y(0===a,"canOwn must imply no weird position inside the file"),s.contents=r.subarray(n,n+o),s.usedBytes=o,o;if(0===s.usedBytes&&0===a)return s.contents=r.slice(n,n+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(n,n+o),a),o}if(yr.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+o),a);else for(var l=0;l<o;l++)s.contents[a+l]=r[n+l];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&kr.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new kr.ErrnoError(28);return n},allocate(e,r,t){yr.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,n,o,a){if(!kr.isFile(e.node.mode))throw new kr.ErrnoError(43);var i,s,l=e.node.contents;if(2&a||l.buffer!==t().buffer){if((n>0||n+r<l.length)&&(l=l.subarray?l.subarray(n,n+r):Array.prototype.slice.call(l,n,n+r)),s=!0,!(i=gr(r)))throw new kr.ErrnoError(48);t().set(l,i)}else s=!1,i=l.byteOffset;return{ptr:i,allocated:s}},msync:(e,r,t,n,o)=>(yr.stream_ops.write(e,r,0,n,t,!1),0)}},_r=d.preloadPlugins||[],wr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Er={dbs:{},indexedDB:()=>{if("undefined"!=typeof indexedDB)return indexedDB;var e=null;return"object"==typeof window&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Y(e,"IDBFS used, but indexedDB not supported"),e},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(e){return yr.mount.apply(null,arguments)},syncfs:(e,r,t)=>{Er.getLocalSet(e,((n,o)=>{if(n)return t(n);Er.getRemoteSet(e,((e,n)=>{if(e)return t(e);var a=r?n:o,i=r?o:n;Er.reconcile(a,i,t)}))}))},quit:()=>{Object.values(Er.dbs).forEach((e=>e.close())),Er.dbs={}},getDB:(e,r)=>{var t,n=Er.dbs[e];if(n)return r(null,n);try{t=Er.indexedDB().open(e,Er.DB_VERSION)}catch(e){return r(e)}if(!t)return r("Unable to connect to IndexedDB");t.onupgradeneeded=e=>{var r,t=e.target.result,n=e.target.transaction;(r=t.objectStoreNames.contains(Er.DB_STORE_NAME)?n.objectStore(Er.DB_STORE_NAME):t.createObjectStore(Er.DB_STORE_NAME)).indexNames.contains("timestamp")||r.createIndex("timestamp","timestamp",{unique:!1})},t.onsuccess=()=>{n=t.result,Er.dbs[e]=n,r(null,n)},t.onerror=e=>{r(e.target.error),e.preventDefault()}},getLocalSet:(e,r)=>{var t={};function n(e){return"."!==e&&".."!==e}function o(e){return r=>dr.join2(e,r)}for(var a=kr.readdir(e.mountpoint).filter(n).map(o(e.mountpoint));a.length;){var i,s=a.pop();try{i=kr.stat(s)}catch(e){return r(e)}kr.isDir(i.mode)&&a.push.apply(a,kr.readdir(s).filter(n).map(o(s))),t[s]={timestamp:i.mtime}}return r(null,{type:"local",entries:t})},getRemoteSet:(e,r)=>{var t={};Er.getDB(e.mountpoint,((e,n)=>{if(e)return r(e);try{var o=n.transaction([Er.DB_STORE_NAME],"readonly");o.onerror=e=>{r(e.target.error),e.preventDefault()},o.objectStore(Er.DB_STORE_NAME).index("timestamp").openKeyCursor().onsuccess=e=>{var o=e.target.result;if(!o)return r(null,{type:"remote",db:n,entries:t});t[o.primaryKey]={timestamp:o.key},o.continue()}}catch(e){return r(e)}}))},loadLocalEntry:(e,r)=>{var t,n;try{n=kr.lookupPath(e).node,t=kr.stat(e)}catch(e){return r(e)}return kr.isDir(t.mode)?r(null,{timestamp:t.mtime,mode:t.mode}):kr.isFile(t.mode)?(n.contents=yr.getFileDataAsTypedArray(n),r(null,{timestamp:t.mtime,mode:t.mode,contents:n.contents})):r(new Error("node type not supported"))},storeLocalEntry:(e,r,t)=>{try{if(kr.isDir(r.mode))kr.mkdirTree(e,r.mode);else{if(!kr.isFile(r.mode))return t(new Error("node type not supported"));kr.writeFile(e,r.contents,{canOwn:!0})}kr.chmod(e,r.mode),kr.utime(e,r.timestamp,r.timestamp)}catch(e){return t(e)}t(null)},removeLocalEntry:(e,r)=>{try{var t=kr.stat(e);kr.isDir(t.mode)?kr.rmdir(e):kr.isFile(t.mode)&&kr.unlink(e)}catch(e){return r(e)}r(null)},loadRemoteEntry:(e,r,t)=>{var n=e.get(r);n.onsuccess=e=>t(null,e.target.result),n.onerror=e=>{t(e.target.error),e.preventDefault()}},storeRemoteEntry:(e,r,t,n)=>{try{var o=e.put(t,r)}catch(e){return void n(e)}o.onsuccess=e=>n(),o.onerror=e=>{n(e.target.error),e.preventDefault()}},removeRemoteEntry:(e,r,t)=>{var n=e.delete(r);n.onsuccess=e=>t(),n.onerror=e=>{t(e.target.error),e.preventDefault()}},reconcile:(e,r,t)=>{var n=0,o=[];Object.keys(e.entries).forEach((function(t){var a=e.entries[t],i=r.entries[t];i&&a.timestamp.getTime()==i.timestamp.getTime()||(o.push(t),n++)}));var a=[];if(Object.keys(r.entries).forEach((function(r){e.entries[r]||(a.push(r),n++)})),!n)return t(null);var i=!1,s=("remote"===e.type?e.db:r.db).transaction([Er.DB_STORE_NAME],"readwrite"),l=s.objectStore(Er.DB_STORE_NAME);function c(e){if(e&&!i)return i=!0,t(e)}s.onerror=e=>{c(this.error),e.preventDefault()},s.oncomplete=e=>{i||t(null)},o.sort().forEach((e=>{"local"===r.type?Er.loadRemoteEntry(l,e,((r,t)=>{if(r)return c(r);Er.storeLocalEntry(e,t,c)})):Er.loadLocalEntry(e,((r,t)=>{if(r)return c(r);Er.storeRemoteEntry(l,e,t,c)}))})),a.sort().reverse().forEach((e=>{"local"===r.type?Er.removeLocalEntry(e,c):Er.removeRemoteEntry(l,e,c)}))}},br={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},Tr={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},kr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class extends Error{constructor(e){for(var r in super(br[e]),this.name="ErrnoError",this.errno=e,Tr)if(Tr[r]===e){this.code=r;break}}},genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=pr.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new kr.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=kr.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=kr.lookupNode(n,t[a]),o=dr.join2(o,t[a]),kr.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;kr.isLink(n.mode);){var l=kr.readlink(o);if(o=pr.resolve(dr.dirname(o),l),n=kr.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new kr.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(kr.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%kr.nameTable.length},hashAddNode(e){var r=kr.hashName(e.parent.id,e.name);e.name_next=kr.nameTable[r],kr.nameTable[r]=e},hashRemoveNode(e){var r=kr.hashName(e.parent.id,e.name);if(kr.nameTable[r]===e)kr.nameTable[r]=e.name_next;else for(var t=kr.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=kr.mayLookup(e);if(t)throw new kr.ErrnoError(t);for(var n=kr.hashName(e.id,r),o=kr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return kr.lookup(e,r)},createNode(e,r,t,n){Y("object"==typeof e);var o=new kr.FSNode(e,r,t,n);return kr.hashAddNode(o),o},destroyNode(e){kr.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>kr.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>kr.isDir(e.mode)?kr.nodePermissions(e,"x")||(e.node_ops.lookup?0:2):54,mayCreate(e,r){try{return kr.lookupNode(e,r),20}catch(e){}return kr.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=kr.lookupNode(e,r)}catch(e){return e.errno}var o=kr.nodePermissions(e,"wx");if(o)return o;if(t){if(!kr.isDir(n.mode))return 54;if(kr.isRoot(n)||kr.getPath(n)===kr.cwd())return 10}else if(kr.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?kr.isLink(e.mode)?32:kr.isDir(e.mode)&&("r"!==kr.flagsToPermissionString(r)||512&r)?31:kr.nodePermissions(e,kr.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=kr.MAX_OPEN_FDS;e++)if(!kr.streams[e])return e;throw new kr.ErrnoError(33)},getStreamChecked(e){var r=kr.getStream(e);if(!r)throw new kr.ErrnoError(8);return r},getStream:e=>kr.streams[e],createStream:(e,r=-1)=>(kr.FSStream||(kr.FSStream=function(){this.shared={}},kr.FSStream.prototype={},Object.defineProperties(kr.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new kr.FSStream,e),-1==r&&(r=kr.nextfd()),e.fd=r,kr.streams[r]=e,e),closeStream(e){kr.streams[e]=null},chrdev_stream_ops:{open(e){var r=kr.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new kr.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){kr.devices[e]={stream_ops:r}},getDevice:e=>kr.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),kr.syncFSRequests++,kr.syncFSRequests>1&&R(`warning: ${kr.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=kr.getMounts(kr.root.mount),n=0;function o(e){return Y(kr.syncFSRequests>0),kr.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){if("string"==typeof e)throw e;var n,o="/"===t,a=!t;if(o&&kr.root)throw new kr.ErrnoError(10);if(!o&&!a){var i=kr.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,kr.isMountpoint(n))throw new kr.ErrnoError(10);if(!kr.isDir(n.mode))throw new kr.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?kr.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=kr.lookupPath(e,{follow_mount:!1});if(!kr.isMountpoint(r.node))throw new kr.ErrnoError(28);var t=r.node,n=t.mounted,o=kr.getMounts(n);Object.keys(kr.nameTable).forEach((e=>{for(var r=kr.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&kr.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);Y(-1!==a),t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=kr.lookupPath(e,{parent:!0}).node,o=dr.basename(e);if(!o||"."===o||".."===o)throw new kr.ErrnoError(28);var a=kr.mayCreate(n,o);if(a)throw new kr.ErrnoError(a);if(!n.node_ops.mknod)throw new kr.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,kr.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,kr.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{kr.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,kr.mknod(e,r,t)),symlink(e,r){if(!pr.resolve(e))throw new kr.ErrnoError(44);var t=kr.lookupPath(r,{parent:!0}).node;if(!t)throw new kr.ErrnoError(44);var n=dr.basename(r),o=kr.mayCreate(t,n);if(o)throw new kr.ErrnoError(o);if(!t.node_ops.symlink)throw new kr.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=dr.dirname(e),a=dr.dirname(r),i=dr.basename(e),s=dr.basename(r);if(t=kr.lookupPath(e,{parent:!0}).node,n=kr.lookupPath(r,{parent:!0}).node,!t||!n)throw new kr.ErrnoError(44);if(t.mount!==n.mount)throw new kr.ErrnoError(75);var l,c=kr.lookupNode(t,i),u=pr.relative(e,a);if("."!==u.charAt(0))throw new kr.ErrnoError(28);if("."!==(u=pr.relative(r,o)).charAt(0))throw new kr.ErrnoError(55);try{l=kr.lookupNode(n,s)}catch(e){}if(c!==l){var d=kr.isDir(c.mode),f=kr.mayDelete(t,i,d);if(f)throw new kr.ErrnoError(f);if(f=l?kr.mayDelete(n,s,d):kr.mayCreate(n,s))throw new kr.ErrnoError(f);if(!t.node_ops.rename)throw new kr.ErrnoError(63);if(kr.isMountpoint(c)||l&&kr.isMountpoint(l))throw new kr.ErrnoError(10);if(n!==t&&(f=kr.nodePermissions(t,"w")))throw new kr.ErrnoError(f);kr.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{kr.hashAddNode(c)}}},rmdir(e){var r=kr.lookupPath(e,{parent:!0}).node,t=dr.basename(e),n=kr.lookupNode(r,t),o=kr.mayDelete(r,t,!0);if(o)throw new kr.ErrnoError(o);if(!r.node_ops.rmdir)throw new kr.ErrnoError(63);if(kr.isMountpoint(n))throw new kr.ErrnoError(10);r.node_ops.rmdir(r,t),kr.destroyNode(n)},readdir(e){var r=kr.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new kr.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=kr.lookupPath(e,{parent:!0}).node;if(!r)throw new kr.ErrnoError(44);var t=dr.basename(e),n=kr.lookupNode(r,t),o=kr.mayDelete(r,t,!1);if(o)throw new kr.ErrnoError(o);if(!r.node_ops.unlink)throw new kr.ErrnoError(63);if(kr.isMountpoint(n))throw new kr.ErrnoError(10);r.node_ops.unlink(r,t),kr.destroyNode(n)},readlink(e){var r=kr.lookupPath(e).node;if(!r)throw new kr.ErrnoError(44);if(!r.node_ops.readlink)throw new kr.ErrnoError(28);return pr.resolve(kr.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=kr.lookupPath(e,{follow:!r}).node;if(!t)throw new kr.ErrnoError(44);if(!t.node_ops.getattr)throw new kr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>kr.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?kr.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new kr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){kr.chmod(e,r,!0)},fchmod(e,r){var t=kr.getStreamChecked(e);kr.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?kr.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new kr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){kr.chown(e,r,t,!0)},fchown(e,r,t){var n=kr.getStreamChecked(e);kr.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new kr.ErrnoError(28);var t;if(!(t="string"==typeof e?kr.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new kr.ErrnoError(63);if(kr.isDir(t.mode))throw new kr.ErrnoError(31);if(!kr.isFile(t.mode))throw new kr.ErrnoError(28);var n=kr.nodePermissions(t,"w");if(n)throw new kr.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=kr.getStreamChecked(e);if(0==(2097155&t.flags))throw new kr.ErrnoError(28);kr.truncate(t.node,r)},utime(e,r,t){var n=kr.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new kr.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=dr.normalize(e);try{n=kr.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new kr.ErrnoError(20)}else n=kr.mknod(e,t,0),o=!0;if(!n)throw new kr.ErrnoError(44);if(kr.isChrdev(n.mode)&&(r&=-513),65536&r&&!kr.isDir(n.mode))throw new kr.ErrnoError(54);if(!o){var a=kr.mayOpen(n,r);if(a)throw new kr.ErrnoError(a)}512&r&&!o&&kr.truncate(n,0),r&=-131713;var i=kr.createStream({node:n,path:kr.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!d.logReadFiles||1&r||(kr.readFiles||(kr.readFiles={}),e in kr.readFiles||(kr.readFiles[e]=1)),i},close(e){if(kr.isClosed(e))throw new kr.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{kr.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(kr.isClosed(e))throw new kr.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new kr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new kr.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(Y(t>=0),n<0||o<0)throw new kr.ErrnoError(28);if(kr.isClosed(e))throw new kr.ErrnoError(8);if(1==(2097155&e.flags))throw new kr.ErrnoError(8);if(kr.isDir(e.node.mode))throw new kr.ErrnoError(31);if(!e.stream_ops.read)throw new kr.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new kr.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(Y(t>=0),n<0||o<0)throw new kr.ErrnoError(28);if(kr.isClosed(e))throw new kr.ErrnoError(8);if(0==(2097155&e.flags))throw new kr.ErrnoError(8);if(kr.isDir(e.node.mode))throw new kr.ErrnoError(31);if(!e.stream_ops.write)throw new kr.ErrnoError(28);e.seekable&&1024&e.flags&&kr.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new kr.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(kr.isClosed(e))throw new kr.ErrnoError(8);if(r<0||t<=0)throw new kr.ErrnoError(28);if(0==(2097155&e.flags))throw new kr.ErrnoError(8);if(!kr.isFile(e.node.mode)&&!kr.isDir(e.node.mode))throw new kr.ErrnoError(43);if(!e.stream_ops.allocate)throw new kr.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new kr.ErrnoError(2);if(1==(2097155&e.flags))throw new kr.ErrnoError(2);if(!e.stream_ops.mmap)throw new kr.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>(Y(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0),munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new kr.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=kr.open(e,r.flags),o=kr.stat(e).size,a=new Uint8Array(o);return kr.read(n,a,0,o,0),"utf8"===r.encoding?t=Je(a,0):"binary"===r.encoding&&(t=a),kr.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=kr.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(Ve(r)+1),a=Ye(r,o,0,o.length);kr.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");kr.write(n,r,0,r.byteLength,void 0,t.canOwn)}kr.close(n)},cwd:()=>kr.currentPath,chdir(e){var r=kr.lookupPath(e,{follow:!0});if(null===r.node)throw new kr.ErrnoError(44);if(!kr.isDir(r.node.mode))throw new kr.ErrnoError(54);var t=kr.nodePermissions(r.node,"x");if(t)throw new kr.ErrnoError(t);kr.currentPath=r.path},createDefaultDirectories(){kr.mkdir("/tmp"),kr.mkdir("/home"),kr.mkdir("/home/web_user")},createDefaultDevices(){kr.mkdir("/dev"),kr.registerDevice(kr.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),kr.mkdev("/dev/null",kr.makedev(1,3)),vr.register(kr.makedev(5,0),vr.default_tty_ops),vr.register(kr.makedev(6,0),vr.default_tty1_ops),kr.mkdev("/dev/tty",kr.makedev(5,0)),kr.mkdev("/dev/tty1",kr.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=fr(e).byteLength),e[--r]);kr.createDevice("/dev","random",t),kr.createDevice("/dev","urandom",t),kr.mkdir("/dev/shm"),kr.mkdir("/dev/shm/tmp")},createSpecialDirectories(){kr.mkdir("/proc");var e=kr.mkdir("/proc/self");kr.mkdir("/proc/self/fd"),kr.mount({mount(){var r=kr.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=kr.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){d.stdin?kr.createDevice("/dev","stdin",d.stdin):kr.symlink("/dev/tty","/dev/stdin"),d.stdout?kr.createDevice("/dev","stdout",null,d.stdout):kr.symlink("/dev/tty","/dev/stdout"),d.stderr?kr.createDevice("/dev","stderr",null,d.stderr):kr.symlink("/dev/tty1","/dev/stderr");var e=kr.open("/dev/stdin",0),r=kr.open("/dev/stdout",1),t=kr.open("/dev/stderr",1);Y(0===e.fd,`invalid handle for stdin (${e.fd})`),Y(1===r.fd,`invalid handle for stdout (${r.fd})`),Y(2===t.fd,`invalid handle for stderr (${t.fd})`)},staticInit(){[44].forEach((e=>{kr.genericErrors[e]=new kr.ErrnoError(e),kr.genericErrors[e].stack="<generic error, no stack>"})),kr.nameTable=new Array(4096),kr.mount(yr,{},"/"),kr.createDefaultDirectories(),kr.createDefaultDevices(),kr.createSpecialDirectories(),kr.filesystems={MEMFS:yr,IDBFS:Er}},init(e,r,t){Y(!kr.init.initialized,"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)"),kr.init.initialized=!0,d.stdin=e||d.stdin,d.stdout=r||d.stdout,d.stderr=t||d.stderr,kr.createStandardStreams()},quit(){kr.init.initialized=!1,Tn(0);for(var e=0;e<kr.streams.length;e++){var r=kr.streams[e];r&&kr.close(r)}},findObject(e,r){var t=kr.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=kr.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=kr.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=dr.basename(e),n=kr.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:kr.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=dr.join2(e,a);try{kr.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=dr.join2("string"==typeof e?e:kr.getPath(e),r),i=wr(n,o);return kr.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:kr.getPath(e),i=r?dr.join2(e,r):e);var s=wr(n,o),l=kr.create(i,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),u=0,d=t.length;u<d;++u)c[u]=t.charCodeAt(u);t=c}kr.chmod(l,146|s);var f=kr.open(l,577);kr.write(f,t,0,t.length,0,a),kr.close(f),kr.chmod(l,s)}},createDevice(e,r,t,n){var o=dr.join2("string"==typeof e?e:kr.getPath(e),r),a=wr(!!t,!!n);kr.createDevice.major||(kr.createDevice.major=64);var i=kr.makedev(kr.createDevice.major++,0);return kr.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(e){throw new kr.ErrnoError(29)}if(void 0===l&&0===i)throw new kr.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new kr.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),kr.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=hr(_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new kr.ErrnoError(29)}},createLazyFile(e,r,n,o,a){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var r,t=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=t);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,t-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>t-1)throw new Error("only "+t+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),t!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):hr(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&t||(i=t=1,t=this.getter(0).length,i=t,N("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=t,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var l={isDevice:!1,contents:s}}else l={isDevice:!1,url:n};var c=kr.createFile(e,r,l,o,a);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function d(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(Y(i>=0),a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(c.stream_ops).forEach((e=>{var r=c.stream_ops[e];u[e]=function(){return kr.forceLoadFile(c),r.apply(null,arguments)}})),u.read=(e,r,t,n,o)=>(kr.forceLoadFile(c),d(e,r,t,n,o)),u.mmap=(e,r,n,o,a)=>{kr.forceLoadFile(c);var i=gr(r);if(!i)throw new kr.ErrnoError(48);return d(e,t(),i,r,n),{ptr:i,allocated:!0}},c.stream_ops=u,c},absolutePath(){de("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){de("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){de("FS.createLink has been removed; use FS.symlink instead")},joinPath(){de("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){de("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){de("FS.standardizePath has been removed; use PATH.normalize instead")}},Sr={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(dr.isAbs(r))return r;var n;if(n=-100===e?kr.cwd():Sr.getStreamFromFD(e).path,0==r.length){if(!t)throw new kr.ErrnoError(44);return n}return dr.join2(n,r)},doStat(e,r,t){var n=e(r);i()[t>>2]=n.dev,Fe(n.dev),i()[t+4>>2]=n.mode,Fe(n.mode),s()[t+8>>2]=n.nlink,Fe(n.nlink),i()[t+12>>2]=n.uid,Fe(n.uid),i()[t+16>>2]=n.gid,Fe(n.gid),i()[t+20>>2]=n.rdev,Fe(n.rdev),me=[n.size>>>0,(pe=n.size,+Math.abs(pe)>=1?pe>0?+Math.floor(pe/4294967296)>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],i()[t+24>>2]=me[0],i()[t+28>>2]=me[1],De(n.size),i()[t+32>>2]=4096,Fe(4096),i()[t+36>>2]=n.blocks,Fe(n.blocks);var o=n.atime.getTime(),a=n.mtime.getTime(),l=n.ctime.getTime();return me=[Math.floor(o/1e3)>>>0,(pe=Math.floor(o/1e3),+Math.abs(pe)>=1?pe>0?+Math.floor(pe/4294967296)>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],i()[t+40>>2]=me[0],i()[t+44>>2]=me[1],De(Math.floor(o/1e3)),s()[t+48>>2]=o%1e3*1e3,Fe(o%1e3*1e3),me=[Math.floor(a/1e3)>>>0,(pe=Math.floor(a/1e3),+Math.abs(pe)>=1?pe>0?+Math.floor(pe/4294967296)>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],i()[t+56>>2]=me[0],i()[t+60>>2]=me[1],De(Math.floor(a/1e3)),s()[t+64>>2]=a%1e3*1e3,Fe(a%1e3*1e3),me=[Math.floor(l/1e3)>>>0,(pe=Math.floor(l/1e3),+Math.abs(pe)>=1?pe>0?+Math.floor(pe/4294967296)>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],i()[t+72>>2]=me[0],i()[t+76>>2]=me[1],De(Math.floor(l/1e3)),s()[t+80>>2]=l%1e3*1e3,Fe(l%1e3*1e3),me=[n.ino>>>0,(pe=n.ino,+Math.abs(pe)>=1?pe>0?+Math.floor(pe/4294967296)>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],i()[t+88>>2]=me[0],i()[t+92>>2]=me[1],De(n.ino),0},doMsync(e,r,t,o,a){if(!kr.isFile(r.node.mode))throw new kr.ErrnoError(43);if(2&o)return 0;var i=n().slice(e,e+t);kr.msync(r,i,a,t,o)},varargs:void 0,get(){Y(null!=Sr.varargs);var e=i()[+Sr.varargs>>2];return Sr.varargs+=4,e},getp:()=>Sr.get(),getStr:e=>Xe(e),getStreamFromFD:e=>kr.getStreamChecked(e)};function Pr(e,r,t){if(b)return We(2,1,e,r,t);Sr.varargs=t;try{var n=Sr.getStreamFromFD(e);switch(r){case 0:if((a=Sr.get())<0)return-28;for(;kr.streams[a];)a++;return kr.createStream(n,a).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var a=Sr.get();return n.flags|=a,0;case 12:return a=Sr.getp(),o()[a+0>>1]=2,Ce(2),0}return-28}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}function Ar(e,r){if(b)return We(3,1,e,r);try{var t=Sr.getStreamFromFD(e);return Sr.doStat(kr.stat,t.path,r)}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}function Cr(e,r,n){if(b)return We(4,1,e,r,n);Sr.varargs=n;try{var a=Sr.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return a.tty?0:-59;case 21505:if(!a.tty)return-59;if(a.tty.ops.ioctl_tcgets){var s=a.tty.ops.ioctl_tcgets(a),l=Sr.getp();i()[l>>2]=s.c_iflag||0,Fe(s.c_iflag||0),i()[l+4>>2]=s.c_oflag||0,Fe(s.c_oflag||0),i()[l+8>>2]=s.c_cflag||0,Fe(s.c_cflag||0),i()[l+12>>2]=s.c_lflag||0,Fe(s.c_lflag||0);for(var c=0;c<32;c++)t()[l+c+17>>0]=s.c_cc[c]||0,Ae(s.c_cc[c]||0);return 0}return 0;case 21506:case 21507:case 21508:if(!a.tty)return-59;if(a.tty.ops.ioctl_tcsets){l=Sr.getp();var u=i()[l>>2],d=i()[l+4>>2],f=i()[l+8>>2],p=i()[l+12>>2],m=[];for(c=0;c<32;c++)m.push(t()[l+c+17>>0]);return a.tty.ops.ioctl_tcsets(a.tty,r,{c_iflag:u,c_oflag:d,c_cflag:f,c_lflag:p,c_cc:m})}return 0;case 21519:return a.tty?(l=Sr.getp(),i()[l>>2]=0,Fe(0),0):-59;case 21520:return a.tty?-28:-59;case 21531:return l=Sr.getp(),kr.ioctl(a,r,l);case 21523:if(!a.tty)return-59;if(a.tty.ops.ioctl_tiocgwinsz){var h=a.tty.ops.ioctl_tiocgwinsz(a.tty);l=Sr.getp(),o()[l>>1]=h[0],Ce(h[0]),o()[l+2>>1]=h[1],Ce(h[1])}return 0;default:return-28}}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}function Fr(e,r){if(b)return We(5,1,e,r);try{return e=Sr.getStr(e),Sr.doStat(kr.lstat,e,r)}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}function Dr(e,r,t,n){if(b)return We(6,1,e,r,t,n);try{r=Sr.getStr(r);var o=256&n,a=4096&n;return Y(!(n&=-6401),`unknown flags in __syscall_newfstatat: ${n}`),r=Sr.calculateAt(e,r,a),Sr.doStat(o?kr.lstat:kr.stat,r,t)}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}function Or(e,r,t,n){if(b)return We(7,1,e,r,t,n);Sr.varargs=n;try{r=Sr.getStr(r),r=Sr.calculateAt(e,r);var o=n?Sr.get():0;return kr.open(r,t,o).fd}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}function Mr(e,r){if(b)return We(8,1,e,r);try{return e=Sr.getStr(e),Sr.doStat(kr.stat,e,r)}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}function $r(e,r,t){if(b)return We(9,1,e,r,t);try{return r=Sr.getStr(r),r=Sr.calculateAt(e,r),0===t?kr.unlink(r):512===t?kr.rmdir(r):de("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}var Ir={},Nr=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function Rr(e){return this.fromWireType(i()[e>>2])}var xr,Lr,Wr,jr={},Ur={},Br={},zr=e=>{throw new xr(e)},Hr=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&zr("Mismatched type converter count");for(var o=0;o<e.length;++o)qr(e[o],n[o])}e.forEach((function(e){Br[e]=r}));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{Ur.hasOwnProperty(e)?o[r]=Ur[e]:(a.push(e),jr.hasOwnProperty(e)||(jr[e]=[]),jr[e].push((()=>{o[r]=Ur[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},Gr={},Vr=e=>{for(var r="",t=e;n()[t];)r+=Lr[n()[t++]];return r},Yr=e=>{throw new Wr(e)};function qr(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Yr(`type "${n}" must have a positive integer typeid pointer`),Ur.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Yr(`Cannot register type '${n}' twice`)}if(Ur[e]=r,delete Br[e],jr.hasOwnProperty(e)){var o=jr[e];delete jr[e],o.forEach((e=>e()))}}(e,r,t)}var Kr,Jr=e=>{Yr(e.$$.ptrType.registeredClass.name+" instance already deleted")},Xr=!1,Zr=e=>{},Qr=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},et=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=et(e,r,t.baseClass);return null===n?null:t.downcast(n)},rt={},tt=[],nt=()=>{for(;tt.length;){var e=tt.pop();e.$$.deleteScheduled=!1,e.delete()}},ot={},at=(e,r)=>(r.ptrType&&r.ptr||zr("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&zr("Both smartPtrType and smartPtr must be specified"),r.count={value:1},st(Object.create(e,{$$:{value:r,writable:!0}})));function it(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&Yr("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(e,r),ot[r]))(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?at(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):at(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=rt[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=et(r,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?at(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):at(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var st=e=>"undefined"==typeof FinalizationRegistry?(st=e=>e,e):(Xr=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),Qr(e.$$)})),st=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r},n=r.ptrType.registeredClass;t.leakWarning=new Error(`Embind found a leaked C++ instance ${n.name} <${Be(r.ptr)}>.\nWe'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(t.leakWarning,it),Xr.register(e,t,e)}return e},Zr=e=>Xr.unregister(e),st(e));function lt(){}var ct=(e,r)=>Object.defineProperty(r,"name",{value:e}),ut=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||Yr(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},dt=(e,r,t)=>{d.hasOwnProperty(e)?((void 0===t||void 0!==d[e].overloadTable&&void 0!==d[e].overloadTable[t])&&Yr(`Cannot register public name '${e}' twice`),ut(d,e,e),d.hasOwnProperty(t)&&Yr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),d[e].overloadTable[t]=r):(d[e]=r,void 0!==t&&(d[e].numArguments=t))};function ft(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var pt=(e,r,t)=>{for(;r!==t;)r.upcast||Yr(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function mt(e,r){if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),0;r.$$||Yr(`Cannot pass "${Nt(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return pt(r.$$.ptr,t,this.registeredClass)}function ht(e,r){var t;if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r&&r.$$||Yr(`Cannot pass "${Nt(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Yr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=pt(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Yr("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Yr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,Ot.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Yr("Unsupporting sharing policy")}return t}function vt(e,r){if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),0;r.$$||Yr(`Cannot pass "${Nt(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Yr(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return pt(r.$$.ptr,t,this.registeredClass)}function gt(e){return this.fromWireType(s()[e>>2])}function yt(e,r,t,n,o,a,i,s,l,c,u){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,o||void 0!==r.baseClass?this.toWireType=ht:n?(this.toWireType=mt,this.destructorFunction=null):(this.toWireType=vt,this.destructorFunction=null)}var _t,wt=(e,r,t)=>{d.hasOwnProperty(e)||zr("Replacing nonexistant public symbol"),void 0!==d[e].overloadTable&&void 0!==t?d[e].overloadTable[t]=r:(d[e]=r,d[e].argCount=t)},Et=(e,r)=>{var t=(e=Vr(e)).includes("j")?((e,r)=>{Y(e.includes("j")||e.includes("p"),"getDynCaller should only be called with i64 sigs");var t=[];return function(){return t.length=0,Object.assign(t,arguments),((e,r,t)=>e.includes("j")?((e,r,t)=>{Y("dynCall_"+e in d,`bad function pointer type - dynCall function not found for sig '${e}'`),Y(t?.length?t.length===e.substring(1).replace(/j/g,"--").length:1==e.length);var n=d["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)})(e,r,t):(Y(tr(r),`missing table entry in dynCall: ${r}`),tr(r).apply(null,t)))(e,r,t)}})(e,r):tr(r);return"function"!=typeof t&&Yr(`unknown function pointer with signature ${e}: ${r}`),t},bt=e=>{var r=Sn(e),t=Vr(r);return bn(r),t},Tt=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||Ur[r]||(Br[r]?Br[r].forEach(e):(t.push(r),n[r]=!0))})),new _t(`${e}: `+t.map(bt).join([", "]))},kt=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(s()[r+4*n>>2]);return t};function St(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function Pt(e,r,t,n,o,a){var i=r.length;i<2&&Yr("argTypes array size mismatch! Must at least get return value and 'this' types!"),Y(!a,"Async bindings are only supported with JSPI.");for(var s=null!==r[1]&&null!==t,l=St(r),c="void"!==r[0].name,u=[e,Yr,n,o,Nr,r[0],r[1]],d=0;d<i-2;++d)u.push(r[d+2]);if(!l)for(d=s?1:2;d<r.length;++d)null!==r[d].destructorFunction&&u.push(r[d].destructorFunction);let[f,p]=function(e,r,t,n){for(var o=St(e),a=e.length,i="",s="",l=0;l<a-2;++l)i+=(0!==l?", ":"")+"arg"+l,s+=(0!==l?", ":"")+"arg"+l+"Wired";var c=`\n return function (${i}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${a-2}');\n }`;o&&(c+="var destructors = [];\n");var u=o?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(r&&(c+="var thisWired = classParam['toWireType']("+u+", this);\n"),l=0;l<a-2;++l)c+="var arg"+l+"Wired = argType"+l+"['toWireType']("+u+", arg"+l+");\n",d.push("argType"+l);if(r&&(s="thisWired"+(s.length>0?", ":"")+s),c+=(t||n?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",o)c+="runDestructors(destructors);\n";else for(l=r?1:2;l<e.length;++l){var f=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(c+=f+"_dtor("+f+");\n",d.push(f+"_dtor"))}return t&&(c+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),c+="}\n",[d,c=`if (arguments.length !== ${d.length}){ throw new Error(humanName + "Expected ${d.length} closure arguments " + arguments.length + " given."); }\n${c}`]}(r,s,c,a);f.push(p);var m=function(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=ct(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,o=e.apply(n,r);return o instanceof Object?o:n}(Function,f).apply(null,u);return ct(e,m)}var At=e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?(Y(")"==e[e.length-1],"Parentheses for argument names should match."),e.substr(0,r)):e},Ct=(e,r,t)=>(e instanceof Object||Yr(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||Yr(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Yr(`cannot call emscripten binding method ${t} on deleted object`),pt(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Ft=new class{constructor(){this.allocated=[void 0],this.freelist=[]}get(e){return Y(void 0!==this.allocated[e],`invalid handle: ${e}`),this.allocated[e]}has(e){return void 0!==this.allocated[e]}allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r}free(e){Y(void 0!==this.allocated[e]),this.allocated[e]=void 0,this.freelist.push(e)}},Dt=e=>{e>=Ft.reserved&&0==--Ft.get(e).refcount&&Ft.free(e)},Ot={toValue:e=>(e||Yr("Cannot use deleted val. handle = "+e),Ft.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Ft.allocate({refcount:1,value:e})}}},Mt={name:"emscripten::val",fromWireType:e=>{var r=Ot.toValue(e);return Dt(e),r},toWireType:(e,r)=>Ot.toHandle(r),argPackAdvance:8,readValueFromPointer:Rr,destructorFunction:null},$t=(e,r,l)=>{switch(r){case 1:return l?function(e){return this.fromWireType(t()[e>>0])}:function(e){return this.fromWireType(n()[e>>0])};case 2:return l?function(e){return this.fromWireType(o()[e>>1])}:function(e){return this.fromWireType(a()[e>>1])};case 4:return l?function(e){return this.fromWireType(i()[e>>2])}:function(e){return this.fromWireType(s()[e>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},It=(e,r)=>{var t=Ur[e];return void 0===t&&Yr(r+" has unknown type "+bt(e)),t},Nt=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},Rt=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(($.buffer!=L.buffer&&q(),H)[e>>2])};case 8:return function(e){return this.fromWireType(l()[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},xt=(e,r,l)=>{switch(r){case 1:return l?e=>t()[e>>0]:e=>n()[e>>0];case 2:return l?e=>o()[e>>1]:e=>a()[e>>1];case 4:return l?e=>i()[e>>2]:e=>s()[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Lt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Wt=(e,r)=>{Y(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var t=e,i=t>>1,s=i+r/2;!(i>=s)&&a()[i];)++i;if((t=i<<1)-e>32&&Lt)return Lt.decode(n().slice(e,t));for(var l="",c=0;!(c>=r/2);++c){var u=o()[e+2*c>>1];if(0==u)break;l+=String.fromCharCode(u)}return l},jt=(e,r,t)=>{if(Y(r%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),Y("number"==typeof t,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),t??=2147483647,t<2)return 0;for(var n=r,a=(t-=2)<2*e.length?t/2:e.length,i=0;i<a;++i){var s=e.charCodeAt(i);o()[r>>1]=s,Ce(s),r+=2}return o()[r>>1]=0,Ce(0),r-n},Ut=e=>2*e.length,Bt=(e,r)=>{Y(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var t=0,n="";!(t>=r/4);){var o=i()[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},zt=(e,r,t)=>{if(Y(r%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),Y("number"==typeof t,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),i()[r>>2]=s,Fe(s),(r+=4)+4>o)break}return i()[r>>2]=0,Fe(0),r-n},Ht=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Gt=e=>{if("function"==typeof Atomics.waitAsync){var r=Atomics.waitAsync(i(),e>>2,e);Y(r.async),r.value.then(Vt);var t=e+128;Atomics.store(i(),t>>2,1)}};d.__emscripten_thread_mailbox_await=Gt;var Vt=()=>{var e=En();e&&(Gt(e),(e=>{if(V)R("user callback triggered after runtime exited or application aborted. Ignoring.");else try{e(),(()=>{if(!Re())try{b?On(x):Ue(x)}catch(e){ze(e)}})()}catch(e){ze(e)}})(Mn))};d.checkMailbox=Vt;var Yt=[],qt=e=>e%4==0&&(e%100!=0||e%400==0),Kt=[0,31,60,91,121,152,182,213,244,274,305,335],Jt=[0,31,59,90,120,151,181,212,243,273,304,334];function Xt(e,r,t,n,o,a,l,c){if(b)return We(10,1,e,r,t,n,o,a,l,c);var u=Le(o,a);try{if(isNaN(u))return 61;var d=Sr.getStreamFromFD(n),f=kr.mmap(d,e,u,r,t),p=f.ptr;return i()[l>>2]=f.allocated,Fe(f.allocated),s()[c>>2]=p,0}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}function Zt(e,r,t,n,o,a,i){if(b)return We(11,1,e,r,t,n,o,a,i);var s=Le(a,i);try{if(isNaN(s))return 61;var l=Sr.getStreamFromFD(o);2&t&&Sr.doMsync(e,l,r,n,s),kr.munmap(l)}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return-e.errno}}var Qt,en=e=>{var r=Ve(e)+1,t=wn(r);return t&&qe(e,t,r),t};Qt=()=>performance.timeOrigin+performance.now();var rn=e=>{var r=$.buffer,t=(e-r.byteLength+65535)/65536;try{return $.grow(t),q(),1}catch(t){R(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${t}`)}},tn={},nn=()=>{if(!nn.strings){var e={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",_:p||"./this.program"};for(var r in tn)void 0===tn[r]?delete e[r]:e[r]=tn[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);nn.strings=t}return nn.strings},on=function(e,r){if(b)return We(12,1,e,r);var n=0;return nn().forEach(((o,a)=>{var i=r+n;s()[e+4*a>>2]=i,Fe(i),((e,r)=>{for(var n=0;n<e.length;++n)Y(e.charCodeAt(n)===(255&e.charCodeAt(n))),t()[r++>>0]=e.charCodeAt(n),Ae(e.charCodeAt(n));t()[r>>0]=0,Ae(0)})(o,i),n+=o.length+1})),0},an=function(e,r){if(b)return We(13,1,e,r);var t=nn();s()[e>>2]=t.length,Fe(t.length);var n=0;return t.forEach((e=>n+=e.length+1)),s()[r>>2]=n,Fe(n),0};function sn(e){if(b)return We(14,1,e);try{var r=Sr.getStreamFromFD(e);return kr.close(r),0}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return e.errno}}function ln(e,r,n,o){if(b)return We(15,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var l=s()[r>>2],c=s()[r+4>>2];r+=8;var u=kr.read(e,t(),l,c,o);if(u<0)return-1;if(a+=u,u<c)break;void 0!==o&&(o+=u)}return a})(Sr.getStreamFromFD(e),r,n);return s()[o>>2]=a,Fe(a),0}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return e.errno}}function cn(e,r,t,n,o){if(b)return We(16,1,e,r,t,n,o);var a=Le(r,t);try{if(isNaN(a))return 61;var s=Sr.getStreamFromFD(e);return kr.llseek(s,a,n),me=[s.position>>>0,(pe=s.position,+Math.abs(pe)>=1?pe>0?+Math.floor(pe/4294967296)>>>0:~~+Math.ceil((pe-+(~~pe>>>0))/4294967296)>>>0:0)],i()[o>>2]=me[0],i()[o+4>>2]=me[1],De(s.position),s.getdents&&0===a&&0===n&&(s.getdents=null),0}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return e.errno}}function un(e,r,n,o){if(b)return We(17,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var l=s()[r>>2],c=s()[r+4>>2];r+=8;var u=kr.write(e,t(),l,c,o);if(u<0)return-1;a+=u,void 0!==o&&(o+=u)}return a})(Sr.getStreamFromFD(e),r,n);return s()[o>>2]=a,Fe(a),0}catch(e){if(void 0===kr||"ErrnoError"!==e.name)throw e;return e.errno}}var dn=[31,29,31,30,31,30,31,31,30,31,30,31],fn=[31,28,31,30,31,30,31,31,30,31,30,31];He.init();var pn,mn,hn=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=kr.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(hn.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return kr.isDir(this.mode)}},isDevice:{get:function(){return kr.isChrdev(this.mode)}}}),kr.FSNode=hn,kr.createPreloadedFile=(e,r,t,n,o,a,i,s,l,c)=>{var u=r?pr.resolve(dr.join2(e,r)):e,d=le(`cp ${u}`);function f(t){function f(t){c?.(),s||((e,r,t,n,o,a)=>{kr.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,l),a?.(),ue(d)}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return _r.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,u,f,(()=>{i?.(),ue(d)}))||f(t)}ce(d),"string"==typeof t?((e,r,t,n)=>{var o=le(`al ${e}`);w(e,(t=>{Y(t,`Loading data file "${e}" failed (no arrayBuffer).`),r(new Uint8Array(t)),o&&ue(o)}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&ce(o)})(t,f,i):f(t)},kr.staticInit(),d.FS_createPath=kr.createPath,d.FS_createDataFile=kr.createDataFile,d.FS_createPreloadedFile=kr.createPreloadedFile,d.FS_unlink=kr.unlink,d.FS_createLazyFile=kr.createLazyFile,d.FS_createDevice=kr.createDevice,xr=d.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Lr=e})(),Wr=d.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(lt.prototype,{isAliasOf(e){if(!(this instanceof lt))return!1;if(!(e instanceof lt))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||Jr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=st(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Jr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Yr("Object already scheduled for deletion"),Zr(this),Qr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Jr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Yr("Object already scheduled for deletion"),tt.push(this),1===tt.length&&Kr&&Kr(nt),this.$$.deleteScheduled=!0,this}}),d.getInheritedInstanceCount=()=>Object.keys(ot).length,d.getLiveInheritedInstances=()=>{var e=[];for(var r in ot)ot.hasOwnProperty(r)&&e.push(ot[r]);return e},d.flushPendingDeletes=nt,d.setDelayFunction=e=>{Kr=e,tt.length&&Kr&&Kr(nt)},Object.assign(yt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:gt,fromWireType:it}),_t=d.UnboundTypeError=(pn=Error,(mn=ct("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(pn.prototype),mn.prototype.constructor=mn,mn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},mn),Ft.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Object.assign(Ft,{reserved:Ft.allocated.length}),d.count_emval_handles=()=>{for(var e=0,r=Ft.reserved;r<Ft.allocated.length;++r)void 0!==Ft.allocated[r]&&++e;return e};var vn,gn=[je,Ze,Pr,Ar,Cr,Fr,Dr,Or,Mr,$r,Xt,Zt,on,an,sn,ln,cn,un],yn={__assert_fail:(e,r,t,n)=>{de(`Assertion failed: ${Xe(e)}, at: `+[r?Xe(r):"unknown filename",t,n?Xe(n):"unknown function"])},__cxa_begin_catch:e=>{var r=new cr(e);return r.get_caught()||(r.set_caught(!0),sr--),r.set_rethrown(!1),ir.push(r),Bn(r.excPtr),r.get_exception_ptr()},__cxa_end_catch:()=>{$n(0,0),Y(ir.length>0);var e=ir.pop();Un(e.excPtr),lr=0},__cxa_find_matching_catch_2:()=>ur([]),__cxa_find_matching_catch_3:e=>ur([e]),__cxa_rethrow:()=>{var e=ir.pop();e||de("no exception to throw");var r=e.excPtr;throw e.get_rethrown()||(ir.push(e),e.set_rethrown(!0),e.set_caught(!1),sr++),lr=new _e(r)},__cxa_throw:(e,r,t)=>{throw new cr(e).init(r,t),lr=new _e(e),sr++,lr},__cxa_uncaught_exceptions:()=>sr,__emscripten_init_main_thread_js:e=>{Pn(e,!v,1,!h,2097152,!1),He.threadInitTLS()},__emscripten_thread_cleanup:e=>{b?postMessage({cmd:"cleanupThread",thread:e}):Ie(e)},__handle_stack_overflow:e=>{var r=An(),t=Cn();de(`stack overflow (Attempt to set SP to ${Be(e)}, with stack limits [${Be(t)} - ${Be(r)}]). If you require more stack space build with -sSTACK_SIZE=<bytes>`)},__resumeException:e=>{throw lr||(lr=new _e(e)),lr},__syscall_fcntl64:Pr,__syscall_fstat64:Ar,__syscall_ioctl:Cr,__syscall_lstat64:Fr,__syscall_newfstatat:Dr,__syscall_openat:Or,__syscall_stat64:Mr,__syscall_unlinkat:$r,_embind_finalize_value_array:e=>{var r=Ir[e];delete Ir[e];var t=r.elements,n=t.length,o=t.map((e=>e.getterReturnType)).concat(t.map((e=>e.setterArgumentType))),a=r.rawConstructor,i=r.rawDestructor;Hr([e],o,(function(e){return t.forEach(((r,t)=>{var o=e[t],a=r.getter,i=r.getterContext,s=e[t+n],l=r.setter,c=r.setterContext;r.read=e=>o.fromWireType(a(i,e)),r.write=(e,r)=>{var t=[];l(c,e,s.toWireType(t,r)),Nr(t)}})),[{name:r.name,fromWireType:e=>{for(var r=new Array(n),o=0;o<n;++o)r[o]=t[o].read(e);return i(e),r},toWireType:(e,o)=>{if(n!==o.length)throw new TypeError(`Incorrect number of tuple elements for ${r.name}: expected=${n}, actual=${o.length}`);for(var s=a(),l=0;l<n;++l)t[l].write(s,o[l]);return null!==e&&e.push(i,s),s},argPackAdvance:8,readValueFromPointer:Rr,destructorFunction:i}]}))},_embind_finalize_value_object:e=>{var r=Gr[e];delete Gr[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType)));Hr([e],a,(e=>{var a={};return o.forEach(((r,t)=>{var n=r.fieldName,i=e[t],s=r.getter,l=r.getterContext,c=e[t+o.length],u=r.setter,d=r.setterContext;a[n]={read:e=>i.fromWireType(s(l,e)),write:(e,r)=>{var t=[];u(d,e,c.toWireType(t,r)),Nr(t)}}})),[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},argPackAdvance:8,readValueFromPointer:Rr,destructorFunction:n}]}))},_embind_register_bigint:(e,r,t,n,o)=>{},_embind_register_bool:(e,r,t,o)=>{qr(e,{name:r=Vr(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:o},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(n()[e])},destructorFunction:null})},_embind_register_class:(e,r,t,n,o,a,i,s,l,c,u,d,f)=>{u=Vr(u),a=Et(o,a),s&&=Et(i,s),c&&=Et(l,c),f=Et(d,f);var p=(e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(u);dt(p,(function(){Tt(`Cannot construct ${u} due to unbound types`,[n])})),Hr([e,r,t],n?[n]:[],(function(r){var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:lt.prototype;var i=ct(u,(function(){if(Object.getPrototypeOf(this)!==l)throw new Wr("Use 'new' to construct "+u);if(void 0===d.constructor_body)throw new Wr(u+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Wr(`Tried to invoke ctor of ${u} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),l=Object.create(o,{constructor:{value:i}});i.prototype=l;var d=new ft(u,i,l,f,t,a,s,c);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var m=new yt(u,d,!0,!1,!1),h=new yt(u+"*",d,!1,!1,!1),v=new yt(u+" const*",d,!1,!0,!1);return rt[e]={pointerType:h,constPointerType:v},wt(p,i),[m,h,v]}))},_embind_register_class_constructor:(e,r,t,n,o,a)=>{Y(r>0);var i=kt(r,t);o=Et(n,o),Hr([],[e],(function(e){var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Wr(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{Tt(`Cannot construct ${e.name} due to unbound types`,i)},Hr([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=Pt(t,n,null,o,a),[]))),[]}))},_embind_register_class_function:(e,r,t,n,o,a,i,s,l)=>{var c=kt(t,n);r=Vr(r),r=At(r),a=Et(o,a),Hr([],[e],(function(e){var n=`${(e=e[0]).name}.${r}`;function o(){Tt(`Cannot call ${n} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var u=e.registeredClass.instancePrototype,d=u[r];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===t-2?(o.argCount=t-2,o.className=e.name,u[r]=o):(ut(u,r,n),u[r].overloadTable[t-2]=o),Hr([],c,(function(o){var s=Pt(n,o,e,a,i,l);return void 0===u[r].overloadTable?(s.argCount=t-2,u[r]=s):u[r].overloadTable[t-2]=s,[]})),[]}))},_embind_register_class_property:(e,r,t,n,o,a,i,s,l,c)=>{r=Vr(r),o=Et(n,o),Hr([],[e],(function(e){var n=`${(e=e[0]).name}.${r}`,u={get(){Tt(`Cannot access ${n} due to unbound types`,[t,i])},enumerable:!0,configurable:!0};return u.set=l?()=>Tt(`Cannot access ${n} due to unbound types`,[t,i]):e=>Yr(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,r,u),Hr([],l?[t,i]:[t],(function(t){var i=t[0],u={get(){var r=Ct(this,e,n+" getter");return i.fromWireType(o(a,r))},enumerable:!0};if(l){l=Et(s,l);var d=t[1];u.set=function(r){var t=Ct(this,e,n+" setter"),o=[];l(c,t,d.toWireType(o,r)),Nr(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,u),[]})),[]}))},_embind_register_emval:e=>qr(e,Mt),_embind_register_enum:(e,r,t,n)=>{function o(){}r=Vr(r),o.values={},qr(e,{name:r,constructor:o,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,r)=>r.value,argPackAdvance:8,readValueFromPointer:$t(r,t,n),destructorFunction:null}),dt(r,o)},_embind_register_enum_value:(e,r,t)=>{var n=It(e,"enum");r=Vr(r);var o=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:ct(`${n.name}_${r}`,(function(){}))}});o.values[t]=a,o[r]=a},_embind_register_float:(e,r,t)=>{qr(e,{name:r=Vr(r),fromWireType:e=>e,toWireType:(e,r)=>{if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError(`Cannot convert ${Nt(r)} to ${this.name}`);return r},argPackAdvance:8,readValueFromPointer:Rt(r,t),destructorFunction:null})},_embind_register_function:(e,r,t,n,o,a,i)=>{var s=kt(r,t);e=Vr(e),e=At(e),o=Et(n,o),dt(e,(function(){Tt(`Cannot call ${e} due to unbound types`,s)}),r-1),Hr([],s,(function(t){var n=[t[0],null].concat(t.slice(1));return wt(e,Pt(e,n,null,o,a,i),r-1),[]}))},_embind_register_integer:(e,r,t,n,o)=>{r=Vr(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned"),l=(e,t)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert "${Nt(e)}" to ${t}`);if(e<n||e>o)throw new TypeError(`Passing a number "${Nt(e)}" from JS side to C/C++ side to an argument of type "${r}", which is outside the valid range [${n}, ${o}]!`)};qr(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return l(r,this.name),r>>>0}:function(e,r){return l(r,this.name),r},argPackAdvance:8,readValueFromPointer:xt(r,t,0!==n),destructorFunction:null})},_embind_register_memory_view:(e,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=s()[e>>2],n=s()[e+4>>2];return new o(t().buffer,n,r)}qr(e,{name:n=Vr(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(e,r)=>{var t="std::string"===(r=Vr(r));qr(e,{name:r,fromWireType(e){var r,o=s()[e>>2],a=e+4;if(t)for(var i=a,l=0;l<=o;++l){var c=a+l;if(l==o||0==n()[c]){var u=Xe(i,c-i);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),i=c+1}}else{var d=new Array(o);for(l=0;l<o;++l)d[l]=String.fromCharCode(n()[a+l]);r=d.join("")}return bn(e),r},toWireType(e,r){var o;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var a="string"==typeof r;a||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||Yr("Cannot pass non-string to std::string"),o=t&&a?Ve(r):r.length;var i=wn(4+o+1),l=i+4;if(s()[i>>2]=o,Fe(o),t&&a)qe(r,l,o+1);else if(a)for(var c=0;c<o;++c){var u=r.charCodeAt(c);u>255&&(bn(l),Yr("String has UTF-16 code units that do not fit in 8 bits")),n()[l+c]=u}else for(c=0;c<o;++c)n()[l+c]=r[c];return null!==e&&e.push(bn,i),i},argPackAdvance:8,readValueFromPointer:gt,destructorFunction(e){bn(e)}})},_embind_register_std_wstring:(e,r,t)=>{var n,o,i,l,c;t=Vr(t),2===r?(n=Wt,o=jt,l=Ut,i=()=>a(),c=1):4===r&&(n=Bt,o=zt,l=Ht,i=()=>s(),c=2),qr(e,{name:t,fromWireType:e=>{for(var t,o=s()[e>>2],a=i(),l=e+4,u=0;u<=o;++u){var d=e+4+u*r;if(u==o||0==a[d>>c]){var f=n(l,d-l);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),l=d+r}}return bn(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Yr(`Cannot pass non-string to C++ string type ${t}`);var a=l(n),i=wn(4+a+r);return s()[i>>2]=a>>c,Fe(a>>c),o(n,i+4,a+r),null!==e&&e.push(bn,i),i},argPackAdvance:8,readValueFromPointer:Rr,destructorFunction(e){bn(e)}})},_embind_register_value_array:(e,r,t,n,o,a)=>{Ir[e]={name:Vr(r),rawConstructor:Et(t,n),rawDestructor:Et(o,a),elements:[]}},_embind_register_value_array_element:(e,r,t,n,o,a,i,s,l)=>{Ir[e].elements.push({getterReturnType:r,getter:Et(t,n),getterContext:o,setterArgumentType:a,setter:Et(i,s),setterContext:l})},_embind_register_value_object:(e,r,t,n,o,a)=>{Gr[e]={name:Vr(r),rawConstructor:Et(t,n),rawDestructor:Et(o,a),fields:[]}},_embind_register_value_object_field:(e,r,t,n,o,a,i,s,l,c)=>{Gr[e].fields.push({fieldName:Vr(r),getterReturnType:t,getter:Et(n,o),getterContext:a,setterArgumentType:i,setter:Et(s,l),setterContext:c})},_embind_register_void:(e,r)=>{qr(e,{isVoid:!0,name:r=Vr(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_notify_mailbox_postmessage:(e,r,t)=>{if(e==r)setTimeout(Vt);else if(b)postMessage({targetThread:e,cmd:"checkMailbox"});else{var n=He.pthreads[e];if(!n)return void R(`Cannot send message to thread with ID ${e}, unknown thread ID!`);n.postMessage({cmd:"checkMailbox"})}},_emscripten_receive_on_main_thread_js:(e,r,t,n)=>{Yt.length=t;for(var o=n>>3,a=0;a<t;a++)Yt[a]=l()[o+a];var i=gn[e];Y(i.length==t,"Call args mismatch in _emscripten_receive_on_main_thread_js"),He.currentProxiedOperationCallerThread=r;var s=i.apply(null,Yt);return He.currentProxiedOperationCallerThread=0,Y("bigint"!=typeof s),s},_emscripten_thread_mailbox_await:Gt,_emscripten_thread_set_strongref:e=>{g&&He.pthreads[e].ref()},_emval_decref:Dt,_emval_incref:e=>{e>4&&(Ft.get(e).refcount+=1)},_emval_take_value:(e,r)=>{var t=(e=It(e,"_emval_take_value")).readValueFromPointer(r);return Ot.toHandle(t)},_localtime_js:function(e,r,t){var n=Le(e,r),o=new Date(1e3*n);i()[t>>2]=o.getSeconds(),Fe(o.getSeconds()),i()[t+4>>2]=o.getMinutes(),Fe(o.getMinutes()),i()[t+8>>2]=o.getHours(),Fe(o.getHours()),i()[t+12>>2]=o.getDate(),Fe(o.getDate()),i()[t+16>>2]=o.getMonth(),Fe(o.getMonth()),i()[t+20>>2]=o.getFullYear()-1900,Fe(o.getFullYear()-1900),i()[t+24>>2]=o.getDay(),Fe(o.getDay());var a=0|(e=>(qt(e.getFullYear())?Kt:Jt)[e.getMonth()]+e.getDate()-1)(o);i()[t+28>>2]=a,Fe(a),i()[t+36>>2]=-60*o.getTimezoneOffset(),Fe(-60*o.getTimezoneOffset());var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=s.getTimezoneOffset(),u=0|(l!=c&&o.getTimezoneOffset()==Math.min(c,l));i()[t+32>>2]=u,Fe(u)},_mmap_js:Xt,_munmap_js:Zt,_tzset_js:(e,r,t)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),l=o.getTimezoneOffset(),c=a.getTimezoneOffset(),u=Math.max(l,c);function d(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}s()[e>>2]=60*u,Fe(60*u),i()[r>>2]=Number(l!=c),Fe(Number(l!=c));var f=d(o),p=d(a),m=en(f),h=en(p);c<l?(s()[t>>2]=m,Fe(m),s()[t+4>>2]=h,Fe(h)):(s()[t>>2]=h,Fe(h),s()[t+4>>2]=m,Fe(m))},abort:()=>{de("native code called abort()")},emscripten_check_blocking_allowed:()=>{g||v||ar("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},emscripten_date_now:()=>Date.now(),emscripten_exit_with_live_runtime:()=>{throw Ne+=1,"unwind"},emscripten_get_now:Qt,emscripten_resize_heap:e=>{var r=n().length;if((e>>>=0)<=r)return!1;var t=2147483648;if(e>t)return R(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var o,a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(t,(o=Math.max(e,i))+(65536-o%65536)%65536),l=Qt(),c=rn(s);if(Oe(`Heap resize call from ${r} to ${s} took ${Qt()-l} msecs. Success: ${!!c}`),c)return!0}return R(`Failed to grow the heap from ${r} bytes to ${s} bytes, not enough memory!`),!1},environ_get:on,environ_sizes_get:an,exit:Ue,fd_close:sn,fd_read:ln,fd_seek:cn,fd_write:un,invoke_dii:function(e,r,t){var n=xn();try{return tr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof ye))throw e;$n(1,0)}},invoke_diii:function(e,r,t,n){var o=xn();try{return tr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof ye))throw e;$n(1,0)}},invoke_fi:function(e,r){var t=xn();try{return tr(e)(r)}catch(e){if(Ln(t),!(e instanceof ye))throw e;$n(1,0)}},invoke_fii:function(e,r,t){var n=xn();try{return tr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof ye))throw e;$n(1,0)}},invoke_fiii:function(e,r,t,n){var o=xn();try{return tr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof ye))throw e;$n(1,0)}},invoke_i:function(e){var r=xn();try{return tr(e)()}catch(e){if(Ln(r),!(e instanceof ye))throw e;$n(1,0)}},invoke_idi:function(e,r,t){var n=xn();try{return tr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof ye))throw e;$n(1,0)}},invoke_ii:function(e,r){var t=xn();try{return tr(e)(r)}catch(e){if(Ln(t),!(e instanceof ye))throw e;$n(1,0)}},invoke_iid:function(e,r,t){var n=xn();try{return tr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof ye))throw e;$n(1,0)}},invoke_iii:function(e,r,t){var n=xn();try{return tr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiid:function(e,r,t,n){var o=xn();try{return tr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiii:function(e,r,t,n){var o=xn();try{return tr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiii:function(e,r,t,n,o){var a=xn();try{return tr(e)(r,t,n,o)}catch(e){if(Ln(a),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiiid:function(e,r,t,n,o,a){var i=xn();try{return tr(e)(r,t,n,o,a)}catch(e){if(Ln(i),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiiii:function(e,r,t,n,o,a){var i=xn();try{return tr(e)(r,t,n,o,a)}catch(e){if(Ln(i),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiiiii:function(e,r,t,n,o,a,i){var s=xn();try{return tr(e)(r,t,n,o,a,i)}catch(e){if(Ln(s),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiiiiii:function(e,r,t,n,o,a,i,s){var l=xn();try{return tr(e)(r,t,n,o,a,i,s)}catch(e){if(Ln(l),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiiiiiii:function(e,r,t,n,o,a,i,s,l){var c=xn();try{return tr(e)(r,t,n,o,a,i,s,l)}catch(e){if(Ln(c),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u){var d=xn();try{return tr(e)(r,t,n,o,a,i,s,l,c,u)}catch(e){if(Ln(d),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d){var f=xn();try{return tr(e)(r,t,n,o,a,i,s,l,c,u,d)}catch(e){if(Ln(f),!(e instanceof ye))throw e;$n(1,0)}},invoke_iiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f){var p=xn();try{return tr(e)(r,t,n,o,a,i,s,l,c,u,d,f)}catch(e){if(Ln(p),!(e instanceof ye))throw e;$n(1,0)}},invoke_jiiii:function(e,r,t,n,o){var a=xn();try{return Yn(e,r,t,n,o)}catch(e){if(Ln(a),!(e instanceof ye))throw e;$n(1,0)}},invoke_v:function(e){var r=xn();try{tr(e)()}catch(e){if(Ln(r),!(e instanceof ye))throw e;$n(1,0)}},invoke_vi:function(e,r){var t=xn();try{tr(e)(r)}catch(e){if(Ln(t),!(e instanceof ye))throw e;$n(1,0)}},invoke_vid:function(e,r,t){var n=xn();try{tr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof ye))throw e;$n(1,0)}},invoke_vidddddd:function(e,r,t,n,o,a,i,s){var l=xn();try{tr(e)(r,t,n,o,a,i,s)}catch(e){if(Ln(l),!(e instanceof ye))throw e;$n(1,0)}},invoke_vidi:function(e,r,t,n){var o=xn();try{tr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof ye))throw e;$n(1,0)}},invoke_vii:function(e,r,t){var n=xn();try{tr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof ye))throw e;$n(1,0)}},invoke_viif:function(e,r,t,n){var o=xn();try{tr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof ye))throw e;$n(1,0)}},invoke_viii:function(e,r,t,n){var o=xn();try{tr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiii:function(e,r,t,n,o){var a=xn();try{tr(e)(r,t,n,o)}catch(e){if(Ln(a),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiidi:function(e,r,t,n,o,a,i){var s=xn();try{tr(e)(r,t,n,o,a,i)}catch(e){if(Ln(s),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiif:function(e,r,t,n,o,a){var i=xn();try{tr(e)(r,t,n,o,a)}catch(e){if(Ln(i),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiii:function(e,r,t,n,o,a){var i=xn();try{tr(e)(r,t,n,o,a)}catch(e){if(Ln(i),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiiii:function(e,r,t,n,o,a,i){var s=xn();try{tr(e)(r,t,n,o,a,i)}catch(e){if(Ln(s),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiiiii:function(e,r,t,n,o,a,i,s){var l=xn();try{tr(e)(r,t,n,o,a,i,s)}catch(e){if(Ln(l),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiiiiii:function(e,r,t,n,o,a,i,s,l){var c=xn();try{tr(e)(r,t,n,o,a,i,s,l)}catch(e){if(Ln(c),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiiiiiii:function(e,r,t,n,o,a,i,s,l,c){var u=xn();try{tr(e)(r,t,n,o,a,i,s,l,c)}catch(e){if(Ln(u),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u){var d=xn();try{tr(e)(r,t,n,o,a,i,s,l,c,u)}catch(e){if(Ln(d),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f,p){var m=xn();try{tr(e)(r,t,n,o,a,i,s,l,c,u,d,f,p)}catch(e){if(Ln(m),!(e instanceof ye))throw e;$n(1,0)}},invoke_viiiiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f,p,m,h){var v=xn();try{tr(e)(r,t,n,o,a,i,s,l,c,u,d,f,p,m,h)}catch(e){if(Ln(v),!(e instanceof ye))throw e;$n(1,0)}},llvm_eh_typeid_for:e=>e,memory:$||d.wasmMemory,strftime_l:(e,r,n,o,a)=>((e,r,n,o)=>{var a=s()[o+40>>2],l={tm_sec:i()[o>>2],tm_min:i()[o+4>>2],tm_hour:i()[o+8>>2],tm_mday:i()[o+12>>2],tm_mon:i()[o+16>>2],tm_year:i()[o+20>>2],tm_wday:i()[o+24>>2],tm_yday:i()[o+28>>2],tm_isdst:i()[o+32>>2],tm_gmtoff:i()[o+36>>2],tm_zone:a?Xe(a):""},c=Xe(n),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var d in u)c=c.replace(new RegExp(d,"g"),u[d]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function m(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function h(e,r){return m(e,r,"0")}function v(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function g(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function y(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=qt(t.getFullYear()),o=t.getMonth(),a=(n?dn:fn)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=g(t),a=g(n);return v(o,r)<=0?v(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var _={"%a":e=>f[e.tm_wday].substring(0,3),"%A":e=>f[e.tm_wday],"%b":e=>p[e.tm_mon].substring(0,3),"%B":e=>p[e.tm_mon],"%C":e=>h((e.tm_year+1900)/100|0,2),"%d":e=>h(e.tm_mday,2),"%e":e=>m(e.tm_mday,2," "),"%g":e=>y(e).toString().substring(2),"%G":y,"%H":e=>h(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),h(r,2)},"%j":e=>h(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(qt(e.tm_year+1900)?dn:fn,e.tm_mon-1),3),"%m":e=>h(e.tm_mon+1,2),"%M":e=>h(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>h(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return h(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&qt(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&qt(e.tm_year%400-1))&&r++}return h(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return h(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var d in c=c.replace(/%%/g,"\0\0"),_)c.includes(d)&&(c=c.replace(new RegExp(d,"g"),_[d](l)));var w,E,b=hr(c=c.replace(/\0\0/g,"%"),!1);return b.length>r?0:(E=e,Y((w=b).length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),t().set(w,E),b.length-1)})(e,r,n,o)},_n=function(){var e={env:yn,wasi_snapshot_preview1:yn};function r(e,r){var t,n;return _n=e.exports,n=_n._emscripten_tls_init,He.tlsInitFunctions.push(n),Y(er=_n.__indirect_function_table,"table not found in wasm exports"),t=_n.__wasm_call_ctors,Q.unshift(t),I=r,ue("wasm-instantiate"),_n}ce("wasm-instantiate");var t,n,o,a,i=d;if(d.instantiateWasm)try{return d.instantiateWasm(e,r)}catch(e){R(`Module.instantiateWasm callback failed with error: ${e}`),u(e)}return(t=M,n=fe,o=e,a=function(e){Y(d===i,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),i=null,r(e.instance,e.module)},t||"function"!=typeof WebAssembly.instantiateStreaming||he(n)||ve(n)||g||"function"!=typeof fetch?Ee(n,o,a):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return R(`wasm streaming compile failed: ${e}`),R("falling back to ArrayBuffer instantiation"),Ee(n,o,a)}))))).catch(u),{}}(),wn=(ge("__wasm_call_ctors"),ge("__cxa_free_exception"),ge("malloc")),En=d._pthread_self=()=>(En=d._pthread_self=_n.pthread_self)(),bn=ge("free"),Tn=ge("fflush"),kn=(d.__emscripten_tls_init=ge("_emscripten_tls_init"),ge("emscripten_builtin_memalign")),Sn=ge("__getTypeName"),Pn=(d.__embind_initialize_bindings=ge("_embind_initialize_bindings"),d.__emscripten_thread_init=ge("_emscripten_thread_init")),An=(d.__emscripten_thread_crashed=ge("_emscripten_thread_crashed"),ge("emscripten_main_thread_process_queued_calls"),ge("emscripten_main_runtime_thread_id"),()=>(An=_n.emscripten_stack_get_base)()),Cn=()=>(Cn=_n.emscripten_stack_get_end)(),Fn=ge("_emscripten_run_on_main_thread_js"),Dn=ge("_emscripten_thread_free_data"),On=d.__emscripten_thread_exit=ge("_emscripten_thread_exit"),Mn=ge("_emscripten_check_mailbox"),$n=ge("setThrew"),In=ge("setTempRet0"),Nn=()=>(Nn=_n.emscripten_stack_init)(),Rn=(e,r)=>(Rn=_n.emscripten_stack_set_limits)(e,r),xn=ge("stackSave"),Ln=ge("stackRestore"),Wn=ge("stackAlloc"),jn=()=>(jn=_n.emscripten_stack_get_current)(),Un=ge("__cxa_decrement_exception_refcount"),Bn=ge("__cxa_increment_exception_refcount"),zn=(ge("__cxa_demangle"),ge("__get_exception_message")),Hn=ge("__cxa_can_catch"),Gn=ge("__cxa_is_pointer_type"),Vn=d.___set_stack_limits=ge("__set_stack_limits"),Yn=(d.dynCall_jii=ge("dynCall_jii"),d.dynCall_viij=ge("dynCall_viij"),d.dynCall_jiji=ge("dynCall_jiji"),d.dynCall_viijii=ge("dynCall_viijii"),d.dynCall_jiiii=ge("dynCall_jiiii"));function qn(){if(!(oe>0)){if(b||(Y(!b),Nn(),J()),b)return c(d),te(),void startWorker(d);!function(){if(Y(!b),d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)ne(d.preRun.shift());Ge(Z)}(),oe>0||(d.setStatus?(d.setStatus("Running..."),setTimeout((function(){setTimeout((function(){d.setStatus("")}),1),e()}),1)):e(),X())}function e(){vn||(vn=!0,d.calledRun=!0,V||(te(),c(d),d.onRuntimeInitialized&&d.onRuntimeInitialized(),Y(!d._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(X(),!b){if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),ee.unshift(e);var e;Ge(ee)}}()))}}if(d.dynCall_iiiiij=ge("dynCall_iiiiij"),d.dynCall_iiiiijj=ge("dynCall_iiiiijj"),d.dynCall_iiiiiijj=ge("dynCall_iiiiiijj"),d.addRunDependency=ce,d.removeRunDependency=ue,d.FS_createPath=kr.createPath,d.FS_createLazyFile=kr.createLazyFile,d.FS_createDevice=kr.createDevice,d.wasmMemory=$,d.keepRuntimeAlive=Re,d.ExitStatus=Me,d.FS_createPreloadedFile=kr.createPreloadedFile,d.FS=kr,d.FS_createDataFile=kr.createDataFile,d.FS_unlink=kr.unlink,d.PThread=He,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","runtimeKeepalivePop","asmjsMangle","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","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","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","emscripten_webgl_destroy_context_before_on_calling_thread","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","getFunctionArgsName","createJsInvokerSignature","registerInheritedInstance","unregisterInheritedInstance","getStringOrSymbol","emval_get_global","emval_returnValue","emval_lookupTypes","emval_addMethodCaller"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var r=`\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,t=e;t.startsWith("_")||(t="$"+e),r+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${t}')`,Te(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),ar(r)}}),Se(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","GROWABLE_HEAP_I8","GROWABLE_HEAP_U8","GROWABLE_HEAP_I16","GROWABLE_HEAP_U16","GROWABLE_HEAP_I32","GROWABLE_HEAP_U32","GROWABLE_HEAP_F32","GROWABLE_HEAP_F64","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","setStackLimits","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","jstoi_s","getExecutableName","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","HandleAllocator","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","jsStackTrace","stackTrace","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","incrementExceptionRefcount","decrementExceptionRefcount","getExceptionMessage","Browser","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","terminateWorker","killThread","cleanupThread","registerTLSInit","cancelThread","spawnThread","exitOnMainThread","proxyToMainThread","proxiedJSCallArgs","invokeEntryPoint","checkMailbox","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","usesDestructorStack","createJsInvoker","UnboundTypeError","PureVirtualError","GenericWireTypeSize","EmValType","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","readPointer","runDestructors","newFunc","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","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handles","emval_symbols","init_emval","count_emval_handles","Emval","emval_methodCallers","reflectConstruct","IDBFS"].forEach(Se),ie=function e(){vn||qn(),vn||(ie=e)},d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();return qn(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=createCCP4Module:"function"==typeof define&&define.amd&&define([],(()=>createCCP4Module));
|
|
1
|
+
var createCCP4Module=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r={}){function t(){return N.buffer!=W.buffer&&K(),W}function n(){return N.buffer!=W.buffer&&K(),j}function o(){return N.buffer!=W.buffer&&K(),U}function a(){return N.buffer!=W.buffer&&K(),B}function i(){return N.buffer!=W.buffer&&K(),z}function s(){return N.buffer!=W.buffer&&K(),H}function l(){return N.buffer!=W.buffer&&K(),Y}var c,u,d=r;d.ready=new Promise(((e,r)=>{c=e,u=r})),["_main","__emscripten_thread_init","__emscripten_thread_exit","__emscripten_thread_crashed","__emscripten_thread_mailbox_await","__emscripten_tls_init","_pthread_self","checkMailbox","establishStackSpace","invokeEntryPoint","PThread","getExceptionMessage","___get_exception_message","_free","___indirect_function_table","_fflush","__embind_initialize_bindings","__emscripten_check_mailbox","___set_stack_limits","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(d.ready,e)||Object.defineProperty(d.ready,e,{get:()=>pe("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>pe("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var f=Object.assign({},d),h="./this.program",p=(e,r)=>{throw r},m="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g=!m&&!y&&!v;if(d.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var _,w,E,b=d.ENVIRONMENT_IS_PTHREAD||!1,T="";function k(e){return d.locateFile?d.locateFile(e,T):T+e}if(y){if("undefined"==typeof process||!process.release||"node"!==process.release.name)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var S=process.versions.node,P=S.split(".").slice(0,3);if((P=1e4*P[0]+100*P[1]+1*P[2].split("-")[0])<16e4)throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+S+")");var A=require("fs"),C=require("path");let e;T=v?C.dirname(T)+"/":__dirname+"/",_=(e,r)=>(e=_e(e)?new URL(e):C.normalize(e),A.readFileSync(e,r?void 0:"utf8")),E=e=>{var r=_(e,!0);return r.buffer||(r=new Uint8Array(r)),q(r.buffer),r},w=(e,r,t,n=!0)=>{e=_e(e)?new URL(e):C.normalize(e),A.readFile(e,n?void 0:"utf8",((e,o)=>{e?t(e):r(n?o.buffer:o)}))},!d.thisProgram&&process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),p=(e,r)=>{throw process.exitCode=e,r},d.inspect=()=>"[Emscripten Module object]";try{e=require("worker_threads")}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}global.Worker=e.Worker}else if(g){if("object"==typeof process&&"function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(_=read),E=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let r=read(e,"binary");return q("object"==typeof r),r},w=(e,r,t)=>{setTimeout((()=>r(E(e))))},"undefined"==typeof clearTimeout&&(globalThis.clearTimeout=e=>{}),"undefined"==typeof setTimeout&&(globalThis.setTimeout=e=>"function"==typeof e?e():pe()),"undefined"!=typeof scriptArgs&&scriptArgs,"function"==typeof quit&&(p=(e,r)=>{throw setTimeout((()=>{if(!(r instanceof Ne)){let e=r;r&&"object"==typeof r&&r.stack&&(e=[r,r.stack]),I(`exiting due to exception: ${e}`)}quit(e)})),r}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!m&&!v)throw new Error("environment detection error");if(v?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),e&&(T=e),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");y||(_=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},v&&(E=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),w=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)})}y&&"undefined"==typeof performance&&(global.performance=require("perf_hooks").performance);var F=console.log.bind(console),D=console.error.bind(console);y&&(F=(...e)=>A.writeSync(1,e.join(" ")+"\n"),D=(...e)=>A.writeSync(2,e.join(" ")+"\n"));var O,M,$=d.print||F,I=d.printErr||D;Object.assign(d,f),f=null,O="fetchSettings",Object.getOwnPropertyDescriptor(d,O)&&pe(`\`Module.${O}\` was supplied but \`${O}\` not included in INCOMING_MODULE_JS_API`),d.arguments&&d.arguments,Se("arguments","arguments_"),d.thisProgram&&(h=d.thisProgram),Se("thisProgram","thisProgram"),d.quit&&(p=d.quit),Se("quit","quit_"),q(void 0===d.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),q(void 0===d.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),q(void 0===d.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),q(void 0===d.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),q(void 0===d.read,"Module.read option was removed (modify read_ in JS)"),q(void 0===d.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),q(void 0===d.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),q(void 0===d.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),q(void 0===d.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Se("asm","wasmExports"),Se("read","read_"),Se("readAsync","readAsync"),Se("readBinary","readBinary"),Se("setWindowTitle","setWindowTitle"),q(m||v||y,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"),q(!g,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),d.wasmBinary&&(M=d.wasmBinary),Se("wasmBinary","wasmBinary");var N,R,x=d.noExitRuntime||!0;Se("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&pe("no native wasm support detected");var L,W,j,U,B,z,H,G,Y,V=!1;function q(e,r){e||pe("Assertion failed"+(r?": "+r:""))}function K(){var e=N.buffer;d.HEAP8=W=new Int8Array(e),d.HEAP16=U=new Int16Array(e),d.HEAPU8=j=new Uint8Array(e),d.HEAPU16=B=new Uint16Array(e),d.HEAP32=z=new Int32Array(e),d.HEAPU32=H=new Uint32Array(e),d.HEAPF32=G=new Float32Array(e),d.HEAPF64=Y=new Float64Array(e)}q(!d.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),q("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support");var X=d.INITIAL_MEMORY||16777216;if(Se("INITIAL_MEMORY","INITIAL_MEMORY"),q(X>=5242880,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+X+"! (STACK_SIZE=5242880)"),b)N=d.wasmMemory;else if(d.wasmMemory)N=d.wasmMemory;else if(!((N=new WebAssembly.Memory({initial:X/65536,maximum:32768,shared:!0})).buffer instanceof SharedArrayBuffer))throw I("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),y&&I("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");function J(){var e=Fn();q(0==(3&e)),0==e&&(e+=4),s()[e>>2]=34821223,Me(34821223),s()[e+4>>2]=2310721022,Me(2310721022),s()[0]=1668509029,Me(1668509029)}function Z(){if(!V){var e=Fn();0==e&&(e+=4);var r=s()[e>>2],t=s()[e+4>>2];34821223==r&&2310721022==t||pe(`Stack overflow! Stack cookie has been overwritten at ${cr(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${cr(t)} ${cr(r)}`),1668509029!=s()[0]&&pe("Runtime error: The application has corrupted its heap memory area (address zero)!")}}K(),q((X=N.buffer.byteLength)%65536==0),function(){var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,115!==r[0]||99!==r[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var Q=[],ee=[],re=[],te=!1,ne=0;function oe(){return x||ne>0}function ae(){q(!te),te=!0,b||(Z(),gr(),d.noFSInit||ar.init.initialized||ar.init(),ar.ignorePermissions=!1,Ve.init(),fr(ee))}function ie(e){Q.unshift(e)}q(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(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 se=0,le=null,ce=null,ue={};function de(e){for(var r=e;;){if(!ue[e])return e;e=r+Math.random()}}function fe(e){se++,d.monitorRunDependencies&&d.monitorRunDependencies(se),e?(q(!ue[e]),ue[e]=1,null===le&&"undefined"!=typeof setInterval&&(le=setInterval((()=>{if(V)return clearInterval(le),void(le=null);var e=!1;for(var r in ue)e||(e=!0,I("still waiting on run dependencies:")),I(`dependency: ${r}`);e&&I("(end of list)")}),1e4))):I("warning: run dependency added without ID")}function he(e){if(se--,d.monitorRunDependencies&&d.monitorRunDependencies(se),e?(q(ue[e]),delete ue[e]):I("warning: run dependency removed without ID"),0==se&&(null!==le&&(clearInterval(le),le=null),ce)){var r=ce;ce=null,r()}}function pe(e){d.onAbort&&d.onAbort(e),I(e="Aborted("+e+")"),V=!0,L=1;var r=new WebAssembly.RuntimeError(e);throw u(r),r}var me,ve,ye;function ge(e){return e.startsWith("data:application/octet-stream;base64,")}function _e(e){return e.startsWith("file://")}function we(e){return function(){q(te,`native function \`${e}\` called before runtime initialization`);var r=_n[e];return q(r,`exported native function \`${e}\` not found`),r.apply(null,arguments)}}class Ee extends Error{}class be extends Ee{constructor(e){super(e),this.excPtr=e;const r=pr(e);this.name=r[0],this.message=r[1]}}function Te(e){if(e==me&&M)return new Uint8Array(M);if(E)return E(e);throw"both async and sync fetching of the wasm failed"}function ke(e,r,t){return function(e){if(!M&&(m||v)){if("function"==typeof fetch&&!_e(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>Te(e)));if(w)return new Promise(((r,t)=>{w(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>Te(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{I(`failed to asynchronously prepare wasm: ${e}`),_e(me)&&I(`warning: Loading from a file URI (${me}) 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`),pe(e)}))}function Se(e,r,t=!0){Object.getOwnPropertyDescriptor(d,e)||Object.defineProperty(d,e,{configurable:!0,get(){pe(`\`Module.${e}\` has been replaced by \`${r}\``+(t?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function Pe(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function Ae(e,r){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){_r("`"+e+"` is not longer defined by emscripten. "+r)}})}function Ce(e){Object.getOwnPropertyDescriptor(d,e)||Object.defineProperty(d,e,{configurable:!0,get(){var r="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";Pe(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),pe(r)}})}function Fe(e,r,t,n){q(Number.isInteger(Number(e)),"attempt to write non-integer ("+e+") into integer heap"),q(e<=n,"value ("+e+") too large to write as "+r+"-bit value"),q(e>=t,"value ("+e+") too small to write as "+r+"-bit value")}ge(me="web_example.wasm")||(me=k(me)),Ae("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),Ae("asm","Please use wasmExports instead");var De=e=>Fe(e,8,-127,255),Oe=e=>Fe(e,16,-32767,65535),Me=e=>Fe(e,32,-2147483647,4294967295),$e=e=>Fe(e,64,-0x8000000000000000,0x10000000000000000);function Ie(e){y?A.writeSync(2,Array.from(arguments).join(" ")+"\n"):console.warn.apply(console,arguments)}function Ne(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var Re=e=>{e.terminate(),e.onmessage=r=>{var t=r.data.cmd;I(`received "${t}" command from terminated worker: ${e.workerID}`)}},xe=e=>{q(!b,"Internal Error! cleanupThread() can only ever be called from main application thread!"),q(e,"Internal Error! Null pthread_ptr in cleanupThread!");var r=dr.pthreads[e];q(r),dr.returnWorkerToPool(r)},Le={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Le.isAbs(e),t="/"===e.substr(-1);return(e=Le.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Le.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Le.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Le.normalize(e.join("/"))},join2:(e,r)=>Le.normalize(e+"/"+r)},We=e=>(We=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>(e.set(crypto.getRandomValues(new Uint8Array(e.byteLength))),e);if(y)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}pe("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 } };")})())(e),je={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:ar.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=Le.isAbs(n)}return(r?"/":"")+(e=Le.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=je.resolve(e).substr(1),r=je.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},Ue="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,Be=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Ue)return Ue.decode(e.buffer instanceof SharedArrayBuffer?e.slice(r,o):e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var l=63&e[r++];if(224==(240&i)?i=(15&i)<<12|s<<6|l:(240!=(248&i)&&_r("Invalid UTF-8 leading byte "+cr(i)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),i=(7&i)<<18|s<<12|l<<6|63&e[r++]),i<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ze=[],He=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Ge=(e,r,t,n)=>{if(q("string"==typeof e),!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;s>1114111&&_r("Invalid Unicode code point "+cr(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function Ye(e,r,t){var n=t>0?t:He(e)+1,o=new Array(n),a=Ge(e,o,0,o.length);return r&&(o.length=a),o}var Ve={ttys:[],init(){},shutdown(){},register(e,r){Ve.ttys[e]={input:[],output:[],ops:r},ar.registerDevice(e,Ve.stream_ops)},stream_ops:{open(e){var r=Ve.ttys[e.node.rdev];if(!r)throw new ar.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new ar.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ar.ErrnoError(29)}if(void 0===s&&0===a)throw new ar.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new ar.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new ar.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!ze.length){var e=null;if(y){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=A.readSync(n,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;ze=Ye(e,!0)}return ze.shift()})(),put_char(e,r){null===r||10===r?($(Be(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&($(Be(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(I(Be(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(I(Be(e.output,0)),e.output=[])}}},qe=e=>{e=((e,r)=>(q(r,"alignment argument is required"),Math.ceil(e/r)*r))(e,65536);var r=Sn(65536,e);return r?((e,r)=>(n().fill(0,e,e+r),e))(r,e):0},Ke={ops_table:null,mount:e=>Ke.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ar.isBlkdev(t)||ar.isFIFO(t))throw new ar.ErrnoError(63);Ke.ops_table||(Ke.ops_table={dir:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr,lookup:Ke.node_ops.lookup,mknod:Ke.node_ops.mknod,rename:Ke.node_ops.rename,unlink:Ke.node_ops.unlink,rmdir:Ke.node_ops.rmdir,readdir:Ke.node_ops.readdir,symlink:Ke.node_ops.symlink},stream:{llseek:Ke.stream_ops.llseek}},file:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr},stream:{llseek:Ke.stream_ops.llseek,read:Ke.stream_ops.read,write:Ke.stream_ops.write,allocate:Ke.stream_ops.allocate,mmap:Ke.stream_ops.mmap,msync:Ke.stream_ops.msync}},link:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr,readlink:Ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr},stream:ar.chrdev_stream_ops}});var o=ar.createNode(e,r,t,n);return ar.isDir(o.mode)?(o.node_ops=Ke.ops_table.dir.node,o.stream_ops=Ke.ops_table.dir.stream,o.contents={}):ar.isFile(o.mode)?(o.node_ops=Ke.ops_table.file.node,o.stream_ops=Ke.ops_table.file.stream,o.usedBytes=0,o.contents=null):ar.isLink(o.mode)?(o.node_ops=Ke.ops_table.link.node,o.stream_ops=Ke.ops_table.link.stream):ar.isChrdev(o.mode)&&(o.node_ops=Ke.ops_table.chrdev.node,o.stream_ops=Ke.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ar.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,ar.isDir(e.mode)?r.size=4096:ar.isFile(e.mode)?r.size=e.usedBytes:ar.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&Ke.resizeFileStorage(e,r.size)},lookup(e,r){throw ar.genericErrors[44]},mknod:(e,r,t,n)=>Ke.createNode(e,r,t,n),rename(e,r,t){if(ar.isDir(e.mode)){var n;try{n=ar.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new ar.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ar.lookupNode(e,r);for(var n in t.contents)throw new ar.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=Ke.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ar.isLink(e.mode))throw new ar.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(q(i>=0),i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,n,o,a,i){if(q(!(r instanceof ArrayBuffer)),r.buffer===t().buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return q(0===a,"canOwn must imply no weird position inside the file"),s.contents=r.subarray(n,n+o),s.usedBytes=o,o;if(0===s.usedBytes&&0===a)return s.contents=r.slice(n,n+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(n,n+o),a),o}if(Ke.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+o),a);else for(var l=0;l<o;l++)s.contents[a+l]=r[n+l];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ar.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ar.ErrnoError(28);return n},allocate(e,r,t){Ke.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,n,o,a){if(!ar.isFile(e.node.mode))throw new ar.ErrnoError(43);var i,s,l=e.node.contents;if(2&a||l.buffer!==t().buffer){if((n>0||n+r<l.length)&&(l=l.subarray?l.subarray(n,n+r):Array.prototype.slice.call(l,n,n+r)),s=!0,!(i=qe(r)))throw new ar.ErrnoError(48);t().set(l,i)}else s=!1,i=l.byteOffset;return{ptr:i,allocated:s}},msync:(e,r,t,n,o)=>(Ke.stream_ops.write(e,r,0,n,t,!1),0)}},Xe=d.preloadPlugins||[],Je=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Ze={dbs:{},indexedDB:()=>{if("undefined"!=typeof indexedDB)return indexedDB;var e=null;return"object"==typeof window&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),q(e,"IDBFS used, but indexedDB not supported"),e},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(e){return Ke.mount.apply(null,arguments)},syncfs:(e,r,t)=>{Ze.getLocalSet(e,((n,o)=>{if(n)return t(n);Ze.getRemoteSet(e,((e,n)=>{if(e)return t(e);var a=r?n:o,i=r?o:n;Ze.reconcile(a,i,t)}))}))},quit:()=>{Object.values(Ze.dbs).forEach((e=>e.close())),Ze.dbs={}},getDB:(e,r)=>{var t,n=Ze.dbs[e];if(n)return r(null,n);try{t=Ze.indexedDB().open(e,Ze.DB_VERSION)}catch(e){return r(e)}if(!t)return r("Unable to connect to IndexedDB");t.onupgradeneeded=e=>{var r,t=e.target.result,n=e.target.transaction;(r=t.objectStoreNames.contains(Ze.DB_STORE_NAME)?n.objectStore(Ze.DB_STORE_NAME):t.createObjectStore(Ze.DB_STORE_NAME)).indexNames.contains("timestamp")||r.createIndex("timestamp","timestamp",{unique:!1})},t.onsuccess=()=>{n=t.result,Ze.dbs[e]=n,r(null,n)},t.onerror=e=>{r(e.target.error),e.preventDefault()}},getLocalSet:(e,r)=>{var t={};function n(e){return"."!==e&&".."!==e}function o(e){return r=>Le.join2(e,r)}for(var a=ar.readdir(e.mountpoint).filter(n).map(o(e.mountpoint));a.length;){var i,s=a.pop();try{i=ar.stat(s)}catch(e){return r(e)}ar.isDir(i.mode)&&a.push.apply(a,ar.readdir(s).filter(n).map(o(s))),t[s]={timestamp:i.mtime}}return r(null,{type:"local",entries:t})},getRemoteSet:(e,r)=>{var t={};Ze.getDB(e.mountpoint,((e,n)=>{if(e)return r(e);try{var o=n.transaction([Ze.DB_STORE_NAME],"readonly");o.onerror=e=>{r(e.target.error),e.preventDefault()},o.objectStore(Ze.DB_STORE_NAME).index("timestamp").openKeyCursor().onsuccess=e=>{var o=e.target.result;if(!o)return r(null,{type:"remote",db:n,entries:t});t[o.primaryKey]={timestamp:o.key},o.continue()}}catch(e){return r(e)}}))},loadLocalEntry:(e,r)=>{var t,n;try{n=ar.lookupPath(e).node,t=ar.stat(e)}catch(e){return r(e)}return ar.isDir(t.mode)?r(null,{timestamp:t.mtime,mode:t.mode}):ar.isFile(t.mode)?(n.contents=Ke.getFileDataAsTypedArray(n),r(null,{timestamp:t.mtime,mode:t.mode,contents:n.contents})):r(new Error("node type not supported"))},storeLocalEntry:(e,r,t)=>{try{if(ar.isDir(r.mode))ar.mkdirTree(e,r.mode);else{if(!ar.isFile(r.mode))return t(new Error("node type not supported"));ar.writeFile(e,r.contents,{canOwn:!0})}ar.chmod(e,r.mode),ar.utime(e,r.timestamp,r.timestamp)}catch(e){return t(e)}t(null)},removeLocalEntry:(e,r)=>{try{var t=ar.stat(e);ar.isDir(t.mode)?ar.rmdir(e):ar.isFile(t.mode)&&ar.unlink(e)}catch(e){return r(e)}r(null)},loadRemoteEntry:(e,r,t)=>{var n=e.get(r);n.onsuccess=e=>{t(null,e.target.result)},n.onerror=e=>{t(e.target.error),e.preventDefault()}},storeRemoteEntry:(e,r,t,n)=>{try{var o=e.put(t,r)}catch(e){return void n(e)}o.onsuccess=()=>{n(null)},o.onerror=e=>{n(e.target.error),e.preventDefault()}},removeRemoteEntry:(e,r,t)=>{var n=e.delete(r);n.onsuccess=()=>{t(null)},n.onerror=e=>{t(e.target.error),e.preventDefault()}},reconcile:(e,r,t)=>{var n=0,o=[];Object.keys(e.entries).forEach((function(t){var a=e.entries[t],i=r.entries[t];i&&a.timestamp.getTime()==i.timestamp.getTime()||(o.push(t),n++)}));var a=[];if(Object.keys(r.entries).forEach((function(r){e.entries[r]||(a.push(r),n++)})),!n)return t(null);var i=!1,s=("remote"===e.type?e.db:r.db).transaction([Ze.DB_STORE_NAME],"readwrite"),l=s.objectStore(Ze.DB_STORE_NAME);function c(e){if(e&&!i)return i=!0,t(e)}s.onerror=e=>{c(this.error),e.preventDefault()},s.oncomplete=e=>{i||t(null)},o.sort().forEach((e=>{"local"===r.type?Ze.loadRemoteEntry(l,e,((r,t)=>{if(r)return c(r);Ze.storeLocalEntry(e,t,c)})):Ze.loadLocalEntry(e,((r,t)=>{if(r)return c(r);Ze.storeRemoteEntry(l,e,t,c)}))})),a.sort().reverse().forEach((e=>{"local"===r.type?Ze.removeLocalEntry(e,c):Ze.removeRemoteEntry(l,e,c)}))}},Qe={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},er={},rr=e=>{var r=Ln(),t=e();return Wn(r),t},tr=(e,r,t)=>(q("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Ge(e,n(),r,t)),nr=(e,r)=>(q("number"==typeof e),e?Be(n(),e,r):""),or=e=>(or.recursionGuard=1+(0|or.recursionGuard),or.recursionGuard>1?e:rr((()=>{try{var r=e;r.startsWith("__Z")&&(r=r.substr(1));var t=(e=>{var r=He(e)+1,t=jn(r);return tr(e,t,r),t})(r),n=jn(4),o=Hn(t,0,0,n);if(0===i()[n>>2]&&o)return nr(o)}catch(e){}finally{bn(o),or.recursionGuard<2&&--or.recursionGuard}return e}))),ar={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=je.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ar.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=ar.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=ar.lookupNode(n,t[a]),o=Le.join2(o,t[a]),ar.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;ar.isLink(n.mode);){var l=ar.readlink(o);if(o=je.resolve(Le.dirname(o),l),n=ar.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new ar.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(ar.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%ar.nameTable.length},hashAddNode(e){var r=ar.hashName(e.parent.id,e.name);e.name_next=ar.nameTable[r],ar.nameTable[r]=e},hashRemoveNode(e){var r=ar.hashName(e.parent.id,e.name);if(ar.nameTable[r]===e)ar.nameTable[r]=e.name_next;else for(var t=ar.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ar.mayLookup(e);if(t)throw new ar.ErrnoError(t,e);for(var n=ar.hashName(e.id,r),o=ar.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ar.lookup(e,r)},createNode(e,r,t,n){q("object"==typeof e);var o=new ar.FSNode(e,r,t,n);return ar.hashAddNode(o),o},destroyNode(e){ar.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ar.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>ar.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return ar.lookupNode(e,r),20}catch(e){}return ar.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ar.lookupNode(e,r)}catch(e){return e.errno}var o=ar.nodePermissions(e,"wx");if(o)return o;if(t){if(!ar.isDir(n.mode))return 54;if(ar.isRoot(n)||ar.getPath(n)===ar.cwd())return 10}else if(ar.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ar.isLink(e.mode)?32:ar.isDir(e.mode)&&("r"!==ar.flagsToPermissionString(r)||512&r)?31:ar.nodePermissions(e,ar.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ar.MAX_OPEN_FDS;e++)if(!ar.streams[e])return e;throw new ar.ErrnoError(33)},getStreamChecked(e){var r=ar.getStream(e);if(!r)throw new ar.ErrnoError(8);return r},getStream:e=>ar.streams[e],createStream:(e,r=-1)=>(ar.FSStream||(ar.FSStream=function(){this.shared={}},ar.FSStream.prototype={},Object.defineProperties(ar.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new ar.FSStream,e),-1==r&&(r=ar.nextfd()),e.fd=r,ar.streams[r]=e,e),closeStream(e){ar.streams[e]=null},chrdev_stream_ops:{open(e){var r=ar.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new ar.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ar.devices[e]={stream_ops:r}},getDevice:e=>ar.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ar.syncFSRequests++,ar.syncFSRequests>1&&I(`warning: ${ar.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ar.getMounts(ar.root.mount),n=0;function o(e){return q(ar.syncFSRequests>0),ar.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){if("string"==typeof e)throw e;var n,o="/"===t,a=!t;if(o&&ar.root)throw new ar.ErrnoError(10);if(!o&&!a){var i=ar.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ar.isMountpoint(n))throw new ar.ErrnoError(10);if(!ar.isDir(n.mode))throw new ar.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?ar.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=ar.lookupPath(e,{follow_mount:!1});if(!ar.isMountpoint(r.node))throw new ar.ErrnoError(28);var t=r.node,n=t.mounted,o=ar.getMounts(n);Object.keys(ar.nameTable).forEach((e=>{for(var r=ar.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ar.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);q(-1!==a),t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ar.lookupPath(e,{parent:!0}).node,o=Le.basename(e);if(!o||"."===o||".."===o)throw new ar.ErrnoError(28);var a=ar.mayCreate(n,o);if(a)throw new ar.ErrnoError(a);if(!n.node_ops.mknod)throw new ar.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ar.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ar.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{ar.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,ar.mknod(e,r,t)),symlink(e,r){if(!je.resolve(e))throw new ar.ErrnoError(44);var t=ar.lookupPath(r,{parent:!0}).node;if(!t)throw new ar.ErrnoError(44);var n=Le.basename(r),o=ar.mayCreate(t,n);if(o)throw new ar.ErrnoError(o);if(!t.node_ops.symlink)throw new ar.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=Le.dirname(e),a=Le.dirname(r),i=Le.basename(e),s=Le.basename(r);if(t=ar.lookupPath(e,{parent:!0}).node,n=ar.lookupPath(r,{parent:!0}).node,!t||!n)throw new ar.ErrnoError(44);if(t.mount!==n.mount)throw new ar.ErrnoError(75);var l,c=ar.lookupNode(t,i),u=je.relative(e,a);if("."!==u.charAt(0))throw new ar.ErrnoError(28);if("."!==(u=je.relative(r,o)).charAt(0))throw new ar.ErrnoError(55);try{l=ar.lookupNode(n,s)}catch(e){}if(c!==l){var d=ar.isDir(c.mode),f=ar.mayDelete(t,i,d);if(f)throw new ar.ErrnoError(f);if(f=l?ar.mayDelete(n,s,d):ar.mayCreate(n,s))throw new ar.ErrnoError(f);if(!t.node_ops.rename)throw new ar.ErrnoError(63);if(ar.isMountpoint(c)||l&&ar.isMountpoint(l))throw new ar.ErrnoError(10);if(n!==t&&(f=ar.nodePermissions(t,"w")))throw new ar.ErrnoError(f);ar.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{ar.hashAddNode(c)}}},rmdir(e){var r=ar.lookupPath(e,{parent:!0}).node,t=Le.basename(e),n=ar.lookupNode(r,t),o=ar.mayDelete(r,t,!0);if(o)throw new ar.ErrnoError(o);if(!r.node_ops.rmdir)throw new ar.ErrnoError(63);if(ar.isMountpoint(n))throw new ar.ErrnoError(10);r.node_ops.rmdir(r,t),ar.destroyNode(n)},readdir(e){var r=ar.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ar.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ar.lookupPath(e,{parent:!0}).node;if(!r)throw new ar.ErrnoError(44);var t=Le.basename(e),n=ar.lookupNode(r,t),o=ar.mayDelete(r,t,!1);if(o)throw new ar.ErrnoError(o);if(!r.node_ops.unlink)throw new ar.ErrnoError(63);if(ar.isMountpoint(n))throw new ar.ErrnoError(10);r.node_ops.unlink(r,t),ar.destroyNode(n)},readlink(e){var r=ar.lookupPath(e).node;if(!r)throw new ar.ErrnoError(44);if(!r.node_ops.readlink)throw new ar.ErrnoError(28);return je.resolve(ar.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ar.lookupPath(e,{follow:!r}).node;if(!t)throw new ar.ErrnoError(44);if(!t.node_ops.getattr)throw new ar.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ar.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?ar.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new ar.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ar.chmod(e,r,!0)},fchmod(e,r){var t=ar.getStreamChecked(e);ar.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?ar.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ar.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){ar.chown(e,r,t,!0)},fchown(e,r,t){var n=ar.getStreamChecked(e);ar.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ar.ErrnoError(28);var t;if(!(t="string"==typeof e?ar.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ar.ErrnoError(63);if(ar.isDir(t.mode))throw new ar.ErrnoError(31);if(!ar.isFile(t.mode))throw new ar.ErrnoError(28);var n=ar.nodePermissions(t,"w");if(n)throw new ar.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ar.getStreamChecked(e);if(0==(2097155&t.flags))throw new ar.ErrnoError(28);ar.truncate(t.node,r)},utime(e,r,t){var n=ar.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ar.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=Le.normalize(e);try{n=ar.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new ar.ErrnoError(20)}else n=ar.mknod(e,t,0),o=!0;if(!n)throw new ar.ErrnoError(44);if(ar.isChrdev(n.mode)&&(r&=-513),65536&r&&!ar.isDir(n.mode))throw new ar.ErrnoError(54);if(!o){var a=ar.mayOpen(n,r);if(a)throw new ar.ErrnoError(a)}512&r&&!o&&ar.truncate(n,0),r&=-131713;var i=ar.createStream({node:n,path:ar.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!d.logReadFiles||1&r||(ar.readFiles||(ar.readFiles={}),e in ar.readFiles||(ar.readFiles[e]=1)),i},close(e){if(ar.isClosed(e))throw new ar.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ar.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ar.isClosed(e))throw new ar.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ar.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ar.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(q(t>=0),n<0||o<0)throw new ar.ErrnoError(28);if(ar.isClosed(e))throw new ar.ErrnoError(8);if(1==(2097155&e.flags))throw new ar.ErrnoError(8);if(ar.isDir(e.node.mode))throw new ar.ErrnoError(31);if(!e.stream_ops.read)throw new ar.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ar.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(q(t>=0),n<0||o<0)throw new ar.ErrnoError(28);if(ar.isClosed(e))throw new ar.ErrnoError(8);if(0==(2097155&e.flags))throw new ar.ErrnoError(8);if(ar.isDir(e.node.mode))throw new ar.ErrnoError(31);if(!e.stream_ops.write)throw new ar.ErrnoError(28);e.seekable&&1024&e.flags&&ar.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ar.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(ar.isClosed(e))throw new ar.ErrnoError(8);if(r<0||t<=0)throw new ar.ErrnoError(28);if(0==(2097155&e.flags))throw new ar.ErrnoError(8);if(!ar.isFile(e.node.mode)&&!ar.isDir(e.node.mode))throw new ar.ErrnoError(43);if(!e.stream_ops.allocate)throw new ar.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new ar.ErrnoError(2);if(1==(2097155&e.flags))throw new ar.ErrnoError(2);if(!e.stream_ops.mmap)throw new ar.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>(q(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0),munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ar.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ar.open(e,r.flags),o=ar.stat(e).size,a=new Uint8Array(o);return ar.read(n,a,0,o,0),"utf8"===r.encoding?t=Be(a,0):"binary"===r.encoding&&(t=a),ar.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ar.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(He(r)+1),a=Ge(r,o,0,o.length);ar.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ar.write(n,r,0,r.byteLength,void 0,t.canOwn)}ar.close(n)},cwd:()=>ar.currentPath,chdir(e){var r=ar.lookupPath(e,{follow:!0});if(null===r.node)throw new ar.ErrnoError(44);if(!ar.isDir(r.node.mode))throw new ar.ErrnoError(54);var t=ar.nodePermissions(r.node,"x");if(t)throw new ar.ErrnoError(t);ar.currentPath=r.path},createDefaultDirectories(){ar.mkdir("/tmp"),ar.mkdir("/home"),ar.mkdir("/home/web_user")},createDefaultDevices(){ar.mkdir("/dev"),ar.registerDevice(ar.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),ar.mkdev("/dev/null",ar.makedev(1,3)),Ve.register(ar.makedev(5,0),Ve.default_tty_ops),Ve.register(ar.makedev(6,0),Ve.default_tty1_ops),ar.mkdev("/dev/tty",ar.makedev(5,0)),ar.mkdev("/dev/tty1",ar.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=We(e).byteLength),e[--r]);ar.createDevice("/dev","random",t),ar.createDevice("/dev","urandom",t),ar.mkdir("/dev/shm"),ar.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ar.mkdir("/proc");var e=ar.mkdir("/proc/self");ar.mkdir("/proc/self/fd"),ar.mount({mount(){var r=ar.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ar.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){d.stdin?ar.createDevice("/dev","stdin",d.stdin):ar.symlink("/dev/tty","/dev/stdin"),d.stdout?ar.createDevice("/dev","stdout",null,d.stdout):ar.symlink("/dev/tty","/dev/stdout"),d.stderr?ar.createDevice("/dev","stderr",null,d.stderr):ar.symlink("/dev/tty1","/dev/stderr");var e=ar.open("/dev/stdin",0),r=ar.open("/dev/stdout",1),t=ar.open("/dev/stderr",1);q(0===e.fd,`invalid handle for stdin (${e.fd})`),q(1===r.fd,`invalid handle for stdout (${r.fd})`),q(2===t.fd,`invalid handle for stderr (${t.fd})`)},ensureErrnoError(){ar.ErrnoError||(ar.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){for(var r in this.errno=e,er)if(er[r]===e){this.code=r;break}},this.setErrno(e),this.message=Qe[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=this.stack.replace(/\b_Z[\w\d_]+/g,(function(e){var r=or(e);return e===r?e:r+" ["+e+"]"})))},ar.ErrnoError.prototype=new Error,ar.ErrnoError.prototype.constructor=ar.ErrnoError,[44].forEach((e=>{ar.genericErrors[e]=new ar.ErrnoError(e),ar.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){ar.ensureErrnoError(),ar.nameTable=new Array(4096),ar.mount(Ke,{},"/"),ar.createDefaultDirectories(),ar.createDefaultDevices(),ar.createSpecialDirectories(),ar.filesystems={MEMFS:Ke,IDBFS:Ze}},init(e,r,t){q(!ar.init.initialized,"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)"),ar.init.initialized=!0,ar.ensureErrnoError(),d.stdin=e||d.stdin,d.stdout=r||d.stdout,d.stderr=t||d.stderr,ar.createStandardStreams()},quit(){ar.init.initialized=!1,Tn(0);for(var e=0;e<ar.streams.length;e++){var r=ar.streams[e];r&&ar.close(r)}},findObject(e,r){var t=ar.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ar.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ar.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Le.basename(e),n=ar.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:ar.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Le.join2(e,a);try{ar.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=Le.join2("string"==typeof e?e:ar.getPath(e),r),i=Je(n,o);return ar.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:ar.getPath(e),i=r?Le.join2(e,r):e);var s=Je(n,o),l=ar.create(i,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),u=0,d=t.length;u<d;++u)c[u]=t.charCodeAt(u);t=c}ar.chmod(l,146|s);var f=ar.open(l,577);ar.write(f,t,0,t.length,0,a),ar.close(f),ar.chmod(l,s)}return l},createDevice(e,r,t,n){var o=Le.join2("string"==typeof e?e:ar.getPath(e),r),a=Je(!!t,!!n);ar.createDevice.major||(ar.createDevice.major=64);var i=ar.makedev(ar.createDevice.major++,0);return ar.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(e){throw new ar.ErrnoError(29)}if(void 0===l&&0===i)throw new ar.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new ar.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),ar.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ye(_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new ar.ErrnoError(29)}},createLazyFile(e,r,n,o,a){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var r,t=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=t);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,t-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>t-1)throw new Error("only "+t+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),t!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ye(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&t||(i=t=1,t=this.getter(0).length,i=t,$("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=t,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var l={isDevice:!1,contents:s}}else l={isDevice:!1,url:n};var c=ar.createFile(e,r,l,o,a);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function d(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(q(i>=0),a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(c.stream_ops).forEach((e=>{var r=c.stream_ops[e];u[e]=function(){return ar.forceLoadFile(c),r.apply(null,arguments)}})),u.read=(e,r,t,n,o)=>(ar.forceLoadFile(c),d(e,r,t,n,o)),u.mmap=(e,r,n,o,a)=>{ar.forceLoadFile(c);var i=qe(r);if(!i)throw new ar.ErrnoError(48);return d(e,t(),i,r,n),{ptr:i,allocated:!0}},c.stream_ops=u,c},absolutePath(){pe("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){pe("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){pe("FS.createLink has been removed; use FS.symlink instead")},joinPath(){pe("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){pe("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){pe("FS.standardizePath has been removed; use PATH.normalize instead")}},ir={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(Le.isAbs(r))return r;var n;if(n=-100===e?ar.cwd():ir.getStreamFromFD(e).path,0==r.length){if(!t)throw new ar.ErrnoError(44);return n}return Le.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&Le.normalize(r)!==Le.normalize(ar.getPath(e.node)))return-54;throw e}i()[t>>2]=n.dev,Me(n.dev),i()[t+4>>2]=n.mode,Me(n.mode),s()[t+8>>2]=n.nlink,Me(n.nlink),i()[t+12>>2]=n.uid,Me(n.uid),i()[t+16>>2]=n.gid,Me(n.gid),i()[t+20>>2]=n.rdev,Me(n.rdev),ye=[n.size>>>0,(ve=n.size,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+24>>2]=ye[0],i()[t+28>>2]=ye[1],$e(n.size),i()[t+32>>2]=4096,Me(4096),i()[t+36>>2]=n.blocks,Me(n.blocks);var o=n.atime.getTime(),a=n.mtime.getTime(),l=n.ctime.getTime();return ye=[Math.floor(o/1e3)>>>0,(ve=Math.floor(o/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+40>>2]=ye[0],i()[t+44>>2]=ye[1],$e(Math.floor(o/1e3)),s()[t+48>>2]=o%1e3*1e3,Me(o%1e3*1e3),ye=[Math.floor(a/1e3)>>>0,(ve=Math.floor(a/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+56>>2]=ye[0],i()[t+60>>2]=ye[1],$e(Math.floor(a/1e3)),s()[t+64>>2]=a%1e3*1e3,Me(a%1e3*1e3),ye=[Math.floor(l/1e3)>>>0,(ve=Math.floor(l/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+72>>2]=ye[0],i()[t+76>>2]=ye[1],$e(Math.floor(l/1e3)),s()[t+80>>2]=l%1e3*1e3,Me(l%1e3*1e3),ye=[n.ino>>>0,(ve=n.ino,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+88>>2]=ye[0],i()[t+92>>2]=ye[1],$e(n.ino),0},doMsync(e,r,t,o,a){if(!ar.isFile(r.node.mode))throw new ar.ErrnoError(43);if(2&o)return 0;var i=n().slice(e,e+t);ar.msync(r,i,a,t,o)},varargs:void 0,get(){q(null!=ir.varargs);var e=i()[+ir.varargs>>2];return ir.varargs+=4,e},getp:()=>ir.get(),getStr:e=>nr(e),getStreamFromFD:e=>ar.getStreamChecked(e)};function sr(e){if(b)return Gt(0,1,e);L=e,oe()||(dr.terminateAllThreads(),d.onExit&&d.onExit(e),V=!0),p(e,new Ne(e))}var lr=(e,r)=>{if(L=e,function(){var e=$,r=I,t=!1;$=I=e=>{t=!0};try{Tn(0),["stdout","stderr"].forEach((function(e){var r=ar.analyzePath("/dev/"+e);if(r){var n=r.object.rdev,o=Ve.ttys[n];o&&o.output&&o.output.length&&(t=!0)}}))}catch(e){}$=e,I=r,t&&_r("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.")}(),b)throw q(!r),hr(e),"unwind";if(oe()&&!r){var t=`program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${ne}) 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)`;u(t),I(t)}sr(e)},cr=e=>(q("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),ur=e=>{if(e instanceof Ne||"unwind"==e)return L;Z(),e instanceof WebAssembly.RuntimeError&&Un()<=0&&I("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 5242880)"),p(1,e)},dr={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},nextWorkerID:1,debugInit(){var e=Ie;Ie=r=>{return e((t=0,te&&void 0!==kn&&(t=kn()),"w:"+(d.workerID||0)+",t:"+cr(t)+": "+r));var t}},init(){dr.debugInit(),b?dr.initWorker():dr.initMainThread()},initMainThread(){ie((()=>{fe("loading-workers"),dr.loadWasmModuleToAllWorkers((()=>he("loading-workers")))}))},initWorker(){x=!1},setExitStatus:e=>{L=e},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var e of(q(!b,"Internal Error! terminateAllThreads() can only ever be called from main application thread!"),dr.runningWorkers))Re(e);for(var e of dr.unusedWorkers)Re(e);dr.unusedWorkers=[],dr.runningWorkers=[],dr.pthreads=[]},returnWorkerToPool:e=>{var r=e.pthread_ptr;delete dr.pthreads[r],dr.unusedWorkers.push(e),dr.runningWorkers.splice(dr.runningWorkers.indexOf(e),1),e.pthread_ptr=0,On(r)},receiveObjectTransfer(e){},threadInitTLS(){dr.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:r=>new Promise((t=>{r.onmessage=e=>{var n=e.data,o=n.cmd;if(n.targetThread&&n.targetThread!=kn()){var a=dr.pthreads[n.targetThread];a?a.postMessage(n,n.transferList):I(`Internal error! Worker sent a message "${o}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else{var i;"checkMailbox"===o?Ht():"spawnThread"===o?(e=>{q(!b,"Internal Error! spawnThread() can only ever be called from main application thread!"),q(e.pthread_ptr,"Internal error, no pthread ptr!");var r=dr.getNewWorker();if(!r)return 6;q(!r.pthread_ptr,"Internal error!"),dr.runningWorkers.push(r),dr.pthreads[e.pthread_ptr]=r,r.pthread_ptr=e.pthread_ptr;var t={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};y&&r.unref(),r.postMessage(t,e.transferList)})(n):"cleanupThread"===o?xe(n.thread):"killThread"===o?(e=>{q(!b,"Internal Error! killThread() can only ever be called from main application thread!"),q(e,"Internal Error! Null pthread_ptr in killThread!");var r=dr.pthreads[e];delete dr.pthreads[e],Re(r),On(e),dr.runningWorkers.splice(dr.runningWorkers.indexOf(r),1),r.pthread_ptr=0})(n.thread):"cancelThread"===o?(i=n.thread,q(!b,"Internal Error! cancelThread() can only ever be called from main application thread!"),q(i,"Internal Error! Null pthread_ptr in cancelThread!"),dr.pthreads[i].postMessage({cmd:"cancel"})):"loaded"===o?(r.loaded=!0,t(r)):"alert"===o?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?r.postMessage(n):"callHandler"===o?d[n.handler](...n.args):o&&I(`worker sent an unknown command ${o}`)}},r.onerror=e=>{var t="worker sent an error!";throw r.pthread_ptr&&(t=`Pthread ${cr(r.pthread_ptr)} sent an error!`),I(`${t} ${e.filename}:${e.lineno}: ${e.message}`),e},y&&(r.on("message",(e=>r.onmessage({data:e}))),r.on("error",(e=>r.onerror(e)))),q(N instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!"),q(R instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");var n=[];for(var o of["onExit","onAbort","print","printErr"])d.hasOwnProperty(o)&&n.push(o);r.workerID=dr.nextWorkerID++,r.postMessage({cmd:"load",handlers:n,urlOrBlob:d.mainScriptUrlOrBlob||e,wasmMemory:N,wasmModule:R,workerID:r.workerID})})),loadWasmModuleToAllWorkers(e){e()},allocateUnusedWorker(){var e,r=k("web_example.worker.js");e=new Worker(r),dr.unusedWorkers.push(e)},getNewWorker:()=>(0==dr.unusedWorkers.length&&(y||I("Tried to spawn a new thread, but the thread pool is exhausted.\nThis might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.\nIf you want to increase the pool size, use setting `-sPTHREAD_POOL_SIZE=...`.\nIf you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting `-sPTHREAD_POOL_SIZE_STRICT=2`."),dr.allocateUnusedWorker(),dr.loadWasmModuleToWorker(dr.unusedWorkers[0])),dr.unusedWorkers.pop())};d.PThread=dr;var fr=e=>{for(;e.length>0;)e.shift()(d)};function hr(e){if(b)return Gt(1,0,e);lr(e)}d.establishStackSpace=()=>{var e=kn(),r=s()[e+52>>2],t=r-s()[e+56>>2];q(0!=r),q(0!=t),q(r>t,"stackHigh must be higher then stackLow"),xn(r,t),gr(),Wn(r),J()};var pr=e=>(e=>rr((()=>{var r=jn(4),t=jn(4);Gn(e,r,t);var n,o=s()[r>>2],a=s()[t>>2],i=nr(o);return bn(o),a&&(n=nr(a),bn(a)),[i,n]})))(e);d.getExceptionMessage=pr;var mr,vr=[],yr=e=>{var r=vr[e];return r||(e>=vr.length&&(vr.length=e+1),vr[e]=r=mr.get(e)),q(mr.get(e)==r,"JavaScript-side Wasm function table mirror is out of date!"),r};d.invokeEntryPoint=(e,r)=>{var t=yr(e)(r);Z(),function(e){oe()?dr.setExitStatus(e):Mn(e)}(t)};var gr=()=>{var e=Cn(),r=Fn();qn(e,r)},_r=e=>{_r.shown||(_r.shown={}),_r.shown[e]||(_r.shown[e]=1,y&&(e="warning: "+e),I(e))},wr=[],Er=0,br=0;function Tr(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){s()[this.ptr+4>>2]=e},this.get_type=function(){return s()[this.ptr+4>>2]},this.set_destructor=function(e){s()[this.ptr+8>>2]=e},this.get_destructor=function(){return s()[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,t()[this.ptr+12>>0]=e,De(e)},this.get_caught=function(){return 0!=t()[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,t()[this.ptr+13>>0]=e,De(e)},this.get_rethrown=function(){return 0!=t()[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){s()[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return s()[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Vn(this.get_type()))return s()[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var kr=e=>{var r=br&&br.excPtr;if(!r)return Nn(0),0;var t=new Tr(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return Nn(0),r;for(var o in e){var a=e[o];if(0===a||a===n)break;var i=t.ptr+16;if(Yn(a,n,i))return Nn(a),r}return Nn(n),r};function Sr(e,r,t){if(b)return Gt(2,1,e,r,t);ir.varargs=t;try{var n=ir.getStreamFromFD(e);switch(r){case 0:if((a=ir.get())<0)return-28;for(;ar.streams[a];)a++;return ar.createStream(n,a).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var a=ir.get();return n.flags|=a,0;case 5:return a=ir.getp(),o()[a+0>>1]=2,Oe(2),0;case 16:case 8:default:return-28;case 9:return 28,i()[En()>>2]=28,Me(28),-1}}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Pr(e,r){if(b)return Gt(3,1,e,r);try{var t=ir.getStreamFromFD(e);return ir.doStat(ar.stat,t.path,r)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Ar(e,r,n){if(b)return Gt(4,1,e,r,n);ir.varargs=n;try{var a=ir.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return a.tty?0:-59;case 21505:if(!a.tty)return-59;if(a.tty.ops.ioctl_tcgets){var s=a.tty.ops.ioctl_tcgets(a),l=ir.getp();i()[l>>2]=s.c_iflag||0,Me(s.c_iflag||0),i()[l+4>>2]=s.c_oflag||0,Me(s.c_oflag||0),i()[l+8>>2]=s.c_cflag||0,Me(s.c_cflag||0),i()[l+12>>2]=s.c_lflag||0,Me(s.c_lflag||0);for(var c=0;c<32;c++)t()[l+c+17>>0]=s.c_cc[c]||0,De(s.c_cc[c]||0);return 0}return 0;case 21506:case 21507:case 21508:if(!a.tty)return-59;if(a.tty.ops.ioctl_tcsets){l=ir.getp();var u=i()[l>>2],d=i()[l+4>>2],f=i()[l+8>>2],h=i()[l+12>>2],p=[];for(c=0;c<32;c++)p.push(t()[l+c+17>>0]);return a.tty.ops.ioctl_tcsets(a.tty,r,{c_iflag:u,c_oflag:d,c_cflag:f,c_lflag:h,c_cc:p})}return 0;case 21519:return a.tty?(l=ir.getp(),i()[l>>2]=0,Me(0),0):-59;case 21520:return a.tty?-28:-59;case 21531:return l=ir.getp(),ar.ioctl(a,r,l);case 21523:if(!a.tty)return-59;if(a.tty.ops.ioctl_tiocgwinsz){var m=a.tty.ops.ioctl_tiocgwinsz(a.tty);l=ir.getp(),o()[l>>1]=m[0],Oe(m[0]),o()[l+2>>1]=m[1],Oe(m[1])}return 0;default:return-28}}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Cr(e,r){if(b)return Gt(5,1,e,r);try{return e=ir.getStr(e),ir.doStat(ar.lstat,e,r)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Fr(e,r,t,n){if(b)return Gt(6,1,e,r,t,n);try{r=ir.getStr(r);var o=256&n,a=4096&n;return q(!(n&=-6401),`unknown flags in __syscall_newfstatat: ${n}`),r=ir.calculateAt(e,r,a),ir.doStat(o?ar.lstat:ar.stat,r,t)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Dr(e,r,t,n){if(b)return Gt(7,1,e,r,t,n);ir.varargs=n;try{r=ir.getStr(r),r=ir.calculateAt(e,r);var o=n?ir.get():0;return ar.open(r,t,o).fd}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Or(e,r){if(b)return Gt(8,1,e,r);try{return e=ir.getStr(e),ir.doStat(ar.stat,e,r)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Mr(e,r,t){if(b)return Gt(9,1,e,r,t);try{return r=ir.getStr(r),r=ir.calculateAt(e,r),0===t?ar.unlink(r):512===t?ar.rmdir(r):pe("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}var $r={},Ir=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function Nr(e){return this.fromWireType(i()[e>>2])}var Rr,xr,Lr,Wr={},jr={},Ur={},Br=e=>{throw new Rr(e)},zr=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Br("Mismatched type converter count");for(var o=0;o<e.length;++o)Vr(e[o],n[o])}e.forEach((function(e){Ur[e]=r}));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{jr.hasOwnProperty(e)?o[r]=jr[e]:(a.push(e),Wr.hasOwnProperty(e)||(Wr[e]=[]),Wr[e].push((()=>{o[r]=jr[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},Hr={},Gr=e=>{for(var r="",t=e;n()[t];)r+=xr[n()[t++]];return r},Yr=e=>{throw new Lr(e)};function Vr(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Yr(`type "${n}" must have a positive integer typeid pointer`),jr.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Yr(`Cannot register type '${n}' twice`)}if(jr[e]=r,delete Ur[e],Wr.hasOwnProperty(e)){var o=Wr[e];delete Wr[e],o.forEach((e=>e()))}}(e,r,t)}var qr,Kr=e=>{Yr(e.$$.ptrType.registeredClass.name+" instance already deleted")},Xr=!1,Jr=e=>{},Zr=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Qr=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=Qr(e,r,t.baseClass);return null===n?null:t.downcast(n)},et={},rt=[],tt=()=>{for(;rt.length;){var e=rt.pop();e.$$.deleteScheduled=!1,e.delete()}},nt={},ot=(e,r)=>(r.ptrType&&r.ptr||Br("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&Br("Both smartPtrType and smartPtr must be specified"),r.count={value:1},it(Object.create(e,{$$:{value:r}})));function at(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&Yr("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(e,r),nt[r]))(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?ot(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):ot(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=et[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=Qr(r,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?ot(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):ot(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var it=e=>"undefined"==typeof FinalizationRegistry?(it=e=>e,e):(Xr=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),Zr(e.$$)})),it=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r},n=r.ptrType.registeredClass;t.leakWarning=new Error(`Embind found a leaked C++ instance ${n.name} <${cr(r.ptr)}>.\nWe'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(t.leakWarning,at),Xr.register(e,t,e)}return e},Jr=e=>Xr.unregister(e),it(e));function st(){}var lt=e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e};function ct(e,r){return{[e=lt(e)]:function(){return r.apply(this,arguments)}}[e]}var ut=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||Yr(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},dt=(e,r,t)=>{d.hasOwnProperty(e)?((void 0===t||void 0!==d[e].overloadTable&&void 0!==d[e].overloadTable[t])&&Yr(`Cannot register public name '${e}' twice`),ut(d,e,e),d.hasOwnProperty(t)&&Yr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),d[e].overloadTable[t]=r):(d[e]=r,void 0!==t&&(d[e].numArguments=t))};function ft(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var ht=(e,r,t)=>{for(;r!==t;)r.upcast||Yr(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function pt(e,r){if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),0;r.$$||Yr(`Cannot pass "${$t(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return ht(r.$$.ptr,t,this.registeredClass)}function mt(e,r){var t;if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||Yr(`Cannot pass "${$t(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Yr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=ht(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Yr("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Yr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,Dt.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Yr("Unsupporting sharing policy")}return t}function vt(e,r){if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),0;r.$$||Yr(`Cannot pass "${$t(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Yr(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return ht(r.$$.ptr,t,this.registeredClass)}function yt(e){return this.fromWireType(s()[e>>2])}function gt(e,r,t,n,o,a,i,s,l,c,u){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,o||void 0!==r.baseClass?this.toWireType=mt:n?(this.toWireType=pt,this.destructorFunction=null):(this.toWireType=vt,this.destructorFunction=null)}var _t,wt=(e,r,t)=>{d.hasOwnProperty(e)||Br("Replacing nonexistant public symbol"),void 0!==d[e].overloadTable&&void 0!==t?d[e].overloadTable[t]=r:(d[e]=r,d[e].argCount=t)},Et=(e,r)=>{var t=(e=Gr(e)).includes("j")?((e,r)=>{q(e.includes("j")||e.includes("p"),"getDynCaller should only be called with i64 sigs");var t=[];return function(){return t.length=0,Object.assign(t,arguments),((e,r,t)=>e.includes("j")?((e,r,t)=>{q("dynCall_"+e in d,`bad function pointer type - dynCall function not found for sig '${e}'`),t&&t.length?q(t.length===e.substring(1).replace(/j/g,"--").length):q(1==e.length);var n=d["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)})(e,r,t):(q(yr(r),`missing table entry in dynCall: ${r}`),yr(r).apply(null,t)))(e,r,t)}})(e,r):yr(r);return"function"!=typeof t&&Yr(`unknown function pointer with signature ${e}: ${r}`),t},bt=e=>{var r=Pn(e),t=Gr(r);return bn(r),t},Tt=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||jr[r]||(Ur[r]?Ur[r].forEach(e):(t.push(r),n[r]=!0))})),new _t(`${e}: `+t.map(bt).join([", "]))},kt=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(s()[r+4*n>>2]);return t};function St(e,r,t,n,o,a){var i=r.length;i<2&&Yr("argTypes array size mismatch! Must at least get return value and 'this' types!"),q(!a,"Async bindings are only supported with JSPI.");for(var s=null!==r[1]&&null!==t,l=!1,c=1;c<r.length;++c)if(null!==r[c]&&void 0===r[c].destructorFunction){l=!0;break}var u="void"!==r[0].name,d="",f="";for(c=0;c<i-2;++c)d+=(0!==c?", ":"")+"arg"+c,f+=(0!==c?", ":"")+"arg"+c+"Wired";var h=`\n return function ${lt(e)}(${d}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`;l&&(h+="var destructors = [];\n");var p=l?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[Yr,n,o,Ir,r[0],r[1]];for(s&&(h+="var thisWired = classParam.toWireType("+p+", this);\n"),c=0;c<i-2;++c)h+="var arg"+c+"Wired = argType"+c+".toWireType("+p+", arg"+c+"); // "+r[c+2].name+"\n",m.push("argType"+c),v.push(r[c+2]);if(s&&(f="thisWired"+(f.length>0?", ":"")+f),h+=(u||a?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",l)h+="runDestructors(destructors);\n";else for(c=s?1:2;c<r.length;++c){var y=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==r[c].destructorFunction&&(h+=y+"_dtor("+y+"); // "+r[c].name+"\n",m.push(y+"_dtor"),v.push(r[c].destructorFunction))}return u&&(h+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),h+="}\n",m.push(h),function(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=ct(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,o=e.apply(n,r);return o instanceof Object?o:n}(Function,m).apply(null,v)}var Pt=(e,r,t)=>(e instanceof Object||Yr(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||Yr(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Yr(`cannot call emscripten binding method ${t} on deleted object`),ht(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass));function At(){this.allocated=[void 0],this.freelist=[]}var Ct=new At,Ft=e=>{e>=Ct.reserved&&0==--Ct.get(e).refcount&&Ct.free(e)},Dt={toValue:e=>(e||Yr("Cannot use deleted val. handle = "+e),Ct.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Ct.allocate({refcount:1,value:e})}}},Ot=(e,r,l)=>{switch(r){case 1:return l?function(e){return this.fromWireType(t()[e>>0])}:function(e){return this.fromWireType(n()[e>>0])};case 2:return l?function(e){return this.fromWireType(o()[e>>1])}:function(e){return this.fromWireType(a()[e>>1])};case 4:return l?function(e){return this.fromWireType(i()[e>>2])}:function(e){return this.fromWireType(s()[e>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Mt=(e,r)=>{var t=jr[e];return void 0===t&&Yr(r+" has unknown type "+bt(e)),t},$t=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},It=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType((N.buffer!=W.buffer&&K(),G)[e>>2])};case 8:return function(e){return this.fromWireType(l()[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Nt=(e,r,l)=>{switch(r){case 1:return l?e=>t()[e>>0]:e=>n()[e>>0];case 2:return l?e=>o()[e>>1]:e=>a()[e>>1];case 4:return l?e=>i()[e>>2]:e=>s()[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Rt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,xt=(e,r)=>{q(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var t=e,i=t>>1,s=i+r/2;!(i>=s)&&a()[i];)++i;if((t=i<<1)-e>32&&Rt)return Rt.decode(n().slice(e,t));for(var l="",c=0;!(c>=r/2);++c){var u=o()[e+2*c>>1];if(0==u)break;l+=String.fromCharCode(u)}return l},Lt=(e,r,t)=>{if(q(r%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),q("number"==typeof t,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,a=(t-=2)<2*e.length?t/2:e.length,i=0;i<a;++i){var s=e.charCodeAt(i);o()[r>>1]=s,Oe(s),r+=2}return o()[r>>1]=0,Oe(0),r-n},Wt=e=>2*e.length,jt=(e,r)=>{q(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var t=0,n="";!(t>=r/4);){var o=i()[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ut=(e,r,t)=>{if(q(r%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),q("number"==typeof t,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),i()[r>>2]=s,Me(s),(r+=4)+4>o)break}return i()[r>>2]=0,Me(0),r-n},Bt=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},zt=e=>{if("function"==typeof Atomics.waitAsync){var r=Atomics.waitAsync(i(),e>>2,e);q(r.async),r.value.then(Ht);var t=e+128;Atomics.store(i(),t>>2,1)}};d.__emscripten_thread_mailbox_await=zt;var Ht=()=>{var e=kn();e&&(zt(e),(e=>{if(V)I("user callback triggered after runtime exited or application aborted. Ignoring.");else try{e(),(()=>{if(!oe())try{b?Mn(L):lr(L)}catch(e){ur(e)}})()}catch(e){ur(e)}})((()=>$n())))};d.checkMailbox=Ht;var Gt=function(e,r){var t=arguments.length-2,n=arguments;return rr((()=>{for(var o=t,a=jn(8*o),i=a>>3,s=0;s<t;s++){var c=n[2+s];l()[i+s]=c}return Dn(e,o,a,r)}))},Yt=[],Vt=e=>e%4==0&&(e%100!=0||e%400==0),qt=[0,31,60,91,121,152,182,213,244,274,305,335],Kt=[0,31,59,90,120,151,181,212,243,273,304,334],Xt=(e,r)=>(q(e==e>>>0||e==(0|e)),q(r===(0|r)),r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN);function Jt(e,r,t,n,o,a,l,c){if(b)return Gt(10,1,e,r,t,n,o,a,l,c);var u=Xt(o,a);try{if(isNaN(u))return 61;var d=ir.getStreamFromFD(n),f=ar.mmap(d,e,u,r,t),h=f.ptr;return i()[l>>2]=f.allocated,Me(f.allocated),s()[c>>2]=h,0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Zt(e,r,t,n,o,a,i){if(b)return Gt(11,1,e,r,t,n,o,a,i);var s=Xt(a,i);try{if(isNaN(s))return 61;var l=ir.getStreamFromFD(o);2&t&&ir.doMsync(e,l,r,n,s),ar.munmap(l)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}var Qt,en=e=>{var r=He(e)+1,t=wn(r);return t&&tr(e,t,r),t};Qt=()=>performance.timeOrigin+performance.now();var rn=e=>{var r=N.buffer,t=(e-r.byteLength+65535)/65536;try{return N.grow(t),K(),1}catch(t){I(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${t}`)}},tn={},nn=()=>{if(!nn.strings){var e={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",_:h||"./this.program"};for(var r in tn)void 0===tn[r]?delete e[r]:e[r]=tn[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);nn.strings=t}return nn.strings},on=function(e,r){if(b)return Gt(12,1,e,r);var n=0;return nn().forEach(((o,a)=>{var i=r+n;s()[e+4*a>>2]=i,Me(i),((e,r)=>{for(var n=0;n<e.length;++n)q(e.charCodeAt(n)===(255&e.charCodeAt(n))),t()[r++>>0]=e.charCodeAt(n),De(e.charCodeAt(n));t()[r>>0]=0,De(0)})(o,i),n+=o.length+1})),0},an=function(e,r){if(b)return Gt(13,1,e,r);var t=nn();s()[e>>2]=t.length,Me(t.length);var n=0;return t.forEach((e=>n+=e.length+1)),s()[r>>2]=n,Me(n),0};function sn(e){if(b)return Gt(14,1,e);try{var r=ir.getStreamFromFD(e);return ar.close(r),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return e.errno}}function ln(e,r,n,o){if(b)return Gt(15,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var l=s()[r>>2],c=s()[r+4>>2];r+=8;var u=ar.read(e,t(),l,c,o);if(u<0)return-1;if(a+=u,u<c)break;void 0!==o&&(o+=u)}return a})(ir.getStreamFromFD(e),r,n);return s()[o>>2]=a,Me(a),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return e.errno}}function cn(e,r,t,n,o){if(b)return Gt(16,1,e,r,t,n,o);var a=Xt(r,t);try{if(isNaN(a))return 61;var s=ir.getStreamFromFD(e);return ar.llseek(s,a,n),ye=[s.position>>>0,(ve=s.position,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[o>>2]=ye[0],i()[o+4>>2]=ye[1],$e(s.position),s.getdents&&0===a&&0===n&&(s.getdents=null),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return e.errno}}function un(e,r,n,o){if(b)return Gt(17,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var l=s()[r>>2],c=s()[r+4>>2];r+=8;var u=ar.write(e,t(),l,c,o);if(u<0)return-1;a+=u,void 0!==o&&(o+=u)}return a})(ir.getStreamFromFD(e),r,n);return s()[o>>2]=a,Me(a),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return e.errno}}var dn=[31,29,31,30,31,30,31,31,30,31,30,31],fn=[31,28,31,30,31,30,31,31,30,31,30,31];dr.init();var hn,pn,mn=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ar.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(mn.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return ar.isDir(this.mode)}},isDevice:{get:function(){return ar.isChrdev(this.mode)}}}),ar.FSNode=mn,ar.createPreloadedFile=(e,r,t,n,o,a,i,s,l,c)=>{var u=r?je.resolve(Le.join2(e,r)):e,d=de(`cp ${u}`);function f(t){function f(t){c&&c(),s||((e,r,t,n,o,a)=>{ar.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,l),a&&a(),he(d)}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return Xe.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,u,f,(()=>{i&&i(),he(d)}))||f(t)}fe(d),"string"==typeof t?((e,r,t,n)=>{var o=de(`al ${e}`);w(e,(r=>{q(r,`Loading data file "${e}" failed (no arrayBuffer).`),f(new Uint8Array(r)),o&&he(o)}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&fe(o)})(t,0,i):f(t)},ar.staticInit(),d.FS_createPath=ar.createPath,d.FS_createDataFile=ar.createDataFile,d.FS_createPreloadedFile=ar.createPreloadedFile,d.FS_unlink=ar.unlink,d.FS_createLazyFile=ar.createLazyFile,d.FS_createDevice=ar.createDevice,er={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},Rr=d.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);xr=e})(),Lr=d.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(st.prototype,{isAliasOf(e){if(!(this instanceof st))return!1;if(!(e instanceof st))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||Kr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=it(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Kr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Yr("Object already scheduled for deletion"),Jr(this),Zr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Kr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Yr("Object already scheduled for deletion"),rt.push(this),1===rt.length&&qr&&qr(tt),this.$$.deleteScheduled=!0,this}}),d.getInheritedInstanceCount=()=>Object.keys(nt).length,d.getLiveInheritedInstances=()=>{var e=[];for(var r in nt)nt.hasOwnProperty(r)&&e.push(nt[r]);return e},d.flushPendingDeletes=tt,d.setDelayFunction=e=>{qr=e,rt.length&&qr&&qr(tt)},Object.assign(gt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor&&this.rawDestructor(e)},argPackAdvance:8,readValueFromPointer:yt,deleteObject(e){null!==e&&e.delete()},fromWireType:at}),_t=d.UnboundTypeError=(hn=Error,(pn=ct("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(hn.prototype),pn.prototype.constructor=pn,pn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},pn),Object.assign(At.prototype,{get(e){return q(void 0!==this.allocated[e],`invalid handle: ${e}`),this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){q(void 0!==this.allocated[e]),this.allocated[e]=void 0,this.freelist.push(e)}}),Ct.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Ct.reserved=Ct.allocated.length,d.count_emval_handles=()=>{for(var e=0,r=Ct.reserved;r<Ct.allocated.length;++r)void 0!==Ct.allocated[r]&&++e;return e};var vn,yn=[sr,hr,Sr,Pr,Ar,Cr,Fr,Dr,Or,Mr,Jt,Zt,on,an,sn,ln,cn,un],gn={__assert_fail:(e,r,t,n)=>{pe(`Assertion failed: ${nr(e)}, at: `+[r?nr(r):"unknown filename",t,n?nr(n):"unknown function"])},__cxa_begin_catch:e=>{var r=new Tr(e);return r.get_caught()||(r.set_caught(!0),Er--),r.set_rethrown(!1),wr.push(r),zn(r.excPtr),r.get_exception_ptr()},__cxa_end_catch:()=>{In(0,0),q(wr.length>0);var e=wr.pop();Bn(e.excPtr),br=0},__cxa_find_matching_catch_2:()=>kr([]),__cxa_find_matching_catch_3:e=>kr([e]),__cxa_rethrow:()=>{var e=wr.pop();e||pe("no exception to throw");var r=e.excPtr;throw e.get_rethrown()||(wr.push(e),e.set_rethrown(!0),e.set_caught(!1),Er++),br=new be(r)},__cxa_throw:(e,r,t)=>{throw new Tr(e).init(r,t),br=new be(e),Er++,br},__cxa_uncaught_exceptions:()=>Er,__emscripten_init_main_thread_js:e=>{An(e,!v,1,!m,2097152,!1),dr.threadInitTLS()},__emscripten_thread_cleanup:e=>{b?postMessage({cmd:"cleanupThread",thread:e}):xe(e)},__handle_stack_overflow:e=>{var r=Cn(),t=Fn();pe(`stack overflow (Attempt to set SP to ${cr(e)}, with stack limits [${cr(t)} - ${cr(r)}]). If you require more stack space build with -sSTACK_SIZE=<bytes>`)},__resumeException:e=>{throw br||(br=new be(e)),br},__syscall_fcntl64:Sr,__syscall_fstat64:Pr,__syscall_ioctl:Ar,__syscall_lstat64:Cr,__syscall_newfstatat:Fr,__syscall_openat:Dr,__syscall_stat64:Or,__syscall_unlinkat:Mr,_embind_finalize_value_array:e=>{var r=$r[e];delete $r[e];var t=r.elements,n=t.length,o=t.map((e=>e.getterReturnType)).concat(t.map((e=>e.setterArgumentType))),a=r.rawConstructor,i=r.rawDestructor;zr([e],o,(function(e){return t.forEach(((r,t)=>{var o=e[t],a=r.getter,i=r.getterContext,s=e[t+n],l=r.setter,c=r.setterContext;r.read=e=>o.fromWireType(a(i,e)),r.write=(e,r)=>{var t=[];l(c,e,s.toWireType(t,r)),Ir(t)}})),[{name:r.name,fromWireType:e=>{for(var r=new Array(n),o=0;o<n;++o)r[o]=t[o].read(e);return i(e),r},toWireType:(e,o)=>{if(n!==o.length)throw new TypeError(`Incorrect number of tuple elements for ${r.name}: expected=${n}, actual=${o.length}`);for(var s=a(),l=0;l<n;++l)t[l].write(s,o[l]);return null!==e&&e.push(i,s),s},argPackAdvance:8,readValueFromPointer:Nr,destructorFunction:i}]}))},_embind_finalize_value_object:e=>{var r=Hr[e];delete Hr[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType)));zr([e],a,(e=>{var a={};return o.forEach(((r,t)=>{var n=r.fieldName,i=e[t],s=r.getter,l=r.getterContext,c=e[t+o.length],u=r.setter,d=r.setterContext;a[n]={read:e=>i.fromWireType(s(l,e)),write:(e,r)=>{var t=[];u(d,e,c.toWireType(t,r)),Ir(t)}}})),[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},argPackAdvance:8,readValueFromPointer:Nr,destructorFunction:n}]}))},_embind_register_bigint:(e,r,t,n,o)=>{},_embind_register_bool:(e,r,t,o)=>{Vr(e,{name:r=Gr(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:o},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(n()[e])},destructorFunction:null})},_embind_register_class:(e,r,t,n,o,a,i,s,l,c,u,d,f)=>{u=Gr(u),a=Et(o,a),s&&(s=Et(i,s)),c&&(c=Et(l,c)),f=Et(d,f);var h=lt(u);dt(h,(function(){Tt(`Cannot construct ${u} due to unbound types`,[n])})),zr([e,r,t],n?[n]:[],(function(r){var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:st.prototype;var i=ct(h,(function(){if(Object.getPrototypeOf(this)!==l)throw new Lr("Use 'new' to construct "+u);if(void 0===d.constructor_body)throw new Lr(u+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Lr(`Tried to invoke ctor of ${u} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),l=Object.create(o,{constructor:{value:i}});i.prototype=l;var d=new ft(u,i,l,f,t,a,s,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var p=new gt(u,d,!0,!1,!1),m=new gt(u+"*",d,!1,!1,!1),v=new gt(u+" const*",d,!1,!0,!1);return et[e]={pointerType:m,constPointerType:v},wt(h,i),[p,m,v]}))},_embind_register_class_constructor:(e,r,t,n,o,a)=>{q(r>0);var i=kt(r,t);o=Et(n,o),zr([],[e],(function(e){var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Lr(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{Tt(`Cannot construct ${e.name} due to unbound types`,i)},zr([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=St(t,n,null,o,a),[]))),[]}))},_embind_register_class_function:(e,r,t,n,o,a,i,s,l)=>{var c=kt(t,n);r=Gr(r),a=Et(o,a),zr([],[e],(function(e){var n=`${(e=e[0]).name}.${r}`;function o(){Tt(`Cannot call ${n} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var u=e.registeredClass.instancePrototype,d=u[r];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===t-2?(o.argCount=t-2,o.className=e.name,u[r]=o):(ut(u,r,n),u[r].overloadTable[t-2]=o),zr([],c,(function(o){var s=St(n,o,e,a,i,l);return void 0===u[r].overloadTable?(s.argCount=t-2,u[r]=s):u[r].overloadTable[t-2]=s,[]})),[]}))},_embind_register_class_property:(e,r,t,n,o,a,i,s,l,c)=>{r=Gr(r),o=Et(n,o),zr([],[e],(function(e){var n=`${(e=e[0]).name}.${r}`,u={get(){Tt(`Cannot access ${n} due to unbound types`,[t,i])},enumerable:!0,configurable:!0};return u.set=l?()=>Tt(`Cannot access ${n} due to unbound types`,[t,i]):e=>Yr(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,r,u),zr([],l?[t,i]:[t],(function(t){var i=t[0],u={get(){var r=Pt(this,e,n+" getter");return i.fromWireType(o(a,r))},enumerable:!0};if(l){l=Et(s,l);var d=t[1];u.set=function(r){var t=Pt(this,e,n+" setter"),o=[];l(c,t,d.toWireType(o,r)),Ir(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,u),[]})),[]}))},_embind_register_emval:(e,r)=>{Vr(e,{name:r=Gr(r),fromWireType:e=>{var r=Dt.toValue(e);return Ft(e),r},toWireType:(e,r)=>Dt.toHandle(r),argPackAdvance:8,readValueFromPointer:Nr,destructorFunction:null})},_embind_register_enum:(e,r,t,n)=>{function o(){}r=Gr(r),o.values={},Vr(e,{name:r,constructor:o,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,r)=>r.value,argPackAdvance:8,readValueFromPointer:Ot(r,t,n),destructorFunction:null}),dt(r,o)},_embind_register_enum_value:(e,r,t)=>{var n=Mt(e,"enum");r=Gr(r);var o=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:ct(`${n.name}_${r}`,(function(){}))}});o.values[t]=a,o[r]=a},_embind_register_float:(e,r,t)=>{Vr(e,{name:r=Gr(r),fromWireType:e=>e,toWireType:(e,r)=>{if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError(`Cannot convert ${$t(r)} to ${this.name}`);return r},argPackAdvance:8,readValueFromPointer:It(r,t),destructorFunction:null})},_embind_register_function:(e,r,t,n,o,a,i)=>{var s=kt(r,t);e=Gr(e),o=Et(n,o),dt(e,(function(){Tt(`Cannot call ${e} due to unbound types`,s)}),r-1),zr([],s,(function(t){var n=[t[0],null].concat(t.slice(1));return wt(e,St(e,n,null,o,a,i),r-1),[]}))},_embind_register_integer:(e,r,t,n,o)=>{r=Gr(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned"),l=(e,t)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert "${$t(e)}" to ${t}`);if(e<n||e>o)throw new TypeError(`Passing a number "${$t(e)}" from JS side to C/C++ side to an argument of type "${r}", which is outside the valid range [${n}, ${o}]!`)};Vr(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return l(r,this.name),r>>>0}:function(e,r){return l(r,this.name),r},argPackAdvance:8,readValueFromPointer:Nt(r,t,0!==n),destructorFunction:null})},_embind_register_memory_view:(e,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=s()[e>>2],n=s()[e+4>>2];return new o(t().buffer,n,r)}Vr(e,{name:n=Gr(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(e,r)=>{var t="std::string"===(r=Gr(r));Vr(e,{name:r,fromWireType(e){var r,o=s()[e>>2],a=e+4;if(t)for(var i=a,l=0;l<=o;++l){var c=a+l;if(l==o||0==n()[c]){var u=nr(i,c-i);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),i=c+1}}else{var d=new Array(o);for(l=0;l<o;++l)d[l]=String.fromCharCode(n()[a+l]);r=d.join("")}return bn(e),r},toWireType(e,r){var o;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var a="string"==typeof r;a||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||Yr("Cannot pass non-string to std::string"),o=t&&a?He(r):r.length;var i=wn(4+o+1),l=i+4;if(s()[i>>2]=o,Me(o),t&&a)tr(r,l,o+1);else if(a)for(var c=0;c<o;++c){var u=r.charCodeAt(c);u>255&&(bn(l),Yr("String has UTF-16 code units that do not fit in 8 bits")),n()[l+c]=u}else for(c=0;c<o;++c)n()[l+c]=r[c];return null!==e&&e.push(bn,i),i},argPackAdvance:8,readValueFromPointer:yt,destructorFunction(e){bn(e)}})},_embind_register_std_wstring:(e,r,t)=>{var n,o,i,l,c;t=Gr(t),2===r?(n=xt,o=Lt,l=Wt,i=()=>a(),c=1):4===r&&(n=jt,o=Ut,l=Bt,i=()=>s(),c=2),Vr(e,{name:t,fromWireType:e=>{for(var t,o=s()[e>>2],a=i(),l=e+4,u=0;u<=o;++u){var d=e+4+u*r;if(u==o||0==a[d>>c]){var f=n(l,d-l);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),l=d+r}}return bn(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Yr(`Cannot pass non-string to C++ string type ${t}`);var a=l(n),i=wn(4+a+r);return s()[i>>2]=a>>c,o(n,i+4,a+r),null!==e&&e.push(bn,i),i},argPackAdvance:8,readValueFromPointer:Nr,destructorFunction(e){bn(e)}})},_embind_register_value_array:(e,r,t,n,o,a)=>{$r[e]={name:Gr(r),rawConstructor:Et(t,n),rawDestructor:Et(o,a),elements:[]}},_embind_register_value_array_element:(e,r,t,n,o,a,i,s,l)=>{$r[e].elements.push({getterReturnType:r,getter:Et(t,n),getterContext:o,setterArgumentType:a,setter:Et(i,s),setterContext:l})},_embind_register_value_object:(e,r,t,n,o,a)=>{Hr[e]={name:Gr(r),rawConstructor:Et(t,n),rawDestructor:Et(o,a),fields:[]}},_embind_register_value_object_field:(e,r,t,n,o,a,i,s,l,c)=>{Hr[e].fields.push({fieldName:Gr(r),getterReturnType:t,getter:Et(n,o),getterContext:a,setterArgumentType:i,setter:Et(s,l),setterContext:c})},_embind_register_void:(e,r)=>{Vr(e,{isVoid:!0,name:r=Gr(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},_emscripten_get_now_is_monotonic:()=>!0,_emscripten_notify_mailbox_postmessage:(e,r,t)=>{if(e==r)setTimeout((()=>Ht()));else if(b)postMessage({targetThread:e,cmd:"checkMailbox"});else{var n=dr.pthreads[e];if(!n)return void I(`Cannot send message to thread with ID ${e}, unknown thread ID!`);n.postMessage({cmd:"checkMailbox"})}},_emscripten_receive_on_main_thread_js:(e,r,t,n)=>{Yt.length=t;for(var o=n>>3,a=0;a<t;a++)Yt[a]=l()[o+a];var i=yn[e];q(i.length==t,"Call args mismatch in _emscripten_receive_on_main_thread_js"),dr.currentProxiedOperationCallerThread=r;var s=i.apply(null,Yt);return dr.currentProxiedOperationCallerThread=0,s},_emscripten_thread_mailbox_await:zt,_emscripten_thread_set_strongref:e=>{y&&dr.pthreads[e].ref()},_emval_decref:Ft,_emval_incref:e=>{e>4&&(Ct.get(e).refcount+=1)},_emval_take_value:(e,r)=>{var t=(e=Mt(e,"_emval_take_value")).readValueFromPointer(r);return Dt.toHandle(t)},_localtime_js:function(e,r,t){var n=Xt(e,r),o=new Date(1e3*n);i()[t>>2]=o.getSeconds(),Me(o.getSeconds()),i()[t+4>>2]=o.getMinutes(),Me(o.getMinutes()),i()[t+8>>2]=o.getHours(),Me(o.getHours()),i()[t+12>>2]=o.getDate(),Me(o.getDate()),i()[t+16>>2]=o.getMonth(),Me(o.getMonth()),i()[t+20>>2]=o.getFullYear()-1900,Me(o.getFullYear()-1900),i()[t+24>>2]=o.getDay(),Me(o.getDay());var a=0|(e=>(Vt(e.getFullYear())?qt:Kt)[e.getMonth()]+e.getDate()-1)(o);i()[t+28>>2]=a,Me(a),i()[t+36>>2]=-60*o.getTimezoneOffset(),Me(-60*o.getTimezoneOffset());var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=s.getTimezoneOffset(),u=0|(l!=c&&o.getTimezoneOffset()==Math.min(c,l));i()[t+32>>2]=u,Me(u)},_mmap_js:Jt,_munmap_js:Zt,_tzset_js:(e,r,t)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),l=o.getTimezoneOffset(),c=a.getTimezoneOffset(),u=Math.max(l,c);function d(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}s()[e>>2]=60*u,Me(60*u),i()[r>>2]=Number(l!=c),Me(Number(l!=c));var f=d(o),h=d(a),p=en(f),m=en(h);c<l?(s()[t>>2]=p,Me(p),s()[t+4>>2]=m,Me(m)):(s()[t>>2]=m,Me(m),s()[t+4>>2]=p,Me(p))},abort:()=>{pe("native code called abort()")},emscripten_check_blocking_allowed:()=>{y||v||_r("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},emscripten_date_now:()=>Date.now(),emscripten_exit_with_live_runtime:()=>{throw ne+=1,"unwind"},emscripten_get_now:Qt,emscripten_resize_heap:e=>{var r=n().length;if((e>>>=0)<=r)return!1;var t=2147483648;if(e>t)return I(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var o,a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(t,(o=Math.max(e,i))+(65536-o%65536)%65536),l=Qt(),c=rn(s);if(Ie(`Heap resize call from ${r} to ${s} took ${Qt()-l} msecs. Success: ${!!c}`),c)return!0}return I(`Failed to grow the heap from ${r} bytes to ${s} bytes, not enough memory!`),!1},environ_get:on,environ_sizes_get:an,exit:lr,fd_close:sn,fd_read:ln,fd_seek:cn,fd_write:un,invoke_dii:function(e,r,t){var n=Ln();try{return yr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;In(1,0)}},invoke_diii:function(e,r,t,n){var o=Ln();try{return yr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;In(1,0)}},invoke_fi:function(e,r){var t=Ln();try{return yr(e)(r)}catch(e){if(Wn(t),!(e instanceof Ee))throw e;In(1,0)}},invoke_fii:function(e,r,t){var n=Ln();try{return yr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;In(1,0)}},invoke_fiii:function(e,r,t,n){var o=Ln();try{return yr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;In(1,0)}},invoke_i:function(e){var r=Ln();try{return yr(e)()}catch(e){if(Wn(r),!(e instanceof Ee))throw e;In(1,0)}},invoke_idi:function(e,r,t){var n=Ln();try{return yr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;In(1,0)}},invoke_ii:function(e,r){var t=Ln();try{return yr(e)(r)}catch(e){if(Wn(t),!(e instanceof Ee))throw e;In(1,0)}},invoke_iid:function(e,r,t){var n=Ln();try{return yr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;In(1,0)}},invoke_iii:function(e,r,t){var n=Ln();try{return yr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiid:function(e,r,t,n){var o=Ln();try{return yr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiii:function(e,r,t,n){var o=Ln();try{return yr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiii:function(e,r,t,n,o){var a=Ln();try{return yr(e)(r,t,n,o)}catch(e){if(Wn(a),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiiid:function(e,r,t,n,o,a){var i=Ln();try{return yr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiiii:function(e,r,t,n,o,a){var i=Ln();try{return yr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiiiii:function(e,r,t,n,o,a,i){var s=Ln();try{return yr(e)(r,t,n,o,a,i)}catch(e){if(Wn(s),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiiiiii:function(e,r,t,n,o,a,i,s){var l=Ln();try{return yr(e)(r,t,n,o,a,i,s)}catch(e){if(Wn(l),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiiiiiii:function(e,r,t,n,o,a,i,s,l){var c=Ln();try{return yr(e)(r,t,n,o,a,i,s,l)}catch(e){if(Wn(c),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u){var d=Ln();try{return yr(e)(r,t,n,o,a,i,s,l,c,u)}catch(e){if(Wn(d),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d){var f=Ln();try{return yr(e)(r,t,n,o,a,i,s,l,c,u,d)}catch(e){if(Wn(f),!(e instanceof Ee))throw e;In(1,0)}},invoke_iiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f){var h=Ln();try{return yr(e)(r,t,n,o,a,i,s,l,c,u,d,f)}catch(e){if(Wn(h),!(e instanceof Ee))throw e;In(1,0)}},invoke_jiiii:function(e,r,t,n,o){var a=Ln();try{return Kn(e,r,t,n,o)}catch(e){if(Wn(a),!(e instanceof Ee))throw e;In(1,0)}},invoke_v:function(e){var r=Ln();try{yr(e)()}catch(e){if(Wn(r),!(e instanceof Ee))throw e;In(1,0)}},invoke_vi:function(e,r){var t=Ln();try{yr(e)(r)}catch(e){if(Wn(t),!(e instanceof Ee))throw e;In(1,0)}},invoke_vid:function(e,r,t){var n=Ln();try{yr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;In(1,0)}},invoke_vidddddd:function(e,r,t,n,o,a,i,s){var l=Ln();try{yr(e)(r,t,n,o,a,i,s)}catch(e){if(Wn(l),!(e instanceof Ee))throw e;In(1,0)}},invoke_vidi:function(e,r,t,n){var o=Ln();try{yr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;In(1,0)}},invoke_vii:function(e,r,t){var n=Ln();try{yr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;In(1,0)}},invoke_viif:function(e,r,t,n){var o=Ln();try{yr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;In(1,0)}},invoke_viii:function(e,r,t,n){var o=Ln();try{yr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiii:function(e,r,t,n,o){var a=Ln();try{yr(e)(r,t,n,o)}catch(e){if(Wn(a),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiidi:function(e,r,t,n,o,a,i){var s=Ln();try{yr(e)(r,t,n,o,a,i)}catch(e){if(Wn(s),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiif:function(e,r,t,n,o,a){var i=Ln();try{yr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiii:function(e,r,t,n,o,a){var i=Ln();try{yr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiiii:function(e,r,t,n,o,a,i){var s=Ln();try{yr(e)(r,t,n,o,a,i)}catch(e){if(Wn(s),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiiiii:function(e,r,t,n,o,a,i,s){var l=Ln();try{yr(e)(r,t,n,o,a,i,s)}catch(e){if(Wn(l),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiiiiii:function(e,r,t,n,o,a,i,s,l){var c=Ln();try{yr(e)(r,t,n,o,a,i,s,l)}catch(e){if(Wn(c),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiiiiiii:function(e,r,t,n,o,a,i,s,l,c){var u=Ln();try{yr(e)(r,t,n,o,a,i,s,l,c)}catch(e){if(Wn(u),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u){var d=Ln();try{yr(e)(r,t,n,o,a,i,s,l,c,u)}catch(e){if(Wn(d),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f,h){var p=Ln();try{yr(e)(r,t,n,o,a,i,s,l,c,u,d,f,h)}catch(e){if(Wn(p),!(e instanceof Ee))throw e;In(1,0)}},invoke_viiiiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f,h,p,m){var v=Ln();try{yr(e)(r,t,n,o,a,i,s,l,c,u,d,f,h,p,m)}catch(e){if(Wn(v),!(e instanceof Ee))throw e;In(1,0)}},llvm_eh_typeid_for:e=>e,memory:N||d.wasmMemory,strftime_l:(e,r,n,o,a)=>((e,r,n,o)=>{var a=s()[o+40>>2],l={tm_sec:i()[o>>2],tm_min:i()[o+4>>2],tm_hour:i()[o+8>>2],tm_mday:i()[o+12>>2],tm_mon:i()[o+16>>2],tm_year:i()[o+20>>2],tm_wday:i()[o+24>>2],tm_yday:i()[o+28>>2],tm_isdst:i()[o+32>>2],tm_gmtoff:i()[o+36>>2],tm_zone:a?nr(a):""},c=nr(n),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var d in u)c=c.replace(new RegExp(d,"g"),u[d]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function p(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function m(e,r){return p(e,r,"0")}function v(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function y(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=Vt(t.getFullYear()),o=t.getMonth(),a=(n?dn:fn)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=y(t),a=y(n);return v(o,r)<=0?v(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var _={"%a":e=>f[e.tm_wday].substring(0,3),"%A":e=>f[e.tm_wday],"%b":e=>h[e.tm_mon].substring(0,3),"%B":e=>h[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>p(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":e=>m(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(Vt(e.tm_year+1900)?dn:fn,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return m(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&Vt(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Vt(e.tm_year%400-1))&&r++}return m(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var d in c=c.replace(/%%/g,"\0\0"),_)c.includes(d)&&(c=c.replace(new RegExp(d,"g"),_[d](l)));var w,E,b=Ye(c=c.replace(/\0\0/g,"%"),!1);return b.length>r?0:(E=e,q((w=b).length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),t().set(w,E),b.length-1)})(e,r,n,o)},_n=function(){var e={env:gn,wasi_snapshot_preview1:gn};function r(e,r){var t,n;return _n=e.exports,n=_n._emscripten_tls_init,dr.tlsInitFunctions.push(n),q(mr=_n.__indirect_function_table,"table not found in wasm exports"),t=_n.__wasm_call_ctors,ee.unshift(t),R=r,he("wasm-instantiate"),_n}fe("wasm-instantiate");var t,n,o,a,i=d;if(d.instantiateWasm)try{return d.instantiateWasm(e,r)}catch(e){I(`Module.instantiateWasm callback failed with error: ${e}`),u(e)}return(t=M,n=me,o=e,a=function(e){q(d===i,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),i=null,r(e.instance,e.module)},t||"function"!=typeof WebAssembly.instantiateStreaming||ge(n)||_e(n)||y||"function"!=typeof fetch?ke(n,o,a):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return I(`wasm streaming compile failed: ${e}`),I("falling back to ArrayBuffer instantiation"),ke(n,o,a)}))))).catch(u),{}}(),wn=(we("__wasm_call_ctors"),we("__cxa_free_exception"),we("malloc")),En=we("__errno_location"),bn=d._free=we("free"),Tn=d._fflush=we("fflush"),kn=(d.__emscripten_tls_init=we("_emscripten_tls_init"),d._pthread_self=()=>(kn=d._pthread_self=_n.pthread_self)()),Sn=we("emscripten_builtin_memalign"),Pn=we("__getTypeName"),An=(d.__embind_initialize_bindings=we("_embind_initialize_bindings"),d.__emscripten_thread_init=we("_emscripten_thread_init")),Cn=(d.__emscripten_thread_crashed=we("_emscripten_thread_crashed"),we("emscripten_main_thread_process_queued_calls"),we("emscripten_main_runtime_thread_id"),()=>(Cn=_n.emscripten_stack_get_base)()),Fn=()=>(Fn=_n.emscripten_stack_get_end)(),Dn=we("_emscripten_run_on_main_thread_js"),On=we("_emscripten_thread_free_data"),Mn=d.__emscripten_thread_exit=we("_emscripten_thread_exit"),$n=d.__emscripten_check_mailbox=we("_emscripten_check_mailbox"),In=we("setThrew"),Nn=we("setTempRet0"),Rn=()=>(Rn=_n.emscripten_stack_init)(),xn=(e,r)=>(xn=_n.emscripten_stack_set_limits)(e,r),Ln=we("stackSave"),Wn=we("stackRestore"),jn=we("stackAlloc"),Un=()=>(Un=_n.emscripten_stack_get_current)(),Bn=we("__cxa_decrement_exception_refcount"),zn=we("__cxa_increment_exception_refcount"),Hn=we("__cxa_demangle"),Gn=d.___get_exception_message=we("__get_exception_message"),Yn=we("__cxa_can_catch"),Vn=we("__cxa_is_pointer_type"),qn=d.___set_stack_limits=we("__set_stack_limits"),Kn=(d.dynCall_jii=we("dynCall_jii"),d.dynCall_viij=we("dynCall_viij"),d.dynCall_jiji=we("dynCall_jiji"),d.dynCall_viijii=we("dynCall_viijii"),d.dynCall_jiiii=we("dynCall_jiiii"));function Xn(){if(!(se>0)){if(b||(q(!b),Rn(),J()),b)return c(d),ae(),void startWorker(d);!function(){if(q(!b),d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)ie(d.preRun.shift());fr(Q)}(),se>0||(d.setStatus?(d.setStatus("Running..."),setTimeout((function(){setTimeout((function(){d.setStatus("")}),1),e()}),1)):e(),Z())}function e(){vn||(vn=!0,d.calledRun=!0,V||(ae(),c(d),d.onRuntimeInitialized&&d.onRuntimeInitialized(),q(!d._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(Z(),!b){if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),re.unshift(e);var e;fr(re)}}()))}}if(d.dynCall_iiiiij=we("dynCall_iiiiij"),d.dynCall_iiiiijj=we("dynCall_iiiiijj"),d.dynCall_iiiiiijj=we("dynCall_iiiiiijj"),d.addRunDependency=fe,d.removeRunDependency=he,d.FS_createPath=ar.createPath,d.FS_createLazyFile=ar.createLazyFile,d.FS_createDevice=ar.createDevice,d.keepRuntimeAlive=oe,d.wasmMemory=N,d.ExitStatus=Ne,d.FS_createPreloadedFile=ar.createPreloadedFile,d.FS=ar,d.FS_createDataFile=ar.createDataFile,d.FS_unlink=ar.unlink,d.PThread=dr,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePop","safeSetTimeout","asmjsMangle","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","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","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","emscripten_webgl_destroy_context_before_on_calling_thread","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","registerInheritedInstance","unregisterInheritedInstance","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var r="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",t=e;t.startsWith("_")||(t="$"+e),r+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='"+t+"')",Pe(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),_r(r)}}),Ce(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","GROWABLE_HEAP_I8","GROWABLE_HEAP_U8","GROWABLE_HEAP_I16","GROWABLE_HEAP_U16","GROWABLE_HEAP_I32","GROWABLE_HEAP_U32","GROWABLE_HEAP_F32","GROWABLE_HEAP_F64","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","setStackLimits","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","getExecutableName","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","handleAllocatorInit","HandleAllocator","wasmTable","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","jsStackTrace","stackTrace","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","incrementExceptionRefcount","decrementExceptionRefcount","getExceptionMessage","Browser","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","terminateWorker","killThread","cleanupThread","registerTLSInit","cancelThread","spawnThread","exitOnMainThread","proxyToMainThread","proxiedJSCallArgs","invokeEntryPoint","checkMailbox","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","UnboundTypeError","PureVirtualError","GenericWireTypeSize","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","readPointer","runDestructors","newFunc","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","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handles","emval_symbols","init_emval","count_emval_handles","Emval","emval_newers","emval_methodCallers","emval_registeredMethods","IDBFS"].forEach(Ce),ce=function e(){vn||Xn(),vn||(ce=e)},d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();return Xn(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=createCCP4Module:"function"==typeof define&&define.amd&&define([],(()=>createCCP4Module));
|