mjswan 0.2.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ var Gn=Object.freeze({__proto__:null}),rc=(async function(Sr={}){var Tr,v=Sr,Ke=typeof window=="object",Z=typeof WorkerGlobalScope<"u",V=typeof process=="object"&&process.versions?.node&&process.type!="renderer",ct=!Ke&&!V&&!Z,A=Z&&self.name?.startsWith("em-pthread");if(A&&(p(!globalThis.moduleLoaded,"module should only be loaded once on each pthread worker"),globalThis.moduleLoaded=!0),V){const{createRequire:e}=await Promise.resolve().then(function(){return Gn});var ve=e(import.meta.url),qe=ve("worker_threads");global.Worker=qe.Worker,Z=!qe.isMainThread,A=Z&&qe.workerData=="em-pthread"}var Fr="./this.program",Pr=(e,r)=>{throw r},Ar=import.meta.url,Xe="";function Kn(e){return v.locateFile?v.locateFile(e,Xe):Xe+e}var Je,Re;if(V){if(!(typeof process=="object"&&process.versions?.node&&process.type!="renderer"))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 lt=process.versions.node,Oe=lt.split(".").slice(0,3);if(Oe=Oe[0]*1e4+Oe[1]*100+Oe[2].split("-")[0]*1,Oe<160400)throw new Error("This emscripten-generated code requires node v16.04.4.0 (detected v"+lt+")");var Ie=ve("fs");Ar.startsWith("file:")&&(Xe=ve("path").dirname(ve("url").fileURLToPath(Ar))+"/"),Re=r=>{r=Ne(r)?new URL(r):r;var t=Ie.readFileSync(r);return p(Buffer.isBuffer(t)),t},Je=async(r,t=!0)=>{r=Ne(r)?new URL(r):r;var n=Ie.readFileSync(r,t?void 0:"utf8");return p(t?Buffer.isBuffer(n):typeof n=="string"),n},process.argv.length>1&&(Fr=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),Pr=(r,t)=>{throw process.exitCode=r,t}}else if(ct){if(typeof process=="object"&&process.versions?.node&&process.type!="renderer"||typeof window=="object"||typeof WorkerGlobalScope<"u")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?)")}else if(Ke||Z){try{Xe=new URL(".",Ar).href}catch{}if(!(typeof window=="object"||typeof WorkerGlobalScope<"u"))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?)");V||(Z&&(Re=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),Je=async e=>{if(Ne(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{if(i.status==200||i.status==0&&i.response){t(i.response);return}n(i.status)},i.onerror=n,i.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)})}else throw new Error("environment detection error");var ut=console.log.bind(console),dt=console.error.bind(console);if(V){var qn=ve("util"),ft=e=>typeof e=="object"?qn.inspect(e):e;ut=(...e)=>Ie.writeSync(1,e.map(ft).join(" ")+`
2
+ `),dt=(...e)=>Ie.writeSync(2,e.map(ft).join(" ")+`
3
+ `)}var ue=ut,C=dt;p(Ke||Z||V,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"),p(!ct,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var Me;typeof WebAssembly!="object"&&C("no native wasm support detected");var Cr,ke=!1,Se;function p(e,r){e||z("Assertion failed"+(r?": "+r:""))}var Ne=e=>e.startsWith("file://");function vt(){var e=tt();p((e&3)==0),e==0&&(e+=4),(d(),T)[e>>2]=34821223,(d(),T)[e+4>>2]=2310721022,(d(),T)[0]=1668509029}function xe(){if(!ke){var e=tt();e==0&&(e+=4);var r=(d(),T)[e>>2],t=(d(),T)[e+4>>2];(r!=34821223||t!=2310721022)&&z(`Stack overflow! Stack cookie has been overwritten at ${he(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${he(t)} ${he(r)}`),(d(),T)[0]!=1668509029&&z("Runtime error: The application has corrupted its heap memory area (address zero)!")}}class b extends Error{}class Xn extends b{}class $r extends b{constructor(r){super(r),this.excPtr=r;const t=Pn(r);this.name=t[0],this.message=t[1]}}(()=>{var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,r[0]!==115||r[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})();function Ze(e){Object.getOwnPropertyDescriptor(v,e)||Object.defineProperty(v,e,{configurable:!0,set(){z(`Attempt to set \`Module.${e}\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`)}})}function M(e){return()=>p(!1,`call to '${e}' via reference taken before Wasm module initialization`)}function Jn(e){Object.getOwnPropertyDescriptor(v,e)&&z(`\`Module.${e}\` was supplied but \`${e}\` not included in INCOMING_MODULE_JS_API`)}function _t(e){return e==="FS_createPath"||e==="FS_createDataFile"||e==="FS_createPreloadedFile"||e==="FS_unlink"||e==="addRunDependency"||e==="FS_createLazyFile"||e==="FS_createDevice"||e==="removeRunDependency"}function pt(e,r){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,e)&&Object.defineProperty(globalThis,e,{configurable:!0,get(){r()}})}function ht(e,r){pt(e,()=>{ae(`\`${e}\` is not longer defined by emscripten. ${r}`)})}ht("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),ht("asm","Please use wasmExports instead");function Zn(e){pt(e,()=>{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}')`,_t(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),ae(r)}),mt(e)}function mt(e){A||Object.getOwnPropertyDescriptor(v,e)||Object.defineProperty(v,e,{configurable:!0,get(){var r=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;_t(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),z(r)}})}function d(){Q.buffer!=j.buffer&&Qe()}var Dr,Rr,gt;if(V&&A){var yt=qe.parentPort;yt.on("message",e=>global.onmessage?.({data:e})),Object.assign(globalThis,{self:global,postMessage:e=>yt.postMessage(e)})}var Qn=0;if(A){let e=function(r){try{var t=r.data,n=t.cmd;if(n==="load"){Qn=t.workerID;let i=[];self.onmessage=a=>i.push(a),self.startWorker=a=>{postMessage({cmd:"loaded"});for(let s of i)e(s);self.onmessage=e};for(const a of t.handlers)(!v[a]||v[a].proxy)&&(v[a]=(...s)=>{postMessage({cmd:"callHandler",handler:a,args:s})},a=="print"&&(ue=v[a]),a=="printErr"&&(C=v[a]));Q=t.wasmMemory,Qe(),gt(t.wasmModule)}else if(n==="run"){p(t.pthread_ptr),fi(t.pthread_ptr),rt(t.pthread_ptr,0,0,1,0,0),$.threadInitTLS(),Yr(t.pthread_ptr),Or||(Cn(),Or=!0);try{vi(t.start_routine,t.arg)}catch(i){if(i!="unwind")throw i}}else t.target==="setimmediate"||(n==="checkMailbox"?Or&&yr():n&&(C(`worker: received unknown command ${n}`),C(t)))}catch(i){throw C(`worker: onmessage() captured an uncaught exception: ${i}`),i?.stack&&C(i.stack),$n(),i}};var Or=!1;self.onunhandledrejection=r=>{throw r.reason||r},self.onmessage=e}var Q,j,q,de,ie,S,T,wt,Le,Y,Et,Ue=!1;function Qe(){var e=Q.buffer;j=new Int8Array(e),de=new Int16Array(e),q=new Uint8Array(e),ie=new Uint16Array(e),S=new Int32Array(e),T=new Uint32Array(e),wt=new Float32Array(e),Le=new Float64Array(e),Y=new BigInt64Array(e),Et=new BigUint64Array(e)}function ei(){if(!A){if(v.wasmMemory)Q=v.wasmMemory;else{var e=v.INITIAL_MEMORY||16777216;p(e>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+e+"! (STACK_SIZE=65536)"),Q=new WebAssembly.Memory({initial:e/65536,maximum:32768,shared:!0})}Qe()}}p(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support");function ri(){if(p(!A),v.preRun)for(typeof v.preRun=="function"&&(v.preRun=[v.preRun]);v.preRun.length;)Ct(v.preRun.shift());Ze("preRun"),Pt(At)}function bt(){if(p(!Ue),Ue=!0,A)return startWorker(v);xe(),!v.noFSInit&&!o.initialized&&o.init(),Ee.__wasm_call_ctors(),o.ignorePermissions=!1}function ti(){if(xe(),!A){if(v.postRun)for(typeof v.postRun=="function"&&(v.postRun=[v.postRun]);v.postRun.length;)di(v.postRun.shift());Ze("postRun"),Pt(Dt)}}var _e=0,We=null,Te={},pe=null;function er(e){_e++,v.monitorRunDependencies?.(_e),e?(p(!Te[e]),Te[e]=1,pe===null&&typeof setInterval<"u"&&(pe=setInterval(()=>{if(ke){clearInterval(pe),pe=null;return}var r=!1;for(var t in Te)r||(r=!0,C("still waiting on run dependencies:")),C(`dependency: ${t}`);r&&C("(end of list)")},1e4))):C("warning: run dependency added without ID")}function Be(e){if(_e--,v.monitorRunDependencies?.(_e),e?(p(Te[e]),delete Te[e]):C("warning: run dependency removed without ID"),_e==0&&(pe!==null&&(clearInterval(pe),pe=null),We)){var r=We;We=null,r()}}function z(e){v.onAbort?.(e),e="Aborted("+e+")",C(e),ke=!0;var r=new WebAssembly.RuntimeError(e);throw Rr?.(r),r}function U(e,r){return(...t)=>{p(Ue,`native function \`${e}\` called before runtime initialization`);var n=Ee[e];return p(n,`exported native function \`${e}\` not found`),p(t.length<=r,`native function \`${e}\` called with ${t.length} args but expects ${r}`),n(...t)}}var je;function ni(){return v.locateFile?Kn("mujoco.wasm"):new URL("/assets/mujoco-BrqJA_5D.wasm",import.meta.url).href}function ii(e){if(e==je&&Me)return new Uint8Array(Me);if(Re)return Re(e);throw"both async and sync fetching of the wasm failed"}async function ai(e){if(!Me)try{var r=await Je(e);return new Uint8Array(r)}catch{}return ii(e)}async function oi(e,r){try{var t=await ai(e),n=await WebAssembly.instantiate(t,r);return n}catch(i){C(`failed to asynchronously prepare wasm: ${i}`),Ne(je)&&C(`warning: Loading from a file URI (${je}) 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`),z(i)}}async function si(e,r,t){if(!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Ne(r)&&!V)try{var n=fetch(r,{credentials:"same-origin"}),i=await WebAssembly.instantiateStreaming(n,t);return i}catch(a){C(`wasm streaming compile failed: ${a}`),C("falling back to ArrayBuffer instantiation")}return oi(r,t)}function kt(){return jo(),{env:ot,wasi_snapshot_preview1:ot}}async function ci(){function e(s,c){return Ee=s.exports,_i(Ee._emscripten_tls_init),tr=Ee.__indirect_function_table,p(tr,"table not found in wasm exports"),Cr=c,Bo(Ee),Be("wasm-instantiate"),Ee}er("wasm-instantiate");var r=v;function t(s){return p(v===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,e(s.instance,s.module)}var n=kt();if(v.instantiateWasm)return new Promise((s,c)=>{try{v.instantiateWasm(n,(l,u)=>{s(e(l,u))})}catch(l){C(`Module.instantiateWasm callback failed with error: ${l}`),c(l)}});if(A)return new Promise(s=>{gt=c=>{var l=new WebAssembly.Instance(c,kt());s(e(l,c))}});je??=ni();var i=await si(Me,je,n),a=t(i);return a}class St{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var Tt=e=>{e.terminate(),e.onmessage=r=>{var t=r.data.cmd;C(`received "${t}" command from terminated worker: ${e.workerID}`)}},Ft=e=>{p(!A,"Internal Error! cleanupThread() can only ever be called from main application thread!"),p(e,"Internal Error! Null pthread_ptr in cleanupThread!");var r=$.pthreads[e];p(r),$.returnWorkerToPool(r)},Pt=e=>{for(;e.length>0;)e.shift()(v)},At=[],Ct=e=>At.push(e),li=e=>{p(!A,"Internal Error! spawnThread() can only ever be called from main application thread!"),p(e.pthread_ptr,"Internal error, no pthread ptr!");var r=$.getNewWorker();if(!r)return 6;p(!r.pthread_ptr,"Internal error!"),$.runningWorkers.push(r),$.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};return V&&r.unref(),r.postMessage(t,e.transferList),0},ze=0,rr=()=>nr||ze>0,w=()=>it(),y=e=>Un(e),He=e=>Wn(e),G=(e,r,t,...n)=>{for(var i=n.length*2,a=w(),s=He(i*8),c=s>>3,l=0;l<n.length;l++){var u=n[l];typeof u=="bigint"?((d(),Y)[c+2*l]=1n,(d(),Y)[c+2*l+1]=u):((d(),Y)[c+2*l]=0n,(d(),Le)[c+2*l+1]=u)}var f=Dn(e,r,i,s,t);return y(a),f};function Ir(e){if(A)return G(0,0,1,e);Se=e,rr()||($.terminateAllThreads(),v.onExit?.(e),ke=!0),Pr(e,new St(e))}function $t(e){if(A)return G(1,0,0,e);Mr(e)}var ui=(e,r)=>{if(Se=e,Qs(),A)throw p(!r),$t(e),"unwind";if(rr()&&!r){var t=`program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${ze}) 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)`;Rr?.(t),C(t)}Ir(e)},Mr=ui,he=e=>(p(typeof e=="number"),e>>>=0,"0x"+e.toString(16).padStart(8,"0")),$={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},nextWorkerID:1,init(){A||$.initMainThread()},initMainThread(){Ct(()=>{er("loading-workers"),$.loadWasmModuleToAllWorkers(()=>Be("loading-workers"))})},terminateAllThreads:()=>{p(!A,"Internal Error! terminateAllThreads() can only ever be called from main application thread!");for(var e of $.runningWorkers)Tt(e);for(var e of $.unusedWorkers)Tt(e);$.unusedWorkers=[],$.runningWorkers=[],$.pthreads={}},returnWorkerToPool:e=>{var r=e.pthread_ptr;delete $.pthreads[r],$.unusedWorkers.push(e),$.runningWorkers.splice($.runningWorkers.indexOf(e),1),e.pthread_ptr=0,Rn(r)},threadInitTLS(){$.tlsInitFunctions.forEach(e=>e())},loadWasmModuleToWorker:e=>new Promise(r=>{e.onmessage=a=>{var s=a.data,c=s.cmd;if(s.targetThread&&s.targetThread!=Zr()){var l=$.pthreads[s.targetThread];l?l.postMessage(s,s.transferList):C(`Internal error! Worker sent a message "${c}" to target pthread ${s.targetThread}, but that thread no longer exists!`);return}c==="checkMailbox"?yr():c==="spawnThread"?li(s):c==="cleanupThread"?Ft(s.thread):c==="loaded"?(e.loaded=!0,r(e)):s.target==="setimmediate"?e.postMessage(s):c==="callHandler"?v[s.handler](...s.args):c&&C(`worker sent an unknown command ${c}`)},e.onerror=a=>{var s="worker sent an error!";throw e.pthread_ptr&&(s=`Pthread ${he(e.pthread_ptr)} sent an error!`),C(`${s} ${a.filename}:${a.lineno}: ${a.message}`),a},V&&(e.on("message",a=>e.onmessage({data:a})),e.on("error",a=>e.onerror(a))),p(Q instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!"),p(Cr instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");var t=[],n=["onExit","onAbort","print","printErr"];for(var i of n)v.propertyIsEnumerable(i)&&t.push(i);e.postMessage({cmd:"load",handlers:t,wasmMemory:Q,wasmModule:Cr,workerID:e.workerID})}),loadWasmModuleToAllWorkers(e){e()},allocateUnusedWorker(){var e;if(v.mainScriptUrlOrBlob){var r=v.mainScriptUrlOrBlob;typeof r!="string"&&(r=URL.createObjectURL(r)),e=new Worker(r,{type:"module",workerData:"em-pthread",name:"em-pthread-"+$.nextWorkerID})}else e=new Worker(self.location.href,{type:"module",workerData:"em-pthread",name:"em-pthread-"+$.nextWorkerID});e.workerID=$.nextWorkerID++,$.unusedWorkers.push(e)},getNewWorker(){return $.unusedWorkers.length==0&&(V||C("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`."),$.allocateUnusedWorker(),$.loadWasmModuleToWorker($.unusedWorkers[0])),$.unusedWorkers.pop()}},Dt=[],di=e=>Dt.push(e);function fi(e){var r=(d(),T)[e+52>>2],t=(d(),T)[e+56>>2],n=r-t;p(r!=0),p(n!=0),p(r>n,"stackHigh must be higher then stackLow"),Ln(r,n),y(r),vt()}var Rt=[],tr,E=e=>{var r=Rt[e];return r||(Rt[e]=r=tr.get(e)),p(tr.get(e)==r,"JavaScript-side Wasm function table mirror is out of date!"),r},vi=(e,r)=>{ze=0,nr=0;var t=E(e)(r);xe();function n(i){rr()?Se=i:nt(i)}n(t)},nr=!0,_i=e=>$.tlsInitFunctions.push(e),ae=e=>{ae.shown||={},ae.shown[e]||(ae.shown[e]=1,V&&(e="warning: "+e),C(e))},Ot=typeof TextDecoder<"u"?new TextDecoder:void 0,Fe=(e,r=0,t=NaN)=>{for(var n=r+t,i=r;e[i]&&!(i>=n);)++i;if(i-r>16&&e.buffer&&Ot)return Ot.decode(e.buffer instanceof ArrayBuffer?e.subarray(r,i):e.slice(r,i));for(var a="";r<i;){var s=e[r++];if(!(s&128)){a+=String.fromCharCode(s);continue}var c=e[r++]&63;if((s&224)==192){a+=String.fromCharCode((s&31)<<6|c);continue}var l=e[r++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|l:((s&248)!=240&&ae("Invalid UTF-8 leading byte "+he(s)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),s=(s&7)<<18|c<<12|l<<6|e[r++]&63),s<65536)a+=String.fromCharCode(s);else{var u=s-65536;a+=String.fromCharCode(55296|u>>10,56320|u&1023)}}return a},oe=(e,r)=>(p(typeof e=="number",`UTF8ToString expects a number (got ${typeof e})`),e?Fe((d(),q),e,r):""),pi=(e,r,t,n)=>z(`Assertion failed: ${oe(e)}, at: `+[r?oe(r):"unknown filename",t,n?oe(n):"unknown function"]),hi=(e,r)=>E(e)(r),se=[],ir=0,mi=e=>{var r=new ar(e);return r.get_caught()||(r.set_caught(!0),ir--),r.set_rethrown(!1),se.push(r),kr(e),zn(e)},gi=()=>{if(!se.length)return 0;var e=se[se.length-1];return kr(e.excPtr),e.excPtr},ce=0,yi=()=>{k(0,0),p(se.length>0);var e=se.pop();at(e.excPtr),ce=0};class ar{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){(d(),T)[this.ptr+4>>2]=r}get_type(){return(d(),T)[this.ptr+4>>2]}set_destructor(r){(d(),T)[this.ptr+8>>2]=r}get_destructor(){return(d(),T)[this.ptr+8>>2]}set_caught(r){r=r?1:0,(d(),j)[this.ptr+12]=r}get_caught(){return(d(),j)[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,(d(),j)[this.ptr+13]=r}get_rethrown(){return(d(),j)[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){(d(),T)[this.ptr+16>>2]=r}get_adjusted_ptr(){return(d(),T)[this.ptr+16>>2]}}var or=e=>Nn(e),Nr=e=>{var r=ce?.excPtr;if(!r)return or(0),0;var t=new ar(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return or(0),r;for(var i of e){if(i===0||i===n)break;var a=t.ptr+16;if(jn(i,n,a))return or(i),r}return or(n),r},wi=()=>Nr([]),Ei=e=>Nr([e]),bi=(e,r)=>Nr([e,r]),It=()=>{var e=se.pop();e||z("no exception to throw");var r=e.excPtr;throw e.get_rethrown()||(se.push(e),e.set_rethrown(!0),e.set_caught(!1),ir++),ce=new $r(r),ce},ki=e=>{if(e){var r=new ar(e);se.push(r),r.set_rethrown(!0),It()}},Si=(e,r,t)=>{var n=new ar(e);throw n.init(r,t),ce=new $r(e),ir++,ce},Ti=()=>ir,Fi=e=>{throw ce||(ce=new $r(e)),ce},O={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=O.isAbs(e),t=e.slice(-1)==="/";return e=O.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=O.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.slice(0,-1)),t+n)},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>O.normalize(e.join("/")),join2:(e,r)=>O.normalize(e+"/"+r)},Pi=()=>{if(V){var e=ve("crypto");return r=>e.randomFillSync(r)}return r=>r.set(crypto.getRandomValues(new Uint8Array(r.byteLength)))},Mt=e=>{(Mt=Pi())(e)},Pe={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var i=n>=0?e[n]:o.cwd();if(typeof i!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";r=i+"/"+r,t=O.isAbs(i)}return r=O.normalizeArray(r.split("/").filter(a=>!!a),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=Pe.resolve(e).slice(1),r=Pe.resolve(r).slice(1);function t(u){for(var f=0;f<u.length&&u[f]==="";f++);for(var h=u.length-1;h>=0&&u[h]==="";h--);return f>h?[]:u.slice(f,h-f+1)}for(var n=t(e.split("/")),i=t(r.split("/")),a=Math.min(n.length,i.length),s=a,c=0;c<a;c++)if(n[c]!==i[c]){s=c;break}for(var l=[],c=s;c<n.length;c++)l.push("..");return l=l.concat(i.slice(s)),l.join("/")}},xr=[],Ae=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},Nt=(e,r,t,n)=>{if(p(typeof e=="string",`stringToUTF8Array expects a string (got ${typeof e})`),!(n>0))return 0;for(var i=t,a=t+n-1,s=0;s<e.length;++s){var c=e.codePointAt(s);if(c<=127){if(t>=a)break;r[t++]=c}else if(c<=2047){if(t+1>=a)break;r[t++]=192|c>>6,r[t++]=128|c&63}else if(c<=65535){if(t+2>=a)break;r[t++]=224|c>>12,r[t++]=128|c>>6&63,r[t++]=128|c&63}else{if(t+3>=a)break;c>1114111&&ae("Invalid Unicode code point "+he(c)+" 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|c>>18,r[t++]=128|c>>12&63,r[t++]=128|c>>6&63,r[t++]=128|c&63,s++}}return r[t]=0,t-i},Lr=(e,r,t)=>{var n=Ae(e)+1,i=new Array(n),a=Nt(e,i,0,i.length);return i.length=a,i},Ai=()=>{if(!xr.length){var e=null;if(V){var r=256,t=Buffer.alloc(r),n=0,i=process.stdin.fd;try{n=Ie.readSync(i,t,0,r)}catch(a){if(a.toString().includes("EOF"))n=0;else throw a}n>0&&(e=t.slice(0,n).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
4
+ `));if(!e)return null;xr=Lr(e)}return xr.shift()},fe={ttys:[],init(){},shutdown(){},register(e,r){fe.ttys[e]={input:[],output:[],ops:r},o.registerDevice(e,fe.stream_ops)},stream_ops:{open(e){var r=fe.ttys[e.node.rdev];if(!r)throw new o.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,i){if(!e.tty||!e.tty.ops.get_char)throw new o.ErrnoError(60);for(var a=0,s=0;s<n;s++){var c;try{c=e.tty.ops.get_char(e.tty)}catch{throw new o.ErrnoError(29)}if(c===void 0&&a===0)throw new o.ErrnoError(6);if(c==null)break;a++,r[t+s]=c}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,i){if(!e.tty||!e.tty.ops.put_char)throw new o.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch{throw new o.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char(e){return Ai()},put_char(e,r){r===null||r===10?(ue(Fe(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(ue(Fe(e.output)),e.output=[])},ioctl_tcgets(e){return{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){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(C(Fe(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(C(Fe(e.output)),e.output=[])}}},xt=e=>{z("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},P={ops_table:null,mount(e){return P.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(o.isBlkdev(t)||o.isFIFO(t))throw new o.ErrnoError(63);P.ops_table||={dir:{node:{getattr:P.node_ops.getattr,setattr:P.node_ops.setattr,lookup:P.node_ops.lookup,mknod:P.node_ops.mknod,rename:P.node_ops.rename,unlink:P.node_ops.unlink,rmdir:P.node_ops.rmdir,readdir:P.node_ops.readdir,symlink:P.node_ops.symlink},stream:{llseek:P.stream_ops.llseek}},file:{node:{getattr:P.node_ops.getattr,setattr:P.node_ops.setattr},stream:{llseek:P.stream_ops.llseek,read:P.stream_ops.read,write:P.stream_ops.write,mmap:P.stream_ops.mmap,msync:P.stream_ops.msync}},link:{node:{getattr:P.node_ops.getattr,setattr:P.node_ops.setattr,readlink:P.node_ops.readlink},stream:{}},chrdev:{node:{getattr:P.node_ops.getattr,setattr:P.node_ops.setattr},stream:o.chrdev_stream_ops}};var i=o.createNode(e,r,t,n);return o.isDir(i.mode)?(i.node_ops=P.ops_table.dir.node,i.stream_ops=P.ops_table.dir.stream,i.contents={}):o.isFile(i.mode)?(i.node_ops=P.ops_table.file.node,i.stream_ops=P.ops_table.file.stream,i.usedBytes=0,i.contents=null):o.isLink(i.mode)?(i.node_ops=P.ops_table.link.node,i.stream_ops=P.ops_table.link.stream):o.isChrdev(i.mode)&&(i.node_ops=P.ops_table.chrdev.node,i.stream_ops=P.ops_table.chrdev.stream),i.atime=i.mtime=i.ctime=Date.now(),e&&(e.contents[r]=i,e.atime=e.mtime=e.ctime=i.atime),i},getFileDataAsTypedArray(e){return 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)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var i=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)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=o.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,o.isDir(e.mode)?r.size=4096:o.isFile(e.mode)?r.size=e.usedBytes:o.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])r[t]!=null&&(e[t]=r[t]);r.size!==void 0&&P.resizeFileStorage(e,r.size)},lookup(e,r){throw new o.ErrnoError(44)},mknod(e,r,t,n){return P.createNode(e,r,t,n)},rename(e,r,t){var n;try{n=o.lookupNode(r,t)}catch{}if(n){if(o.isDir(e.mode))for(var i in n.contents)throw new o.ErrnoError(55);o.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=o.lookupNode(e,r);for(var n in t.contents)throw new o.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,r,t){var n=P.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!o.isLink(e.mode))throw new o.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-i,n);if(p(s>=0),s>8&&a.subarray)r.set(a.subarray(i,i+s),t);else for(var c=0;c<s;c++)r[t+c]=a[i+c];return s},write(e,r,t,n,i,a){if(p(!(r instanceof ArrayBuffer)),r.buffer===(d(),j).buffer&&(a=!1),!n)return 0;var s=e.node;if(s.mtime=s.ctime=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(a)return p(i===0,"canOwn must imply no weird position inside the file"),s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&i===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(i+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),i),n}if(P.expandFileStorage(s,i+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),i);else for(var c=0;c<n;c++)s.contents[i+c]=r[t+c];return s.usedBytes=Math.max(s.usedBytes,i+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&o.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new o.ErrnoError(28);return n},mmap(e,r,t,n,i){if(!o.isFile(e.node.mode))throw new o.ErrnoError(43);var a,s,c=e.node.contents;if(!(i&2)&&c&&c.buffer===(d(),j).buffer)s=!1,a=c.byteOffset;else{if(s=!0,a=xt(),!a)throw new o.ErrnoError(48);c&&((t>0||t+r<c.length)&&(c.subarray?c=c.subarray(t,t+r):c=Array.prototype.slice.call(c,t,t+r)),(d(),j).set(c,a))}return{ptr:a,allocated:s}},msync(e,r,t,n,i){return P.stream_ops.write(e,r,0,n,t,!1),0}}},Ci=async e=>{var r=await Je(e);return p(r,`Loading data file "${e}" failed (no arrayBuffer).`),new Uint8Array(r)},Lt=(...e)=>o.createDataFile(...e),$i=e=>{for(var r=e;;){if(!Te[e])return e;e=r+Math.random()}},Ut=[],Di=(e,r,t,n)=>{typeof Browser<"u"&&Browser.init();var i=!1;return Ut.forEach(a=>{i||a.canHandle(r)&&(a.handle(e,r,t,n),i=!0)}),i},Wt=(e,r,t,n,i,a,s,c,l,u)=>{var f=r?Pe.resolve(O.join2(e,r)):e,h=$i(`cp ${f}`);function m(_){function g(F){u?.(),c||Lt(e,r,F,n,i,l),a?.(),Be(h)}Di(_,f,g,()=>{s?.(),Be(h)})||g(_)}er(h),typeof t=="string"?Ci(t).then(m,s):m(t)},Ri=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},Ur=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Oi=e=>oe(In(e)),Bt={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},o={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class extends Error{name="ErrnoError";constructor(e){super(Ue?Oi(e):""),this.errno=e;for(var r in Bt)if(Bt[r]===e){this.code=r;break}}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=o.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return o.isDir(this.mode)}get isDevice(){return o.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new o.ErrnoError(44);r.follow_mount??=!0,O.isAbs(e)||(e=o.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter(u=>!!u),i=o.root,a="/",s=0;s<n.length;s++){var c=s===n.length-1;if(c&&r.parent)break;if(n[s]!=="."){if(n[s]===".."){if(a=O.dirname(a),o.isRoot(i)){e=a+"/"+n.slice(s+1).join("/");continue e}else i=i.parent;continue}a=O.join2(a,n[s]);try{i=o.lookupNode(i,n[s])}catch(u){if(u?.errno===44&&c&&r.noent_okay)return{path:a};throw u}if(o.isMountpoint(i)&&(!c||r.follow_mount)&&(i=i.mounted.root),o.isLink(i.mode)&&(!c||r.follow)){if(!i.node_ops.readlink)throw new o.ErrnoError(52);var l=i.node_ops.readlink(i);O.isAbs(l)||(l=O.dirname(a)+"/"+l),e=l+"/"+n.slice(s+1).join("/");continue e}}}return{path:a,node:i}}throw new o.ErrnoError(32)},getPath(e){for(var r;;){if(o.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)%o.nameTable.length},hashAddNode(e){var r=o.hashName(e.parent.id,e.name);e.name_next=o.nameTable[r],o.nameTable[r]=e},hashRemoveNode(e){var r=o.hashName(e.parent.id,e.name);if(o.nameTable[r]===e)o.nameTable[r]=e.name_next;else for(var t=o.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=o.mayLookup(e);if(t)throw new o.ErrnoError(t);for(var n=o.hashName(e.id,r),i=o.nameTable[n];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===r)return i}return o.lookup(e,r)},createNode(e,r,t,n){p(typeof e=="object");var i=new o.FSNode(e,r,t,n);return o.hashAddNode(i),i},destroyNode(e){o.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return o.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!o.isDir(e.mode))return 54;var r=o.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!o.isDir(e.mode))return 54;try{var t=o.lookupNode(e,r);return 20}catch{}return o.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=o.lookupNode(e,r)}catch(a){return a.errno}var i=o.nodePermissions(e,"wx");if(i)return i;if(t){if(!o.isDir(n.mode))return 54;if(o.isRoot(n)||o.getPath(n)===o.cwd())return 10}else if(o.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?o.isLink(e.mode)?32:o.isDir(e.mode)&&(o.flagsToPermissionString(r)!=="r"||r&576)?31:o.nodePermissions(e,o.flagsToPermissionString(r)):44},checkOpExists(e,r){if(!e)throw new o.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=o.MAX_OPEN_FDS;e++)if(!o.streams[e])return e;throw new o.ErrnoError(33)},getStreamChecked(e){var r=o.getStream(e);if(!r)throw new o.ErrnoError(8);return r},getStream:e=>o.streams[e],createStream(e,r=-1){return p(r>=-1),e=Object.assign(new o.FSStream,e),r==-1&&(r=o.nextfd()),e.fd=r,o.streams[r]=e,e},closeStream(e){o.streams[e]=null},dupStream(e,r=-1){var t=o.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,i=n?e:r;n??=r.node_ops.setattr,o.checkOpExists(n,63),n(i,t)},chrdev_stream_ops:{open(e){var r=o.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new o.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){o.devices[e]={stream_ops:r}},getDevice:e=>o.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),o.syncFSRequests++,o.syncFSRequests>1&&C(`warning: ${o.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=o.getMounts(o.root.mount),n=0;function i(s){return p(o.syncFSRequests>0),o.syncFSRequests--,r(s)}function a(s){if(s)return a.errored?void 0:(a.errored=!0,i(s));++n>=t.length&&i(null)}t.forEach(s=>{if(!s.type.syncfs)return a(null);s.type.syncfs(s,e,a)})},mount(e,r,t){if(typeof e=="string")throw e;var n=t==="/",i=!t,a;if(n&&o.root)throw new o.ErrnoError(10);if(!n&&!i){var s=o.lookupPath(t,{follow_mount:!1});if(t=s.path,a=s.node,o.isMountpoint(a))throw new o.ErrnoError(10);if(!o.isDir(a.mode))throw new o.ErrnoError(54)}var c={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(c);return l.mount=c,c.root=l,n?o.root=l:a&&(a.mounted=c,a.mount&&a.mount.mounts.push(c)),l},unmount(e){var r=o.lookupPath(e,{follow_mount:!1});if(!o.isMountpoint(r.node))throw new o.ErrnoError(28);var t=r.node,n=t.mounted,i=o.getMounts(n);Object.keys(o.nameTable).forEach(s=>{for(var c=o.nameTable[s];c;){var l=c.name_next;i.includes(c.mount)&&o.destroyNode(c),c=l}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);p(a!==-1),t.mount.mounts.splice(a,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=o.lookupPath(e,{parent:!0}),i=n.node,a=O.basename(e);if(!a)throw new o.ErrnoError(28);if(a==="."||a==="..")throw new o.ErrnoError(20);var s=o.mayCreate(i,a);if(s)throw new o.ErrnoError(s);if(!i.node_ops.mknod)throw new o.ErrnoError(63);return i.node_ops.mknod(i,a,r,t)},statfs(e){return o.statfsNode(o.lookupPath(e,{follow:!0}).node)},statfsStream(e){return o.statfsNode(e.node)},statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:o.nextInode,ffree:o.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create(e,r=438){return r&=4095,r|=32768,o.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,o.mknod(e,r,0)},mkdirTree(e,r){var t=e.split("/"),n="";for(var i of t)if(i){(n||O.isAbs(e))&&(n+="/"),n+=i;try{o.mkdir(n,r)}catch(a){if(a.errno!=20)throw a}}},mkdev(e,r,t){return typeof t>"u"&&(t=r,r=438),r|=8192,o.mknod(e,r,t)},symlink(e,r){if(!Pe.resolve(e))throw new o.ErrnoError(44);var t=o.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new o.ErrnoError(44);var i=O.basename(r),a=o.mayCreate(n,i);if(a)throw new o.ErrnoError(a);if(!n.node_ops.symlink)throw new o.ErrnoError(63);return n.node_ops.symlink(n,i,e)},rename(e,r){var t=O.dirname(e),n=O.dirname(r),i=O.basename(e),a=O.basename(r),s,c,l;if(s=o.lookupPath(e,{parent:!0}),c=s.node,s=o.lookupPath(r,{parent:!0}),l=s.node,!c||!l)throw new o.ErrnoError(44);if(c.mount!==l.mount)throw new o.ErrnoError(75);var u=o.lookupNode(c,i),f=Pe.relative(e,n);if(f.charAt(0)!==".")throw new o.ErrnoError(28);if(f=Pe.relative(r,t),f.charAt(0)!==".")throw new o.ErrnoError(55);var h;try{h=o.lookupNode(l,a)}catch{}if(u!==h){var m=o.isDir(u.mode),_=o.mayDelete(c,i,m);if(_)throw new o.ErrnoError(_);if(_=h?o.mayDelete(l,a,m):o.mayCreate(l,a),_)throw new o.ErrnoError(_);if(!c.node_ops.rename)throw new o.ErrnoError(63);if(o.isMountpoint(u)||h&&o.isMountpoint(h))throw new o.ErrnoError(10);if(l!==c&&(_=o.nodePermissions(c,"w"),_))throw new o.ErrnoError(_);o.hashRemoveNode(u);try{c.node_ops.rename(u,l,a),u.parent=l}catch(g){throw g}finally{o.hashAddNode(u)}}},rmdir(e){var r=o.lookupPath(e,{parent:!0}),t=r.node,n=O.basename(e),i=o.lookupNode(t,n),a=o.mayDelete(t,n,!0);if(a)throw new o.ErrnoError(a);if(!t.node_ops.rmdir)throw new o.ErrnoError(63);if(o.isMountpoint(i))throw new o.ErrnoError(10);t.node_ops.rmdir(t,n),o.destroyNode(i)},readdir(e){var r=o.lookupPath(e,{follow:!0}),t=r.node,n=o.checkOpExists(t.node_ops.readdir,54);return n(t)},unlink(e){var r=o.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new o.ErrnoError(44);var n=O.basename(e),i=o.lookupNode(t,n),a=o.mayDelete(t,n,!1);if(a)throw new o.ErrnoError(a);if(!t.node_ops.unlink)throw new o.ErrnoError(63);if(o.isMountpoint(i))throw new o.ErrnoError(10);t.node_ops.unlink(t,n),o.destroyNode(i)},readlink(e){var r=o.lookupPath(e),t=r.node;if(!t)throw new o.ErrnoError(44);if(!t.node_ops.readlink)throw new o.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r){var t=o.lookupPath(e,{follow:!r}),n=t.node,i=o.checkOpExists(n.node_ops.getattr,63);return i(n)},fstat(e){var r=o.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,i=n?r:t;return n??=t.node_ops.getattr,o.checkOpExists(n,63),n(i)},lstat(e){return o.stat(e,!0)},doChmod(e,r,t,n){o.doSetAttr(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n;if(typeof e=="string"){var i=o.lookupPath(e,{follow:!t});n=i.node}else n=e;o.doChmod(null,n,r,t)},lchmod(e,r){o.chmod(e,r,!0)},fchmod(e,r){var t=o.getStreamChecked(e);o.doChmod(t,t.node,r,!1)},doChown(e,r,t){o.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var i;if(typeof e=="string"){var a=o.lookupPath(e,{follow:!n});i=a.node}else i=e;o.doChown(null,i,n)},lchown(e,r,t){o.chown(e,r,t,!0)},fchown(e,r,t){var n=o.getStreamChecked(e);o.doChown(n,n.node,!1)},doTruncate(e,r,t){if(o.isDir(r.mode))throw new o.ErrnoError(31);if(!o.isFile(r.mode))throw new o.ErrnoError(28);var n=o.nodePermissions(r,"w");if(n)throw new o.ErrnoError(n);o.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new o.ErrnoError(28);var t;if(typeof e=="string"){var n=o.lookupPath(e,{follow:!0});t=n.node}else t=e;o.doTruncate(null,t,r)},ftruncate(e,r){var t=o.getStreamChecked(e);if(r<0||(t.flags&2097155)===0)throw new o.ErrnoError(28);o.doTruncate(t,t.node,r)},utime(e,r,t){var n=o.lookupPath(e,{follow:!0}),i=n.node,a=o.checkOpExists(i.node_ops.setattr,63);a(i,{atime:r,mtime:t})},open(e,r,t=438){if(e==="")throw new o.ErrnoError(44);r=typeof r=="string"?Ri(r):r,r&64?t=t&4095|32768:t=0;var n,i;if(typeof e=="object")n=e;else{i=e.endsWith("/");var a=o.lookupPath(e,{follow:!(r&131072),noent_okay:!0});n=a.node,e=a.path}var s=!1;if(r&64)if(n){if(r&128)throw new o.ErrnoError(20)}else{if(i)throw new o.ErrnoError(31);n=o.mknod(e,t|511,0),s=!0}if(!n)throw new o.ErrnoError(44);if(o.isChrdev(n.mode)&&(r&=-513),r&65536&&!o.isDir(n.mode))throw new o.ErrnoError(54);if(!s){var c=o.mayOpen(n,r);if(c)throw new o.ErrnoError(c)}r&512&&!s&&o.truncate(n,0),r&=-131713;var l=o.createStream({node:n,path:o.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),s&&o.chmod(n,t&511),v.logReadFiles&&!(r&1)&&(e in o.readFiles||(o.readFiles[e]=1)),l},close(e){if(o.isClosed(e))throw new o.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{o.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(o.isClosed(e))throw new o.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new o.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new o.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,i){if(p(t>=0),n<0||i<0)throw new o.ErrnoError(28);if(o.isClosed(e))throw new o.ErrnoError(8);if((e.flags&2097155)===1)throw new o.ErrnoError(8);if(o.isDir(e.node.mode))throw new o.ErrnoError(31);if(!e.stream_ops.read)throw new o.ErrnoError(28);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new o.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,i);return a||(e.position+=s),s},write(e,r,t,n,i,a){if(p(t>=0),n<0||i<0)throw new o.ErrnoError(28);if(o.isClosed(e))throw new o.ErrnoError(8);if((e.flags&2097155)===0)throw new o.ErrnoError(8);if(o.isDir(e.node.mode))throw new o.ErrnoError(31);if(!e.stream_ops.write)throw new o.ErrnoError(28);e.seekable&&e.flags&1024&&o.llseek(e,0,2);var s=typeof i<"u";if(!s)i=e.position;else if(!e.seekable)throw new o.ErrnoError(70);var c=e.stream_ops.write(e,r,t,n,i,a);return s||(e.position+=c),c},mmap(e,r,t,n,i){if((n&2)!==0&&(i&2)===0&&(e.flags&2097155)!==2)throw new o.ErrnoError(2);if((e.flags&2097155)===1)throw new o.ErrnoError(2);if(!e.stream_ops.mmap)throw new o.ErrnoError(43);if(!r)throw new o.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,i)},msync(e,r,t,n,i){return p(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,i):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new o.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t=o.open(e,r.flags),n=o.stat(e),i=n.size,a=new Uint8Array(i);return o.read(t,a,0,i,0),r.encoding==="utf8"&&(a=Fe(a)),o.close(t),a},writeFile(e,r,t={}){t.flags=t.flags||577;var n=o.open(e,t.flags,t.mode);if(typeof r=="string"&&(r=new Uint8Array(Lr(r))),ArrayBuffer.isView(r))o.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");o.close(n)},cwd:()=>o.currentPath,chdir(e){var r=o.lookupPath(e,{follow:!0});if(r.node===null)throw new o.ErrnoError(44);if(!o.isDir(r.node.mode))throw new o.ErrnoError(54);var t=o.nodePermissions(r.node,"x");if(t)throw new o.ErrnoError(t);o.currentPath=r.path},createDefaultDirectories(){o.mkdir("/tmp"),o.mkdir("/home"),o.mkdir("/home/web_user")},createDefaultDevices(){o.mkdir("/dev"),o.registerDevice(o.makedev(1,3),{read:()=>0,write:(n,i,a,s,c)=>s,llseek:()=>0}),o.mkdev("/dev/null",o.makedev(1,3)),fe.register(o.makedev(5,0),fe.default_tty_ops),fe.register(o.makedev(6,0),fe.default_tty1_ops),o.mkdev("/dev/tty",o.makedev(5,0)),o.mkdev("/dev/tty1",o.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(Mt(e),r=e.byteLength),e[--r]);o.createDevice("/dev","random",t),o.createDevice("/dev","urandom",t),o.mkdir("/dev/shm"),o.mkdir("/dev/shm/tmp")},createSpecialDirectories(){o.mkdir("/proc");var e=o.mkdir("/proc/self");o.mkdir("/proc/self/fd"),o.mount({mount(){var r=o.createNode(e,"fd",16895,73);return r.stream_ops={llseek:P.stream_ops.llseek},r.node_ops={lookup(t,n){var i=+n,a=o.getStreamChecked(i),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path},id:i+1};return s.parent=s,s},readdir(){return Array.from(o.streams.entries()).filter(([t,n])=>n).map(([t,n])=>t.toString())}},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?o.createDevice("/dev","stdin",e):o.symlink("/dev/tty","/dev/stdin"),r?o.createDevice("/dev","stdout",null,r):o.symlink("/dev/tty","/dev/stdout"),t?o.createDevice("/dev","stderr",null,t):o.symlink("/dev/tty1","/dev/stderr");var n=o.open("/dev/stdin",0),i=o.open("/dev/stdout",1),a=o.open("/dev/stderr",1);p(n.fd===0,`invalid handle for stdin (${n.fd})`),p(i.fd===1,`invalid handle for stdout (${i.fd})`),p(a.fd===2,`invalid handle for stderr (${a.fd})`)},staticInit(){o.nameTable=new Array(4096),o.mount(P,{},"/"),o.createDefaultDirectories(),o.createDefaultDevices(),o.createSpecialDirectories(),o.filesystems={MEMFS:P}},init(e,r,t){p(!o.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)"),o.initialized=!0,e??=v.stdin,r??=v.stdout,t??=v.stderr,o.createStandardStreams(e,r,t)},quit(){o.initialized=!1,et(0);for(var e of o.streams)e&&o.close(e)},findObject(e,r){var t=o.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=o.lookupPath(e,{follow:!r});e=t.path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=o.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=O.basename(e),t=o.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(i){n.error=i.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:o.getPath(e);for(var i=r.split("/").reverse();i.length;){var a=i.pop();if(a){var s=O.join2(e,a);try{o.mkdir(s)}catch(c){if(c.errno!=20)throw c}e=s}}return s},createFile(e,r,t,n,i){var a=O.join2(typeof e=="string"?e:o.getPath(e),r),s=Ur(n,i);return o.create(a,s)},createDataFile(e,r,t,n,i,a){var s=r;e&&(e=typeof e=="string"?e:o.getPath(e),s=r?O.join2(e,r):e);var c=Ur(n,i),l=o.create(s,c);if(t){if(typeof t=="string"){for(var u=new Array(t.length),f=0,h=t.length;f<h;++f)u[f]=t.charCodeAt(f);t=u}o.chmod(l,c|146);var m=o.open(l,577);o.write(m,t,0,t.length,0,a),o.close(m),o.chmod(l,c)}},createDevice(e,r,t,n){var i=O.join2(typeof e=="string"?e:o.getPath(e),r),a=Ur(!!t,!!n);o.createDevice.major??=64;var s=o.makedev(o.createDevice.major++,0);return o.registerDevice(s,{open(c){c.seekable=!1},close(c){n?.buffer?.length&&n(10)},read(c,l,u,f,h){for(var m=0,_=0;_<f;_++){var g;try{g=t()}catch{throw new o.ErrnoError(29)}if(g===void 0&&m===0)throw new o.ErrnoError(6);if(g==null)break;m++,l[u+_]=g}return m&&(c.node.atime=Date.now()),m},write(c,l,u,f,h){for(var m=0;m<f;m++)try{n(l[u+m])}catch{throw new o.ErrnoError(29)}return f&&(c.node.mtime=c.node.ctime=Date.now()),m}}),o.mkdev(i,a,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")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.");try{e.contents=Re(e.url),e.usedBytes=e.contents.length}catch{throw new o.ErrnoError(29)}},createLazyFile(e,r,t,n,i){class a{lengthKnown=!1;chunks=[];get(_){if(!(_>this.length-1||_<0)){var g=_%this.chunkSize,F=_/this.chunkSize|0;return this.getter(F)[g]}}setDataGetter(_){this.getter=_}cacheLength(){var _=new XMLHttpRequest;if(_.open("HEAD",t,!1),_.send(null),!(_.status>=200&&_.status<300||_.status===304))throw new Error("Couldn't load "+t+". Status: "+_.status);var g=Number(_.getResponseHeader("Content-length")),F,I=(F=_.getResponseHeader("Accept-Ranges"))&&F==="bytes",R=(F=_.getResponseHeader("Content-Encoding"))&&F==="gzip",H=1024*1024;I||(H=g);var N=(K,le)=>{if(K>le)throw new Error("invalid range ("+K+", "+le+") or no bytes requested!");if(le>g-1)throw new Error("only "+g+" bytes available! programmer error!");var L=new XMLHttpRequest;if(L.open("GET",t,!1),g!==H&&L.setRequestHeader("Range","bytes="+K+"-"+le),L.responseType="arraybuffer",L.overrideMimeType&&L.overrideMimeType("text/plain; charset=x-user-defined"),L.send(null),!(L.status>=200&&L.status<300||L.status===304))throw new Error("Couldn't load "+t+". Status: "+L.status);return L.response!==void 0?new Uint8Array(L.response||[]):Lr(L.responseText||"")},be=this;be.setDataGetter(K=>{var le=K*H,L=(K+1)*H-1;if(L=Math.min(L,g-1),typeof be.chunks[K]>"u"&&(be.chunks[K]=N(le,L)),typeof be.chunks[K]>"u")throw new Error("doXHR failed!");return be.chunks[K]}),(R||!g)&&(H=g=1,g=this.getter(0).length,H=g,ue("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=g,this._chunkSize=H,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!Z)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new a,c={isDevice:!1,contents:s}}else var c={isDevice:!1,url:t};var l=o.createFile(e,r,c,n,i);c.contents?l.contents=c.contents:c.url&&(l.contents=null,l.url=c.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={},f=Object.keys(l.stream_ops);f.forEach(m=>{var _=l.stream_ops[m];u[m]=(...g)=>(o.forceLoadFile(l),_(...g))});function h(m,_,g,F,I){var R=m.node.contents;if(I>=R.length)return 0;var H=Math.min(R.length-I,F);if(p(H>=0),R.slice)for(var N=0;N<H;N++)_[g+N]=R[I+N];else for(var N=0;N<H;N++)_[g+N]=R.get(I+N);return H}return u.read=(m,_,g,F,I)=>(o.forceLoadFile(l),h(m,_,g,F,I)),u.mmap=(m,_,g,F,I)=>{o.forceLoadFile(l);var R=xt();if(!R)throw new o.ErrnoError(48);return h(m,(d(),j),R,_,g),{ptr:R,allocated:!0}},l.stream_ops=u,l},absolutePath(){z("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){z("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){z("FS.createLink has been removed; use FS.symlink instead")},joinPath(){z("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){z("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){z("FS.standardizePath has been removed; use PATH.normalize instead")}},x={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(O.isAbs(r))return r;var n;if(e===-100)n=o.cwd();else{var i=x.getStreamFromFD(e);n=i.path}if(r.length==0){if(!t)throw new o.ErrnoError(44);return n}return n+"/"+r},writeStat(e,r){(d(),S)[e>>2]=r.dev,(d(),S)[e+4>>2]=r.mode,(d(),T)[e+8>>2]=r.nlink,(d(),S)[e+12>>2]=r.uid,(d(),S)[e+16>>2]=r.gid,(d(),S)[e+20>>2]=r.rdev,(d(),Y)[e+24>>3]=BigInt(r.size),(d(),S)[e+32>>2]=4096,(d(),S)[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),i=r.ctime.getTime();return(d(),Y)[e+40>>3]=BigInt(Math.floor(t/1e3)),(d(),T)[e+48>>2]=t%1e3*1e3*1e3,(d(),Y)[e+56>>3]=BigInt(Math.floor(n/1e3)),(d(),T)[e+64>>2]=n%1e3*1e3*1e3,(d(),Y)[e+72>>3]=BigInt(Math.floor(i/1e3)),(d(),T)[e+80>>2]=i%1e3*1e3*1e3,(d(),Y)[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){(d(),S)[e+4>>2]=r.bsize,(d(),S)[e+40>>2]=r.bsize,(d(),S)[e+8>>2]=r.blocks,(d(),S)[e+12>>2]=r.bfree,(d(),S)[e+16>>2]=r.bavail,(d(),S)[e+20>>2]=r.files,(d(),S)[e+24>>2]=r.ffree,(d(),S)[e+28>>2]=r.fsid,(d(),S)[e+44>>2]=r.flags,(d(),S)[e+36>>2]=r.namelen},doMsync(e,r,t,n,i){if(!o.isFile(r.node.mode))throw new o.ErrnoError(43);if(n&2)return 0;var a=(d(),q).slice(e,e+t);o.msync(r,a,i,t,n)},getStreamFromFD(e){var r=o.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=oe(e);return r}};function jt(e,r,t){if(A)return G(2,0,1,e,r,t);try{var n=x.getStreamFromFD(e);if(p(!t),n.fd===r)return-28;if(r<0||r>=o.MAX_OPEN_FDS)return-8;var i=o.getStream(r);return i&&o.close(i),o.dupStream(n,r).fd}catch(a){if(typeof o>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}var sr=()=>{p(x.varargs!=null);var e=(d(),S)[+x.varargs>>2];return x.varargs+=4,e},Ce=sr;function zt(e,r,t){if(A)return G(3,0,1,e,r,t);x.varargs=t;try{var n=x.getStreamFromFD(e);switch(r){case 0:{var i=sr();if(i<0)return-28;for(;o.streams[i];)i++;var a;return a=o.dupStream(n,i),a.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var i=sr();return n.flags|=i,0}case 12:{var i=Ce(),s=0;return(d(),de)[i+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(c){if(typeof o>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function Ht(e,r){if(A)return G(4,0,1,e,r);try{return x.writeStat(r,o.fstat(e))}catch(t){if(typeof o>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function Vt(e,r,t){if(A)return G(5,0,1,e,r,t);x.varargs=t;try{var n=x.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var i=n.tty.ops.ioctl_tcgets(n),a=Ce();(d(),S)[a>>2]=i.c_iflag||0,(d(),S)[a+4>>2]=i.c_oflag||0,(d(),S)[a+8>>2]=i.c_cflag||0,(d(),S)[a+12>>2]=i.c_lflag||0;for(var s=0;s<32;s++)(d(),j)[a+s+17]=i.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var a=Ce(),c=(d(),S)[a>>2],l=(d(),S)[a+4>>2],u=(d(),S)[a+8>>2],f=(d(),S)[a+12>>2],h=[],s=0;s<32;s++)h.push((d(),j)[a+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:c,c_oflag:l,c_cflag:u,c_lflag:f,c_cc:h})}return 0}case 21519:{if(!n.tty)return-59;var a=Ce();return(d(),S)[a>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var a=Ce();return o.ioctl(n,r,a)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty),a=Ce();(d(),de)[a>>1]=m[0],(d(),de)[a+2>>1]=m[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(_){if(typeof o>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}function Gt(e,r){if(A)return G(6,0,1,e,r);try{return e=x.getStr(e),x.writeStat(r,o.lstat(e))}catch(t){if(typeof o>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function Yt(e,r,t,n){if(A)return G(7,0,1,e,r,t,n);try{r=x.getStr(r);var i=n&256,a=n&4096;return n=n&-6401,p(!n,`unknown flags in __syscall_newfstatat: ${n}`),r=x.calculateAt(e,r,a),x.writeStat(t,i?o.lstat(r):o.stat(r))}catch(s){if(typeof o>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function Kt(e,r,t,n){if(A)return G(8,0,1,e,r,t,n);x.varargs=n;try{r=x.getStr(r),r=x.calculateAt(e,r);var i=n?sr():0;return o.open(r,t,i).fd}catch(a){if(typeof o>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}function qt(e,r){if(A)return G(9,0,1,e,r);try{return e=x.getStr(e),x.writeStat(r,o.stat(e))}catch(t){if(typeof o>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}var Ii=()=>z("native code called abort()"),W=e=>{for(var r="";;){var t=(d(),q)[e++];if(!t)return r;r+=String.fromCharCode(t)}},$e={},me={},cr={},Ve=class extends Error{constructor(r){super(r),this.name="BindingError"}},D=e=>{throw new Ve(e)};function Mi(e,r,t={}){var n=r.name;if(e||D(`type "${n}" must have a positive integer typeid pointer`),me.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;D(`Cannot register type '${n}' twice`)}if(me[e]=r,delete cr[e],$e.hasOwnProperty(e)){var i=$e[e];delete $e[e],i.forEach(a=>a())}}function X(e,r,t={}){if(r.argPackAdvance===void 0)throw new TypeError("registerType registeredInstance requires argPackAdvance");return Mi(e,r,t)}var Xt=(e,r,t)=>{switch(r){case 1:return t?n=>(d(),j)[n]:n=>(d(),q)[n];case 2:return t?n=>(d(),de)[n>>1]:n=>(d(),ie)[n>>1];case 4:return t?n=>(d(),S)[n>>2]:n=>(d(),T)[n>>2];case 8:return t?n=>(d(),Y)[n>>3]:n=>(d(),Et)[n>>3];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},ge=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},Jt=(e,r,t,n)=>{if(r<t||r>n)throw new TypeError(`Passing a number "${ge(r)}" from JS side to C/C++ side to an argument of type "${e}", which is outside the valid range [${t}, ${n}]!`)},Ni=(e,r,t,n,i)=>{r=W(r);const a=n===0n;let s=c=>c;if(a){const c=t*8;s=l=>BigInt.asUintN(c,l),i=s(i)}X(e,{name:r,fromWireType:s,toWireType:(c,l)=>{if(typeof l=="number")l=BigInt(l);else if(typeof l!="bigint")throw new TypeError(`Cannot convert "${ge(l)}" to ${this.name}`);return Jt(r,l,n,i),l},argPackAdvance:ee,readValueFromPointer:Xt(r,t,!a),destructorFunction:null})},ee=8,xi=(e,r,t,n)=>{r=W(r),X(e,{name:r,fromWireType:function(i){return!!i},toWireType:function(i,a){return a?t:n},argPackAdvance:ee,readValueFromPointer:function(i){return this.fromWireType((d(),q)[i])},destructorFunction:null})},Li=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Wr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}D(r(e)+" instance already deleted")},Br=!1,Zt=e=>{},Ui=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Qt=e=>{e.count.value-=1;var r=e.count.value===0;r&&Ui(e)},en=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=en(e,r,t.baseClass);return n===null?null:t.downcast(n)},rn={},Wi={},Bi=(e,r)=>{for(r===void 0&&D("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},ji=(e,r)=>(r=Bi(e,r),Wi[r]),zi=class extends Error{constructor(r){super(r),this.name="InternalError"}},lr=e=>{throw new zi(e)},ur=(e,r)=>{(!r.ptrType||!r.ptr)&&lr("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&lr("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Ge(Object.create(e,{$$:{value:r,writable:!0}}))};function tn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=ji(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?ur(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):ur(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=this.registeredClass.getActualType(r),s=rn[a];if(!s)return i.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var l=en(r,this.registeredClass,c.registeredClass);return l===null?i.call(this):this.isSmartPointer?ur(c.registeredClass.instancePrototype,{ptrType:c,ptr:l,smartPtrType:this,smartPtr:e}):ur(c.registeredClass.instancePrototype,{ptrType:c,ptr:l})}var Ge=e=>typeof FinalizationRegistry>"u"?(Ge=r=>r,e):(Br=new FinalizationRegistry(r=>{console.warn(r.leakWarning),Qt(r.$$)}),Ge=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var i={$$:t},a=t.ptrType.registeredClass,s=new Error(`Embind found a leaked C++ instance ${a.name} <${he(t.ptr)}>.
5
+ We'll free it automatically in this case, but this functionality is not reliable across various environments.
6
+ Make sure to invoke .delete() manually once you're done with the instance instead.
7
+ Originally allocated`);"captureStackTrace"in Error&&Error.captureStackTrace(s,tn),i.leakWarning=s.stack.replace(/^Error: /,""),Br.register(r,i,r)}return r},Zt=r=>Br.unregister(r),Ge(e)),Hi=()=>{let e=dr.prototype;Object.assign(e,{isAliasOf(t){if(!(this instanceof dr)||!(t instanceof dr))return!1;var n=this.$$.ptrType.registeredClass,i=this.$$.ptr;t.$$=t.$$;for(var a=t.$$.ptrType.registeredClass,s=t.$$.ptr;n.baseClass;)i=n.upcast(i),n=n.baseClass;for(;a.baseClass;)s=a.upcast(s),a=a.baseClass;return n===a&&i===s},clone(){if(this.$$.ptr||Wr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ge(Object.create(Object.getPrototypeOf(this),{$$:{value:Li(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Wr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&D("Object already scheduled for deletion"),Zt(this),Qt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Wr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&D("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const r=Symbol.dispose;r&&(e[r]=e.delete)};function dr(){}var fr=(e,r)=>Object.defineProperty(r,"name",{value:e}),jr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...i){return e[r].overloadTable.hasOwnProperty(i.length)||D(`Function '${t}' called with an invalid number of arguments (${i.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[i.length].apply(this,i)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},zr=(e,r,t)=>{v.hasOwnProperty(e)?((t===void 0||v[e].overloadTable!==void 0&&v[e].overloadTable[t]!==void 0)&&D(`Cannot register public name '${e}' twice`),jr(v,e,e),v[e].overloadTable.hasOwnProperty(t)&&D(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),v[e].overloadTable[t]=r):(v[e]=r,v[e].argCount=t)},Vi=48,Gi=57,Yi=e=>{p(typeof e=="string"),e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=Vi&&r<=Gi?`_${e}`:e};function Ki(e,r,t,n,i,a,s,c){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=i,this.getActualType=a,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var vr=(e,r,t)=>{for(;r!==t;)r.upcast||D(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function qi(e,r){if(r===null)return this.isReference&&D(`null is not a valid ${this.name}`),0;r.$$||D(`Cannot pass "${ge(r)}" as a ${this.name}`),r.$$.ptr||D(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=vr(r.$$.ptr,t,this.registeredClass);return n}function Xi(e,r){var t;if(r===null)return this.isReference&&D(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&D(`Cannot pass "${ge(r)}" as a ${this.name}`),r.$$.ptr||D(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&D(`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=vr(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&D("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:D(`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 i=r.clone();t=this.rawShare(t,B.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:D("Unsupporting sharing policy")}return t}function Ji(e,r){if(r===null)return this.isReference&&D(`null is not a valid ${this.name}`),0;r.$$||D(`Cannot pass "${ge(r)}" as a ${this.name}`),r.$$.ptr||D(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&D(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=vr(r.$$.ptr,t,this.registeredClass);return n}function _r(e){return this.fromWireType((d(),T)[e>>2])}var Zi=()=>{Object.assign(pr.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:ee,readValueFromPointer:_r,fromWireType:tn})};function pr(e,r,t,n,i,a,s,c,l,u,f){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=f,!i&&r.baseClass===void 0?n?(this.toWireType=qi,this.destructorFunction=null):(this.toWireType=Ji,this.destructorFunction=null):this.toWireType=Xi}var nn=(e,r,t)=>{v.hasOwnProperty(e)||lr("Replacing nonexistent public symbol"),v[e].overloadTable!==void 0&&t!==void 0?v[e].overloadTable[t]=r:(v[e]=r,v[e].argCount=t)},re=(e,r,t=!1)=>{p(!t,"Async bindings are only supported with JSPI."),e=W(e);function n(){var a=E(r);return a}var i=n();return typeof i!="function"&&D(`unknown function pointer with signature ${e}: ${r}`),i};class Qi extends Error{}var an=e=>{var r=An(e),t=W(r);return ne(r),t},ye=(e,r)=>{var t=[],n={};function i(a){if(!n[a]&&!me[a]){if(cr[a]){cr[a].forEach(i);return}t.push(a),n[a]=!0}}throw r.forEach(i),new Qi(`${e}: `+t.map(an).join([", "]))},J=(e,r,t)=>{e.forEach(c=>cr[c]=r);function n(c){var l=t(c);l.length!==e.length&&lr("Mismatched type converter count");for(var u=0;u<e.length;++u)X(e[u],l[u])}var i=new Array(r.length),a=[],s=0;r.forEach((c,l)=>{me.hasOwnProperty(c)?i[l]=me[c]:(a.push(c),$e.hasOwnProperty(c)||($e[c]=[]),$e[c].push(()=>{i[l]=me[c],++s,s===a.length&&n(i)}))}),a.length===0&&n(i)},ea=(e,r,t,n,i,a,s,c,l,u,f,h,m)=>{f=W(f),a=re(i,a),c&&=re(s,c),u&&=re(l,u),m=re(h,m);var _=Yi(f);zr(_,function(){ye(`Cannot construct ${f} due to unbound types`,[n])}),J([e,r,t],n?[n]:[],g=>{g=g[0];var F,I;n?(F=g.registeredClass,I=F.instancePrototype):I=dr.prototype;var R=fr(f,function(...L){if(Object.getPrototypeOf(this)!==H)throw new Ve(`Use 'new' to construct ${f}`);if(N.constructor_body===void 0)throw new Ve(`${f} has no accessible constructor`);var Vn=N.constructor_body[L.length];if(Vn===void 0)throw new Ve(`Tried to invoke ctor of ${f} with invalid number of parameters (${L.length}) - expected (${Object.keys(N.constructor_body).toString()}) parameters instead!`);return Vn.apply(this,L)}),H=Object.create(I,{constructor:{value:R}});R.prototype=H;var N=new Ki(f,R,H,m,F,a,c,u);N.baseClass&&(N.baseClass.__derivedClasses??=[],N.baseClass.__derivedClasses.push(N));var be=new pr(f,N,!0,!1,!1),K=new pr(f+"*",N,!1,!1,!1),le=new pr(f+" const*",N,!1,!0,!1);return rn[e]={pointerType:K,constPointerType:le},nn(_,R),[be,K,le]})},Hr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function on(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function ra(e,r,t,n,i){if(e<r||e>t){var a=r==t?r:`${r} to ${t}`;i(`function ${n} called with ${e} arguments, expected ${a}`)}}function ta(e,r,t,n){var i=on(e),a=e.length-2,s=[],c=["fn"];r&&c.push("thisWired");for(var l=0;l<a;++l)s.push(`arg${l}`),c.push(`arg${l}Wired`);s=s.join(","),c=c.join(",");var u=`return function (${s}) {
8
+ `;u+=`checkArgCount(arguments.length, minArgs, maxArgs, humanName, throwBindingError);
9
+ `,i&&(u+=`var destructors = [];
10
+ `);var f=i?"destructors":"null",h=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];r&&(u+=`var thisWired = classParam['toWireType'](${f}, this);
11
+ `);for(var l=0;l<a;++l)u+=`var arg${l}Wired = argType${l}['toWireType'](${f}, arg${l});
12
+ `,h.push(`argType${l}`);if(u+=(t||n?"var rv = ":"")+`invoker(${c});
13
+ `,i)u+=`runDestructors(destructors);
14
+ `;else for(var l=r?1:2;l<e.length;++l){var m=l===1?"thisWired":"arg"+(l-2)+"Wired";e[l].destructorFunction!==null&&(u+=`${m}_dtor(${m});
15
+ `,h.push(`${m}_dtor`))}return t&&(u+=`var ret = retType['fromWireType'](rv);
16
+ return ret;
17
+ `),u+=`}
18
+ `,h.push("checkArgCount","minArgs","maxArgs"),u=`if (arguments.length !== ${h.length}){ throw new Error(humanName + "Expected ${h.length} closure arguments " + arguments.length + " given."); }
19
+ ${u}`,[h,u]}function na(e){for(var r=e.length-2,t=e.length-1;t>=2&&e[t].optional;--t)r--;return r}function hr(e,r,t,n,i,a){var s=r.length;s<2&&D("argTypes array size mismatch! Must at least get return value and 'this' types!"),p(!a,"Async bindings are only supported with JSPI.");for(var c=r[1]!==null&&t!==null,l=on(r),u=r[0].name!=="void",f=s-2,h=na(r),m=[e,D,n,i,Hr,r[0],r[1]],_=0;_<s-2;++_)m.push(r[_+2]);if(!l)for(var _=c?1:2;_<r.length;++_)r[_].destructorFunction!==null&&m.push(r[_].destructorFunction);m.push(ra,h,f);let[g,F]=ta(r,c,u,a);var I=new Function(...g,F)(...m);return fr(e,I)}var mr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push((d(),T)[r+n*4>>2]);return t},Vr=e=>{e=e.trim();const r=e.indexOf("(");return r===-1?e:(p(e.endsWith(")"),"Parentheses for argument names should match."),e.slice(0,r))},ia=(e,r,t,n,i,a,s,c,l)=>{var u=mr(t,n);r=W(r),r=Vr(r),a=re(i,a,c),J([],[e],f=>{f=f[0];var h=`${f.name}.${r}`;function m(){ye(`Cannot call ${h} due to unbound types`,u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var _=f.registeredClass.constructor;return _[r]===void 0?(m.argCount=t-1,_[r]=m):(jr(_,r,h),_[r].overloadTable[t-1]=m),J([],u,g=>{var F=[g[0],null].concat(g.slice(1)),I=hr(h,F,null,a,s,c);if(_[r].overloadTable===void 0?(I.argCount=t-1,_[r]=I):_[r].overloadTable[t-1]=I,f.registeredClass.__derivedClasses)for(const R of f.registeredClass.__derivedClasses)R.constructor.hasOwnProperty(r)||(R.constructor[r]=I);return[]}),[]})},aa=(e,r,t,n,i,a)=>{p(r>0);var s=mr(r,t);i=re(n,i),J([],[e],c=>{c=c[0];var l=`constructor ${c.name}`;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[r-1]!==void 0)throw new Ve(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return c.registeredClass.constructor_body[r-1]=()=>{ye(`Cannot construct ${c.name} due to unbound types`,s)},J([],s,u=>(u.splice(1,0,null),c.registeredClass.constructor_body[r-1]=hr(l,u,null,i,a),[])),[]})},oa=(e,r,t,n,i,a,s,c,l,u)=>{var f=mr(t,n);r=W(r),r=Vr(r),a=re(i,a,l),J([],[e],h=>{h=h[0];var m=`${h.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),c&&h.registeredClass.pureVirtualFunctions.push(r);function _(){ye(`Cannot call ${m} due to unbound types`,f)}var g=h.registeredClass.instancePrototype,F=g[r];return F===void 0||F.overloadTable===void 0&&F.className!==h.name&&F.argCount===t-2?(_.argCount=t-2,_.className=h.name,g[r]=_):(jr(g,r,m),g[r].overloadTable[t-2]=_),J([],f,I=>{var R=hr(m,I,h,a,s,l);return g[r].overloadTable===void 0?(R.argCount=t-2,g[r]=R):g[r].overloadTable[t-2]=R,[]}),[]})},sn=(e,r,t)=>(e instanceof Object||D(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||D(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||D(`cannot call emscripten binding method ${t} on deleted object`),vr(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),sa=(e,r,t,n,i,a,s,c,l,u)=>{r=W(r),i=re(n,i),J([],[e],f=>{f=f[0];var h=`${f.name}.${r}`,m={get(){ye(`Cannot access ${h} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return l?m.set=()=>ye(`Cannot access ${h} due to unbound types`,[t,s]):m.set=_=>D(h+" is a read-only property"),Object.defineProperty(f.registeredClass.instancePrototype,r,m),J([],l?[t,s]:[t],_=>{var g=_[0],F={get(){var R=sn(this,f,h+" getter");return g.fromWireType(i(a,R))},enumerable:!0};if(l){l=re(c,l);var I=_[1];F.set=function(R){var H=sn(this,f,h+" setter"),N=[];l(u,H,I.toWireType(N,R)),Hr(N)}}return Object.defineProperty(f.registeredClass.instancePrototype,r,F),[]}),[]})},ca=(e,r,t)=>{e=W(e),J([],[r],n=>(n=n[0],v[e]=n.fromWireType(t),[]))},cn=[],te=[0,1,,1,null,1,!0,1,!1,1],Gr=e=>{e>9&&--te[e+1]===0&&(p(te[e]!==void 0,"Decref for unallocated handle."),te[e]=void 0,cn.push(e))},B={toValue:e=>(e||D(`Cannot use deleted val. handle = ${e}`),p(e===2||te[e]!==void 0&&e%2===0,`invalid handle: ${e}`),te[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=cn.pop()||te.length;return te[r]=e,te[r+1]=1,r}}}},ln={name:"emscripten::val",fromWireType:e=>{var r=B.toValue(e);return Gr(e),r},toWireType:(e,r)=>B.toHandle(r),argPackAdvance:ee,readValueFromPointer:_r,destructorFunction:null},un=e=>X(e,ln),la=(e,r,t)=>{switch(r){case 1:return t?function(n){return this.fromWireType((d(),j)[n])}:function(n){return this.fromWireType((d(),q)[n])};case 2:return t?function(n){return this.fromWireType((d(),de)[n>>1])}:function(n){return this.fromWireType((d(),ie)[n>>1])};case 4:return t?function(n){return this.fromWireType((d(),S)[n>>2])}:function(n){return this.fromWireType((d(),T)[n>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},ua=(e,r,t,n)=>{r=W(r);function i(){}i.values={},X(e,{name:r,constructor:i,fromWireType:function(a){return this.constructor.values[a]},toWireType:(a,s)=>s.value,argPackAdvance:ee,readValueFromPointer:la(r,t,n),destructorFunction:null}),zr(r,i)},gr=(e,r)=>{var t=me[e];return t===void 0&&D(`${r} has unknown type ${an(e)}`),t},da=(e,r,t)=>{var n=gr(e,"enum");r=W(r);var i=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:fr(`${n.name}_${r}`,function(){})}});i.values[t]=a,i[r]=a},fa=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType((d(),wt)[t>>2])};case 8:return function(t){return this.fromWireType((d(),Le)[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},va=(e,r,t)=>{r=W(r),X(e,{name:r,fromWireType:n=>n,toWireType:(n,i)=>{if(typeof i!="number"&&typeof i!="boolean")throw new TypeError(`Cannot convert ${ge(i)} to ${this.name}`);return i},argPackAdvance:ee,readValueFromPointer:fa(r,t),destructorFunction:null})},_a=(e,r,t,n,i,a,s,c)=>{var l=mr(r,t);e=W(e),e=Vr(e),i=re(n,i,s),zr(e,function(){ye(`Cannot call ${e} due to unbound types`,l)},r-1),J([],l,u=>{var f=[u[0],null].concat(u.slice(1));return nn(e,hr(e,f,null,i,a,s),r-1),[]})},pa=(e,r,t,n,i)=>{r=W(r);const a=n===0;let s=l=>l;if(a){var c=32-8*t;s=l=>l<<c>>>c,i=s(i)}X(e,{name:r,fromWireType:s,toWireType:(l,u)=>{if(typeof u!="number"&&typeof u!="boolean")throw new TypeError(`Cannot convert "${ge(u)}" to ${r}`);return Jt(r,u,n,i),u},argPackAdvance:ee,readValueFromPointer:Xt(r,t,n!==0),destructorFunction:null})},ha=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array],i=n[r];function a(s){var c=(d(),T)[s>>2],l=(d(),T)[s+4>>2];return new i((d(),j).buffer,l,c)}t=W(t),X(e,{name:t,fromWireType:a,argPackAdvance:ee,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},ma=Object.assign({optional:!0},ln),ga=(e,r)=>{X(e,ma)},we=(e,r,t)=>(p(typeof t=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Nt(e,(d(),q),r,t)),ya=(e,r)=>{r=W(r),X(e,{name:r,fromWireType(t){for(var n=(d(),T)[t>>2],i=t+4,a,s,c=i,s=0;s<=n;++s){var l=i+s;if(s==n||(d(),q)[l]==0){var u=l-c,f=oe(c,u);a===void 0?a=f:(a+="\0",a+=f),c=l+1}}return ne(t),a},toWireType(t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var i,a=typeof n=="string";a||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||D("Cannot pass non-string to std::string"),a?i=Ae(n):i=n.length;var s=Qr(4+i+1),c=s+4;return(d(),T)[s>>2]=i,a?we(n,c,i+1):(d(),q).set(n,c),t!==null&&t.push(ne,s),s},argPackAdvance:ee,readValueFromPointer:_r,destructorFunction(t){ne(t)}})},dn=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,wa=(e,r)=>{p(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var t=e>>1,n=t+r/2,i=t;!(i>=n)&&(d(),ie)[i];)++i;if(i-t>16&&dn)return dn.decode((d(),ie).buffer instanceof ArrayBuffer?(d(),ie).subarray(t,i):(d(),ie).slice(t,i));for(var a="",s=t;!(s>=n);++s){var c=(d(),ie)[s];if(c==0)break;a+=String.fromCharCode(c)}return a},Ea=(e,r,t)=>{if(p(r%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),p(typeof t=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),t??=2147483647,t<2)return 0;t-=2;for(var n=r,i=t<e.length*2?t/2:e.length,a=0;a<i;++a){var s=e.charCodeAt(a);(d(),de)[r>>1]=s,r+=2}return(d(),de)[r>>1]=0,r-n},ba=e=>e.length*2,ka=(e,r)=>{p(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var t="",n=0;!(n>=r/4);n++){var i=(d(),S)[e+n*4>>2];if(!i)break;t+=String.fromCodePoint(i)}return t},Sa=(e,r,t)=>{if(p(r%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),p(typeof t=="number","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,i=n+t-4,a=0;a<e.length;++a){var s=e.codePointAt(a);if(s>65535&&a++,(d(),S)[r>>2]=s,r+=4,r+4>i)break}return(d(),S)[r>>2]=0,r-n},Ta=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.codePointAt(t);n>65535&&t++,r+=4}return r},Fa=(e,r,t)=>{t=W(t);var n,i,a,s;r===2?(n=wa,i=Ea,s=ba,a=c=>(d(),ie)[c>>1]):r===4&&(n=ka,i=Sa,s=Ta,a=c=>(d(),T)[c>>2]),X(e,{name:t,fromWireType:c=>{for(var l=(d(),T)[c>>2],u,f=c+4,h=0;h<=l;++h){var m=c+4+h*r;if(h==l||a(m)==0){var _=m-f,g=n(f,_);u===void 0?u=g:(u+="\0",u+=g),f=m+r}}return ne(c),u},toWireType:(c,l)=>{typeof l!="string"&&D(`Cannot pass non-string to C++ string type ${t}`);var u=s(l),f=Qr(4+u+r);return(d(),T)[f>>2]=u/r,i(l,f+4,u+r),c!==null&&c.push(ne,f),f},argPackAdvance:ee,readValueFromPointer:_r,destructorFunction(c){ne(c)}})},Pa=(e,r)=>{un(e)},Aa=(e,r)=>{r=W(r),X(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},Ca=e=>{rt(e,!Z,1,!Ke,65536,!1),$.threadInitTLS()},fn=e=>{if(e instanceof St||e=="unwind")return Se;xe(),e instanceof WebAssembly.RuntimeError&&it()<=0&&C("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)"),Pr(1,e)},$a=()=>{if(!rr())try{A?nt(Se):Mr(Se)}catch(e){fn(e)}},vn=e=>{if(ke){C("user callback triggered after runtime exited or application aborted. Ignoring.");return}try{e(),$a()}catch(r){fn(r)}},Yr=e=>{if(typeof Atomics.waitAsync=="function"){var r=Atomics.waitAsync((d(),S),e>>2,e);p(r.async),r.value.then(yr);var t=e+128;Atomics.store((d(),S),t>>2,1)}},yr=()=>{var e=Zr();e&&(Yr(e),vn(Mn))},Da=(e,r)=>{if(e==r)setTimeout(yr);else if(A)postMessage({targetThread:e,cmd:"checkMailbox"});else{var t=$.pthreads[e];if(!t){C(`Cannot send message to thread with ID ${e}, unknown thread ID!`);return}t.postMessage({cmd:"checkMailbox"})}},wr=[],Ra=(e,r,t,n,i)=>{n/=2,wr.length=n;for(var a=i>>3,s=0;s<n;s++)(d(),Y)[a+2*s]?wr[s]=(d(),Y)[a+2*s+1]:wr[s]=(d(),Le)[a+2*s+1];var c=r?Jr[r]:Uo[e];p(!(e&&r)),p(c.length==n,"Call args mismatch in _emscripten_receive_on_main_thread_js"),$.currentProxiedOperationCallerThread=t;var l=c(...wr);return $.currentProxiedOperationCallerThread=0,p(typeof l!="bigint"),l},Oa=()=>{nr=!1,ze=0},Ia=e=>{A?postMessage({cmd:"cleanupThread",thread:e}):Ft(e)},Ma=e=>{V&&$.pthreads[e].ref()},Na=()=>{throw new Xn},_n=(e,r,t)=>{var n=[],i=e.toWireType(n,t);return n.length&&((d(),T)[r>>2]=B.toHandle(n)),i},xa=(e,r,t)=>(e=B.toValue(e),r=gr(r,"emval::as"),_n(r,t,e)),Er=[],La=(e,r,t,n)=>(e=Er[e],r=B.toValue(r),e(null,r,t,n)),Ua={},Kr=e=>{var r=Ua[e];return r===void 0?W(e):r},Wa=(e,r,t,n,i)=>(e=Er[e],r=B.toValue(r),t=Kr(t),e(r,r[t],n,i)),pn=()=>globalThis,Ba=e=>e===0?B.toHandle(pn()):(e=Kr(e),B.toHandle(pn()[e])),ja=e=>{var r=Er.length;return Er.push(e),r},za=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=gr((d(),T)[r+n*4>>2],`parameter ${n}`);return t},Ha=(e,r,t)=>{var n=za(e,r),i=n.shift();e--;var a=`return function (obj, func, destructorsRef, args) {
20
+ `,s=0,c=[];t===0&&c.push("obj");for(var l=["retType"],u=[i],f=0;f<e;++f)c.push(`arg${f}`),l.push(`argType${f}`),u.push(n[f]),a+=` var arg${f} = argType${f}.readValueFromPointer(args${s?"+"+s:""});
21
+ `,s+=n[f].argPackAdvance;var h=t===1?"new func":"func.call";a+=` var rv = ${h}(${c.join(", ")});
22
+ `,i.isVoid||(l.push("emval_returnValue"),u.push(_n),a+=` return emval_returnValue(retType, destructorsRef, rv);
23
+ `),a+=`};
24
+ `;var m=new Function(...l,a)(...u),_=`methodCaller<(${n.map(g=>g.name).join(", ")}) => ${i.name}>`;return ja(fr(_,m))},Va=(e,r)=>(e=B.toValue(e),r=B.toValue(r),B.toHandle(e[r])),Ga=e=>{e>9&&(te[e+1]+=1)},Ya=e=>(e=B.toValue(e),typeof e=="number"),Ka=e=>(e=B.toValue(e),typeof e=="string"),qa=()=>B.toHandle([]),Xa=e=>B.toHandle(Kr(e)),Ja=e=>{var r=B.toValue(e);Hr(r),Gr(e)},Za=(e,r)=>{e=gr(e,"_emval_take_value");var t=e.readValueFromPointer(r);return B.toHandle(t)},Qa=e=>{throw e=B.toValue(e),e},eo=e=>e%4===0&&(e%100!==0||e%400===0),ro=[0,31,60,91,121,152,182,213,244,274,305,335],to=[0,31,59,90,120,151,181,212,243,273,304,334],no=e=>{var r=eo(e.getFullYear()),t=r?ro:to,n=t[e.getMonth()]+e.getDate()-1;return n},io=9007199254740992,ao=-9007199254740992,hn=e=>e<ao||e>io?NaN:Number(e);function oo(e,r){e=hn(e);var t=new Date(e*1e3);(d(),S)[r>>2]=t.getSeconds(),(d(),S)[r+4>>2]=t.getMinutes(),(d(),S)[r+8>>2]=t.getHours(),(d(),S)[r+12>>2]=t.getDate(),(d(),S)[r+16>>2]=t.getMonth(),(d(),S)[r+20>>2]=t.getFullYear()-1900,(d(),S)[r+24>>2]=t.getDay();var n=no(t)|0;(d(),S)[r+28>>2]=n,(d(),S)[r+36>>2]=-(t.getTimezoneOffset()*60);var i=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=i.getTimezoneOffset(),c=(a!=s&&t.getTimezoneOffset()==Math.min(s,a))|0;(d(),S)[r+32>>2]=c}var De={},qr=()=>performance.timeOrigin+performance.now();function mn(e,r){if(A)return G(10,0,1,e,r);if(De[e]&&(clearTimeout(De[e].id),delete De[e]),!r)return 0;var t=setTimeout(()=>{p(e in De),delete De[e],vn(()=>On(e,qr()))},r);return De[e]={id:t,timeout_ms:r},0}var so=(e,r,t,n)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),s=new Date(i,6,1),c=a.getTimezoneOffset(),l=s.getTimezoneOffset(),u=Math.max(c,l);(d(),T)[e>>2]=u*60,(d(),S)[r>>2]=+(c!=l);var f=_=>{var g=_>=0?"-":"+",F=Math.abs(_),I=String(Math.floor(F/60)).padStart(2,"0"),R=String(F%60).padStart(2,"0");return`UTC${g}${I}${R}`},h=f(c),m=f(l);p(h),p(m),p(Ae(h)<=16,`timezone name truncated to fit in TZNAME_MAX (${h})`),p(Ae(m)<=16,`timezone name truncated to fit in TZNAME_MAX (${m})`),l<c?(we(h,t,17),we(m,n,17)):(we(h,n,17),we(m,t,17))},gn=()=>Date.now(),co=e=>e>=0&&e<=3;function lo(e,r,t){if(!co(e))return 28;var n;e===0?n=gn():n=qr();var i=Math.round(n*1e3*1e3);return(d(),Y)[t>>3]=BigInt(i),0}var br=[],uo=(e,r)=>{p(Array.isArray(br)),p(r%16==0),br.length=0;for(var t;t=(d(),q)[e++];){var n=String.fromCharCode(t),i=["d","f","i","p"];i.push("j"),p(i.includes(n),`Invalid character ${t}("${n}") in readEmAsmArgs! Use only [${i}], and do not specify "v" for void return argument.`);var a=t!=105;a&=t!=112,r+=a&&r%8?4:0,br.push(t==112?(d(),T)[r>>2]:t==106?(d(),Y)[r>>3]:t==105?(d(),S)[r>>2]:(d(),Le)[r>>3]),r+=a?8:4}return br},fo=(e,r,t)=>{var n=uo(r,t);return p(Jr.hasOwnProperty(e),`No EM_ASM constant found at address ${e}. The loaded WebAssembly file is likely out of sync with the generated JavaScript.`),Jr[e](...n)},vo=(e,r,t)=>fo(e,r,t),_o=()=>{V||Z||ae("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},po=()=>{ze+=1},ho=()=>{throw po(),"unwind"},yn=()=>2147483648,mo=()=>yn(),go=()=>V?ve("os").cpus().length:navigator.hardwareConcurrency,yo=(e,r)=>(p(r,"alignment argument is required"),Math.ceil(e/r)*r),wo=e=>{var r=Q.buffer,t=(e-r.byteLength+65535)/65536|0;try{return Q.grow(t),Qe(),1}catch(n){C(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},Eo=e=>{var r=(d(),q).length;if(e>>>=0,e<=r)return!1;var t=yn();if(e>t)return C(`Cannot enlarge memory, requested ${e} bytes, but the limit is ${t} bytes!`),!1;for(var n=1;n<=4;n*=2){var i=r*(1+.2/n);i=Math.min(i,e+100663296);var a=Math.min(t,yo(Math.max(e,i),65536)),s=wo(a);if(s)return!0}return C(`Failed to grow the heap from ${r} bytes to ${a} bytes, not enough memory!`),!1},Xr={},bo=()=>Fr||"./this.program",Ye=()=>{if(!Ye.strings){var e=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:bo()};for(var t in Xr)Xr[t]===void 0?delete r[t]:r[t]=Xr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Ye.strings=n}return Ye.strings};function wn(e,r){if(A)return G(11,0,1,e,r);var t=0,n=0;for(var i of Ye()){var a=r+t;(d(),T)[e+n>>2]=a,t+=we(i,a,1/0)+1,n+=4}return 0}function En(e,r){if(A)return G(12,0,1,e,r);var t=Ye();(d(),T)[e>>2]=t.length;var n=0;for(var i of t)n+=Ae(i)+1;return(d(),T)[r>>2]=n,0}function bn(e){if(A)return G(13,0,1,e);try{var r=x.getStreamFromFD(e);return o.close(r),0}catch(t){if(typeof o>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var ko=(e,r,t,n)=>{for(var i=0,a=0;a<t;a++){var s=(d(),T)[r>>2],c=(d(),T)[r+4>>2];r+=8;var l=o.read(e,(d(),j),s,c,n);if(l<0)return-1;if(i+=l,l<c)break}return i};function kn(e,r,t,n){if(A)return G(14,0,1,e,r,t,n);try{var i=x.getStreamFromFD(e),a=ko(i,r,t);return(d(),T)[n>>2]=a,0}catch(s){if(typeof o>"u"||s.name!=="ErrnoError")throw s;return s.errno}}function Sn(e,r,t,n){if(A)return G(15,0,1,e,r,t,n);r=hn(r);try{if(isNaN(r))return 61;var i=x.getStreamFromFD(e);return o.llseek(i,r,t),(d(),Y)[n>>3]=BigInt(i.position),i.getdents&&r===0&&t===0&&(i.getdents=null),0}catch(a){if(typeof o>"u"||a.name!=="ErrnoError")throw a;return a.errno}}var So=(e,r,t,n)=>{for(var i=0,a=0;a<t;a++){var s=(d(),T)[r>>2],c=(d(),T)[r+4>>2];r+=8;var l=o.write(e,(d(),j),s,c,n);if(l<0)return-1;if(i+=l,l<c)break}return i};function Tn(e,r,t,n){if(A)return G(16,0,1,e,r,t,n);try{var i=x.getStreamFromFD(e),a=So(i,r,t);return(d(),T)[n>>2]=a,0}catch(s){if(typeof o>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var To=e=>e,Fo=e=>{var r=v["_"+e];return p(r,"Cannot call unknown function "+e+", make sure it is exported"),r},Po=(e,r)=>{p(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),(d(),j).set(e,r)},Ao=e=>{var r=Ae(e)+1,t=He(r);return we(e,t,r),t},Fn=(e,r,t,n,i)=>{var a={string:g=>{var F=0;return g!=null&&g!==0&&(F=Ao(g)),F},array:g=>{var F=He(g.length);return Po(g,F),F}};function s(g){return r==="string"?oe(g):r==="boolean"?!!g:g}var c=Fo(e),l=[],u=0;if(p(r!=="array",'Return type should not be "array".'),n)for(var f=0;f<n.length;f++){var h=a[t[f]];h?(u===0&&(u=w()),l[f]=h(n[f])):l[f]=n[f]}var m=c(...l);function _(g){return u!==0&&y(u),s(g)}return m=_(m),m},Co=(e,r,t,n)=>(...i)=>Fn(e,r,t,i),$o=(...e)=>o.createPath(...e),Do=(...e)=>o.unlink(...e),Ro=(...e)=>o.createLazyFile(...e),Oo=(...e)=>o.createDevice(...e),Io=e=>kr(e),Mo=e=>at(e),No=e=>{var r=w(),t=He(4),n=He(4);Bn(e,t,n);var i=(d(),T)[t>>2],a=(d(),T)[n>>2],s=oe(i);ne(i);var c;return a&&(c=oe(a),ne(a)),y(r),[s,c]},Pn=e=>No(e);$.init(),o.createPreloadedFile=Wt,o.staticInit(),Hi(),Zi(),p(te.length===10),ei(),v.noExitRuntime&&(nr=v.noExitRuntime),v.preloadPlugins&&(Ut=v.preloadPlugins),v.print&&(ue=v.print),v.printErr&&(C=v.printErr),v.wasmBinary&&(Me=v.wasmBinary),Wo(),v.arguments&&v.arguments,v.thisProgram&&(Fr=v.thisProgram),p(typeof v.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),p(typeof v.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),p(typeof v.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),p(typeof v.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),p(typeof v.read>"u","Module.read option was removed"),p(typeof v.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),p(typeof v.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),p(typeof v.setWindowTitle>"u","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),p(typeof v.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),p(typeof v.ENVIRONMENT>"u","Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"),p(typeof v.STACK_SIZE>"u","STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),v.addRunDependency=er,v.removeRunDependency=Be,v.ccall=Fn,v.cwrap=Co,v.FS_createPreloadedFile=Wt,v.FS_unlink=Do,v.FS_createPath=$o,v.FS_createDevice=Oo,v.FS=o,v.FS_createDataFile=Lt,v.FS_createLazyFile=Ro,v.MEMFS=P;var xo=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getTempRet0","zeroMemory","withStackSave","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","emscriptenLog","runMainThreadEmAsm","jstoi_q","autoResumeAudioContext","getDynCaller","dynCall","runtimeKeepalivePop","asmjsMangle","HandleAllocator","getNativeTypeSize","addOnInit","addOnPostCtor","addOnPreMain","addOnExit","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","stringToAscii","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSizeCallingThread","setCanvasElementSizeMainThread","setCanvasElementSize","getCanvasSizeCallingThread","getCanvasSizeMainThread","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","safeSetTimeout","setImmediateWrapped","safeRequestAnimationFrame","clearImmediateWrapped","registerPostMainLoop","registerPreMainLoop","getPromise","makePromise","idsToPromises","makePromiseCallback","Browser_asyncPrepareDataCounter","arraySum","addDays","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","webgl_enable_EXT_polygon_offset_clamp","webgl_enable_EXT_clip_control","webgl_enable_WEBGL_polygon_mode","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","emscripten_webgl_destroy_context_before_on_calling_thread","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","demangle","stackTrace","getFunctionArgsName","createJsInvokerSignature","PureVirtualError","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","setDelayFunction","count_emval_handles"];xo.forEach(Zn);var Lo=["run","out","err","callMain","abort","wasmMemory","wasmExports","HEAPF32","HEAPF64","HEAP8","HEAPU8","HEAP16","HEAPU16","HEAP32","HEAPU32","HEAP64","HEAPU64","writeStackCookie","checkStackCookie","INT53_MAX","INT53_MIN","bigintToI53Checked","stackSave","stackRestore","stackAlloc","setTempRet0","ptrToString","exitJS","getHeapMax","growMemory","ENV","ERRNO_CODES","strError","DNS","Protocols","Sockets","timers","warnOnce","readEmAsmArgsArray","readEmAsmArgs","runEmAsmFunction","getExecutableName","handleException","keepRuntimeAlive","runtimeKeepalivePush","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","wasmTable","getUniqueRunDependency","noExitRuntime","addOnPreRun","addOnPostRun","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","AsciiToString","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","checkWasiClock","doReadv","doWritev","initRandomFill","randomFill","emSetImmediate","emClearImmediate_deps","emClearImmediate","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","Browser","requestFullscreen","requestFullScreen","setCanvasSize","getUserMedia","createContext","getPreloadedImageData__data","wget","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS_readFile","FS_root","FS_mounts","FS_devices","FS_streams","FS_nextInode","FS_nameTable","FS_currentPath","FS_initialized","FS_ignorePermissions","FS_filesystems","FS_syncFSRequests","FS_readFiles","FS_lookupPath","FS_getPath","FS_hashName","FS_hashAddNode","FS_hashRemoveNode","FS_lookupNode","FS_createNode","FS_destroyNode","FS_isRoot","FS_isMountpoint","FS_isFile","FS_isDir","FS_isLink","FS_isChrdev","FS_isBlkdev","FS_isFIFO","FS_isSocket","FS_flagsToPermissionString","FS_nodePermissions","FS_mayLookup","FS_mayCreate","FS_mayDelete","FS_mayOpen","FS_checkOpExists","FS_nextfd","FS_getStreamChecked","FS_getStream","FS_createStream","FS_closeStream","FS_dupStream","FS_doSetAttr","FS_chrdev_stream_ops","FS_major","FS_minor","FS_makedev","FS_registerDevice","FS_getDevice","FS_getMounts","FS_syncfs","FS_mount","FS_unmount","FS_lookup","FS_mknod","FS_statfs","FS_statfsStream","FS_statfsNode","FS_create","FS_mkdir","FS_mkdev","FS_symlink","FS_rename","FS_rmdir","FS_readdir","FS_readlink","FS_stat","FS_fstat","FS_lstat","FS_doChmod","FS_chmod","FS_lchmod","FS_fchmod","FS_doChown","FS_chown","FS_lchown","FS_fchown","FS_doTruncate","FS_truncate","FS_ftruncate","FS_utime","FS_open","FS_close","FS_isClosed","FS_llseek","FS_read","FS_write","FS_mmap","FS_msync","FS_ioctl","FS_writeFile","FS_cwd","FS_chdir","FS_createDefaultDirectories","FS_createDefaultDevices","FS_createSpecialDirectories","FS_createStandardStreams","FS_staticInit","FS_init","FS_quit","FS_findObject","FS_analyzePath","FS_createFile","FS_forceLoadFile","FS_absolutePath","FS_createFolder","FS_createLink","FS_joinPath","FS_mmapAlloc","FS_standardizePath","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","print","printErr","jstoi_s","PThread","terminateWorker","cleanupThread","registerTLSInit","spawnThread","exitOnMainThread","proxyToMainThread","proxiedJSCallArgs","invokeEntryPoint","checkMailbox","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","usesDestructorStack","checkArgCount","getRequiredArgCount","createJsInvoker","UnboundTypeError","GenericWireTypeSize","EmValType","EmValOptionalType","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","registeredPointers","registerType","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","assertIntegerRange","readPointer","runDestructors","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_freelist","emval_handles","emval_symbols","getStringOrSymbol","Emval","emval_get_global","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller"];Lo.forEach(mt),v.incrementExceptionRefcount=Io,v.decrementExceptionRefcount=Mo,v.getExceptionMessage=Pn;var Uo=[Ir,$t,jt,zt,Ht,Vt,Gt,Yt,Kt,qt,mn,wn,En,bn,kn,Sn,Tn];function Wo(){Jn("fetchSettings")}var Jr={456728:()=>{typeof v<"u"&&"mjDISABLESTRING mjENABLESTRING mjFRAMESTRING mjLABELSTRING mjRNDSTRING mjTIMERSTRING mjVISSTRING".split(" ").forEach(function(e){Object.defineProperty(v,e,{get:function(){return v["get_"+e]()},set:function(r){},enumerable:!0,configurable:!0})})}},An=M("___getTypeName"),Cn=M("__embind_initialize_bindings"),Zr=M("_pthread_self"),Qr=M("_malloc"),et=M("_fflush"),ne=M("_free"),rt=M("__emscripten_thread_init"),$n=M("__emscripten_thread_crashed"),tt=M("_emscripten_stack_get_end"),Dn=M("__emscripten_run_on_main_thread_js"),Rn=M("__emscripten_thread_free_data"),nt=M("__emscripten_thread_exit"),On=M("__emscripten_timeout"),In=M("_strerror"),Mn=M("__emscripten_check_mailbox"),k=M("_setThrew"),Nn=M("__emscripten_tempret_set"),xn=M("_emscripten_stack_init"),Ln=M("_emscripten_stack_set_limits"),Un=M("__emscripten_stack_restore"),Wn=M("__emscripten_stack_alloc"),it=M("_emscripten_stack_get_current"),at=M("___cxa_decrement_exception_refcount"),kr=M("___cxa_increment_exception_refcount"),Bn=M("___get_exception_message"),jn=M("___cxa_can_catch"),zn=M("___cxa_get_exception_ptr");function Bo(e){An=U("__getTypeName",1),Cn=U("_embind_initialize_bindings",0),Zr=e.pthread_self,Qr=U("malloc",1),et=U("fflush",1),ne=U("free",1),rt=U("_emscripten_thread_init",6),$n=U("_emscripten_thread_crashed",0),tt=e.emscripten_stack_get_end,e.emscripten_stack_get_base,Dn=U("_emscripten_run_on_main_thread_js",5),Rn=U("_emscripten_thread_free_data",1),nt=U("_emscripten_thread_exit",1),On=U("_emscripten_timeout",2),In=U("strerror",1),Mn=U("_emscripten_check_mailbox",0),k=U("setThrew",2),Nn=U("_emscripten_tempret_set",1),xn=e.emscripten_stack_init,Ln=e.emscripten_stack_set_limits,e.emscripten_stack_get_free,Un=e._emscripten_stack_restore,Wn=e._emscripten_stack_alloc,it=e.emscripten_stack_get_current,at=U("__cxa_decrement_exception_refcount",1),kr=U("__cxa_increment_exception_refcount",1),Bn=U("__get_exception_message",3),jn=U("__cxa_can_catch",3),zn=U("__cxa_get_exception_ptr",1)}var ot;function jo(){ot={__assert_fail:pi,__call_sighandler:hi,__cxa_begin_catch:mi,__cxa_current_primary_exception:gi,__cxa_end_catch:yi,__cxa_find_matching_catch_2:wi,__cxa_find_matching_catch_3:Ei,__cxa_find_matching_catch_4:bi,__cxa_rethrow:It,__cxa_rethrow_primary_exception:ki,__cxa_throw:Si,__cxa_uncaught_exceptions:Ti,__resumeException:Fi,__syscall_dup3:jt,__syscall_fcntl64:zt,__syscall_fstat64:Ht,__syscall_ioctl:Vt,__syscall_lstat64:Gt,__syscall_newfstatat:Yt,__syscall_openat:Kt,__syscall_stat64:qt,_abort_js:Ii,_embind_register_bigint:Ni,_embind_register_bool:xi,_embind_register_class:ea,_embind_register_class_class_function:ia,_embind_register_class_constructor:aa,_embind_register_class_function:oa,_embind_register_class_property:sa,_embind_register_constant:ca,_embind_register_emval:un,_embind_register_enum:ua,_embind_register_enum_value:da,_embind_register_float:va,_embind_register_function:_a,_embind_register_integer:pa,_embind_register_memory_view:ha,_embind_register_optional:ga,_embind_register_std_string:ya,_embind_register_std_wstring:Fa,_embind_register_user_type:Pa,_embind_register_void:Aa,_emscripten_init_main_thread_js:Ca,_emscripten_notify_mailbox_postmessage:Da,_emscripten_receive_on_main_thread_js:Ra,_emscripten_runtime_keepalive_clear:Oa,_emscripten_thread_cleanup:Ia,_emscripten_thread_mailbox_await:Yr,_emscripten_thread_set_strongref:Ma,_emscripten_throw_longjmp:Na,_emval_as:xa,_emval_call:La,_emval_call_method:Wa,_emval_decref:Gr,_emval_get_global:Ba,_emval_get_method_caller:Ha,_emval_get_property:Va,_emval_incref:Ga,_emval_is_number:Ya,_emval_is_string:Ka,_emval_new_array:qa,_emval_new_cstring:Xa,_emval_run_destructors:Ja,_emval_take_value:Za,_emval_throw:Qa,_localtime_js:oo,_setitimer_js:mn,_tzset_js:so,clock_time_get:lo,emscripten_asm_const_int:vo,emscripten_check_blocking_allowed:_o,emscripten_date_now:gn,emscripten_exit_with_live_runtime:ho,emscripten_get_heap_max:mo,emscripten_get_now:qr,emscripten_num_logical_cores:go,emscripten_resize_heap:Eo,environ_get:wn,environ_sizes_get:En,exit:Mr,fd_close:bn,fd_read:kn,fd_seek:Sn,fd_write:Tn,invoke_dddi:Is,invoke_dddidi:ms,invoke_ddidi:Os,invoke_di:Ms,invoke_dii:Cs,invoke_diii:ts,invoke_diiii:Ko,invoke_diiiidd:hs,invoke_diiiidi:is,invoke_diiiii:Zo,invoke_diiiiii:ls,invoke_diiiiiii:gs,invoke_diiiiiiiii:ss,invoke_diiiiiiiiiiii:cs,invoke_fiii:qs,invoke_i:Qo,invoke_ii:Ho,invoke_iid:Ds,invoke_iif:Hs,invoke_iii:Go,invoke_iiid:_s,invoke_iiididdddddd:vs,invoke_iiidiiiiiiii:fs,invoke_iiii:Yo,invoke_iiiidddiiiii:ws,invoke_iiiii:Vo,invoke_iiiiid:Ys,invoke_iiiiii:Us,invoke_iiiiiii:Ns,invoke_iiiiiiii:$s,invoke_iiiiiiiiii:xs,invoke_iiiiiiiiiiii:Xs,invoke_iiji:Ws,invoke_ji:Bs,invoke_jiiii:Ks,invoke_v:zo,invoke_vi:qo,invoke_vid:Rs,invoke_vidi:Vs,invoke_vidiii:ds,invoke_vii:Jo,invoke_viid:Es,invoke_viiddii:ys,invoke_viidi:Ls,invoke_viidii:bs,invoke_viidiiid:Ps,invoke_viidiiiii:Ts,invoke_viidiiiiiiii:us,invoke_viii:ns,invoke_viiid:Ss,invoke_viiididdddddd:As,invoke_viiidiiiiiiii:Fs,invoke_viiii:rs,invoke_viiiii:Xo,invoke_viiiiid:ks,invoke_viiiiii:es,invoke_viiiiiii:as,invoke_viiiiiiii:ps,invoke_viiiiiiiiii:zs,invoke_viiiiiiiiiiid:os,invoke_viiiiiiiiiiiii:js,invoke_viiiiiiiiiiiiiii:Js,invoke_viiji:Gs,llvm_eh_typeid_for:To,memory:Q,proc_exit:Ir}}var Ee=await ci();function zo(e){var r=w();try{E(e)()}catch(t){if(y(r),!(t instanceof b))throw t;k(1,0)}}function Ho(e,r){var t=w();try{return E(e)(r)}catch(n){if(y(t),!(n instanceof b))throw n;k(1,0)}}function Vo(e,r,t,n,i){var a=w();try{return E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Go(e,r,t){var n=w();try{return E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Yo(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Ko(e,r,t,n,i){var a=w();try{return E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function qo(e,r){var t=w();try{E(e)(r)}catch(n){if(y(t),!(n instanceof b))throw n;k(1,0)}}function Xo(e,r,t,n,i,a){var s=w();try{E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function Jo(e,r,t){var n=w();try{E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Zo(e,r,t,n,i,a){var s=w();try{return E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function Qo(e){var r=w();try{return E(e)()}catch(t){if(y(r),!(t instanceof b))throw t;k(1,0)}}function es(e,r,t,n,i,a,s){var c=w();try{E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function rs(e,r,t,n,i){var a=w();try{E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function ts(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function ns(e,r,t,n){var i=w();try{E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function is(e,r,t,n,i,a,s){var c=w();try{return E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function as(e,r,t,n,i,a,s,c){var l=w();try{E(e)(r,t,n,i,a,s,c)}catch(u){if(y(l),!(u instanceof b))throw u;k(1,0)}}function os(e,r,t,n,i,a,s,c,l,u,f,h,m){var _=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m)}catch(g){if(y(_),!(g instanceof b))throw g;k(1,0)}}function ss(e,r,t,n,i,a,s,c,l,u){var f=w();try{return E(e)(r,t,n,i,a,s,c,l,u)}catch(h){if(y(f),!(h instanceof b))throw h;k(1,0)}}function cs(e,r,t,n,i,a,s,c,l,u,f,h,m){var _=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h,m)}catch(g){if(y(_),!(g instanceof b))throw g;k(1,0)}}function ls(e,r,t,n,i,a,s){var c=w();try{return E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function us(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function ds(e,r,t,n,i,a){var s=w();try{E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function fs(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function vs(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function _s(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function ps(e,r,t,n,i,a,s,c,l){var u=w();try{E(e)(r,t,n,i,a,s,c,l)}catch(f){if(y(u),!(f instanceof b))throw f;k(1,0)}}function hs(e,r,t,n,i,a,s){var c=w();try{return E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function ms(e,r,t,n,i,a){var s=w();try{return E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function gs(e,r,t,n,i,a,s,c){var l=w();try{return E(e)(r,t,n,i,a,s,c)}catch(u){if(y(l),!(u instanceof b))throw u;k(1,0)}}function ys(e,r,t,n,i,a,s){var c=w();try{E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function ws(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function Es(e,r,t,n){var i=w();try{E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function bs(e,r,t,n,i,a){var s=w();try{E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function ks(e,r,t,n,i,a,s){var c=w();try{E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function Ss(e,r,t,n,i){var a=w();try{E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Ts(e,r,t,n,i,a,s,c,l){var u=w();try{E(e)(r,t,n,i,a,s,c,l)}catch(f){if(y(u),!(f instanceof b))throw f;k(1,0)}}function Fs(e,r,t,n,i,a,s,c,l,u,f,h,m){var _=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m)}catch(g){if(y(_),!(g instanceof b))throw g;k(1,0)}}function Ps(e,r,t,n,i,a,s,c){var l=w();try{E(e)(r,t,n,i,a,s,c)}catch(u){if(y(l),!(u instanceof b))throw u;k(1,0)}}function As(e,r,t,n,i,a,s,c,l,u,f,h,m){var _=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m)}catch(g){if(y(_),!(g instanceof b))throw g;k(1,0)}}function Cs(e,r,t){var n=w();try{return E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function $s(e,r,t,n,i,a,s,c){var l=w();try{return E(e)(r,t,n,i,a,s,c)}catch(u){if(y(l),!(u instanceof b))throw u;k(1,0)}}function Ds(e,r,t){var n=w();try{return E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Rs(e,r,t){var n=w();try{E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Os(e,r,t,n,i){var a=w();try{return E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Is(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Ms(e,r){var t=w();try{return E(e)(r)}catch(n){if(y(t),!(n instanceof b))throw n;k(1,0)}}function Ns(e,r,t,n,i,a,s){var c=w();try{return E(e)(r,t,n,i,a,s)}catch(l){if(y(c),!(l instanceof b))throw l;k(1,0)}}function xs(e,r,t,n,i,a,s,c,l,u){var f=w();try{return E(e)(r,t,n,i,a,s,c,l,u)}catch(h){if(y(f),!(h instanceof b))throw h;k(1,0)}}function Ls(e,r,t,n,i){var a=w();try{E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Us(e,r,t,n,i,a){var s=w();try{return E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function Ws(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Bs(e,r){var t=w();try{return E(e)(r)}catch(n){if(y(t),!(n instanceof b))throw n;return k(1,0),0n}}function js(e,r,t,n,i,a,s,c,l,u,f,h,m,_){var g=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m,_)}catch(F){if(y(g),!(F instanceof b))throw F;k(1,0)}}function zs(e,r,t,n,i,a,s,c,l,u,f){var h=w();try{E(e)(r,t,n,i,a,s,c,l,u,f)}catch(m){if(y(h),!(m instanceof b))throw m;k(1,0)}}function Hs(e,r,t){var n=w();try{return E(e)(r,t)}catch(i){if(y(n),!(i instanceof b))throw i;k(1,0)}}function Vs(e,r,t,n){var i=w();try{E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Gs(e,r,t,n,i){var a=w();try{E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;k(1,0)}}function Ys(e,r,t,n,i,a){var s=w();try{return E(e)(r,t,n,i,a)}catch(c){if(y(s),!(c instanceof b))throw c;k(1,0)}}function Ks(e,r,t,n,i){var a=w();try{return E(e)(r,t,n,i)}catch(s){if(y(a),!(s instanceof b))throw s;return k(1,0),0n}}function qs(e,r,t,n){var i=w();try{return E(e)(r,t,n)}catch(a){if(y(i),!(a instanceof b))throw a;k(1,0)}}function Xs(e,r,t,n,i,a,s,c,l,u,f,h){var m=w();try{return E(e)(r,t,n,i,a,s,c,l,u,f,h)}catch(_){if(y(m),!(_ instanceof b))throw _;k(1,0)}}function Js(e,r,t,n,i,a,s,c,l,u,f,h,m,_,g,F){var I=w();try{E(e)(r,t,n,i,a,s,c,l,u,f,h,m,_,g,F)}catch(R){if(y(I),!(R instanceof b))throw R;k(1,0)}}var Hn;function Zs(){p(!A),xn(),vt()}function st(){if(_e>0){We=st;return}if(A){Dr?.(v),bt();return}if(Zs(),ri(),_e>0){We=st;return}function e(){p(!Hn),Hn=!0,v.calledRun=!0,!ke&&(bt(),Dr?.(v),v.onRuntimeInitialized?.(),Ze("onRuntimeInitialized"),p(!v._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),ti())}v.setStatus?(v.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>v.setStatus(""),1),e()},1)):e(),xe()}function Qs(){var e=ue,r=C,t=!1;ue=C=n=>{t=!0};try{et(0),["stdout","stderr"].forEach(n=>{var i=o.analyzePath("/dev/"+n);if(i){var a=i.object,s=a.rdev,c=fe.ttys[s];c?.output?.length&&(t=!0)}})}catch{}ue=e,C=r,t&&ae("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.")}function ec(){if(v.preInit)for(typeof v.preInit=="function"&&(v.preInit=[v.preInit]);v.preInit.length>0;)v.preInit.shift()();Ze("preInit")}ec(),st(),Ue?Tr=v:Tr=new Promise((e,r)=>{Dr=e,Rr=r});for(const e of Object.keys(v))e in Sr||Object.defineProperty(Sr,e,{configurable:!0,get(){z(`Access to module property ('${e}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});return Tr}),Yn=globalThis.self?.name?.startsWith("em-pthread"),tc=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";tc&&(Yn=(await Promise.resolve().then(function(){return Gn})).workerData==="em-pthread");Yn&&rc();