moorhen 0.7.0 → 0.7.2

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.
@@ -1 +1 @@
1
- var createCCP4Module=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r={}){function t(){return I.buffer!=W.buffer&&K(),W}function n(){return I.buffer!=W.buffer&&K(),j}function o(){return I.buffer!=W.buffer&&K(),U}function a(){return I.buffer!=W.buffer&&K(),B}function i(){return I.buffer!=W.buffer&&K(),z}function s(){return I.buffer!=W.buffer&&K(),H}function l(){return I.buffer!=W.buffer&&K(),Y}var c,d,u=r;u.ready=new Promise(((e,r)=>{c=e,d=r})),["_main","__emscripten_thread_init","__emscripten_thread_exit","__emscripten_thread_crashed","__emscripten_thread_mailbox_await","__emscripten_tls_init","_pthread_self","checkMailbox","establishStackSpace","invokeEntryPoint","PThread","getExceptionMessage","___get_exception_message","_free","___indirect_function_table","_fflush","__embind_initialize_bindings","__emscripten_check_mailbox","___set_stack_limits","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(u.ready,e)||Object.defineProperty(u.ready,e,{get:()=>pe("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>pe("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var f=Object.assign({},u),h="./this.program",p=(e,r)=>{throw r},m="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g=!m&&!y&&!v;if(u.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var _,w,E,b=u.ENVIRONMENT_IS_PTHREAD||!1,T="";function k(e){return u.locateFile?u.locateFile(e,T):T+e}if(y){if("undefined"==typeof process||!process.release||"node"!==process.release.name)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var S=process.versions.node,P=S.split(".").slice(0,3);if((P=1e4*P[0]+100*P[1]+1*P[2].split("-")[0])<16e4)throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+S+")");var C=require("fs"),A=require("path");let e;T=v?A.dirname(T)+"/":__dirname+"/",_=(e,r)=>(e=_e(e)?new URL(e):A.normalize(e),C.readFileSync(e,r?void 0:"utf8")),E=e=>{var r=_(e,!0);return r.buffer||(r=new Uint8Array(r)),q(r.buffer),r},w=(e,r,t,n=!0)=>{e=_e(e)?new URL(e):A.normalize(e),C.readFile(e,n?void 0:"utf8",((e,o)=>{e?t(e):r(n?o.buffer:o)}))},!u.thisProgram&&process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),p=(e,r)=>{throw process.exitCode=e,r},u.inspect=()=>"[Emscripten Module object]";try{e=require("worker_threads")}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}global.Worker=e.Worker}else if(g){if("object"==typeof process&&"function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(_=read),E=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let r=read(e,"binary");return q("object"==typeof r),r},w=(e,r,t)=>{setTimeout((()=>r(E(e))))},"undefined"==typeof clearTimeout&&(globalThis.clearTimeout=e=>{}),"undefined"==typeof setTimeout&&(globalThis.setTimeout=e=>"function"==typeof e?e():pe()),"undefined"!=typeof scriptArgs&&scriptArgs,"function"==typeof quit&&(p=(e,r)=>{throw setTimeout((()=>{if(!(r instanceof Ie)){let e=r;r&&"object"==typeof r&&r.stack&&(e=[r,r.stack]),$(`exiting due to exception: ${e}`)}quit(e)})),r}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!m&&!v)throw new Error("environment detection error");if(v?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),e&&(T=e),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");y||(_=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},v&&(E=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),w=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)})}y&&"undefined"==typeof performance&&(global.performance=require("perf_hooks").performance);var F=console.log.bind(console),O=console.error.bind(console);y&&(F=(...e)=>C.writeSync(1,e.join(" ")+"\n"),O=(...e)=>C.writeSync(2,e.join(" ")+"\n"));var D,M,N=u.print||F,$=u.printErr||O;Object.assign(u,f),f=null,D="fetchSettings",Object.getOwnPropertyDescriptor(u,D)&&pe(`\`Module.${D}\` was supplied but \`${D}\` not included in INCOMING_MODULE_JS_API`),u.arguments&&u.arguments,Se("arguments","arguments_"),u.thisProgram&&(h=u.thisProgram),Se("thisProgram","thisProgram"),u.quit&&(p=u.quit),Se("quit","quit_"),q(void 0===u.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),q(void 0===u.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),q(void 0===u.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),q(void 0===u.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),q(void 0===u.read,"Module.read option was removed (modify read_ in JS)"),q(void 0===u.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),q(void 0===u.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),q(void 0===u.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),q(void 0===u.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Se("asm","wasmExports"),Se("read","read_"),Se("readAsync","readAsync"),Se("readBinary","readBinary"),Se("setWindowTitle","setWindowTitle"),q(m||v||y,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"),q(!g,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),u.wasmBinary&&(M=u.wasmBinary),Se("wasmBinary","wasmBinary");var I,R,x=u.noExitRuntime||!0;Se("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&pe("no native wasm support detected");var L,W,j,U,B,z,H,G,Y,V=!1;function q(e,r){e||pe("Assertion failed"+(r?": "+r:""))}function K(){var e=I.buffer;u.HEAP8=W=new Int8Array(e),u.HEAP16=U=new Int16Array(e),u.HEAPU8=j=new Uint8Array(e),u.HEAPU16=B=new Uint16Array(e),u.HEAP32=z=new Int32Array(e),u.HEAPU32=H=new Uint32Array(e),u.HEAPF32=G=new Float32Array(e),u.HEAPF64=Y=new Float64Array(e)}q(!u.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),q("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support");var X=u.INITIAL_MEMORY||16777216;if(Se("INITIAL_MEMORY","INITIAL_MEMORY"),q(X>=5242880,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+X+"! (STACK_SIZE=5242880)"),b)I=u.wasmMemory;else if(u.wasmMemory)I=u.wasmMemory;else if(!((I=new WebAssembly.Memory({initial:X/65536,maximum:32768,shared:!0})).buffer instanceof SharedArrayBuffer))throw $("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),y&&$("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");function J(){var e=Fn();q(0==(3&e)),0==e&&(e+=4),s()[e>>2]=34821223,Me(34821223),s()[e+4>>2]=2310721022,Me(2310721022),s()[0]=1668509029,Me(1668509029)}function Z(){if(!V){var e=Fn();0==e&&(e+=4);var r=s()[e>>2],t=s()[e+4>>2];34821223==r&&2310721022==t||pe(`Stack overflow! Stack cookie has been overwritten at ${dr(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${dr(t)} ${dr(r)}`),1668509029!=s()[0]&&pe("Runtime error: The application has corrupted its heap memory area (address zero)!")}}K(),q((X=I.buffer.byteLength)%65536==0),function(){var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,115!==r[0]||99!==r[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var Q=[],ee=[],re=[],te=!1,ne=0;function oe(){return x||ne>0}function ae(){q(!te),te=!0,b||(Z(),_r(),u.noFSInit||ir.init.initialized||ir.init(),ir.ignorePermissions=!1,Ve.init(),hr(ee))}function ie(e){Q.unshift(e)}q(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var se=0,le=null,ce=null,de={};function ue(e){for(var r=e;;){if(!de[e])return e;e=r+Math.random()}}function fe(e){se++,u.monitorRunDependencies&&u.monitorRunDependencies(se),e?(q(!de[e]),de[e]=1,null===le&&"undefined"!=typeof setInterval&&(le=setInterval((()=>{if(V)return clearInterval(le),void(le=null);var e=!1;for(var r in de)e||(e=!0,$("still waiting on run dependencies:")),$(`dependency: ${r}`);e&&$("(end of list)")}),1e4))):$("warning: run dependency added without ID")}function he(e){if(se--,u.monitorRunDependencies&&u.monitorRunDependencies(se),e?(q(de[e]),delete de[e]):$("warning: run dependency removed without ID"),0==se&&(null!==le&&(clearInterval(le),le=null),ce)){var r=ce;ce=null,r()}}function pe(e){u.onAbort&&u.onAbort(e),$(e="Aborted("+e+")"),V=!0,L=1;var r=new WebAssembly.RuntimeError(e);throw d(r),r}var me,ve,ye;function ge(e){return e.startsWith("data:application/octet-stream;base64,")}function _e(e){return e.startsWith("file://")}function we(e){return function(){q(te,`native function \`${e}\` called before runtime initialization`);var r=_n[e];return q(r,`exported native function \`${e}\` not found`),r.apply(null,arguments)}}class Ee extends Error{}class be extends Ee{constructor(e){super(e),this.excPtr=e;const r=mr(e);this.name=r[0],this.message=r[1]}}function Te(e){if(e==me&&M)return new Uint8Array(M);if(E)return E(e);throw"both async and sync fetching of the wasm failed"}function ke(e,r,t){return function(e){if(!M&&(m||v)){if("function"==typeof fetch&&!_e(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>Te(e)));if(w)return new Promise(((r,t)=>{w(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>Te(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{$(`failed to asynchronously prepare wasm: ${e}`),_e(me)&&$(`warning: Loading from a file URI (${me}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),pe(e)}))}function Se(e,r,t=!0){Object.getOwnPropertyDescriptor(u,e)||Object.defineProperty(u,e,{configurable:!0,get(){pe(`\`Module.${e}\` has been replaced by \`${r}\``+(t?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function Pe(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function Ce(e,r){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){wr("`"+e+"` is not longer defined by emscripten. "+r)}})}function Ae(e){Object.getOwnPropertyDescriptor(u,e)||Object.defineProperty(u,e,{configurable:!0,get(){var r="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";Pe(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),pe(r)}})}function Fe(e,r,t,n){q(Number.isInteger(Number(e)),"attempt to write non-integer ("+e+") into integer heap"),q(e<=n,"value ("+e+") too large to write as "+r+"-bit value"),q(e>=t,"value ("+e+") too small to write as "+r+"-bit value")}ge(me="web_example.wasm")||(me=k(me)),Ce("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),Ce("asm","Please use wasmExports instead");var Oe=e=>Fe(e,8,-127,255),De=e=>Fe(e,16,-32767,65535),Me=e=>Fe(e,32,-2147483647,4294967295),Ne=e=>Fe(e,64,-0x8000000000000000,0x10000000000000000);function $e(e){y?C.writeSync(2,Array.from(arguments).join(" ")+"\n"):console.warn.apply(console,arguments)}function Ie(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var Re=e=>{e.terminate(),e.onmessage=r=>{var t=r.data.cmd;$(`received "${t}" command from terminated worker: ${e.workerID}`)}},xe=e=>{q(!b,"Internal Error! cleanupThread() can only ever be called from main application thread!"),q(e,"Internal Error! Null pthread_ptr in cleanupThread!");var r=fr.pthreads[e];q(r),fr.returnWorkerToPool(r)},Le={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Le.isAbs(e),t="/"===e.substr(-1);return(e=Le.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Le.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Le.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Le.normalize(e.join("/"))},join2:(e,r)=>Le.normalize(e+"/"+r)},We=e=>(We=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>(e.set(crypto.getRandomValues(new Uint8Array(e.byteLength))),e);if(y)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}pe("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")})())(e),je={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:ir.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=Le.isAbs(n)}return(r?"/":"")+(e=Le.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=je.resolve(e).substr(1),r=je.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},Ue="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,Be=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Ue)return Ue.decode(e.buffer instanceof SharedArrayBuffer?e.slice(r,o):e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var l=63&e[r++];if(224==(240&i)?i=(15&i)<<12|s<<6|l:(240!=(248&i)&&wr("Invalid UTF-8 leading byte "+dr(i)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),i=(7&i)<<18|s<<12|l<<6|63&e[r++]),i<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ze=[],He=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Ge=(e,r,t,n)=>{if(q("string"==typeof e),!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;s>1114111&&wr("Invalid Unicode code point "+dr(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function Ye(e,r,t){var n=t>0?t:He(e)+1,o=new Array(n),a=Ge(e,o,0,o.length);return r&&(o.length=a),o}var Ve={ttys:[],init(){},shutdown(){},register(e,r){Ve.ttys[e]={input:[],output:[],ops:r},ir.registerDevice(e,Ve.stream_ops)},stream_ops:{open(e){var r=Ve.ttys[e.node.rdev];if(!r)throw new ir.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new ir.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ir.ErrnoError(29)}if(void 0===s&&0===a)throw new ir.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new ir.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new ir.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!ze.length){var e=null;if(y){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=C.readSync(n,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;ze=Ye(e,!0)}return ze.shift()})(),put_char(e,r){null===r||10===r?(N(Be(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(N(Be(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?($(Be(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&($(Be(e.output,0)),e.output=[])}}},qe=e=>{e=((e,r)=>(q(r,"alignment argument is required"),Math.ceil(e/r)*r))(e,65536);var r=Sn(65536,e);return r?((e,r)=>(n().fill(0,e,e+r),e))(r,e):0},Ke={ops_table:null,mount:e=>Ke.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ir.isBlkdev(t)||ir.isFIFO(t))throw new ir.ErrnoError(63);Ke.ops_table||(Ke.ops_table={dir:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr,lookup:Ke.node_ops.lookup,mknod:Ke.node_ops.mknod,rename:Ke.node_ops.rename,unlink:Ke.node_ops.unlink,rmdir:Ke.node_ops.rmdir,readdir:Ke.node_ops.readdir,symlink:Ke.node_ops.symlink},stream:{llseek:Ke.stream_ops.llseek}},file:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr},stream:{llseek:Ke.stream_ops.llseek,read:Ke.stream_ops.read,write:Ke.stream_ops.write,allocate:Ke.stream_ops.allocate,mmap:Ke.stream_ops.mmap,msync:Ke.stream_ops.msync}},link:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr,readlink:Ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr},stream:ir.chrdev_stream_ops}});var o=ir.createNode(e,r,t,n);return ir.isDir(o.mode)?(o.node_ops=Ke.ops_table.dir.node,o.stream_ops=Ke.ops_table.dir.stream,o.contents={}):ir.isFile(o.mode)?(o.node_ops=Ke.ops_table.file.node,o.stream_ops=Ke.ops_table.file.stream,o.usedBytes=0,o.contents=null):ir.isLink(o.mode)?(o.node_ops=Ke.ops_table.link.node,o.stream_ops=Ke.ops_table.link.stream):ir.isChrdev(o.mode)&&(o.node_ops=Ke.ops_table.chrdev.node,o.stream_ops=Ke.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ir.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,ir.isDir(e.mode)?r.size=4096:ir.isFile(e.mode)?r.size=e.usedBytes:ir.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&Ke.resizeFileStorage(e,r.size)},lookup(e,r){throw ir.genericErrors[44]},mknod:(e,r,t,n)=>Ke.createNode(e,r,t,n),rename(e,r,t){if(ir.isDir(e.mode)){var n;try{n=ir.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new ir.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ir.lookupNode(e,r);for(var n in t.contents)throw new ir.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=Ke.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ir.isLink(e.mode))throw new ir.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(q(i>=0),i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,n,o,a,i){if(q(!(r instanceof ArrayBuffer)),r.buffer===t().buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return q(0===a,"canOwn must imply no weird position inside the file"),s.contents=r.subarray(n,n+o),s.usedBytes=o,o;if(0===s.usedBytes&&0===a)return s.contents=r.slice(n,n+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(n,n+o),a),o}if(Ke.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+o),a);else for(var l=0;l<o;l++)s.contents[a+l]=r[n+l];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ir.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ir.ErrnoError(28);return n},allocate(e,r,t){Ke.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,n,o,a){if(!ir.isFile(e.node.mode))throw new ir.ErrnoError(43);var i,s,l=e.node.contents;if(2&a||l.buffer!==t().buffer){if((n>0||n+r<l.length)&&(l=l.subarray?l.subarray(n,n+r):Array.prototype.slice.call(l,n,n+r)),s=!0,!(i=qe(r)))throw new ir.ErrnoError(48);t().set(l,i)}else s=!1,i=l.byteOffset;return{ptr:i,allocated:s}},msync:(e,r,t,n,o)=>(Ke.stream_ops.write(e,r,0,n,t,!1),0)}},Xe=u.preloadPlugins||[],Je=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Ze={dbs:{},indexedDB:()=>{if("undefined"!=typeof indexedDB)return indexedDB;var e=null;return"object"==typeof window&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),q(e,"IDBFS used, but indexedDB not supported"),e},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(e){return Ke.mount.apply(null,arguments)},syncfs:(e,r,t)=>{Ze.getLocalSet(e,((n,o)=>{if(n)return t(n);Ze.getRemoteSet(e,((e,n)=>{if(e)return t(e);var a=r?n:o,i=r?o:n;Ze.reconcile(a,i,t)}))}))},quit:()=>{Object.values(Ze.dbs).forEach((e=>e.close())),Ze.dbs={}},getDB:(e,r)=>{var t,n=Ze.dbs[e];if(n)return r(null,n);try{t=Ze.indexedDB().open(e,Ze.DB_VERSION)}catch(e){return r(e)}if(!t)return r("Unable to connect to IndexedDB");t.onupgradeneeded=e=>{var r,t=e.target.result,n=e.target.transaction;(r=t.objectStoreNames.contains(Ze.DB_STORE_NAME)?n.objectStore(Ze.DB_STORE_NAME):t.createObjectStore(Ze.DB_STORE_NAME)).indexNames.contains("timestamp")||r.createIndex("timestamp","timestamp",{unique:!1})},t.onsuccess=()=>{n=t.result,Ze.dbs[e]=n,r(null,n)},t.onerror=e=>{r(e.target.error),e.preventDefault()}},getLocalSet:(e,r)=>{var t={};function n(e){return"."!==e&&".."!==e}function o(e){return r=>Le.join2(e,r)}for(var a=ir.readdir(e.mountpoint).filter(n).map(o(e.mountpoint));a.length;){var i,s=a.pop();try{i=ir.stat(s)}catch(e){return r(e)}ir.isDir(i.mode)&&a.push.apply(a,ir.readdir(s).filter(n).map(o(s))),t[s]={timestamp:i.mtime}}return r(null,{type:"local",entries:t})},getRemoteSet:(e,r)=>{var t={};Ze.getDB(e.mountpoint,((e,n)=>{if(e)return r(e);try{var o=n.transaction([Ze.DB_STORE_NAME],"readonly");o.onerror=e=>{r(e.target.error),e.preventDefault()},o.objectStore(Ze.DB_STORE_NAME).index("timestamp").openKeyCursor().onsuccess=e=>{var o=e.target.result;if(!o)return r(null,{type:"remote",db:n,entries:t});t[o.primaryKey]={timestamp:o.key},o.continue()}}catch(e){return r(e)}}))},loadLocalEntry:(e,r)=>{var t,n;try{n=ir.lookupPath(e).node,t=ir.stat(e)}catch(e){return r(e)}return ir.isDir(t.mode)?r(null,{timestamp:t.mtime,mode:t.mode}):ir.isFile(t.mode)?(n.contents=Ke.getFileDataAsTypedArray(n),r(null,{timestamp:t.mtime,mode:t.mode,contents:n.contents})):r(new Error("node type not supported"))},storeLocalEntry:(e,r,t)=>{try{if(ir.isDir(r.mode))ir.mkdirTree(e,r.mode);else{if(!ir.isFile(r.mode))return t(new Error("node type not supported"));ir.writeFile(e,r.contents,{canOwn:!0})}ir.chmod(e,r.mode),ir.utime(e,r.timestamp,r.timestamp)}catch(e){return t(e)}t(null)},removeLocalEntry:(e,r)=>{try{var t=ir.stat(e);ir.isDir(t.mode)?ir.rmdir(e):ir.isFile(t.mode)&&ir.unlink(e)}catch(e){return r(e)}r(null)},loadRemoteEntry:(e,r,t)=>{var n=e.get(r);n.onsuccess=e=>{t(null,e.target.result)},n.onerror=e=>{t(e.target.error),e.preventDefault()}},storeRemoteEntry:(e,r,t,n)=>{try{var o=e.put(t,r)}catch(e){return void n(e)}o.onsuccess=()=>{n(null)},o.onerror=e=>{n(e.target.error),e.preventDefault()}},removeRemoteEntry:(e,r,t)=>{var n=e.delete(r);n.onsuccess=()=>{t(null)},n.onerror=e=>{t(e.target.error),e.preventDefault()}},reconcile:(e,r,t)=>{var n=0,o=[];Object.keys(e.entries).forEach((function(t){var a=e.entries[t],i=r.entries[t];i&&a.timestamp.getTime()==i.timestamp.getTime()||(o.push(t),n++)}));var a=[];if(Object.keys(r.entries).forEach((function(r){e.entries[r]||(a.push(r),n++)})),!n)return t(null);var i=!1,s=("remote"===e.type?e.db:r.db).transaction([Ze.DB_STORE_NAME],"readwrite"),l=s.objectStore(Ze.DB_STORE_NAME);function c(e){if(e&&!i)return i=!0,t(e)}s.onerror=e=>{c(this.error),e.preventDefault()},s.oncomplete=e=>{i||t(null)},o.sort().forEach((e=>{"local"===r.type?Ze.loadRemoteEntry(l,e,((r,t)=>{if(r)return c(r);Ze.storeLocalEntry(e,t,c)})):Ze.loadLocalEntry(e,((r,t)=>{if(r)return c(r);Ze.storeRemoteEntry(l,e,t,c)}))})),a.sort().reverse().forEach((e=>{"local"===r.type?Ze.removeLocalEntry(e,c):Ze.removeRemoteEntry(l,e,c)}))}},Qe={},er={isWindows:!1,staticInit(){er.isWindows=!!process.platform.match(/^win/);var e=process.binding("constants");e.fs&&(e=e.fs),er.flagsForNodeMap={1024:e.O_APPEND,64:e.O_CREAT,128:e.O_EXCL,256:e.O_NOCTTY,0:e.O_RDONLY,2:e.O_RDWR,4096:e.O_SYNC,512:e.O_TRUNC,1:e.O_WRONLY,131072:e.O_NOFOLLOW},q(0===er.flagsForNodeMap[0])},convertNodeCode(e){var r=e.code;return q(r in Qe,`unexpected node error code: ${r} (${e})`),Qe[r]},mount:e=>(q(y),er.createNode(null,"/",er.getMode(e.opts.root),0)),createNode(e,r,t,n){if(!ir.isDir(t)&&!ir.isFile(t)&&!ir.isLink(t))throw new ir.ErrnoError(28);var o=ir.createNode(e,r,t);return o.node_ops=er.node_ops,o.stream_ops=er.stream_ops,o},getMode(e){var r;try{r=C.lstatSync(e),er.isWindows&&(r.mode=r.mode|(292&r.mode)>>2)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}return r.mode},realPath(e){for(var r=[];e.parent!==e;)r.push(e.name),e=e.parent;return r.push(e.mount.opts.root),r.reverse(),Le.join.apply(null,r)},flagsForNode(e){e&=-2097153,e&=-2049,e&=-32769,e&=-524289,e&=-65537;var r=0;for(var t in er.flagsForNodeMap)e&t&&(r|=er.flagsForNodeMap[t],e^=t);if(e)throw new ir.ErrnoError(28);return r},node_ops:{getattr(e){var r,t=er.realPath(e);try{r=C.lstatSync(t)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}return er.isWindows&&!r.blksize&&(r.blksize=4096),er.isWindows&&!r.blocks&&(r.blocks=(r.size+r.blksize-1)/r.blksize|0),{dev:r.dev,ino:r.ino,mode:r.mode,nlink:r.nlink,uid:r.uid,gid:r.gid,rdev:r.rdev,size:r.size,atime:r.atime,mtime:r.mtime,ctime:r.ctime,blksize:r.blksize,blocks:r.blocks}},setattr(e,r){var t=er.realPath(e);try{if(void 0!==r.mode&&(C.chmodSync(t,r.mode),e.mode=r.mode),void 0!==r.timestamp){var n=new Date(r.timestamp);C.utimesSync(t,n,n)}void 0!==r.size&&C.truncateSync(t,r.size)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}},lookup(e,r){var t=Le.join2(er.realPath(e),r),n=er.getMode(t);return er.createNode(e,r,n)},mknod(e,r,t,n){var o=er.createNode(e,r,t,n),a=er.realPath(o);try{ir.isDir(o.mode)?C.mkdirSync(a,o.mode):C.writeFileSync(a,"",{mode:o.mode})}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}return o},rename(e,r,t){var n=er.realPath(e),o=Le.join2(er.realPath(r),t);try{C.renameSync(n,o)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}e.name=t},unlink(e,r){var t=Le.join2(er.realPath(e),r);try{C.unlinkSync(t)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}},rmdir(e,r){var t=Le.join2(er.realPath(e),r);try{C.rmdirSync(t)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}},readdir(e){var r=er.realPath(e);try{return C.readdirSync(r)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}},symlink(e,r,t){var n=Le.join2(er.realPath(e),r);try{C.symlinkSync(t,n)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}},readlink(e){var r=er.realPath(e);try{return r=C.readlinkSync(r),r=A.relative(A.resolve(e.mount.opts.root),r)}catch(e){if(!e.code)throw e;if("UNKNOWN"===e.code)throw new ir.ErrnoError(28);throw new ir.ErrnoError(er.convertNodeCode(e))}}},stream_ops:{open(e){var r=er.realPath(e.node);try{ir.isFile(e.node.mode)&&(e.nfd=C.openSync(r,er.flagsForNode(e.flags)))}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}},close(e){try{ir.isFile(e.node.mode)&&e.nfd&&C.closeSync(e.nfd)}catch(e){if(!e.code)throw e;throw new ir.ErrnoError(er.convertNodeCode(e))}},read(e,r,t,n,o){if(0===n)return 0;try{return C.readSync(e.nfd,new Int8Array(r.buffer,t,n),{position:o})}catch(e){throw new ir.ErrnoError(er.convertNodeCode(e))}},write(e,r,t,n,o){try{return C.writeSync(e.nfd,new Int8Array(r.buffer,t,n),{position:o})}catch(e){throw new ir.ErrnoError(er.convertNodeCode(e))}},llseek(e,r,t){var n=r;if(1===t)n+=e.position;else if(2===t&&ir.isFile(e.node.mode))try{n+=C.fstatSync(e.nfd).size}catch(e){throw new ir.ErrnoError(er.convertNodeCode(e))}if(n<0)throw new ir.ErrnoError(28);return n},mmap(e,r,n,o,a){if(!ir.isFile(e.node.mode))throw new ir.ErrnoError(43);var i=qe(r);return er.stream_ops.read(e,t(),i,r,n),{ptr:i,allocated:!0}},msync:(e,r,t,n,o)=>(er.stream_ops.write(e,r,0,n,t,!1),0)}},rr={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},tr=e=>{var r=Ln(),t=e();return Wn(r),t},nr=(e,r,t)=>(q("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Ge(e,n(),r,t)),or=(e,r)=>(q("number"==typeof e),e?Be(n(),e,r):""),ar=e=>(ar.recursionGuard=1+(0|ar.recursionGuard),ar.recursionGuard>1?e:tr((()=>{try{var r=e;r.startsWith("__Z")&&(r=r.substr(1));var t=(e=>{var r=He(e)+1,t=jn(r);return nr(e,t,r),t})(r),n=jn(4),o=Hn(t,0,0,n);if(0===i()[n>>2]&&o)return or(o)}catch(e){}finally{bn(o),ar.recursionGuard<2&&--ar.recursionGuard}return e}))),ir={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=je.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ir.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=ir.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=ir.lookupNode(n,t[a]),o=Le.join2(o,t[a]),ir.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;ir.isLink(n.mode);){var l=ir.readlink(o);if(o=je.resolve(Le.dirname(o),l),n=ir.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new ir.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(ir.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)%ir.nameTable.length},hashAddNode(e){var r=ir.hashName(e.parent.id,e.name);e.name_next=ir.nameTable[r],ir.nameTable[r]=e},hashRemoveNode(e){var r=ir.hashName(e.parent.id,e.name);if(ir.nameTable[r]===e)ir.nameTable[r]=e.name_next;else for(var t=ir.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ir.mayLookup(e);if(t)throw new ir.ErrnoError(t,e);for(var n=ir.hashName(e.id,r),o=ir.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ir.lookup(e,r)},createNode(e,r,t,n){q("object"==typeof e);var o=new ir.FSNode(e,r,t,n);return ir.hashAddNode(o),o},destroyNode(e){ir.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ir.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>ir.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return ir.lookupNode(e,r),20}catch(e){}return ir.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ir.lookupNode(e,r)}catch(e){return e.errno}var o=ir.nodePermissions(e,"wx");if(o)return o;if(t){if(!ir.isDir(n.mode))return 54;if(ir.isRoot(n)||ir.getPath(n)===ir.cwd())return 10}else if(ir.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ir.isLink(e.mode)?32:ir.isDir(e.mode)&&("r"!==ir.flagsToPermissionString(r)||512&r)?31:ir.nodePermissions(e,ir.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ir.MAX_OPEN_FDS;e++)if(!ir.streams[e])return e;throw new ir.ErrnoError(33)},getStreamChecked(e){var r=ir.getStream(e);if(!r)throw new ir.ErrnoError(8);return r},getStream:e=>ir.streams[e],createStream:(e,r=-1)=>(ir.FSStream||(ir.FSStream=function(){this.shared={}},ir.FSStream.prototype={},Object.defineProperties(ir.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new ir.FSStream,e),-1==r&&(r=ir.nextfd()),e.fd=r,ir.streams[r]=e,e),closeStream(e){ir.streams[e]=null},chrdev_stream_ops:{open(e){var r=ir.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new ir.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ir.devices[e]={stream_ops:r}},getDevice:e=>ir.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ir.syncFSRequests++,ir.syncFSRequests>1&&$(`warning: ${ir.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ir.getMounts(ir.root.mount),n=0;function o(e){return q(ir.syncFSRequests>0),ir.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){if("string"==typeof e)throw e;var n,o="/"===t,a=!t;if(o&&ir.root)throw new ir.ErrnoError(10);if(!o&&!a){var i=ir.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ir.isMountpoint(n))throw new ir.ErrnoError(10);if(!ir.isDir(n.mode))throw new ir.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?ir.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=ir.lookupPath(e,{follow_mount:!1});if(!ir.isMountpoint(r.node))throw new ir.ErrnoError(28);var t=r.node,n=t.mounted,o=ir.getMounts(n);Object.keys(ir.nameTable).forEach((e=>{for(var r=ir.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ir.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);q(-1!==a),t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ir.lookupPath(e,{parent:!0}).node,o=Le.basename(e);if(!o||"."===o||".."===o)throw new ir.ErrnoError(28);var a=ir.mayCreate(n,o);if(a)throw new ir.ErrnoError(a);if(!n.node_ops.mknod)throw new ir.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ir.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ir.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{ir.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,ir.mknod(e,r,t)),symlink(e,r){if(!je.resolve(e))throw new ir.ErrnoError(44);var t=ir.lookupPath(r,{parent:!0}).node;if(!t)throw new ir.ErrnoError(44);var n=Le.basename(r),o=ir.mayCreate(t,n);if(o)throw new ir.ErrnoError(o);if(!t.node_ops.symlink)throw new ir.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=Le.dirname(e),a=Le.dirname(r),i=Le.basename(e),s=Le.basename(r);if(t=ir.lookupPath(e,{parent:!0}).node,n=ir.lookupPath(r,{parent:!0}).node,!t||!n)throw new ir.ErrnoError(44);if(t.mount!==n.mount)throw new ir.ErrnoError(75);var l,c=ir.lookupNode(t,i),d=je.relative(e,a);if("."!==d.charAt(0))throw new ir.ErrnoError(28);if("."!==(d=je.relative(r,o)).charAt(0))throw new ir.ErrnoError(55);try{l=ir.lookupNode(n,s)}catch(e){}if(c!==l){var u=ir.isDir(c.mode),f=ir.mayDelete(t,i,u);if(f)throw new ir.ErrnoError(f);if(f=l?ir.mayDelete(n,s,u):ir.mayCreate(n,s))throw new ir.ErrnoError(f);if(!t.node_ops.rename)throw new ir.ErrnoError(63);if(ir.isMountpoint(c)||l&&ir.isMountpoint(l))throw new ir.ErrnoError(10);if(n!==t&&(f=ir.nodePermissions(t,"w")))throw new ir.ErrnoError(f);ir.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{ir.hashAddNode(c)}}},rmdir(e){var r=ir.lookupPath(e,{parent:!0}).node,t=Le.basename(e),n=ir.lookupNode(r,t),o=ir.mayDelete(r,t,!0);if(o)throw new ir.ErrnoError(o);if(!r.node_ops.rmdir)throw new ir.ErrnoError(63);if(ir.isMountpoint(n))throw new ir.ErrnoError(10);r.node_ops.rmdir(r,t),ir.destroyNode(n)},readdir(e){var r=ir.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ir.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ir.lookupPath(e,{parent:!0}).node;if(!r)throw new ir.ErrnoError(44);var t=Le.basename(e),n=ir.lookupNode(r,t),o=ir.mayDelete(r,t,!1);if(o)throw new ir.ErrnoError(o);if(!r.node_ops.unlink)throw new ir.ErrnoError(63);if(ir.isMountpoint(n))throw new ir.ErrnoError(10);r.node_ops.unlink(r,t),ir.destroyNode(n)},readlink(e){var r=ir.lookupPath(e).node;if(!r)throw new ir.ErrnoError(44);if(!r.node_ops.readlink)throw new ir.ErrnoError(28);return je.resolve(ir.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ir.lookupPath(e,{follow:!r}).node;if(!t)throw new ir.ErrnoError(44);if(!t.node_ops.getattr)throw new ir.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ir.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?ir.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new ir.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ir.chmod(e,r,!0)},fchmod(e,r){var t=ir.getStreamChecked(e);ir.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?ir.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ir.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){ir.chown(e,r,t,!0)},fchown(e,r,t){var n=ir.getStreamChecked(e);ir.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ir.ErrnoError(28);var t;if(!(t="string"==typeof e?ir.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ir.ErrnoError(63);if(ir.isDir(t.mode))throw new ir.ErrnoError(31);if(!ir.isFile(t.mode))throw new ir.ErrnoError(28);var n=ir.nodePermissions(t,"w");if(n)throw new ir.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ir.getStreamChecked(e);if(0==(2097155&t.flags))throw new ir.ErrnoError(28);ir.truncate(t.node,r)},utime(e,r,t){var n=ir.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ir.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=Le.normalize(e);try{n=ir.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new ir.ErrnoError(20)}else n=ir.mknod(e,t,0),o=!0;if(!n)throw new ir.ErrnoError(44);if(ir.isChrdev(n.mode)&&(r&=-513),65536&r&&!ir.isDir(n.mode))throw new ir.ErrnoError(54);if(!o){var a=ir.mayOpen(n,r);if(a)throw new ir.ErrnoError(a)}512&r&&!o&&ir.truncate(n,0),r&=-131713;var i=ir.createStream({node:n,path:ir.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!u.logReadFiles||1&r||(ir.readFiles||(ir.readFiles={}),e in ir.readFiles||(ir.readFiles[e]=1)),i},close(e){if(ir.isClosed(e))throw new ir.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ir.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ir.isClosed(e))throw new ir.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ir.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ir.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(q(t>=0),n<0||o<0)throw new ir.ErrnoError(28);if(ir.isClosed(e))throw new ir.ErrnoError(8);if(1==(2097155&e.flags))throw new ir.ErrnoError(8);if(ir.isDir(e.node.mode))throw new ir.ErrnoError(31);if(!e.stream_ops.read)throw new ir.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ir.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(q(t>=0),n<0||o<0)throw new ir.ErrnoError(28);if(ir.isClosed(e))throw new ir.ErrnoError(8);if(0==(2097155&e.flags))throw new ir.ErrnoError(8);if(ir.isDir(e.node.mode))throw new ir.ErrnoError(31);if(!e.stream_ops.write)throw new ir.ErrnoError(28);e.seekable&&1024&e.flags&&ir.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ir.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(ir.isClosed(e))throw new ir.ErrnoError(8);if(r<0||t<=0)throw new ir.ErrnoError(28);if(0==(2097155&e.flags))throw new ir.ErrnoError(8);if(!ir.isFile(e.node.mode)&&!ir.isDir(e.node.mode))throw new ir.ErrnoError(43);if(!e.stream_ops.allocate)throw new ir.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new ir.ErrnoError(2);if(1==(2097155&e.flags))throw new ir.ErrnoError(2);if(!e.stream_ops.mmap)throw new ir.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>(q(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0),munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ir.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ir.open(e,r.flags),o=ir.stat(e).size,a=new Uint8Array(o);return ir.read(n,a,0,o,0),"utf8"===r.encoding?t=Be(a,0):"binary"===r.encoding&&(t=a),ir.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ir.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(He(r)+1),a=Ge(r,o,0,o.length);ir.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ir.write(n,r,0,r.byteLength,void 0,t.canOwn)}ir.close(n)},cwd:()=>ir.currentPath,chdir(e){var r=ir.lookupPath(e,{follow:!0});if(null===r.node)throw new ir.ErrnoError(44);if(!ir.isDir(r.node.mode))throw new ir.ErrnoError(54);var t=ir.nodePermissions(r.node,"x");if(t)throw new ir.ErrnoError(t);ir.currentPath=r.path},createDefaultDirectories(){ir.mkdir("/tmp"),ir.mkdir("/home"),ir.mkdir("/home/web_user")},createDefaultDevices(){ir.mkdir("/dev"),ir.registerDevice(ir.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),ir.mkdev("/dev/null",ir.makedev(1,3)),Ve.register(ir.makedev(5,0),Ve.default_tty_ops),Ve.register(ir.makedev(6,0),Ve.default_tty1_ops),ir.mkdev("/dev/tty",ir.makedev(5,0)),ir.mkdev("/dev/tty1",ir.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=We(e).byteLength),e[--r]);ir.createDevice("/dev","random",t),ir.createDevice("/dev","urandom",t),ir.mkdir("/dev/shm"),ir.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ir.mkdir("/proc");var e=ir.mkdir("/proc/self");ir.mkdir("/proc/self/fd"),ir.mount({mount(){var r=ir.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ir.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?ir.createDevice("/dev","stdin",u.stdin):ir.symlink("/dev/tty","/dev/stdin"),u.stdout?ir.createDevice("/dev","stdout",null,u.stdout):ir.symlink("/dev/tty","/dev/stdout"),u.stderr?ir.createDevice("/dev","stderr",null,u.stderr):ir.symlink("/dev/tty1","/dev/stderr");var e=ir.open("/dev/stdin",0),r=ir.open("/dev/stdout",1),t=ir.open("/dev/stderr",1);q(0===e.fd,`invalid handle for stdin (${e.fd})`),q(1===r.fd,`invalid handle for stdout (${r.fd})`),q(2===t.fd,`invalid handle for stderr (${t.fd})`)},ensureErrnoError(){ir.ErrnoError||(ir.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){for(var r in this.errno=e,Qe)if(Qe[r]===e){this.code=r;break}},this.setErrno(e),this.message=rr[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=this.stack.replace(/\b_Z[\w\d_]+/g,(function(e){var r=ar(e);return e===r?e:r+" ["+e+"]"})))},ir.ErrnoError.prototype=new Error,ir.ErrnoError.prototype.constructor=ir.ErrnoError,[44].forEach((e=>{ir.genericErrors[e]=new ir.ErrnoError(e),ir.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){ir.ensureErrnoError(),ir.nameTable=new Array(4096),ir.mount(Ke,{},"/"),ir.createDefaultDirectories(),ir.createDefaultDevices(),ir.createSpecialDirectories(),ir.filesystems={MEMFS:Ke,IDBFS:Ze,NODEFS:er}},init(e,r,t){q(!ir.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),ir.init.initialized=!0,ir.ensureErrnoError(),u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,ir.createStandardStreams()},quit(){ir.init.initialized=!1,Tn(0);for(var e=0;e<ir.streams.length;e++){var r=ir.streams[e];r&&ir.close(r)}},findObject(e,r){var t=ir.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ir.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ir.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Le.basename(e),n=ir.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:ir.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Le.join2(e,a);try{ir.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=Le.join2("string"==typeof e?e:ir.getPath(e),r),i=Je(n,o);return ir.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:ir.getPath(e),i=r?Le.join2(e,r):e);var s=Je(n,o),l=ir.create(i,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),d=0,u=t.length;d<u;++d)c[d]=t.charCodeAt(d);t=c}ir.chmod(l,146|s);var f=ir.open(l,577);ir.write(f,t,0,t.length,0,a),ir.close(f),ir.chmod(l,s)}return l},createDevice(e,r,t,n){var o=Le.join2("string"==typeof e?e:ir.getPath(e),r),a=Je(!!t,!!n);ir.createDevice.major||(ir.createDevice.major=64);var i=ir.makedev(ir.createDevice.major++,0);return ir.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(e){throw new ir.ErrnoError(29)}if(void 0===l&&0===i)throw new ir.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new ir.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),ir.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ye(_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new ir.ErrnoError(29)}},createLazyFile(e,r,n,o,a){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var r,t=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=t);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,t-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>t-1)throw new Error("only "+t+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),t!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ye(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&t||(i=t=1,t=this.getter(0).length,i=t,N("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=t,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var l={isDevice:!1,contents:s}}else l={isDevice:!1,url:n};var c=ir.createFile(e,r,l,o,a);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var d={};function u(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(q(i>=0),a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(c.stream_ops).forEach((e=>{var r=c.stream_ops[e];d[e]=function(){return ir.forceLoadFile(c),r.apply(null,arguments)}})),d.read=(e,r,t,n,o)=>(ir.forceLoadFile(c),u(e,r,t,n,o)),d.mmap=(e,r,n,o,a)=>{ir.forceLoadFile(c);var i=qe(r);if(!i)throw new ir.ErrnoError(48);return u(e,t(),i,r,n),{ptr:i,allocated:!0}},c.stream_ops=d,c},absolutePath(){pe("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){pe("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){pe("FS.createLink has been removed; use FS.symlink instead")},joinPath(){pe("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){pe("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){pe("FS.standardizePath has been removed; use PATH.normalize instead")}},sr={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(Le.isAbs(r))return r;var n;if(n=-100===e?ir.cwd():sr.getStreamFromFD(e).path,0==r.length){if(!t)throw new ir.ErrnoError(44);return n}return Le.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&Le.normalize(r)!==Le.normalize(ir.getPath(e.node)))return-54;throw e}i()[t>>2]=n.dev,Me(n.dev),i()[t+4>>2]=n.mode,Me(n.mode),s()[t+8>>2]=n.nlink,Me(n.nlink),i()[t+12>>2]=n.uid,Me(n.uid),i()[t+16>>2]=n.gid,Me(n.gid),i()[t+20>>2]=n.rdev,Me(n.rdev),ye=[n.size>>>0,(ve=n.size,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+24>>2]=ye[0],i()[t+28>>2]=ye[1],Ne(n.size),i()[t+32>>2]=4096,Me(4096),i()[t+36>>2]=n.blocks,Me(n.blocks);var o=n.atime.getTime(),a=n.mtime.getTime(),l=n.ctime.getTime();return ye=[Math.floor(o/1e3)>>>0,(ve=Math.floor(o/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+40>>2]=ye[0],i()[t+44>>2]=ye[1],Ne(Math.floor(o/1e3)),s()[t+48>>2]=o%1e3*1e3,Me(o%1e3*1e3),ye=[Math.floor(a/1e3)>>>0,(ve=Math.floor(a/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+56>>2]=ye[0],i()[t+60>>2]=ye[1],Ne(Math.floor(a/1e3)),s()[t+64>>2]=a%1e3*1e3,Me(a%1e3*1e3),ye=[Math.floor(l/1e3)>>>0,(ve=Math.floor(l/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+72>>2]=ye[0],i()[t+76>>2]=ye[1],Ne(Math.floor(l/1e3)),s()[t+80>>2]=l%1e3*1e3,Me(l%1e3*1e3),ye=[n.ino>>>0,(ve=n.ino,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+88>>2]=ye[0],i()[t+92>>2]=ye[1],Ne(n.ino),0},doMsync(e,r,t,o,a){if(!ir.isFile(r.node.mode))throw new ir.ErrnoError(43);if(2&o)return 0;var i=n().slice(e,e+t);ir.msync(r,i,a,t,o)},varargs:void 0,get(){q(null!=sr.varargs);var e=i()[+sr.varargs>>2];return sr.varargs+=4,e},getp:()=>sr.get(),getStr:e=>or(e),getStreamFromFD:e=>ir.getStreamChecked(e)};function lr(e){if(b)return Gt(0,1,e);L=e,oe()||(fr.terminateAllThreads(),u.onExit&&u.onExit(e),V=!0),p(e,new Ie(e))}var cr=(e,r)=>{if(L=e,function(){var e=N,r=$,t=!1;N=$=e=>{t=!0};try{Tn(0),["stdout","stderr"].forEach((function(e){var r=ir.analyzePath("/dev/"+e);if(r){var n=r.object.rdev,o=Ve.ttys[n];o&&o.output&&o.output.length&&(t=!0)}}))}catch(e){}N=e,$=r,t&&wr("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.")}(),b)throw q(!r),pr(e),"unwind";if(oe()&&!r){var t=`program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${ne}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;d(t),$(t)}lr(e)},dr=e=>(q("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),ur=e=>{if(e instanceof Ie||"unwind"==e)return L;Z(),e instanceof WebAssembly.RuntimeError&&Un()<=0&&$("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 5242880)"),p(1,e)},fr={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},nextWorkerID:1,debugInit(){var e=$e;$e=r=>{return e((t=0,te&&void 0!==kn&&(t=kn()),"w:"+(u.workerID||0)+",t:"+dr(t)+": "+r));var t}},init(){fr.debugInit(),b?fr.initWorker():fr.initMainThread()},initMainThread(){ie((()=>{fe("loading-workers"),fr.loadWasmModuleToAllWorkers((()=>he("loading-workers")))}))},initWorker(){x=!1},setExitStatus:e=>{L=e},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var e of(q(!b,"Internal Error! terminateAllThreads() can only ever be called from main application thread!"),fr.runningWorkers))Re(e);for(var e of fr.unusedWorkers)Re(e);fr.unusedWorkers=[],fr.runningWorkers=[],fr.pthreads=[]},returnWorkerToPool:e=>{var r=e.pthread_ptr;delete fr.pthreads[r],fr.unusedWorkers.push(e),fr.runningWorkers.splice(fr.runningWorkers.indexOf(e),1),e.pthread_ptr=0,Dn(r)},receiveObjectTransfer(e){},threadInitTLS(){fr.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:r=>new Promise((t=>{r.onmessage=e=>{var n=e.data,o=n.cmd;if(n.targetThread&&n.targetThread!=kn()){var a=fr.pthreads[n.targetThread];a?a.postMessage(n,n.transferList):$(`Internal error! Worker sent a message "${o}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else{var i;"checkMailbox"===o?Ht():"spawnThread"===o?(e=>{q(!b,"Internal Error! spawnThread() can only ever be called from main application thread!"),q(e.pthread_ptr,"Internal error, no pthread ptr!");var r=fr.getNewWorker();if(!r)return 6;q(!r.pthread_ptr,"Internal error!"),fr.runningWorkers.push(r),fr.pthreads[e.pthread_ptr]=r,r.pthread_ptr=e.pthread_ptr;var t={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};y&&r.unref(),r.postMessage(t,e.transferList)})(n):"cleanupThread"===o?xe(n.thread):"killThread"===o?(e=>{q(!b,"Internal Error! killThread() can only ever be called from main application thread!"),q(e,"Internal Error! Null pthread_ptr in killThread!");var r=fr.pthreads[e];delete fr.pthreads[e],Re(r),Dn(e),fr.runningWorkers.splice(fr.runningWorkers.indexOf(r),1),r.pthread_ptr=0})(n.thread):"cancelThread"===o?(i=n.thread,q(!b,"Internal Error! cancelThread() can only ever be called from main application thread!"),q(i,"Internal Error! Null pthread_ptr in cancelThread!"),fr.pthreads[i].postMessage({cmd:"cancel"})):"loaded"===o?(r.loaded=!0,t(r)):"alert"===o?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?r.postMessage(n):"callHandler"===o?u[n.handler](...n.args):o&&$(`worker sent an unknown command ${o}`)}},r.onerror=e=>{var t="worker sent an error!";throw r.pthread_ptr&&(t=`Pthread ${dr(r.pthread_ptr)} sent an error!`),$(`${t} ${e.filename}:${e.lineno}: ${e.message}`),e},y&&(r.on("message",(e=>r.onmessage({data:e}))),r.on("error",(e=>r.onerror(e)))),q(I instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!"),q(R instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");var n=[];for(var o of["onExit","onAbort","print","printErr"])u.hasOwnProperty(o)&&n.push(o);r.workerID=fr.nextWorkerID++,r.postMessage({cmd:"load",handlers:n,urlOrBlob:u.mainScriptUrlOrBlob||e,wasmMemory:I,wasmModule:R,workerID:r.workerID})})),loadWasmModuleToAllWorkers(e){e()},allocateUnusedWorker(){var e,r=k("web_example.worker.js");e=new Worker(r),fr.unusedWorkers.push(e)},getNewWorker:()=>(0==fr.unusedWorkers.length&&(y||$("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`."),fr.allocateUnusedWorker(),fr.loadWasmModuleToWorker(fr.unusedWorkers[0])),fr.unusedWorkers.pop())};u.PThread=fr;var hr=e=>{for(;e.length>0;)e.shift()(u)};function pr(e){if(b)return Gt(1,0,e);cr(e)}u.establishStackSpace=()=>{var e=kn(),r=s()[e+52>>2],t=r-s()[e+56>>2];q(0!=r),q(0!=t),q(r>t,"stackHigh must be higher then stackLow"),xn(r,t),_r(),Wn(r),J()};var mr=e=>(e=>tr((()=>{var r=jn(4),t=jn(4);Gn(e,r,t);var n,o=s()[r>>2],a=s()[t>>2],i=or(o);return bn(o),a&&(n=or(a),bn(a)),[i,n]})))(e);u.getExceptionMessage=mr;var vr,yr=[],gr=e=>{var r=yr[e];return r||(e>=yr.length&&(yr.length=e+1),yr[e]=r=vr.get(e)),q(vr.get(e)==r,"JavaScript-side Wasm function table mirror is out of date!"),r};u.invokeEntryPoint=(e,r)=>{var t=gr(e)(r);Z(),function(e){oe()?fr.setExitStatus(e):Mn(e)}(t)};var _r=()=>{var e=An(),r=Fn();qn(e,r)},wr=e=>{wr.shown||(wr.shown={}),wr.shown[e]||(wr.shown[e]=1,y&&(e="warning: "+e),$(e))},Er=[],br=0,Tr=0;function kr(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){s()[this.ptr+4>>2]=e},this.get_type=function(){return s()[this.ptr+4>>2]},this.set_destructor=function(e){s()[this.ptr+8>>2]=e},this.get_destructor=function(){return s()[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,t()[this.ptr+12>>0]=e,Oe(e)},this.get_caught=function(){return 0!=t()[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,t()[this.ptr+13>>0]=e,Oe(e)},this.get_rethrown=function(){return 0!=t()[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){s()[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return s()[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Vn(this.get_type()))return s()[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var Sr=e=>{var r=Tr&&Tr.excPtr;if(!r)return In(0),0;var t=new kr(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return In(0),r;for(var o in e){var a=e[o];if(0===a||a===n)break;var i=t.ptr+16;if(Yn(a,n,i))return In(a),r}return In(n),r};function Pr(e,r,t){if(b)return Gt(2,1,e,r,t);sr.varargs=t;try{var n=sr.getStreamFromFD(e);switch(r){case 0:if((a=sr.get())<0)return-28;for(;ir.streams[a];)a++;return ir.createStream(n,a).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var a=sr.get();return n.flags|=a,0;case 5:return a=sr.getp(),o()[a+0>>1]=2,De(2),0;case 16:case 8:default:return-28;case 9:return 28,i()[En()>>2]=28,Me(28),-1}}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}function Cr(e,r){if(b)return Gt(3,1,e,r);try{var t=sr.getStreamFromFD(e);return sr.doStat(ir.stat,t.path,r)}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}function Ar(e,r,n){if(b)return Gt(4,1,e,r,n);sr.varargs=n;try{var a=sr.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return a.tty?0:-59;case 21505:if(!a.tty)return-59;if(a.tty.ops.ioctl_tcgets){var s=a.tty.ops.ioctl_tcgets(a),l=sr.getp();i()[l>>2]=s.c_iflag||0,Me(s.c_iflag||0),i()[l+4>>2]=s.c_oflag||0,Me(s.c_oflag||0),i()[l+8>>2]=s.c_cflag||0,Me(s.c_cflag||0),i()[l+12>>2]=s.c_lflag||0,Me(s.c_lflag||0);for(var c=0;c<32;c++)t()[l+c+17>>0]=s.c_cc[c]||0,Oe(s.c_cc[c]||0);return 0}return 0;case 21506:case 21507:case 21508:if(!a.tty)return-59;if(a.tty.ops.ioctl_tcsets){l=sr.getp();var d=i()[l>>2],u=i()[l+4>>2],f=i()[l+8>>2],h=i()[l+12>>2],p=[];for(c=0;c<32;c++)p.push(t()[l+c+17>>0]);return a.tty.ops.ioctl_tcsets(a.tty,r,{c_iflag:d,c_oflag:u,c_cflag:f,c_lflag:h,c_cc:p})}return 0;case 21519:return a.tty?(l=sr.getp(),i()[l>>2]=0,Me(0),0):-59;case 21520:return a.tty?-28:-59;case 21531:return l=sr.getp(),ir.ioctl(a,r,l);case 21523:if(!a.tty)return-59;if(a.tty.ops.ioctl_tiocgwinsz){var m=a.tty.ops.ioctl_tiocgwinsz(a.tty);l=sr.getp(),o()[l>>1]=m[0],De(m[0]),o()[l+2>>1]=m[1],De(m[1])}return 0;default:return-28}}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}function Fr(e,r){if(b)return Gt(5,1,e,r);try{return e=sr.getStr(e),sr.doStat(ir.lstat,e,r)}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}function Or(e,r,t,n){if(b)return Gt(6,1,e,r,t,n);try{r=sr.getStr(r);var o=256&n,a=4096&n;return q(!(n&=-6401),`unknown flags in __syscall_newfstatat: ${n}`),r=sr.calculateAt(e,r,a),sr.doStat(o?ir.lstat:ir.stat,r,t)}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}function Dr(e,r,t,n){if(b)return Gt(7,1,e,r,t,n);sr.varargs=n;try{r=sr.getStr(r),r=sr.calculateAt(e,r);var o=n?sr.get():0;return ir.open(r,t,o).fd}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}function Mr(e,r){if(b)return Gt(8,1,e,r);try{return e=sr.getStr(e),sr.doStat(ir.stat,e,r)}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}function Nr(e,r,t){if(b)return Gt(9,1,e,r,t);try{return r=sr.getStr(r),r=sr.calculateAt(e,r),0===t?ir.unlink(r):512===t?ir.rmdir(r):pe("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}var $r={},Ir=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function Rr(e){return this.fromWireType(i()[e>>2])}var xr,Lr,Wr,jr={},Ur={},Br={},zr=e=>{throw new xr(e)},Hr=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&zr("Mismatched type converter count");for(var o=0;o<e.length;++o)Vr(e[o],n[o])}e.forEach((function(e){Br[e]=r}));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{Ur.hasOwnProperty(e)?o[r]=Ur[e]:(a.push(e),jr.hasOwnProperty(e)||(jr[e]=[]),jr[e].push((()=>{o[r]=Ur[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},Gr=e=>{for(var r="",t=e;n()[t];)r+=Lr[n()[t++]];return r},Yr=e=>{throw new Wr(e)};function Vr(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Yr(`type "${n}" must have a positive integer typeid pointer`),Ur.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Yr(`Cannot register type '${n}' twice`)}if(Ur[e]=r,delete Br[e],jr.hasOwnProperty(e)){var o=jr[e];delete jr[e],o.forEach((e=>e()))}}(e,r,t)}var qr,Kr=e=>{Yr(e.$$.ptrType.registeredClass.name+" instance already deleted")},Xr=!1,Jr=e=>{},Zr=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Qr=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=Qr(e,r,t.baseClass);return null===n?null:t.downcast(n)},et={},rt=[],tt=()=>{for(;rt.length;){var e=rt.pop();e.$$.deleteScheduled=!1,e.delete()}},nt={},ot=(e,r)=>(r.ptrType&&r.ptr||zr("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&zr("Both smartPtrType and smartPtr must be specified"),r.count={value:1},it(Object.create(e,{$$:{value:r}})));function at(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&Yr("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(e,r),nt[r]))(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?ot(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):ot(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=et[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=Qr(r,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?ot(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):ot(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var it=e=>"undefined"==typeof FinalizationRegistry?(it=e=>e,e):(Xr=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),Zr(e.$$)})),it=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r},n=r.ptrType.registeredClass;t.leakWarning=new Error(`Embind found a leaked C++ instance ${n.name} <${dr(r.ptr)}>.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated`),"captureStackTrace"in Error&&Error.captureStackTrace(t.leakWarning,at),Xr.register(e,t,e)}return e},Jr=e=>Xr.unregister(e),it(e));function st(){}var lt=e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e};function ct(e,r){return{[e=lt(e)]:function(){return r.apply(this,arguments)}}[e]}var dt=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||Yr(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},ut=(e,r,t)=>{u.hasOwnProperty(e)?((void 0===t||void 0!==u[e].overloadTable&&void 0!==u[e].overloadTable[t])&&Yr(`Cannot register public name '${e}' twice`),dt(u,e,e),u.hasOwnProperty(t)&&Yr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),u[e].overloadTable[t]=r):(u[e]=r,void 0!==t&&(u[e].numArguments=t))};function ft(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var ht=(e,r,t)=>{for(;r!==t;)r.upcast||Yr(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function pt(e,r){if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),0;r.$$||Yr(`Cannot pass "${Nt(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return ht(r.$$.ptr,t,this.registeredClass)}function mt(e,r){var t;if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||Yr(`Cannot pass "${Nt(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Yr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=ht(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Yr("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Yr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,Ot.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Yr("Unsupporting sharing policy")}return t}function vt(e,r){if(null===r)return this.isReference&&Yr(`null is not a valid ${this.name}`),0;r.$$||Yr(`Cannot pass "${Nt(r)}" as a ${this.name}`),r.$$.ptr||Yr(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Yr(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return ht(r.$$.ptr,t,this.registeredClass)}function yt(e){return this.fromWireType(s()[e>>2])}function gt(e,r,t,n,o,a,i,s,l,c,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=d,o||void 0!==r.baseClass?this.toWireType=mt:n?(this.toWireType=pt,this.destructorFunction=null):(this.toWireType=vt,this.destructorFunction=null)}var _t,wt=(e,r,t)=>{u.hasOwnProperty(e)||zr("Replacing nonexistant public symbol"),void 0!==u[e].overloadTable&&void 0!==t?u[e].overloadTable[t]=r:(u[e]=r,u[e].argCount=t)},Et=(e,r)=>{var t=(e=Gr(e)).includes("j")?((e,r)=>{q(e.includes("j")||e.includes("p"),"getDynCaller should only be called with i64 sigs");var t=[];return function(){return t.length=0,Object.assign(t,arguments),((e,r,t)=>e.includes("j")?((e,r,t)=>{q("dynCall_"+e in u,`bad function pointer type - dynCall function not found for sig '${e}'`),t&&t.length?q(t.length===e.substring(1).replace(/j/g,"--").length):q(1==e.length);var n=u["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)})(e,r,t):(q(gr(r),`missing table entry in dynCall: ${r}`),gr(r).apply(null,t)))(e,r,t)}})(e,r):gr(r);return"function"!=typeof t&&Yr(`unknown function pointer with signature ${e}: ${r}`),t},bt=e=>{var r=Pn(e),t=Gr(r);return bn(r),t},Tt=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||Ur[r]||(Br[r]?Br[r].forEach(e):(t.push(r),n[r]=!0))})),new _t(`${e}: `+t.map(bt).join([", "]))},kt=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(s()[r+4*n>>2]);return t};function St(e,r,t,n,o,a){var i=r.length;i<2&&Yr("argTypes array size mismatch! Must at least get return value and 'this' types!"),q(!a,"Async bindings are only supported with JSPI.");for(var s=null!==r[1]&&null!==t,l=!1,c=1;c<r.length;++c)if(null!==r[c]&&void 0===r[c].destructorFunction){l=!0;break}var d="void"!==r[0].name,u="",f="";for(c=0;c<i-2;++c)u+=(0!==c?", ":"")+"arg"+c,f+=(0!==c?", ":"")+"arg"+c+"Wired";var h=`\n return function ${lt(e)}(${u}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`;l&&(h+="var destructors = [];\n");var p=l?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[Yr,n,o,Ir,r[0],r[1]];for(s&&(h+="var thisWired = classParam.toWireType("+p+", this);\n"),c=0;c<i-2;++c)h+="var arg"+c+"Wired = argType"+c+".toWireType("+p+", arg"+c+"); // "+r[c+2].name+"\n",m.push("argType"+c),v.push(r[c+2]);if(s&&(f="thisWired"+(f.length>0?", ":"")+f),h+=(d||a?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",l)h+="runDestructors(destructors);\n";else for(c=s?1:2;c<r.length;++c){var y=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==r[c].destructorFunction&&(h+=y+"_dtor("+y+"); // "+r[c].name+"\n",m.push(y+"_dtor"),v.push(r[c].destructorFunction))}return d&&(h+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),h+="}\n",m.push(h),function(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=ct(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,o=e.apply(n,r);return o instanceof Object?o:n}(Function,m).apply(null,v)}var Pt=(e,r,t)=>(e instanceof Object||Yr(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||Yr(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Yr(`cannot call emscripten binding method ${t} on deleted object`),ht(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass));function Ct(){this.allocated=[void 0],this.freelist=[]}var At=new Ct,Ft=e=>{e>=At.reserved&&0==--At.get(e).refcount&&At.free(e)},Ot={toValue:e=>(e||Yr("Cannot use deleted val. handle = "+e),At.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return At.allocate({refcount:1,value:e})}}},Dt=(e,r,l)=>{switch(r){case 1:return l?function(e){return this.fromWireType(t()[e>>0])}:function(e){return this.fromWireType(n()[e>>0])};case 2:return l?function(e){return this.fromWireType(o()[e>>1])}:function(e){return this.fromWireType(a()[e>>1])};case 4:return l?function(e){return this.fromWireType(i()[e>>2])}:function(e){return this.fromWireType(s()[e>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Mt=(e,r)=>{var t=Ur[e];return void 0===t&&Yr(r+" has unknown type "+bt(e)),t},Nt=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},$t=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType((I.buffer!=W.buffer&&K(),G)[e>>2])};case 8:return function(e){return this.fromWireType(l()[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},It=(e,r,l)=>{switch(r){case 1:return l?e=>t()[e>>0]:e=>n()[e>>0];case 2:return l?e=>o()[e>>1]:e=>a()[e>>1];case 4:return l?e=>i()[e>>2]:e=>s()[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Rt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,xt=(e,r)=>{q(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var t=e,i=t>>1,s=i+r/2;!(i>=s)&&a()[i];)++i;if((t=i<<1)-e>32&&Rt)return Rt.decode(n().slice(e,t));for(var l="",c=0;!(c>=r/2);++c){var d=o()[e+2*c>>1];if(0==d)break;l+=String.fromCharCode(d)}return l},Lt=(e,r,t)=>{if(q(r%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),q("number"==typeof t,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,a=(t-=2)<2*e.length?t/2:e.length,i=0;i<a;++i){var s=e.charCodeAt(i);o()[r>>1]=s,De(s),r+=2}return o()[r>>1]=0,De(0),r-n},Wt=e=>2*e.length,jt=(e,r)=>{q(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var t=0,n="";!(t>=r/4);){var o=i()[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ut=(e,r,t)=>{if(q(r%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),q("number"==typeof t,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),i()[r>>2]=s,Me(s),(r+=4)+4>o)break}return i()[r>>2]=0,Me(0),r-n},Bt=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},zt=e=>{if("function"==typeof Atomics.waitAsync){var r=Atomics.waitAsync(i(),e>>2,e);q(r.async),r.value.then(Ht);var t=e+128;Atomics.store(i(),t>>2,1)}};u.__emscripten_thread_mailbox_await=zt;var Ht=()=>{var e=kn();e&&(zt(e),(e=>{if(V)$("user callback triggered after runtime exited or application aborted. Ignoring.");else try{e(),(()=>{if(!oe())try{b?Mn(L):cr(L)}catch(e){ur(e)}})()}catch(e){ur(e)}})((()=>Nn())))};u.checkMailbox=Ht;var Gt=function(e,r){var t=arguments.length-2,n=arguments;return tr((()=>{for(var o=t,a=jn(8*o),i=a>>3,s=0;s<t;s++){var c=n[2+s];l()[i+s]=c}return On(e,o,a,r)}))},Yt=[],Vt=e=>e%4==0&&(e%100!=0||e%400==0),qt=[0,31,60,91,121,152,182,213,244,274,305,335],Kt=[0,31,59,90,120,151,181,212,243,273,304,334],Xt=(e,r)=>(q(e==e>>>0||e==(0|e)),q(r===(0|r)),r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN);function Jt(e,r,t,n,o,a,l,c){if(b)return Gt(10,1,e,r,t,n,o,a,l,c);var d=Xt(o,a);try{if(isNaN(d))return 61;var u=sr.getStreamFromFD(n),f=ir.mmap(u,e,d,r,t),h=f.ptr;return i()[l>>2]=f.allocated,Me(f.allocated),s()[c>>2]=h,0}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}function Zt(e,r,t,n,o,a,i){if(b)return Gt(11,1,e,r,t,n,o,a,i);var s=Xt(a,i);try{if(isNaN(s))return 61;var l=sr.getStreamFromFD(o);2&t&&sr.doMsync(e,l,r,n,s),ir.munmap(l)}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return-e.errno}}var Qt,en=e=>{var r=He(e)+1,t=wn(r);return t&&nr(e,t,r),t};Qt=()=>performance.timeOrigin+performance.now();var rn=e=>{var r=I.buffer,t=(e-r.byteLength+65535)/65536;try{return I.grow(t),K(),1}catch(t){$(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${t}`)}},tn={},nn=()=>{if(!nn.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:h||"./this.program"};for(var r in tn)void 0===tn[r]?delete e[r]:e[r]=tn[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);nn.strings=t}return nn.strings},on=function(e,r){if(b)return Gt(12,1,e,r);var n=0;return nn().forEach(((o,a)=>{var i=r+n;s()[e+4*a>>2]=i,Me(i),((e,r)=>{for(var n=0;n<e.length;++n)q(e.charCodeAt(n)===(255&e.charCodeAt(n))),t()[r++>>0]=e.charCodeAt(n),Oe(e.charCodeAt(n));t()[r>>0]=0,Oe(0)})(o,i),n+=o.length+1})),0},an=function(e,r){if(b)return Gt(13,1,e,r);var t=nn();s()[e>>2]=t.length,Me(t.length);var n=0;return t.forEach((e=>n+=e.length+1)),s()[r>>2]=n,Me(n),0};function sn(e){if(b)return Gt(14,1,e);try{var r=sr.getStreamFromFD(e);return ir.close(r),0}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return e.errno}}function ln(e,r,n,o){if(b)return Gt(15,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var l=s()[r>>2],c=s()[r+4>>2];r+=8;var d=ir.read(e,t(),l,c,o);if(d<0)return-1;if(a+=d,d<c)break;void 0!==o&&(o+=d)}return a})(sr.getStreamFromFD(e),r,n);return s()[o>>2]=a,Me(a),0}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return e.errno}}function cn(e,r,t,n,o){if(b)return Gt(16,1,e,r,t,n,o);var a=Xt(r,t);try{if(isNaN(a))return 61;var s=sr.getStreamFromFD(e);return ir.llseek(s,a,n),ye=[s.position>>>0,(ve=s.position,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[o>>2]=ye[0],i()[o+4>>2]=ye[1],Ne(s.position),s.getdents&&0===a&&0===n&&(s.getdents=null),0}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return e.errno}}function dn(e,r,n,o){if(b)return Gt(17,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var l=s()[r>>2],c=s()[r+4>>2];r+=8;var d=ir.write(e,t(),l,c,o);if(d<0)return-1;a+=d,void 0!==o&&(o+=d)}return a})(sr.getStreamFromFD(e),r,n);return s()[o>>2]=a,Me(a),0}catch(e){if(void 0===ir||"ErrnoError"!==e.name)throw e;return e.errno}}var un=[31,29,31,30,31,30,31,31,30,31,30,31],fn=[31,28,31,30,31,30,31,31,30,31,30,31];fr.init();var hn,pn,mn=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ir.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(mn.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return ir.isDir(this.mode)}},isDevice:{get:function(){return ir.isChrdev(this.mode)}}}),ir.FSNode=mn,ir.createPreloadedFile=(e,r,t,n,o,a,i,s,l,c)=>{var d=r?je.resolve(Le.join2(e,r)):e,u=ue(`cp ${d}`);function f(t){function f(t){c&&c(),s||((e,r,t,n,o,a)=>{ir.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,l),a&&a(),he(u)}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return Xe.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,f,(()=>{i&&i(),he(u)}))||f(t)}fe(u),"string"==typeof t?((e,r,t,n)=>{var o=ue(`al ${e}`);w(e,(r=>{q(r,`Loading data file "${e}" failed (no arrayBuffer).`),f(new Uint8Array(r)),o&&he(o)}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&fe(o)})(t,0,i):f(t)},ir.staticInit(),u.FS_createPath=ir.createPath,u.FS_createDataFile=ir.createDataFile,u.FS_createPreloadedFile=ir.createPreloadedFile,u.FS_unlink=ir.unlink,u.FS_createLazyFile=ir.createLazyFile,u.FS_createDevice=ir.createDevice,y&&er.staticInit(),Qe={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},xr=u.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Lr=e})(),Wr=u.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(st.prototype,{isAliasOf(e){if(!(this instanceof st))return!1;if(!(e instanceof st))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||Kr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=it(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Kr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Yr("Object already scheduled for deletion"),Jr(this),Zr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Kr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Yr("Object already scheduled for deletion"),rt.push(this),1===rt.length&&qr&&qr(tt),this.$$.deleteScheduled=!0,this}}),u.getInheritedInstanceCount=()=>Object.keys(nt).length,u.getLiveInheritedInstances=()=>{var e=[];for(var r in nt)nt.hasOwnProperty(r)&&e.push(nt[r]);return e},u.flushPendingDeletes=tt,u.setDelayFunction=e=>{qr=e,rt.length&&qr&&qr(tt)},Object.assign(gt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor&&this.rawDestructor(e)},argPackAdvance:8,readValueFromPointer:yt,deleteObject(e){null!==e&&e.delete()},fromWireType:at}),_t=u.UnboundTypeError=(hn=Error,(pn=ct("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(hn.prototype),pn.prototype.constructor=pn,pn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},pn),Object.assign(Ct.prototype,{get(e){return q(void 0!==this.allocated[e],`invalid handle: ${e}`),this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){q(void 0!==this.allocated[e]),this.allocated[e]=void 0,this.freelist.push(e)}}),At.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),At.reserved=At.allocated.length,u.count_emval_handles=()=>{for(var e=0,r=At.reserved;r<At.allocated.length;++r)void 0!==At.allocated[r]&&++e;return e};var vn,yn=[lr,pr,Pr,Cr,Ar,Fr,Or,Dr,Mr,Nr,Jt,Zt,on,an,sn,ln,cn,dn],gn={__assert_fail:(e,r,t,n)=>{pe(`Assertion failed: ${or(e)}, at: `+[r?or(r):"unknown filename",t,n?or(n):"unknown function"])},__cxa_begin_catch:e=>{var r=new kr(e);return r.get_caught()||(r.set_caught(!0),br--),r.set_rethrown(!1),Er.push(r),zn(r.excPtr),r.get_exception_ptr()},__cxa_end_catch:()=>{$n(0,0),q(Er.length>0);var e=Er.pop();Bn(e.excPtr),Tr=0},__cxa_find_matching_catch_2:()=>Sr([]),__cxa_find_matching_catch_3:e=>Sr([e]),__cxa_rethrow:()=>{var e=Er.pop();e||pe("no exception to throw");var r=e.excPtr;throw e.get_rethrown()||(Er.push(e),e.set_rethrown(!0),e.set_caught(!1),br++),Tr=new be(r)},__cxa_throw:(e,r,t)=>{throw new kr(e).init(r,t),Tr=new be(e),br++,Tr},__cxa_uncaught_exceptions:()=>br,__emscripten_init_main_thread_js:e=>{Cn(e,!v,1,!m,2097152,!1),fr.threadInitTLS()},__emscripten_thread_cleanup:e=>{b?postMessage({cmd:"cleanupThread",thread:e}):xe(e)},__handle_stack_overflow:e=>{var r=An(),t=Fn();pe(`stack overflow (Attempt to set SP to ${dr(e)}, with stack limits [${dr(t)} - ${dr(r)}]). If you require more stack space build with -sSTACK_SIZE=<bytes>`)},__resumeException:e=>{throw Tr||(Tr=new be(e)),Tr},__syscall_fcntl64:Pr,__syscall_fstat64:Cr,__syscall_ioctl:Ar,__syscall_lstat64:Fr,__syscall_newfstatat:Or,__syscall_openat:Dr,__syscall_stat64:Mr,__syscall_unlinkat:Nr,_embind_finalize_value_object:e=>{var r=$r[e];delete $r[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType)));Hr([e],a,(e=>{var a={};return o.forEach(((r,t)=>{var n=r.fieldName,i=e[t],s=r.getter,l=r.getterContext,c=e[t+o.length],d=r.setter,u=r.setterContext;a[n]={read:e=>i.fromWireType(s(l,e)),write:(e,r)=>{var t=[];d(u,e,c.toWireType(t,r)),Ir(t)}}})),[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},argPackAdvance:8,readValueFromPointer:Rr,destructorFunction:n}]}))},_embind_register_bigint:(e,r,t,n,o)=>{},_embind_register_bool:(e,r,t,o)=>{Vr(e,{name:r=Gr(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:o},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(n()[e])},destructorFunction:null})},_embind_register_class:(e,r,t,n,o,a,i,s,l,c,d,u,f)=>{d=Gr(d),a=Et(o,a),s&&(s=Et(i,s)),c&&(c=Et(l,c)),f=Et(u,f);var h=lt(d);ut(h,(function(){Tt(`Cannot construct ${d} due to unbound types`,[n])})),Hr([e,r,t],n?[n]:[],(function(r){var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:st.prototype;var i=ct(h,(function(){if(Object.getPrototypeOf(this)!==l)throw new Wr("Use 'new' to construct "+d);if(void 0===u.constructor_body)throw new Wr(d+" has no accessible constructor");var e=u.constructor_body[arguments.length];if(void 0===e)throw new Wr(`Tried to invoke ctor of ${d} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(u.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),l=Object.create(o,{constructor:{value:i}});i.prototype=l;var u=new ft(d,i,l,f,t,a,s,c);u.baseClass&&(void 0===u.baseClass.__derivedClasses&&(u.baseClass.__derivedClasses=[]),u.baseClass.__derivedClasses.push(u));var p=new gt(d,u,!0,!1,!1),m=new gt(d+"*",u,!1,!1,!1),v=new gt(d+" const*",u,!1,!0,!1);return et[e]={pointerType:m,constPointerType:v},wt(h,i),[p,m,v]}))},_embind_register_class_constructor:(e,r,t,n,o,a)=>{q(r>0);var i=kt(r,t);o=Et(n,o),Hr([],[e],(function(e){var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Wr(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{Tt(`Cannot construct ${e.name} due to unbound types`,i)},Hr([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=St(t,n,null,o,a),[]))),[]}))},_embind_register_class_function:(e,r,t,n,o,a,i,s,l)=>{var c=kt(t,n);r=Gr(r),a=Et(o,a),Hr([],[e],(function(e){var n=`${(e=e[0]).name}.${r}`;function o(){Tt(`Cannot call ${n} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var d=e.registeredClass.instancePrototype,u=d[r];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===t-2?(o.argCount=t-2,o.className=e.name,d[r]=o):(dt(d,r,n),d[r].overloadTable[t-2]=o),Hr([],c,(function(o){var s=St(n,o,e,a,i,l);return void 0===d[r].overloadTable?(s.argCount=t-2,d[r]=s):d[r].overloadTable[t-2]=s,[]})),[]}))},_embind_register_class_property:(e,r,t,n,o,a,i,s,l,c)=>{r=Gr(r),o=Et(n,o),Hr([],[e],(function(e){var n=`${(e=e[0]).name}.${r}`,d={get(){Tt(`Cannot access ${n} due to unbound types`,[t,i])},enumerable:!0,configurable:!0};return d.set=l?()=>Tt(`Cannot access ${n} due to unbound types`,[t,i]):e=>Yr(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,r,d),Hr([],l?[t,i]:[t],(function(t){var i=t[0],d={get(){var r=Pt(this,e,n+" getter");return i.fromWireType(o(a,r))},enumerable:!0};if(l){l=Et(s,l);var u=t[1];d.set=function(r){var t=Pt(this,e,n+" setter"),o=[];l(c,t,u.toWireType(o,r)),Ir(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,d),[]})),[]}))},_embind_register_emval:(e,r)=>{Vr(e,{name:r=Gr(r),fromWireType:e=>{var r=Ot.toValue(e);return Ft(e),r},toWireType:(e,r)=>Ot.toHandle(r),argPackAdvance:8,readValueFromPointer:Rr,destructorFunction:null})},_embind_register_enum:(e,r,t,n)=>{function o(){}r=Gr(r),o.values={},Vr(e,{name:r,constructor:o,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,r)=>r.value,argPackAdvance:8,readValueFromPointer:Dt(r,t,n),destructorFunction:null}),ut(r,o)},_embind_register_enum_value:(e,r,t)=>{var n=Mt(e,"enum");r=Gr(r);var o=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:ct(`${n.name}_${r}`,(function(){}))}});o.values[t]=a,o[r]=a},_embind_register_float:(e,r,t)=>{Vr(e,{name:r=Gr(r),fromWireType:e=>e,toWireType:(e,r)=>{if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError(`Cannot convert ${Nt(r)} to ${this.name}`);return r},argPackAdvance:8,readValueFromPointer:$t(r,t),destructorFunction:null})},_embind_register_function:(e,r,t,n,o,a,i)=>{var s=kt(r,t);e=Gr(e),o=Et(n,o),ut(e,(function(){Tt(`Cannot call ${e} due to unbound types`,s)}),r-1),Hr([],s,(function(t){var n=[t[0],null].concat(t.slice(1));return wt(e,St(e,n,null,o,a,i),r-1),[]}))},_embind_register_integer:(e,r,t,n,o)=>{r=Gr(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned"),l=(e,t)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert "${Nt(e)}" to ${t}`);if(e<n||e>o)throw new TypeError(`Passing a number "${Nt(e)}" from JS side to C/C++ side to an argument of type "${r}", which is outside the valid range [${n}, ${o}]!`)};Vr(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return l(r,this.name),r>>>0}:function(e,r){return l(r,this.name),r},argPackAdvance:8,readValueFromPointer:It(r,t,0!==n),destructorFunction:null})},_embind_register_memory_view:(e,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=s()[e>>2],n=s()[e+4>>2];return new o(t().buffer,n,r)}Vr(e,{name:n=Gr(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(e,r)=>{var t="std::string"===(r=Gr(r));Vr(e,{name:r,fromWireType(e){var r,o=s()[e>>2],a=e+4;if(t)for(var i=a,l=0;l<=o;++l){var c=a+l;if(l==o||0==n()[c]){var d=or(i,c-i);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),i=c+1}}else{var u=new Array(o);for(l=0;l<o;++l)u[l]=String.fromCharCode(n()[a+l]);r=u.join("")}return bn(e),r},toWireType(e,r){var o;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var a="string"==typeof r;a||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||Yr("Cannot pass non-string to std::string"),o=t&&a?He(r):r.length;var i=wn(4+o+1),l=i+4;if(s()[i>>2]=o,Me(o),t&&a)nr(r,l,o+1);else if(a)for(var c=0;c<o;++c){var d=r.charCodeAt(c);d>255&&(bn(l),Yr("String has UTF-16 code units that do not fit in 8 bits")),n()[l+c]=d}else for(c=0;c<o;++c)n()[l+c]=r[c];return null!==e&&e.push(bn,i),i},argPackAdvance:8,readValueFromPointer:yt,destructorFunction(e){bn(e)}})},_embind_register_std_wstring:(e,r,t)=>{var n,o,i,l,c;t=Gr(t),2===r?(n=xt,o=Lt,l=Wt,i=()=>a(),c=1):4===r&&(n=jt,o=Ut,l=Bt,i=()=>s(),c=2),Vr(e,{name:t,fromWireType:e=>{for(var t,o=s()[e>>2],a=i(),l=e+4,d=0;d<=o;++d){var u=e+4+d*r;if(d==o||0==a[u>>c]){var f=n(l,u-l);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),l=u+r}}return bn(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Yr(`Cannot pass non-string to C++ string type ${t}`);var a=l(n),i=wn(4+a+r);return s()[i>>2]=a>>c,o(n,i+4,a+r),null!==e&&e.push(bn,i),i},argPackAdvance:8,readValueFromPointer:Rr,destructorFunction(e){bn(e)}})},_embind_register_value_object:(e,r,t,n,o,a)=>{$r[e]={name:Gr(r),rawConstructor:Et(t,n),rawDestructor:Et(o,a),fields:[]}},_embind_register_value_object_field:(e,r,t,n,o,a,i,s,l,c)=>{$r[e].fields.push({fieldName:Gr(r),getterReturnType:t,getter:Et(n,o),getterContext:a,setterArgumentType:i,setter:Et(s,l),setterContext:c})},_embind_register_void:(e,r)=>{Vr(e,{isVoid:!0,name:r=Gr(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},_emscripten_get_now_is_monotonic:()=>!0,_emscripten_notify_mailbox_postmessage:(e,r,t)=>{if(e==r)setTimeout((()=>Ht()));else if(b)postMessage({targetThread:e,cmd:"checkMailbox"});else{var n=fr.pthreads[e];if(!n)return void $(`Cannot send message to thread with ID ${e}, unknown thread ID!`);n.postMessage({cmd:"checkMailbox"})}},_emscripten_receive_on_main_thread_js:(e,r,t,n)=>{Yt.length=t;for(var o=n>>3,a=0;a<t;a++)Yt[a]=l()[o+a];var i=yn[e];q(i.length==t,"Call args mismatch in _emscripten_receive_on_main_thread_js"),fr.currentProxiedOperationCallerThread=r;var s=i.apply(null,Yt);return fr.currentProxiedOperationCallerThread=0,s},_emscripten_thread_mailbox_await:zt,_emscripten_thread_set_strongref:e=>{y&&fr.pthreads[e].ref()},_emval_decref:Ft,_emval_incref:e=>{e>4&&(At.get(e).refcount+=1)},_emval_take_value:(e,r)=>{var t=(e=Mt(e,"_emval_take_value")).readValueFromPointer(r);return Ot.toHandle(t)},_localtime_js:function(e,r,t){var n=Xt(e,r),o=new Date(1e3*n);i()[t>>2]=o.getSeconds(),Me(o.getSeconds()),i()[t+4>>2]=o.getMinutes(),Me(o.getMinutes()),i()[t+8>>2]=o.getHours(),Me(o.getHours()),i()[t+12>>2]=o.getDate(),Me(o.getDate()),i()[t+16>>2]=o.getMonth(),Me(o.getMonth()),i()[t+20>>2]=o.getFullYear()-1900,Me(o.getFullYear()-1900),i()[t+24>>2]=o.getDay(),Me(o.getDay());var a=0|(e=>(Vt(e.getFullYear())?qt:Kt)[e.getMonth()]+e.getDate()-1)(o);i()[t+28>>2]=a,Me(a),i()[t+36>>2]=-60*o.getTimezoneOffset(),Me(-60*o.getTimezoneOffset());var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=s.getTimezoneOffset(),d=0|(l!=c&&o.getTimezoneOffset()==Math.min(c,l));i()[t+32>>2]=d,Me(d)},_mmap_js:Jt,_munmap_js:Zt,_tzset_js:(e,r,t)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),l=o.getTimezoneOffset(),c=a.getTimezoneOffset(),d=Math.max(l,c);function u(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}s()[e>>2]=60*d,Me(60*d),i()[r>>2]=Number(l!=c),Me(Number(l!=c));var f=u(o),h=u(a),p=en(f),m=en(h);c<l?(s()[t>>2]=p,Me(p),s()[t+4>>2]=m,Me(m)):(s()[t>>2]=m,Me(m),s()[t+4>>2]=p,Me(p))},abort:()=>{pe("native code called abort()")},emscripten_check_blocking_allowed:()=>{y||v||wr("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},emscripten_date_now:()=>Date.now(),emscripten_exit_with_live_runtime:()=>{throw ne+=1,"unwind"},emscripten_get_now:Qt,emscripten_resize_heap:e=>{var r=n().length;if((e>>>=0)<=r)return!1;var t=2147483648;if(e>t)return $(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var o,a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(t,(o=Math.max(e,i))+(65536-o%65536)%65536),l=Qt(),c=rn(s);if($e(`Heap resize call from ${r} to ${s} took ${Qt()-l} msecs. Success: ${!!c}`),c)return!0}return $(`Failed to grow the heap from ${r} bytes to ${s} bytes, not enough memory!`),!1},environ_get:on,environ_sizes_get:an,exit:cr,fd_close:sn,fd_read:ln,fd_seek:cn,fd_write:dn,invoke_dd:function(e,r){var t=Ln();try{return gr(e)(r)}catch(e){if(Wn(t),!(e instanceof Ee))throw e;$n(1,0)}},invoke_dii:function(e,r,t){var n=Ln();try{return gr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_diii:function(e,r,t,n){var o=Ln();try{return gr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_fi:function(e,r){var t=Ln();try{return gr(e)(r)}catch(e){if(Wn(t),!(e instanceof Ee))throw e;$n(1,0)}},invoke_fii:function(e,r,t){var n=Ln();try{return gr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_fiii:function(e,r,t,n){var o=Ln();try{return gr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_i:function(e){var r=Ln();try{return gr(e)()}catch(e){if(Wn(r),!(e instanceof Ee))throw e;$n(1,0)}},invoke_idi:function(e,r,t){var n=Ln();try{return gr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_ii:function(e,r){var t=Ln();try{return gr(e)(r)}catch(e){if(Wn(t),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iid:function(e,r,t){var n=Ln();try{return gr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iidddd:function(e,r,t,n,o,a){var i=Ln();try{return gr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iii:function(e,r,t){var n=Ln();try{return gr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiid:function(e,r,t,n){var o=Ln();try{return gr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiii:function(e,r,t,n){var o=Ln();try{return gr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiid:function(e,r,t,n,o){var a=Ln();try{return gr(e)(r,t,n,o)}catch(e){if(Wn(a),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiii:function(e,r,t,n,o){var a=Ln();try{return gr(e)(r,t,n,o)}catch(e){if(Wn(a),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiid:function(e,r,t,n,o,a){var i=Ln();try{return gr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiii:function(e,r,t,n,o,a){var i=Ln();try{return gr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiii:function(e,r,t,n,o,a,i){var s=Ln();try{return gr(e)(r,t,n,o,a,i)}catch(e){if(Wn(s),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiii:function(e,r,t,n,o,a,i,s){var l=Ln();try{return gr(e)(r,t,n,o,a,i,s)}catch(e){if(Wn(l),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiiii:function(e,r,t,n,o,a,i,s,l){var c=Ln();try{return gr(e)(r,t,n,o,a,i,s,l)}catch(e){if(Wn(c),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,d){var u=Ln();try{return gr(e)(r,t,n,o,a,i,s,l,c,d)}catch(e){if(Wn(u),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,d,u){var f=Ln();try{return gr(e)(r,t,n,o,a,i,s,l,c,d,u)}catch(e){if(Wn(f),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,d,u,f){var h=Ln();try{return gr(e)(r,t,n,o,a,i,s,l,c,d,u,f)}catch(e){if(Wn(h),!(e instanceof Ee))throw e;$n(1,0)}},invoke_jiiii:function(e,r,t,n,o){var a=Ln();try{return Kn(e,r,t,n,o)}catch(e){if(Wn(a),!(e instanceof Ee))throw e;$n(1,0)}},invoke_v:function(e){var r=Ln();try{gr(e)()}catch(e){if(Wn(r),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vi:function(e,r){var t=Ln();try{gr(e)(r)}catch(e){if(Wn(t),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vid:function(e,r,t){var n=Ln();try{gr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vidddddd:function(e,r,t,n,o,a,i,s){var l=Ln();try{gr(e)(r,t,n,o,a,i,s)}catch(e){if(Wn(l),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vii:function(e,r,t){var n=Ln();try{gr(e)(r,t)}catch(e){if(Wn(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viif:function(e,r,t,n){var o=Ln();try{gr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viii:function(e,r,t,n){var o=Ln();try{gr(e)(r,t,n)}catch(e){if(Wn(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiid:function(e,r,t,n,o){var a=Ln();try{gr(e)(r,t,n,o)}catch(e){if(Wn(a),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiii:function(e,r,t,n,o){var a=Ln();try{gr(e)(r,t,n,o)}catch(e){if(Wn(a),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiif:function(e,r,t,n,o,a){var i=Ln();try{gr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiii:function(e,r,t,n,o,a){var i=Ln();try{gr(e)(r,t,n,o,a)}catch(e){if(Wn(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiii:function(e,r,t,n,o,a,i){var s=Ln();try{gr(e)(r,t,n,o,a,i)}catch(e){if(Wn(s),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiii:function(e,r,t,n,o,a,i,s){var l=Ln();try{gr(e)(r,t,n,o,a,i,s)}catch(e){if(Wn(l),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiiii:function(e,r,t,n,o,a,i,s,l){var c=Ln();try{gr(e)(r,t,n,o,a,i,s,l)}catch(e){if(Wn(c),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,d){var u=Ln();try{gr(e)(r,t,n,o,a,i,s,l,c,d)}catch(e){if(Wn(u),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,d,u,f,h){var p=Ln();try{gr(e)(r,t,n,o,a,i,s,l,c,d,u,f,h)}catch(e){if(Wn(p),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,d,u,f,h,p,m){var v=Ln();try{gr(e)(r,t,n,o,a,i,s,l,c,d,u,f,h,p,m)}catch(e){if(Wn(v),!(e instanceof Ee))throw e;$n(1,0)}},llvm_eh_typeid_for:e=>e,memory:I||u.wasmMemory,strftime_l:(e,r,n,o,a)=>((e,r,n,o)=>{var a=s()[o+40>>2],l={tm_sec:i()[o>>2],tm_min:i()[o+4>>2],tm_hour:i()[o+8>>2],tm_mday:i()[o+12>>2],tm_mon:i()[o+16>>2],tm_year:i()[o+20>>2],tm_wday:i()[o+24>>2],tm_yday:i()[o+28>>2],tm_isdst:i()[o+32>>2],tm_gmtoff:i()[o+36>>2],tm_zone:a?or(a):""},c=or(n),d={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in d)c=c.replace(new RegExp(u,"g"),d[u]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function p(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function m(e,r){return p(e,r,"0")}function v(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function y(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=Vt(t.getFullYear()),o=t.getMonth(),a=(n?un:fn)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=y(t),a=y(n);return v(o,r)<=0?v(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var _={"%a":e=>f[e.tm_wday].substring(0,3),"%A":e=>f[e.tm_wday],"%b":e=>h[e.tm_mon].substring(0,3),"%B":e=>h[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>p(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":e=>m(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(Vt(e.tm_year+1900)?un:fn,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return m(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&Vt(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Vt(e.tm_year%400-1))&&r++}return m(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in c=c.replace(/%%/g,"\0\0"),_)c.includes(u)&&(c=c.replace(new RegExp(u,"g"),_[u](l)));var w,E,b=Ye(c=c.replace(/\0\0/g,"%"),!1);return b.length>r?0:(E=e,q((w=b).length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),t().set(w,E),b.length-1)})(e,r,n,o)},_n=function(){var e={env:gn,wasi_snapshot_preview1:gn};function r(e,r){var t,n;return _n=e.exports,n=_n._emscripten_tls_init,fr.tlsInitFunctions.push(n),q(vr=_n.__indirect_function_table,"table not found in wasm exports"),t=_n.__wasm_call_ctors,ee.unshift(t),R=r,he("wasm-instantiate"),_n}fe("wasm-instantiate");var t,n,o,a,i=u;if(u.instantiateWasm)try{return u.instantiateWasm(e,r)}catch(e){$(`Module.instantiateWasm callback failed with error: ${e}`),d(e)}return(t=M,n=me,o=e,a=function(e){q(u===i,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),i=null,r(e.instance,e.module)},t||"function"!=typeof WebAssembly.instantiateStreaming||ge(n)||_e(n)||y||"function"!=typeof fetch?ke(n,o,a):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return $(`wasm streaming compile failed: ${e}`),$("falling back to ArrayBuffer instantiation"),ke(n,o,a)}))))).catch(d),{}}(),wn=(we("__wasm_call_ctors"),we("__cxa_free_exception"),we("malloc")),En=we("__errno_location"),bn=u._free=we("free"),Tn=u._fflush=we("fflush"),kn=(u.__emscripten_tls_init=we("_emscripten_tls_init"),u._pthread_self=()=>(kn=u._pthread_self=_n.pthread_self)()),Sn=we("emscripten_builtin_memalign"),Pn=we("__getTypeName"),Cn=(u.__embind_initialize_bindings=we("_embind_initialize_bindings"),u.__emscripten_thread_init=we("_emscripten_thread_init")),An=(u.__emscripten_thread_crashed=we("_emscripten_thread_crashed"),we("emscripten_main_thread_process_queued_calls"),we("emscripten_main_runtime_thread_id"),()=>(An=_n.emscripten_stack_get_base)()),Fn=()=>(Fn=_n.emscripten_stack_get_end)(),On=we("_emscripten_run_on_main_thread_js"),Dn=we("_emscripten_thread_free_data"),Mn=u.__emscripten_thread_exit=we("_emscripten_thread_exit"),Nn=u.__emscripten_check_mailbox=we("_emscripten_check_mailbox"),$n=we("setThrew"),In=we("setTempRet0"),Rn=()=>(Rn=_n.emscripten_stack_init)(),xn=(e,r)=>(xn=_n.emscripten_stack_set_limits)(e,r),Ln=we("stackSave"),Wn=we("stackRestore"),jn=we("stackAlloc"),Un=()=>(Un=_n.emscripten_stack_get_current)(),Bn=we("__cxa_decrement_exception_refcount"),zn=we("__cxa_increment_exception_refcount"),Hn=we("__cxa_demangle"),Gn=u.___get_exception_message=we("__get_exception_message"),Yn=we("__cxa_can_catch"),Vn=we("__cxa_is_pointer_type"),qn=u.___set_stack_limits=we("__set_stack_limits"),Kn=(u.dynCall_jii=we("dynCall_jii"),u.dynCall_viij=we("dynCall_viij"),u.dynCall_jiji=we("dynCall_jiji"),u.dynCall_viijii=we("dynCall_viijii"),u.dynCall_jiiii=we("dynCall_jiiii"));function Xn(){if(!(se>0)){if(b||(q(!b),Rn(),J()),b)return c(u),ae(),void startWorker(u);!function(){if(q(!b),u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)ie(u.preRun.shift());hr(Q)}(),se>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),e()}),1)):e(),Z())}function e(){vn||(vn=!0,u.calledRun=!0,V||(ae(),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),q(!u._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(Z(),!b){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),re.unshift(e);var e;hr(re)}}()))}}if(u.dynCall_iiiiij=we("dynCall_iiiiij"),u.dynCall_iiiiijj=we("dynCall_iiiiijj"),u.dynCall_iiiiiijj=we("dynCall_iiiiiijj"),u.addRunDependency=fe,u.removeRunDependency=he,u.FS_createPath=ir.createPath,u.FS_createLazyFile=ir.createLazyFile,u.FS_createDevice=ir.createDevice,u.keepRuntimeAlive=oe,u.wasmMemory=I,u.ExitStatus=Ie,u.FS_createPreloadedFile=ir.createPreloadedFile,u.FS=ir,u.FS_createDataFile=ir.createDataFile,u.FS_unlink=ir.unlink,u.PThread=fr,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePop","safeSetTimeout","asmjsMangle","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSizeCallingThread","setCanvasElementSizeMainThread","setCanvasElementSize","getCanvasSizeCallingThread","getCanvasSizeMainThread","getCanvasElementSize","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","emscripten_webgl_destroy_context_before_on_calling_thread","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","registerInheritedInstance","unregisterInheritedInstance","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var r="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",t=e;t.startsWith("_")||(t="$"+e),r+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='"+t+"')",Pe(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),wr(r)}}),Ae(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","GROWABLE_HEAP_I8","GROWABLE_HEAP_U8","GROWABLE_HEAP_I16","GROWABLE_HEAP_U16","GROWABLE_HEAP_I32","GROWABLE_HEAP_U32","GROWABLE_HEAP_F32","GROWABLE_HEAP_F64","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","setStackLimits","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","getExecutableName","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","handleAllocatorInit","HandleAllocator","wasmTable","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","jsStackTrace","stackTrace","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","incrementExceptionRefcount","decrementExceptionRefcount","getExceptionMessage","Browser","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","terminateWorker","killThread","cleanupThread","registerTLSInit","cancelThread","spawnThread","exitOnMainThread","proxyToMainThread","proxiedJSCallArgs","invokeEntryPoint","checkMailbox","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","UnboundTypeError","PureVirtualError","GenericWireTypeSize","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handles","emval_symbols","init_emval","count_emval_handles","Emval","emval_newers","emval_methodCallers","emval_registeredMethods","IDBFS","NODEFS"].forEach(Ae),ce=function e(){vn||Xn(),vn||(ce=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return Xn(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=createCCP4Module:"function"==typeof define&&define.amd&&define([],(()=>createCCP4Module));
1
+ var createCCP4Module=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r={}){function t(){return N.buffer!=W.buffer&&K(),W}function n(){return N.buffer!=W.buffer&&K(),j}function o(){return N.buffer!=W.buffer&&K(),U}function a(){return N.buffer!=W.buffer&&K(),B}function i(){return N.buffer!=W.buffer&&K(),z}function s(){return N.buffer!=W.buffer&&K(),H}function l(){return N.buffer!=W.buffer&&K(),Y}var c,u,d=r;d.ready=new Promise(((e,r)=>{c=e,u=r})),["_main","__emscripten_thread_init","__emscripten_thread_exit","__emscripten_thread_crashed","__emscripten_thread_mailbox_await","__emscripten_tls_init","_pthread_self","checkMailbox","establishStackSpace","invokeEntryPoint","PThread","getExceptionMessage","___get_exception_message","_free","___indirect_function_table","_fflush","__embind_initialize_bindings","__emscripten_check_mailbox","___set_stack_limits","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(d.ready,e)||Object.defineProperty(d.ready,e,{get:()=>pe("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>pe("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var f=Object.assign({},d),h="./this.program",p=(e,r)=>{throw r},m="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g=!m&&!y&&!v;if(d.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var _,w,E,b=d.ENVIRONMENT_IS_PTHREAD||!1,T="";function k(e){return d.locateFile?d.locateFile(e,T):T+e}if(y){if("undefined"==typeof process||!process.release||"node"!==process.release.name)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var S=process.versions.node,P=S.split(".").slice(0,3);if((P=1e4*P[0]+100*P[1]+1*P[2].split("-")[0])<16e4)throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+S+")");var A=require("fs"),C=require("path");let e;T=v?C.dirname(T)+"/":__dirname+"/",_=(e,r)=>(e=_e(e)?new URL(e):C.normalize(e),A.readFileSync(e,r?void 0:"utf8")),E=e=>{var r=_(e,!0);return r.buffer||(r=new Uint8Array(r)),q(r.buffer),r},w=(e,r,t,n=!0)=>{e=_e(e)?new URL(e):C.normalize(e),A.readFile(e,n?void 0:"utf8",((e,o)=>{e?t(e):r(n?o.buffer:o)}))},!d.thisProgram&&process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),p=(e,r)=>{throw process.exitCode=e,r},d.inspect=()=>"[Emscripten Module object]";try{e=require("worker_threads")}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}global.Worker=e.Worker}else if(g){if("object"==typeof process&&"function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(_=read),E=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let r=read(e,"binary");return q("object"==typeof r),r},w=(e,r,t)=>{setTimeout((()=>r(E(e))))},"undefined"==typeof clearTimeout&&(globalThis.clearTimeout=e=>{}),"undefined"==typeof setTimeout&&(globalThis.setTimeout=e=>"function"==typeof e?e():pe()),"undefined"!=typeof scriptArgs&&scriptArgs,"function"==typeof quit&&(p=(e,r)=>{throw setTimeout((()=>{if(!(r instanceof Ne)){let e=r;r&&"object"==typeof r&&r.stack&&(e=[r,r.stack]),I(`exiting due to exception: ${e}`)}quit(e)})),r}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!m&&!v)throw new Error("environment detection error");if(v?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),e&&(T=e),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");y||(_=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},v&&(E=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),w=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)})}y&&"undefined"==typeof performance&&(global.performance=require("perf_hooks").performance);var F=console.log.bind(console),D=console.error.bind(console);y&&(F=(...e)=>A.writeSync(1,e.join(" ")+"\n"),D=(...e)=>A.writeSync(2,e.join(" ")+"\n"));var O,M,$=d.print||F,I=d.printErr||D;Object.assign(d,f),f=null,O="fetchSettings",Object.getOwnPropertyDescriptor(d,O)&&pe(`\`Module.${O}\` was supplied but \`${O}\` not included in INCOMING_MODULE_JS_API`),d.arguments&&d.arguments,Se("arguments","arguments_"),d.thisProgram&&(h=d.thisProgram),Se("thisProgram","thisProgram"),d.quit&&(p=d.quit),Se("quit","quit_"),q(void 0===d.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),q(void 0===d.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),q(void 0===d.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),q(void 0===d.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),q(void 0===d.read,"Module.read option was removed (modify read_ in JS)"),q(void 0===d.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),q(void 0===d.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),q(void 0===d.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),q(void 0===d.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Se("asm","wasmExports"),Se("read","read_"),Se("readAsync","readAsync"),Se("readBinary","readBinary"),Se("setWindowTitle","setWindowTitle"),q(m||v||y,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"),q(!g,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),d.wasmBinary&&(M=d.wasmBinary),Se("wasmBinary","wasmBinary");var N,R,x=d.noExitRuntime||!0;Se("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&pe("no native wasm support detected");var L,W,j,U,B,z,H,G,Y,V=!1;function q(e,r){e||pe("Assertion failed"+(r?": "+r:""))}function K(){var e=N.buffer;d.HEAP8=W=new Int8Array(e),d.HEAP16=U=new Int16Array(e),d.HEAPU8=j=new Uint8Array(e),d.HEAPU16=B=new Uint16Array(e),d.HEAP32=z=new Int32Array(e),d.HEAPU32=H=new Uint32Array(e),d.HEAPF32=G=new Float32Array(e),d.HEAPF64=Y=new Float64Array(e)}q(!d.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),q("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support");var X=d.INITIAL_MEMORY||16777216;if(Se("INITIAL_MEMORY","INITIAL_MEMORY"),q(X>=5242880,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+X+"! (STACK_SIZE=5242880)"),b)N=d.wasmMemory;else if(d.wasmMemory)N=d.wasmMemory;else if(!((N=new WebAssembly.Memory({initial:X/65536,maximum:32768,shared:!0})).buffer instanceof SharedArrayBuffer))throw I("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),y&&I("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");function J(){var e=Cn();q(0==(3&e)),0==e&&(e+=4),s()[e>>2]=34821223,Me(34821223),s()[e+4>>2]=2310721022,Me(2310721022),s()[0]=1668509029,Me(1668509029)}function Z(){if(!V){var e=Cn();0==e&&(e+=4);var r=s()[e>>2],t=s()[e+4>>2];34821223==r&&2310721022==t||pe(`Stack overflow! Stack cookie has been overwritten at ${cr(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${cr(t)} ${cr(r)}`),1668509029!=s()[0]&&pe("Runtime error: The application has corrupted its heap memory area (address zero)!")}}K(),q((X=N.buffer.byteLength)%65536==0),function(){var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,115!==r[0]||99!==r[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var Q=[],ee=[],re=[],te=!1,ne=0;function oe(){return x||ne>0}function ae(){q(!te),te=!0,b||(Z(),gr(),d.noFSInit||ar.init.initialized||ar.init(),ar.ignorePermissions=!1,Ve.init(),fr(ee))}function ie(e){Q.unshift(e)}q(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),q(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var se=0,le=null,ce=null,ue={};function de(e){for(var r=e;;){if(!ue[e])return e;e=r+Math.random()}}function fe(e){se++,d.monitorRunDependencies&&d.monitorRunDependencies(se),e?(q(!ue[e]),ue[e]=1,null===le&&"undefined"!=typeof setInterval&&(le=setInterval((()=>{if(V)return clearInterval(le),void(le=null);var e=!1;for(var r in ue)e||(e=!0,I("still waiting on run dependencies:")),I(`dependency: ${r}`);e&&I("(end of list)")}),1e4))):I("warning: run dependency added without ID")}function he(e){if(se--,d.monitorRunDependencies&&d.monitorRunDependencies(se),e?(q(ue[e]),delete ue[e]):I("warning: run dependency removed without ID"),0==se&&(null!==le&&(clearInterval(le),le=null),ce)){var r=ce;ce=null,r()}}function pe(e){d.onAbort&&d.onAbort(e),I(e="Aborted("+e+")"),V=!0,L=1;var r=new WebAssembly.RuntimeError(e);throw u(r),r}var me,ve,ye;function ge(e){return e.startsWith("data:application/octet-stream;base64,")}function _e(e){return e.startsWith("file://")}function we(e){return function(){q(te,`native function \`${e}\` called before runtime initialization`);var r=gn[e];return q(r,`exported native function \`${e}\` not found`),r.apply(null,arguments)}}class Ee extends Error{}class be extends Ee{constructor(e){super(e),this.excPtr=e;const r=pr(e);this.name=r[0],this.message=r[1]}}function Te(e){if(e==me&&M)return new Uint8Array(M);if(E)return E(e);throw"both async and sync fetching of the wasm failed"}function ke(e,r,t){return function(e){if(!M&&(m||v)){if("function"==typeof fetch&&!_e(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>Te(e)));if(w)return new Promise(((r,t)=>{w(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>Te(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{I(`failed to asynchronously prepare wasm: ${e}`),_e(me)&&I(`warning: Loading from a file URI (${me}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),pe(e)}))}function Se(e,r,t=!0){Object.getOwnPropertyDescriptor(d,e)||Object.defineProperty(d,e,{configurable:!0,get(){pe(`\`Module.${e}\` has been replaced by \`${r}\``+(t?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function Pe(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function Ae(e,r){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){_r("`"+e+"` is not longer defined by emscripten. "+r)}})}function Ce(e){Object.getOwnPropertyDescriptor(d,e)||Object.defineProperty(d,e,{configurable:!0,get(){var r="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";Pe(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),pe(r)}})}function Fe(e,r,t,n){q(Number.isInteger(Number(e)),"attempt to write non-integer ("+e+") into integer heap"),q(e<=n,"value ("+e+") too large to write as "+r+"-bit value"),q(e>=t,"value ("+e+") too small to write as "+r+"-bit value")}ge(me="web_example.wasm")||(me=k(me)),Ae("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),Ae("asm","Please use wasmExports instead");var De=e=>Fe(e,8,-127,255),Oe=e=>Fe(e,16,-32767,65535),Me=e=>Fe(e,32,-2147483647,4294967295),$e=e=>Fe(e,64,-0x8000000000000000,0x10000000000000000);function Ie(e){y?A.writeSync(2,Array.from(arguments).join(" ")+"\n"):console.warn.apply(console,arguments)}function Ne(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var Re=e=>{e.terminate(),e.onmessage=r=>{var t=r.data.cmd;I(`received "${t}" command from terminated worker: ${e.workerID}`)}},xe=e=>{q(!b,"Internal Error! cleanupThread() can only ever be called from main application thread!"),q(e,"Internal Error! Null pthread_ptr in cleanupThread!");var r=dr.pthreads[e];q(r),dr.returnWorkerToPool(r)},Le={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Le.isAbs(e),t="/"===e.substr(-1);return(e=Le.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Le.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Le.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Le.normalize(e.join("/"))},join2:(e,r)=>Le.normalize(e+"/"+r)},We=e=>(We=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>(e.set(crypto.getRandomValues(new Uint8Array(e.byteLength))),e);if(y)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}pe("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")})())(e),je={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:ar.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=Le.isAbs(n)}return(r?"/":"")+(e=Le.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=je.resolve(e).substr(1),r=je.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},Ue="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,Be=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Ue)return Ue.decode(e.buffer instanceof SharedArrayBuffer?e.slice(r,o):e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var l=63&e[r++];if(224==(240&i)?i=(15&i)<<12|s<<6|l:(240!=(248&i)&&_r("Invalid UTF-8 leading byte "+cr(i)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),i=(7&i)<<18|s<<12|l<<6|63&e[r++]),i<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ze=[],He=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Ge=(e,r,t,n)=>{if(q("string"==typeof e),!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;s>1114111&&_r("Invalid Unicode code point "+cr(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function Ye(e,r,t){var n=t>0?t:He(e)+1,o=new Array(n),a=Ge(e,o,0,o.length);return r&&(o.length=a),o}var Ve={ttys:[],init(){},shutdown(){},register(e,r){Ve.ttys[e]={input:[],output:[],ops:r},ar.registerDevice(e,Ve.stream_ops)},stream_ops:{open(e){var r=Ve.ttys[e.node.rdev];if(!r)throw new ar.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new ar.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ar.ErrnoError(29)}if(void 0===s&&0===a)throw new ar.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new ar.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new ar.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!ze.length){var e=null;if(y){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=A.readSync(n,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;ze=Ye(e,!0)}return ze.shift()})(),put_char(e,r){null===r||10===r?($(Be(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&($(Be(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(I(Be(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(I(Be(e.output,0)),e.output=[])}}},qe=e=>{e=((e,r)=>(q(r,"alignment argument is required"),Math.ceil(e/r)*r))(e,65536);var r=kn(65536,e);return r?((e,r)=>(n().fill(0,e,e+r),e))(r,e):0},Ke={ops_table:null,mount:e=>Ke.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ar.isBlkdev(t)||ar.isFIFO(t))throw new ar.ErrnoError(63);Ke.ops_table||(Ke.ops_table={dir:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr,lookup:Ke.node_ops.lookup,mknod:Ke.node_ops.mknod,rename:Ke.node_ops.rename,unlink:Ke.node_ops.unlink,rmdir:Ke.node_ops.rmdir,readdir:Ke.node_ops.readdir,symlink:Ke.node_ops.symlink},stream:{llseek:Ke.stream_ops.llseek}},file:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr},stream:{llseek:Ke.stream_ops.llseek,read:Ke.stream_ops.read,write:Ke.stream_ops.write,allocate:Ke.stream_ops.allocate,mmap:Ke.stream_ops.mmap,msync:Ke.stream_ops.msync}},link:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr,readlink:Ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ke.node_ops.getattr,setattr:Ke.node_ops.setattr},stream:ar.chrdev_stream_ops}});var o=ar.createNode(e,r,t,n);return ar.isDir(o.mode)?(o.node_ops=Ke.ops_table.dir.node,o.stream_ops=Ke.ops_table.dir.stream,o.contents={}):ar.isFile(o.mode)?(o.node_ops=Ke.ops_table.file.node,o.stream_ops=Ke.ops_table.file.stream,o.usedBytes=0,o.contents=null):ar.isLink(o.mode)?(o.node_ops=Ke.ops_table.link.node,o.stream_ops=Ke.ops_table.link.stream):ar.isChrdev(o.mode)&&(o.node_ops=Ke.ops_table.chrdev.node,o.stream_ops=Ke.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ar.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,ar.isDir(e.mode)?r.size=4096:ar.isFile(e.mode)?r.size=e.usedBytes:ar.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&Ke.resizeFileStorage(e,r.size)},lookup(e,r){throw ar.genericErrors[44]},mknod:(e,r,t,n)=>Ke.createNode(e,r,t,n),rename(e,r,t){if(ar.isDir(e.mode)){var n;try{n=ar.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new ar.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ar.lookupNode(e,r);for(var n in t.contents)throw new ar.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=Ke.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ar.isLink(e.mode))throw new ar.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(q(i>=0),i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,n,o,a,i){if(q(!(r instanceof ArrayBuffer)),r.buffer===t().buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return q(0===a,"canOwn must imply no weird position inside the file"),s.contents=r.subarray(n,n+o),s.usedBytes=o,o;if(0===s.usedBytes&&0===a)return s.contents=r.slice(n,n+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(n,n+o),a),o}if(Ke.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+o),a);else for(var l=0;l<o;l++)s.contents[a+l]=r[n+l];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ar.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ar.ErrnoError(28);return n},allocate(e,r,t){Ke.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,n,o,a){if(!ar.isFile(e.node.mode))throw new ar.ErrnoError(43);var i,s,l=e.node.contents;if(2&a||l.buffer!==t().buffer){if((n>0||n+r<l.length)&&(l=l.subarray?l.subarray(n,n+r):Array.prototype.slice.call(l,n,n+r)),s=!0,!(i=qe(r)))throw new ar.ErrnoError(48);t().set(l,i)}else s=!1,i=l.byteOffset;return{ptr:i,allocated:s}},msync:(e,r,t,n,o)=>(Ke.stream_ops.write(e,r,0,n,t,!1),0)}},Xe=d.preloadPlugins||[],Je=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Ze={dbs:{},indexedDB:()=>{if("undefined"!=typeof indexedDB)return indexedDB;var e=null;return"object"==typeof window&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),q(e,"IDBFS used, but indexedDB not supported"),e},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(e){return Ke.mount.apply(null,arguments)},syncfs:(e,r,t)=>{Ze.getLocalSet(e,((n,o)=>{if(n)return t(n);Ze.getRemoteSet(e,((e,n)=>{if(e)return t(e);var a=r?n:o,i=r?o:n;Ze.reconcile(a,i,t)}))}))},quit:()=>{Object.values(Ze.dbs).forEach((e=>e.close())),Ze.dbs={}},getDB:(e,r)=>{var t,n=Ze.dbs[e];if(n)return r(null,n);try{t=Ze.indexedDB().open(e,Ze.DB_VERSION)}catch(e){return r(e)}if(!t)return r("Unable to connect to IndexedDB");t.onupgradeneeded=e=>{var r,t=e.target.result,n=e.target.transaction;(r=t.objectStoreNames.contains(Ze.DB_STORE_NAME)?n.objectStore(Ze.DB_STORE_NAME):t.createObjectStore(Ze.DB_STORE_NAME)).indexNames.contains("timestamp")||r.createIndex("timestamp","timestamp",{unique:!1})},t.onsuccess=()=>{n=t.result,Ze.dbs[e]=n,r(null,n)},t.onerror=e=>{r(e.target.error),e.preventDefault()}},getLocalSet:(e,r)=>{var t={};function n(e){return"."!==e&&".."!==e}function o(e){return r=>Le.join2(e,r)}for(var a=ar.readdir(e.mountpoint).filter(n).map(o(e.mountpoint));a.length;){var i,s=a.pop();try{i=ar.stat(s)}catch(e){return r(e)}ar.isDir(i.mode)&&a.push.apply(a,ar.readdir(s).filter(n).map(o(s))),t[s]={timestamp:i.mtime}}return r(null,{type:"local",entries:t})},getRemoteSet:(e,r)=>{var t={};Ze.getDB(e.mountpoint,((e,n)=>{if(e)return r(e);try{var o=n.transaction([Ze.DB_STORE_NAME],"readonly");o.onerror=e=>{r(e.target.error),e.preventDefault()},o.objectStore(Ze.DB_STORE_NAME).index("timestamp").openKeyCursor().onsuccess=e=>{var o=e.target.result;if(!o)return r(null,{type:"remote",db:n,entries:t});t[o.primaryKey]={timestamp:o.key},o.continue()}}catch(e){return r(e)}}))},loadLocalEntry:(e,r)=>{var t,n;try{n=ar.lookupPath(e).node,t=ar.stat(e)}catch(e){return r(e)}return ar.isDir(t.mode)?r(null,{timestamp:t.mtime,mode:t.mode}):ar.isFile(t.mode)?(n.contents=Ke.getFileDataAsTypedArray(n),r(null,{timestamp:t.mtime,mode:t.mode,contents:n.contents})):r(new Error("node type not supported"))},storeLocalEntry:(e,r,t)=>{try{if(ar.isDir(r.mode))ar.mkdirTree(e,r.mode);else{if(!ar.isFile(r.mode))return t(new Error("node type not supported"));ar.writeFile(e,r.contents,{canOwn:!0})}ar.chmod(e,r.mode),ar.utime(e,r.timestamp,r.timestamp)}catch(e){return t(e)}t(null)},removeLocalEntry:(e,r)=>{try{var t=ar.stat(e);ar.isDir(t.mode)?ar.rmdir(e):ar.isFile(t.mode)&&ar.unlink(e)}catch(e){return r(e)}r(null)},loadRemoteEntry:(e,r,t)=>{var n=e.get(r);n.onsuccess=e=>{t(null,e.target.result)},n.onerror=e=>{t(e.target.error),e.preventDefault()}},storeRemoteEntry:(e,r,t,n)=>{try{var o=e.put(t,r)}catch(e){return void n(e)}o.onsuccess=()=>{n(null)},o.onerror=e=>{n(e.target.error),e.preventDefault()}},removeRemoteEntry:(e,r,t)=>{var n=e.delete(r);n.onsuccess=()=>{t(null)},n.onerror=e=>{t(e.target.error),e.preventDefault()}},reconcile:(e,r,t)=>{var n=0,o=[];Object.keys(e.entries).forEach((function(t){var a=e.entries[t],i=r.entries[t];i&&a.timestamp.getTime()==i.timestamp.getTime()||(o.push(t),n++)}));var a=[];if(Object.keys(r.entries).forEach((function(r){e.entries[r]||(a.push(r),n++)})),!n)return t(null);var i=!1,s=("remote"===e.type?e.db:r.db).transaction([Ze.DB_STORE_NAME],"readwrite"),l=s.objectStore(Ze.DB_STORE_NAME);function c(e){if(e&&!i)return i=!0,t(e)}s.onerror=e=>{c(this.error),e.preventDefault()},s.oncomplete=e=>{i||t(null)},o.sort().forEach((e=>{"local"===r.type?Ze.loadRemoteEntry(l,e,((r,t)=>{if(r)return c(r);Ze.storeLocalEntry(e,t,c)})):Ze.loadLocalEntry(e,((r,t)=>{if(r)return c(r);Ze.storeRemoteEntry(l,e,t,c)}))})),a.sort().reverse().forEach((e=>{"local"===r.type?Ze.removeLocalEntry(e,c):Ze.removeRemoteEntry(l,e,c)}))}},Qe={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},er={},rr=e=>{var r=xn(),t=e();return Ln(r),t},tr=(e,r,t)=>(q("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Ge(e,n(),r,t)),nr=(e,r)=>(q("number"==typeof e),e?Be(n(),e,r):""),or=e=>(or.recursionGuard=1+(0|or.recursionGuard),or.recursionGuard>1?e:rr((()=>{try{var r=e;r.startsWith("__Z")&&(r=r.substr(1));var t=(e=>{var r=He(e)+1,t=Wn(r);return tr(e,t,r),t})(r),n=Wn(4),o=zn(t,0,0,n);if(0===i()[n>>2]&&o)return nr(o)}catch(e){}finally{En(o),or.recursionGuard<2&&--or.recursionGuard}return e}))),ar={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=je.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ar.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=ar.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=ar.lookupNode(n,t[a]),o=Le.join2(o,t[a]),ar.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;ar.isLink(n.mode);){var l=ar.readlink(o);if(o=je.resolve(Le.dirname(o),l),n=ar.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new ar.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(ar.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%ar.nameTable.length},hashAddNode(e){var r=ar.hashName(e.parent.id,e.name);e.name_next=ar.nameTable[r],ar.nameTable[r]=e},hashRemoveNode(e){var r=ar.hashName(e.parent.id,e.name);if(ar.nameTable[r]===e)ar.nameTable[r]=e.name_next;else for(var t=ar.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ar.mayLookup(e);if(t)throw new ar.ErrnoError(t,e);for(var n=ar.hashName(e.id,r),o=ar.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ar.lookup(e,r)},createNode(e,r,t,n){q("object"==typeof e);var o=new ar.FSNode(e,r,t,n);return ar.hashAddNode(o),o},destroyNode(e){ar.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ar.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>ar.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return ar.lookupNode(e,r),20}catch(e){}return ar.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ar.lookupNode(e,r)}catch(e){return e.errno}var o=ar.nodePermissions(e,"wx");if(o)return o;if(t){if(!ar.isDir(n.mode))return 54;if(ar.isRoot(n)||ar.getPath(n)===ar.cwd())return 10}else if(ar.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ar.isLink(e.mode)?32:ar.isDir(e.mode)&&("r"!==ar.flagsToPermissionString(r)||512&r)?31:ar.nodePermissions(e,ar.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ar.MAX_OPEN_FDS;e++)if(!ar.streams[e])return e;throw new ar.ErrnoError(33)},getStreamChecked(e){var r=ar.getStream(e);if(!r)throw new ar.ErrnoError(8);return r},getStream:e=>ar.streams[e],createStream:(e,r=-1)=>(ar.FSStream||(ar.FSStream=function(){this.shared={}},ar.FSStream.prototype={},Object.defineProperties(ar.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new ar.FSStream,e),-1==r&&(r=ar.nextfd()),e.fd=r,ar.streams[r]=e,e),closeStream(e){ar.streams[e]=null},chrdev_stream_ops:{open(e){var r=ar.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new ar.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ar.devices[e]={stream_ops:r}},getDevice:e=>ar.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ar.syncFSRequests++,ar.syncFSRequests>1&&I(`warning: ${ar.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ar.getMounts(ar.root.mount),n=0;function o(e){return q(ar.syncFSRequests>0),ar.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){if("string"==typeof e)throw e;var n,o="/"===t,a=!t;if(o&&ar.root)throw new ar.ErrnoError(10);if(!o&&!a){var i=ar.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ar.isMountpoint(n))throw new ar.ErrnoError(10);if(!ar.isDir(n.mode))throw new ar.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?ar.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=ar.lookupPath(e,{follow_mount:!1});if(!ar.isMountpoint(r.node))throw new ar.ErrnoError(28);var t=r.node,n=t.mounted,o=ar.getMounts(n);Object.keys(ar.nameTable).forEach((e=>{for(var r=ar.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ar.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);q(-1!==a),t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ar.lookupPath(e,{parent:!0}).node,o=Le.basename(e);if(!o||"."===o||".."===o)throw new ar.ErrnoError(28);var a=ar.mayCreate(n,o);if(a)throw new ar.ErrnoError(a);if(!n.node_ops.mknod)throw new ar.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ar.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ar.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{ar.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,ar.mknod(e,r,t)),symlink(e,r){if(!je.resolve(e))throw new ar.ErrnoError(44);var t=ar.lookupPath(r,{parent:!0}).node;if(!t)throw new ar.ErrnoError(44);var n=Le.basename(r),o=ar.mayCreate(t,n);if(o)throw new ar.ErrnoError(o);if(!t.node_ops.symlink)throw new ar.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=Le.dirname(e),a=Le.dirname(r),i=Le.basename(e),s=Le.basename(r);if(t=ar.lookupPath(e,{parent:!0}).node,n=ar.lookupPath(r,{parent:!0}).node,!t||!n)throw new ar.ErrnoError(44);if(t.mount!==n.mount)throw new ar.ErrnoError(75);var l,c=ar.lookupNode(t,i),u=je.relative(e,a);if("."!==u.charAt(0))throw new ar.ErrnoError(28);if("."!==(u=je.relative(r,o)).charAt(0))throw new ar.ErrnoError(55);try{l=ar.lookupNode(n,s)}catch(e){}if(c!==l){var d=ar.isDir(c.mode),f=ar.mayDelete(t,i,d);if(f)throw new ar.ErrnoError(f);if(f=l?ar.mayDelete(n,s,d):ar.mayCreate(n,s))throw new ar.ErrnoError(f);if(!t.node_ops.rename)throw new ar.ErrnoError(63);if(ar.isMountpoint(c)||l&&ar.isMountpoint(l))throw new ar.ErrnoError(10);if(n!==t&&(f=ar.nodePermissions(t,"w")))throw new ar.ErrnoError(f);ar.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{ar.hashAddNode(c)}}},rmdir(e){var r=ar.lookupPath(e,{parent:!0}).node,t=Le.basename(e),n=ar.lookupNode(r,t),o=ar.mayDelete(r,t,!0);if(o)throw new ar.ErrnoError(o);if(!r.node_ops.rmdir)throw new ar.ErrnoError(63);if(ar.isMountpoint(n))throw new ar.ErrnoError(10);r.node_ops.rmdir(r,t),ar.destroyNode(n)},readdir(e){var r=ar.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ar.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ar.lookupPath(e,{parent:!0}).node;if(!r)throw new ar.ErrnoError(44);var t=Le.basename(e),n=ar.lookupNode(r,t),o=ar.mayDelete(r,t,!1);if(o)throw new ar.ErrnoError(o);if(!r.node_ops.unlink)throw new ar.ErrnoError(63);if(ar.isMountpoint(n))throw new ar.ErrnoError(10);r.node_ops.unlink(r,t),ar.destroyNode(n)},readlink(e){var r=ar.lookupPath(e).node;if(!r)throw new ar.ErrnoError(44);if(!r.node_ops.readlink)throw new ar.ErrnoError(28);return je.resolve(ar.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ar.lookupPath(e,{follow:!r}).node;if(!t)throw new ar.ErrnoError(44);if(!t.node_ops.getattr)throw new ar.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ar.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?ar.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new ar.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ar.chmod(e,r,!0)},fchmod(e,r){var t=ar.getStreamChecked(e);ar.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?ar.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ar.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){ar.chown(e,r,t,!0)},fchown(e,r,t){var n=ar.getStreamChecked(e);ar.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ar.ErrnoError(28);var t;if(!(t="string"==typeof e?ar.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ar.ErrnoError(63);if(ar.isDir(t.mode))throw new ar.ErrnoError(31);if(!ar.isFile(t.mode))throw new ar.ErrnoError(28);var n=ar.nodePermissions(t,"w");if(n)throw new ar.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ar.getStreamChecked(e);if(0==(2097155&t.flags))throw new ar.ErrnoError(28);ar.truncate(t.node,r)},utime(e,r,t){var n=ar.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ar.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=Le.normalize(e);try{n=ar.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new ar.ErrnoError(20)}else n=ar.mknod(e,t,0),o=!0;if(!n)throw new ar.ErrnoError(44);if(ar.isChrdev(n.mode)&&(r&=-513),65536&r&&!ar.isDir(n.mode))throw new ar.ErrnoError(54);if(!o){var a=ar.mayOpen(n,r);if(a)throw new ar.ErrnoError(a)}512&r&&!o&&ar.truncate(n,0),r&=-131713;var i=ar.createStream({node:n,path:ar.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!d.logReadFiles||1&r||(ar.readFiles||(ar.readFiles={}),e in ar.readFiles||(ar.readFiles[e]=1)),i},close(e){if(ar.isClosed(e))throw new ar.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ar.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ar.isClosed(e))throw new ar.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ar.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ar.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(q(t>=0),n<0||o<0)throw new ar.ErrnoError(28);if(ar.isClosed(e))throw new ar.ErrnoError(8);if(1==(2097155&e.flags))throw new ar.ErrnoError(8);if(ar.isDir(e.node.mode))throw new ar.ErrnoError(31);if(!e.stream_ops.read)throw new ar.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ar.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(q(t>=0),n<0||o<0)throw new ar.ErrnoError(28);if(ar.isClosed(e))throw new ar.ErrnoError(8);if(0==(2097155&e.flags))throw new ar.ErrnoError(8);if(ar.isDir(e.node.mode))throw new ar.ErrnoError(31);if(!e.stream_ops.write)throw new ar.ErrnoError(28);e.seekable&&1024&e.flags&&ar.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ar.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(ar.isClosed(e))throw new ar.ErrnoError(8);if(r<0||t<=0)throw new ar.ErrnoError(28);if(0==(2097155&e.flags))throw new ar.ErrnoError(8);if(!ar.isFile(e.node.mode)&&!ar.isDir(e.node.mode))throw new ar.ErrnoError(43);if(!e.stream_ops.allocate)throw new ar.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new ar.ErrnoError(2);if(1==(2097155&e.flags))throw new ar.ErrnoError(2);if(!e.stream_ops.mmap)throw new ar.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>(q(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0),munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ar.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ar.open(e,r.flags),o=ar.stat(e).size,a=new Uint8Array(o);return ar.read(n,a,0,o,0),"utf8"===r.encoding?t=Be(a,0):"binary"===r.encoding&&(t=a),ar.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ar.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(He(r)+1),a=Ge(r,o,0,o.length);ar.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ar.write(n,r,0,r.byteLength,void 0,t.canOwn)}ar.close(n)},cwd:()=>ar.currentPath,chdir(e){var r=ar.lookupPath(e,{follow:!0});if(null===r.node)throw new ar.ErrnoError(44);if(!ar.isDir(r.node.mode))throw new ar.ErrnoError(54);var t=ar.nodePermissions(r.node,"x");if(t)throw new ar.ErrnoError(t);ar.currentPath=r.path},createDefaultDirectories(){ar.mkdir("/tmp"),ar.mkdir("/home"),ar.mkdir("/home/web_user")},createDefaultDevices(){ar.mkdir("/dev"),ar.registerDevice(ar.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),ar.mkdev("/dev/null",ar.makedev(1,3)),Ve.register(ar.makedev(5,0),Ve.default_tty_ops),Ve.register(ar.makedev(6,0),Ve.default_tty1_ops),ar.mkdev("/dev/tty",ar.makedev(5,0)),ar.mkdev("/dev/tty1",ar.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=We(e).byteLength),e[--r]);ar.createDevice("/dev","random",t),ar.createDevice("/dev","urandom",t),ar.mkdir("/dev/shm"),ar.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ar.mkdir("/proc");var e=ar.mkdir("/proc/self");ar.mkdir("/proc/self/fd"),ar.mount({mount(){var r=ar.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ar.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){d.stdin?ar.createDevice("/dev","stdin",d.stdin):ar.symlink("/dev/tty","/dev/stdin"),d.stdout?ar.createDevice("/dev","stdout",null,d.stdout):ar.symlink("/dev/tty","/dev/stdout"),d.stderr?ar.createDevice("/dev","stderr",null,d.stderr):ar.symlink("/dev/tty1","/dev/stderr");var e=ar.open("/dev/stdin",0),r=ar.open("/dev/stdout",1),t=ar.open("/dev/stderr",1);q(0===e.fd,`invalid handle for stdin (${e.fd})`),q(1===r.fd,`invalid handle for stdout (${r.fd})`),q(2===t.fd,`invalid handle for stderr (${t.fd})`)},ensureErrnoError(){ar.ErrnoError||(ar.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){for(var r in this.errno=e,er)if(er[r]===e){this.code=r;break}},this.setErrno(e),this.message=Qe[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=this.stack.replace(/\b_Z[\w\d_]+/g,(function(e){var r=or(e);return e===r?e:r+" ["+e+"]"})))},ar.ErrnoError.prototype=new Error,ar.ErrnoError.prototype.constructor=ar.ErrnoError,[44].forEach((e=>{ar.genericErrors[e]=new ar.ErrnoError(e),ar.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){ar.ensureErrnoError(),ar.nameTable=new Array(4096),ar.mount(Ke,{},"/"),ar.createDefaultDirectories(),ar.createDefaultDevices(),ar.createSpecialDirectories(),ar.filesystems={MEMFS:Ke,IDBFS:Ze}},init(e,r,t){q(!ar.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),ar.init.initialized=!0,ar.ensureErrnoError(),d.stdin=e||d.stdin,d.stdout=r||d.stdout,d.stderr=t||d.stderr,ar.createStandardStreams()},quit(){ar.init.initialized=!1,bn(0);for(var e=0;e<ar.streams.length;e++){var r=ar.streams[e];r&&ar.close(r)}},findObject(e,r){var t=ar.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ar.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ar.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Le.basename(e),n=ar.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:ar.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Le.join2(e,a);try{ar.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=Le.join2("string"==typeof e?e:ar.getPath(e),r),i=Je(n,o);return ar.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:ar.getPath(e),i=r?Le.join2(e,r):e);var s=Je(n,o),l=ar.create(i,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),u=0,d=t.length;u<d;++u)c[u]=t.charCodeAt(u);t=c}ar.chmod(l,146|s);var f=ar.open(l,577);ar.write(f,t,0,t.length,0,a),ar.close(f),ar.chmod(l,s)}return l},createDevice(e,r,t,n){var o=Le.join2("string"==typeof e?e:ar.getPath(e),r),a=Je(!!t,!!n);ar.createDevice.major||(ar.createDevice.major=64);var i=ar.makedev(ar.createDevice.major++,0);return ar.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(e){throw new ar.ErrnoError(29)}if(void 0===l&&0===i)throw new ar.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new ar.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),ar.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ye(_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new ar.ErrnoError(29)}},createLazyFile(e,r,n,o,a){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var r,t=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=t);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,t-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>t-1)throw new Error("only "+t+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),t!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ye(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&t||(i=t=1,t=this.getter(0).length,i=t,$("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=t,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var l={isDevice:!1,contents:s}}else l={isDevice:!1,url:n};var c=ar.createFile(e,r,l,o,a);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function d(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(q(i>=0),a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(c.stream_ops).forEach((e=>{var r=c.stream_ops[e];u[e]=function(){return ar.forceLoadFile(c),r.apply(null,arguments)}})),u.read=(e,r,t,n,o)=>(ar.forceLoadFile(c),d(e,r,t,n,o)),u.mmap=(e,r,n,o,a)=>{ar.forceLoadFile(c);var i=qe(r);if(!i)throw new ar.ErrnoError(48);return d(e,t(),i,r,n),{ptr:i,allocated:!0}},c.stream_ops=u,c},absolutePath(){pe("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){pe("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){pe("FS.createLink has been removed; use FS.symlink instead")},joinPath(){pe("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){pe("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){pe("FS.standardizePath has been removed; use PATH.normalize instead")}},ir={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(Le.isAbs(r))return r;var n;if(n=-100===e?ar.cwd():ir.getStreamFromFD(e).path,0==r.length){if(!t)throw new ar.ErrnoError(44);return n}return Le.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&Le.normalize(r)!==Le.normalize(ar.getPath(e.node)))return-54;throw e}i()[t>>2]=n.dev,Me(n.dev),i()[t+4>>2]=n.mode,Me(n.mode),s()[t+8>>2]=n.nlink,Me(n.nlink),i()[t+12>>2]=n.uid,Me(n.uid),i()[t+16>>2]=n.gid,Me(n.gid),i()[t+20>>2]=n.rdev,Me(n.rdev),ye=[n.size>>>0,(ve=n.size,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+24>>2]=ye[0],i()[t+28>>2]=ye[1],$e(n.size),i()[t+32>>2]=4096,Me(4096),i()[t+36>>2]=n.blocks,Me(n.blocks);var o=n.atime.getTime(),a=n.mtime.getTime(),l=n.ctime.getTime();return ye=[Math.floor(o/1e3)>>>0,(ve=Math.floor(o/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+40>>2]=ye[0],i()[t+44>>2]=ye[1],$e(Math.floor(o/1e3)),s()[t+48>>2]=o%1e3*1e3,Me(o%1e3*1e3),ye=[Math.floor(a/1e3)>>>0,(ve=Math.floor(a/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+56>>2]=ye[0],i()[t+60>>2]=ye[1],$e(Math.floor(a/1e3)),s()[t+64>>2]=a%1e3*1e3,Me(a%1e3*1e3),ye=[Math.floor(l/1e3)>>>0,(ve=Math.floor(l/1e3),+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+72>>2]=ye[0],i()[t+76>>2]=ye[1],$e(Math.floor(l/1e3)),s()[t+80>>2]=l%1e3*1e3,Me(l%1e3*1e3),ye=[n.ino>>>0,(ve=n.ino,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[t+88>>2]=ye[0],i()[t+92>>2]=ye[1],$e(n.ino),0},doMsync(e,r,t,o,a){if(!ar.isFile(r.node.mode))throw new ar.ErrnoError(43);if(2&o)return 0;var i=n().slice(e,e+t);ar.msync(r,i,a,t,o)},varargs:void 0,get(){q(null!=ir.varargs);var e=i()[+ir.varargs>>2];return ir.varargs+=4,e},getp:()=>ir.get(),getStr:e=>nr(e),getStreamFromFD:e=>ar.getStreamChecked(e)};function sr(e){if(b)return Ht(0,1,e);L=e,oe()||(dr.terminateAllThreads(),d.onExit&&d.onExit(e),V=!0),p(e,new Ne(e))}var lr=(e,r)=>{if(L=e,function(){var e=$,r=I,t=!1;$=I=e=>{t=!0};try{bn(0),["stdout","stderr"].forEach((function(e){var r=ar.analyzePath("/dev/"+e);if(r){var n=r.object.rdev,o=Ve.ttys[n];o&&o.output&&o.output.length&&(t=!0)}}))}catch(e){}$=e,I=r,t&&_r("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.")}(),b)throw q(!r),hr(e),"unwind";if(oe()&&!r){var t=`program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${ne}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;u(t),I(t)}sr(e)},cr=e=>(q("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),ur=e=>{if(e instanceof Ne||"unwind"==e)return L;Z(),e instanceof WebAssembly.RuntimeError&&jn()<=0&&I("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 5242880)"),p(1,e)},dr={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},nextWorkerID:1,debugInit(){var e=Ie;Ie=r=>{return e((t=0,te&&void 0!==Tn&&(t=Tn()),"w:"+(d.workerID||0)+",t:"+cr(t)+": "+r));var t}},init(){dr.debugInit(),b?dr.initWorker():dr.initMainThread()},initMainThread(){ie((()=>{fe("loading-workers"),dr.loadWasmModuleToAllWorkers((()=>he("loading-workers")))}))},initWorker(){x=!1},setExitStatus:e=>{L=e},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var e of(q(!b,"Internal Error! terminateAllThreads() can only ever be called from main application thread!"),dr.runningWorkers))Re(e);for(var e of dr.unusedWorkers)Re(e);dr.unusedWorkers=[],dr.runningWorkers=[],dr.pthreads=[]},returnWorkerToPool:e=>{var r=e.pthread_ptr;delete dr.pthreads[r],dr.unusedWorkers.push(e),dr.runningWorkers.splice(dr.runningWorkers.indexOf(e),1),e.pthread_ptr=0,Dn(r)},receiveObjectTransfer(e){},threadInitTLS(){dr.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:r=>new Promise((t=>{r.onmessage=e=>{var n=e.data,o=n.cmd;if(n.targetThread&&n.targetThread!=Tn()){var a=dr.pthreads[n.targetThread];a?a.postMessage(n,n.transferList):I(`Internal error! Worker sent a message "${o}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else{var i;"checkMailbox"===o?zt():"spawnThread"===o?(e=>{q(!b,"Internal Error! spawnThread() can only ever be called from main application thread!"),q(e.pthread_ptr,"Internal error, no pthread ptr!");var r=dr.getNewWorker();if(!r)return 6;q(!r.pthread_ptr,"Internal error!"),dr.runningWorkers.push(r),dr.pthreads[e.pthread_ptr]=r,r.pthread_ptr=e.pthread_ptr;var t={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};y&&r.unref(),r.postMessage(t,e.transferList)})(n):"cleanupThread"===o?xe(n.thread):"killThread"===o?(e=>{q(!b,"Internal Error! killThread() can only ever be called from main application thread!"),q(e,"Internal Error! Null pthread_ptr in killThread!");var r=dr.pthreads[e];delete dr.pthreads[e],Re(r),Dn(e),dr.runningWorkers.splice(dr.runningWorkers.indexOf(r),1),r.pthread_ptr=0})(n.thread):"cancelThread"===o?(i=n.thread,q(!b,"Internal Error! cancelThread() can only ever be called from main application thread!"),q(i,"Internal Error! Null pthread_ptr in cancelThread!"),dr.pthreads[i].postMessage({cmd:"cancel"})):"loaded"===o?(r.loaded=!0,t(r)):"alert"===o?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?r.postMessage(n):"callHandler"===o?d[n.handler](...n.args):o&&I(`worker sent an unknown command ${o}`)}},r.onerror=e=>{var t="worker sent an error!";throw r.pthread_ptr&&(t=`Pthread ${cr(r.pthread_ptr)} sent an error!`),I(`${t} ${e.filename}:${e.lineno}: ${e.message}`),e},y&&(r.on("message",(e=>r.onmessage({data:e}))),r.on("error",(e=>r.onerror(e)))),q(N instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!"),q(R instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");var n=[];for(var o of["onExit","onAbort","print","printErr"])d.hasOwnProperty(o)&&n.push(o);r.workerID=dr.nextWorkerID++,r.postMessage({cmd:"load",handlers:n,urlOrBlob:d.mainScriptUrlOrBlob||e,wasmMemory:N,wasmModule:R,workerID:r.workerID})})),loadWasmModuleToAllWorkers(e){e()},allocateUnusedWorker(){var e,r=k("web_example.worker.js");e=new Worker(r),dr.unusedWorkers.push(e)},getNewWorker:()=>(0==dr.unusedWorkers.length&&(y||I("Tried to spawn a new thread, but the thread pool is exhausted.\nThis might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.\nIf you want to increase the pool size, use setting `-sPTHREAD_POOL_SIZE=...`.\nIf you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting `-sPTHREAD_POOL_SIZE_STRICT=2`."),dr.allocateUnusedWorker(),dr.loadWasmModuleToWorker(dr.unusedWorkers[0])),dr.unusedWorkers.pop())};d.PThread=dr;var fr=e=>{for(;e.length>0;)e.shift()(d)};function hr(e){if(b)return Ht(1,0,e);lr(e)}d.establishStackSpace=()=>{var e=Tn(),r=s()[e+52>>2],t=r-s()[e+56>>2];q(0!=r),q(0!=t),q(r>t,"stackHigh must be higher then stackLow"),Rn(r,t),gr(),Ln(r),J()};var pr=e=>(e=>rr((()=>{var r=Wn(4),t=Wn(4);Hn(e,r,t);var n,o=s()[r>>2],a=s()[t>>2],i=nr(o);return En(o),a&&(n=nr(a),En(a)),[i,n]})))(e);d.getExceptionMessage=pr;var mr,vr=[],yr=e=>{var r=vr[e];return r||(e>=vr.length&&(vr.length=e+1),vr[e]=r=mr.get(e)),q(mr.get(e)==r,"JavaScript-side Wasm function table mirror is out of date!"),r};d.invokeEntryPoint=(e,r)=>{var t=yr(e)(r);Z(),function(e){oe()?dr.setExitStatus(e):On(e)}(t)};var gr=()=>{var e=An(),r=Cn();Vn(e,r)},_r=e=>{_r.shown||(_r.shown={}),_r.shown[e]||(_r.shown[e]=1,y&&(e="warning: "+e),I(e))},wr=[],Er=0,br=0;function Tr(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){s()[this.ptr+4>>2]=e},this.get_type=function(){return s()[this.ptr+4>>2]},this.set_destructor=function(e){s()[this.ptr+8>>2]=e},this.get_destructor=function(){return s()[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,t()[this.ptr+12>>0]=e,De(e)},this.get_caught=function(){return 0!=t()[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,t()[this.ptr+13>>0]=e,De(e)},this.get_rethrown=function(){return 0!=t()[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){s()[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return s()[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Yn(this.get_type()))return s()[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var kr=e=>{var r=br&&br.excPtr;if(!r)return In(0),0;var t=new Tr(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return In(0),r;for(var o in e){var a=e[o];if(0===a||a===n)break;var i=t.ptr+16;if(Gn(a,n,i))return In(a),r}return In(n),r};function Sr(e,r,t){if(b)return Ht(2,1,e,r,t);ir.varargs=t;try{var n=ir.getStreamFromFD(e);switch(r){case 0:if((a=ir.get())<0)return-28;for(;ar.streams[a];)a++;return ar.createStream(n,a).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var a=ir.get();return n.flags|=a,0;case 5:return a=ir.getp(),o()[a+0>>1]=2,Oe(2),0;case 16:case 8:default:return-28;case 9:return 28,i()[wn()>>2]=28,Me(28),-1}}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Pr(e,r){if(b)return Ht(3,1,e,r);try{var t=ir.getStreamFromFD(e);return ir.doStat(ar.stat,t.path,r)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Ar(e,r,n){if(b)return Ht(4,1,e,r,n);ir.varargs=n;try{var a=ir.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return a.tty?0:-59;case 21505:if(!a.tty)return-59;if(a.tty.ops.ioctl_tcgets){var s=a.tty.ops.ioctl_tcgets(a),l=ir.getp();i()[l>>2]=s.c_iflag||0,Me(s.c_iflag||0),i()[l+4>>2]=s.c_oflag||0,Me(s.c_oflag||0),i()[l+8>>2]=s.c_cflag||0,Me(s.c_cflag||0),i()[l+12>>2]=s.c_lflag||0,Me(s.c_lflag||0);for(var c=0;c<32;c++)t()[l+c+17>>0]=s.c_cc[c]||0,De(s.c_cc[c]||0);return 0}return 0;case 21506:case 21507:case 21508:if(!a.tty)return-59;if(a.tty.ops.ioctl_tcsets){l=ir.getp();var u=i()[l>>2],d=i()[l+4>>2],f=i()[l+8>>2],h=i()[l+12>>2],p=[];for(c=0;c<32;c++)p.push(t()[l+c+17>>0]);return a.tty.ops.ioctl_tcsets(a.tty,r,{c_iflag:u,c_oflag:d,c_cflag:f,c_lflag:h,c_cc:p})}return 0;case 21519:return a.tty?(l=ir.getp(),i()[l>>2]=0,Me(0),0):-59;case 21520:return a.tty?-28:-59;case 21531:return l=ir.getp(),ar.ioctl(a,r,l);case 21523:if(!a.tty)return-59;if(a.tty.ops.ioctl_tiocgwinsz){var m=a.tty.ops.ioctl_tiocgwinsz(a.tty);l=ir.getp(),o()[l>>1]=m[0],Oe(m[0]),o()[l+2>>1]=m[1],Oe(m[1])}return 0;default:return-28}}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Cr(e,r){if(b)return Ht(5,1,e,r);try{return e=ir.getStr(e),ir.doStat(ar.lstat,e,r)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Fr(e,r,t,n){if(b)return Ht(6,1,e,r,t,n);try{r=ir.getStr(r);var o=256&n,a=4096&n;return q(!(n&=-6401),`unknown flags in __syscall_newfstatat: ${n}`),r=ir.calculateAt(e,r,a),ir.doStat(o?ar.lstat:ar.stat,r,t)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Dr(e,r,t,n){if(b)return Ht(7,1,e,r,t,n);ir.varargs=n;try{r=ir.getStr(r),r=ir.calculateAt(e,r);var o=n?ir.get():0;return ar.open(r,t,o).fd}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Or(e,r){if(b)return Ht(8,1,e,r);try{return e=ir.getStr(e),ir.doStat(ar.stat,e,r)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Mr(e,r,t){if(b)return Ht(9,1,e,r,t);try{return r=ir.getStr(r),r=ir.calculateAt(e,r),0===t?ar.unlink(r):512===t?ar.rmdir(r):pe("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}var $r={},Ir=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function Nr(e){return this.fromWireType(i()[e>>2])}var Rr,xr,Lr,Wr={},jr={},Ur={},Br=e=>{throw new Rr(e)},zr=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Br("Mismatched type converter count");for(var o=0;o<e.length;++o)Yr(e[o],n[o])}e.forEach((function(e){Ur[e]=r}));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{jr.hasOwnProperty(e)?o[r]=jr[e]:(a.push(e),Wr.hasOwnProperty(e)||(Wr[e]=[]),Wr[e].push((()=>{o[r]=jr[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},Hr=e=>{for(var r="",t=e;n()[t];)r+=xr[n()[t++]];return r},Gr=e=>{throw new Lr(e)};function Yr(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Gr(`type "${n}" must have a positive integer typeid pointer`),jr.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Gr(`Cannot register type '${n}' twice`)}if(jr[e]=r,delete Ur[e],Wr.hasOwnProperty(e)){var o=Wr[e];delete Wr[e],o.forEach((e=>e()))}}(e,r,t)}var Vr,qr=e=>{Gr(e.$$.ptrType.registeredClass.name+" instance already deleted")},Kr=!1,Xr=e=>{},Jr=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Zr=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=Zr(e,r,t.baseClass);return null===n?null:t.downcast(n)},Qr={},et=[],rt=()=>{for(;et.length;){var e=et.pop();e.$$.deleteScheduled=!1,e.delete()}},tt={},nt=(e,r)=>(r.ptrType&&r.ptr||Br("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&Br("Both smartPtrType and smartPtr must be specified"),r.count={value:1},at(Object.create(e,{$$:{value:r}})));function ot(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&Gr("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(e,r),tt[r]))(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?nt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):nt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=Qr[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=Zr(r,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?nt(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):nt(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var at=e=>"undefined"==typeof FinalizationRegistry?(at=e=>e,e):(Kr=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),Jr(e.$$)})),at=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r},n=r.ptrType.registeredClass;t.leakWarning=new Error(`Embind found a leaked C++ instance ${n.name} <${cr(r.ptr)}>.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated`),"captureStackTrace"in Error&&Error.captureStackTrace(t.leakWarning,ot),Kr.register(e,t,e)}return e},Xr=e=>Kr.unregister(e),at(e));function it(){}var st=e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e};function lt(e,r){return{[e=st(e)]:function(){return r.apply(this,arguments)}}[e]}var ct=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||Gr(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},ut=(e,r,t)=>{d.hasOwnProperty(e)?((void 0===t||void 0!==d[e].overloadTable&&void 0!==d[e].overloadTable[t])&&Gr(`Cannot register public name '${e}' twice`),ct(d,e,e),d.hasOwnProperty(t)&&Gr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),d[e].overloadTable[t]=r):(d[e]=r,void 0!==t&&(d[e].numArguments=t))};function dt(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var ft=(e,r,t)=>{for(;r!==t;)r.upcast||Gr(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function ht(e,r){if(null===r)return this.isReference&&Gr(`null is not a valid ${this.name}`),0;r.$$||Gr(`Cannot pass "${Mt(r)}" as a ${this.name}`),r.$$.ptr||Gr(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return ft(r.$$.ptr,t,this.registeredClass)}function pt(e,r){var t;if(null===r)return this.isReference&&Gr(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||Gr(`Cannot pass "${Mt(r)}" as a ${this.name}`),r.$$.ptr||Gr(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Gr(`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=ft(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Gr("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Gr(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,Ft.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Gr("Unsupporting sharing policy")}return t}function mt(e,r){if(null===r)return this.isReference&&Gr(`null is not a valid ${this.name}`),0;r.$$||Gr(`Cannot pass "${Mt(r)}" as a ${this.name}`),r.$$.ptr||Gr(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Gr(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return ft(r.$$.ptr,t,this.registeredClass)}function vt(e){return this.fromWireType(s()[e>>2])}function yt(e,r,t,n,o,a,i,s,l,c,u){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,o||void 0!==r.baseClass?this.toWireType=pt:n?(this.toWireType=ht,this.destructorFunction=null):(this.toWireType=mt,this.destructorFunction=null)}var gt,_t=(e,r,t)=>{d.hasOwnProperty(e)||Br("Replacing nonexistant public symbol"),void 0!==d[e].overloadTable&&void 0!==t?d[e].overloadTable[t]=r:(d[e]=r,d[e].argCount=t)},wt=(e,r)=>{var t=(e=Hr(e)).includes("j")?((e,r)=>{q(e.includes("j")||e.includes("p"),"getDynCaller should only be called with i64 sigs");var t=[];return function(){return t.length=0,Object.assign(t,arguments),((e,r,t)=>e.includes("j")?((e,r,t)=>{q("dynCall_"+e in d,`bad function pointer type - dynCall function not found for sig '${e}'`),t&&t.length?q(t.length===e.substring(1).replace(/j/g,"--").length):q(1==e.length);var n=d["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)})(e,r,t):(q(yr(r),`missing table entry in dynCall: ${r}`),yr(r).apply(null,t)))(e,r,t)}})(e,r):yr(r);return"function"!=typeof t&&Gr(`unknown function pointer with signature ${e}: ${r}`),t},Et=e=>{var r=Sn(e),t=Hr(r);return En(r),t},bt=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||jr[r]||(Ur[r]?Ur[r].forEach(e):(t.push(r),n[r]=!0))})),new gt(`${e}: `+t.map(Et).join([", "]))},Tt=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(s()[r+4*n>>2]);return t};function kt(e,r,t,n,o,a){var i=r.length;i<2&&Gr("argTypes array size mismatch! Must at least get return value and 'this' types!"),q(!a,"Async bindings are only supported with JSPI.");for(var s=null!==r[1]&&null!==t,l=!1,c=1;c<r.length;++c)if(null!==r[c]&&void 0===r[c].destructorFunction){l=!0;break}var u="void"!==r[0].name,d="",f="";for(c=0;c<i-2;++c)d+=(0!==c?", ":"")+"arg"+c,f+=(0!==c?", ":"")+"arg"+c+"Wired";var h=`\n return function ${st(e)}(${d}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`;l&&(h+="var destructors = [];\n");var p=l?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[Gr,n,o,Ir,r[0],r[1]];for(s&&(h+="var thisWired = classParam.toWireType("+p+", this);\n"),c=0;c<i-2;++c)h+="var arg"+c+"Wired = argType"+c+".toWireType("+p+", arg"+c+"); // "+r[c+2].name+"\n",m.push("argType"+c),v.push(r[c+2]);if(s&&(f="thisWired"+(f.length>0?", ":"")+f),h+=(u||a?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",l)h+="runDestructors(destructors);\n";else for(c=s?1:2;c<r.length;++c){var y=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==r[c].destructorFunction&&(h+=y+"_dtor("+y+"); // "+r[c].name+"\n",m.push(y+"_dtor"),v.push(r[c].destructorFunction))}return u&&(h+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),h+="}\n",m.push(h),function(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=lt(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,o=e.apply(n,r);return o instanceof Object?o:n}(Function,m).apply(null,v)}var St=(e,r,t)=>(e instanceof Object||Gr(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||Gr(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Gr(`cannot call emscripten binding method ${t} on deleted object`),ft(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass));function Pt(){this.allocated=[void 0],this.freelist=[]}var At=new Pt,Ct=e=>{e>=At.reserved&&0==--At.get(e).refcount&&At.free(e)},Ft={toValue:e=>(e||Gr("Cannot use deleted val. handle = "+e),At.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return At.allocate({refcount:1,value:e})}}},Dt=(e,r,l)=>{switch(r){case 1:return l?function(e){return this.fromWireType(t()[e>>0])}:function(e){return this.fromWireType(n()[e>>0])};case 2:return l?function(e){return this.fromWireType(o()[e>>1])}:function(e){return this.fromWireType(a()[e>>1])};case 4:return l?function(e){return this.fromWireType(i()[e>>2])}:function(e){return this.fromWireType(s()[e>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Ot=(e,r)=>{var t=jr[e];return void 0===t&&Gr(r+" has unknown type "+Et(e)),t},Mt=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},$t=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType((N.buffer!=W.buffer&&K(),G)[e>>2])};case 8:return function(e){return this.fromWireType(l()[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},It=(e,r,l)=>{switch(r){case 1:return l?e=>t()[e>>0]:e=>n()[e>>0];case 2:return l?e=>o()[e>>1]:e=>a()[e>>1];case 4:return l?e=>i()[e>>2]:e=>s()[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Nt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Rt=(e,r)=>{q(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var t=e,i=t>>1,s=i+r/2;!(i>=s)&&a()[i];)++i;if((t=i<<1)-e>32&&Nt)return Nt.decode(n().slice(e,t));for(var l="",c=0;!(c>=r/2);++c){var u=o()[e+2*c>>1];if(0==u)break;l+=String.fromCharCode(u)}return l},xt=(e,r,t)=>{if(q(r%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),q("number"==typeof t,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,a=(t-=2)<2*e.length?t/2:e.length,i=0;i<a;++i){var s=e.charCodeAt(i);o()[r>>1]=s,Oe(s),r+=2}return o()[r>>1]=0,Oe(0),r-n},Lt=e=>2*e.length,Wt=(e,r)=>{q(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var t=0,n="";!(t>=r/4);){var o=i()[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},jt=(e,r,t)=>{if(q(r%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),q("number"==typeof t,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),i()[r>>2]=s,Me(s),(r+=4)+4>o)break}return i()[r>>2]=0,Me(0),r-n},Ut=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Bt=e=>{if("function"==typeof Atomics.waitAsync){var r=Atomics.waitAsync(i(),e>>2,e);q(r.async),r.value.then(zt);var t=e+128;Atomics.store(i(),t>>2,1)}};d.__emscripten_thread_mailbox_await=Bt;var zt=()=>{var e=Tn();e&&(Bt(e),(e=>{if(V)I("user callback triggered after runtime exited or application aborted. Ignoring.");else try{e(),(()=>{if(!oe())try{b?On(L):lr(L)}catch(e){ur(e)}})()}catch(e){ur(e)}})((()=>Mn())))};d.checkMailbox=zt;var Ht=function(e,r){var t=arguments.length-2,n=arguments;return rr((()=>{for(var o=t,a=Wn(8*o),i=a>>3,s=0;s<t;s++){var c=n[2+s];l()[i+s]=c}return Fn(e,o,a,r)}))},Gt=[],Yt=e=>e%4==0&&(e%100!=0||e%400==0),Vt=[0,31,60,91,121,152,182,213,244,274,305,335],qt=[0,31,59,90,120,151,181,212,243,273,304,334],Kt=(e,r)=>(q(e==e>>>0||e==(0|e)),q(r===(0|r)),r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN);function Xt(e,r,t,n,o,a,l,c){if(b)return Ht(10,1,e,r,t,n,o,a,l,c);var u=Kt(o,a);try{if(isNaN(u))return 61;var d=ir.getStreamFromFD(n),f=ar.mmap(d,e,u,r,t),h=f.ptr;return i()[l>>2]=f.allocated,Me(f.allocated),s()[c>>2]=h,0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}function Jt(e,r,t,n,o,a,i){if(b)return Ht(11,1,e,r,t,n,o,a,i);var s=Kt(a,i);try{if(isNaN(s))return 61;var l=ir.getStreamFromFD(o);2&t&&ir.doMsync(e,l,r,n,s),ar.munmap(l)}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return-e.errno}}var Zt,Qt=e=>{var r=He(e)+1,t=_n(r);return t&&tr(e,t,r),t};Zt=()=>performance.timeOrigin+performance.now();var en=e=>{var r=N.buffer,t=(e-r.byteLength+65535)/65536;try{return N.grow(t),K(),1}catch(t){I(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${t}`)}},rn={},tn=()=>{if(!tn.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:h||"./this.program"};for(var r in rn)void 0===rn[r]?delete e[r]:e[r]=rn[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);tn.strings=t}return tn.strings},nn=function(e,r){if(b)return Ht(12,1,e,r);var n=0;return tn().forEach(((o,a)=>{var i=r+n;s()[e+4*a>>2]=i,Me(i),((e,r)=>{for(var n=0;n<e.length;++n)q(e.charCodeAt(n)===(255&e.charCodeAt(n))),t()[r++>>0]=e.charCodeAt(n),De(e.charCodeAt(n));t()[r>>0]=0,De(0)})(o,i),n+=o.length+1})),0},on=function(e,r){if(b)return Ht(13,1,e,r);var t=tn();s()[e>>2]=t.length,Me(t.length);var n=0;return t.forEach((e=>n+=e.length+1)),s()[r>>2]=n,Me(n),0};function an(e){if(b)return Ht(14,1,e);try{var r=ir.getStreamFromFD(e);return ar.close(r),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return e.errno}}function sn(e,r,n,o){if(b)return Ht(15,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var l=s()[r>>2],c=s()[r+4>>2];r+=8;var u=ar.read(e,t(),l,c,o);if(u<0)return-1;if(a+=u,u<c)break;void 0!==o&&(o+=u)}return a})(ir.getStreamFromFD(e),r,n);return s()[o>>2]=a,Me(a),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return e.errno}}function ln(e,r,t,n,o){if(b)return Ht(16,1,e,r,t,n,o);var a=Kt(r,t);try{if(isNaN(a))return 61;var s=ir.getStreamFromFD(e);return ar.llseek(s,a,n),ye=[s.position>>>0,(ve=s.position,+Math.abs(ve)>=1?ve>0?+Math.floor(ve/4294967296)>>>0:~~+Math.ceil((ve-+(~~ve>>>0))/4294967296)>>>0:0)],i()[o>>2]=ye[0],i()[o+4>>2]=ye[1],$e(s.position),s.getdents&&0===a&&0===n&&(s.getdents=null),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return e.errno}}function cn(e,r,n,o){if(b)return Ht(17,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var l=s()[r>>2],c=s()[r+4>>2];r+=8;var u=ar.write(e,t(),l,c,o);if(u<0)return-1;a+=u,void 0!==o&&(o+=u)}return a})(ir.getStreamFromFD(e),r,n);return s()[o>>2]=a,Me(a),0}catch(e){if(void 0===ar||"ErrnoError"!==e.name)throw e;return e.errno}}var un=[31,29,31,30,31,30,31,31,30,31,30,31],dn=[31,28,31,30,31,30,31,31,30,31,30,31];dr.init();var fn,hn,pn=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ar.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(pn.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return ar.isDir(this.mode)}},isDevice:{get:function(){return ar.isChrdev(this.mode)}}}),ar.FSNode=pn,ar.createPreloadedFile=(e,r,t,n,o,a,i,s,l,c)=>{var u=r?je.resolve(Le.join2(e,r)):e,d=de(`cp ${u}`);function f(t){function f(t){c&&c(),s||((e,r,t,n,o,a)=>{ar.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,l),a&&a(),he(d)}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return Xe.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,u,f,(()=>{i&&i(),he(d)}))||f(t)}fe(d),"string"==typeof t?((e,r,t,n)=>{var o=de(`al ${e}`);w(e,(r=>{q(r,`Loading data file "${e}" failed (no arrayBuffer).`),f(new Uint8Array(r)),o&&he(o)}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&fe(o)})(t,0,i):f(t)},ar.staticInit(),d.FS_createPath=ar.createPath,d.FS_createDataFile=ar.createDataFile,d.FS_createPreloadedFile=ar.createPreloadedFile,d.FS_unlink=ar.unlink,d.FS_createLazyFile=ar.createLazyFile,d.FS_createDevice=ar.createDevice,er={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},Rr=d.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);xr=e})(),Lr=d.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(it.prototype,{isAliasOf(e){if(!(this instanceof it))return!1;if(!(e instanceof it))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||qr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=at(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||qr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Gr("Object already scheduled for deletion"),Xr(this),Jr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||qr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Gr("Object already scheduled for deletion"),et.push(this),1===et.length&&Vr&&Vr(rt),this.$$.deleteScheduled=!0,this}}),d.getInheritedInstanceCount=()=>Object.keys(tt).length,d.getLiveInheritedInstances=()=>{var e=[];for(var r in tt)tt.hasOwnProperty(r)&&e.push(tt[r]);return e},d.flushPendingDeletes=rt,d.setDelayFunction=e=>{Vr=e,et.length&&Vr&&Vr(rt)},Object.assign(yt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor&&this.rawDestructor(e)},argPackAdvance:8,readValueFromPointer:vt,deleteObject(e){null!==e&&e.delete()},fromWireType:ot}),gt=d.UnboundTypeError=(fn=Error,(hn=lt("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(fn.prototype),hn.prototype.constructor=hn,hn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},hn),Object.assign(Pt.prototype,{get(e){return q(void 0!==this.allocated[e],`invalid handle: ${e}`),this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){q(void 0!==this.allocated[e]),this.allocated[e]=void 0,this.freelist.push(e)}}),At.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),At.reserved=At.allocated.length,d.count_emval_handles=()=>{for(var e=0,r=At.reserved;r<At.allocated.length;++r)void 0!==At.allocated[r]&&++e;return e};var mn,vn=[sr,hr,Sr,Pr,Ar,Cr,Fr,Dr,Or,Mr,Xt,Jt,nn,on,an,sn,ln,cn],yn={__assert_fail:(e,r,t,n)=>{pe(`Assertion failed: ${nr(e)}, at: `+[r?nr(r):"unknown filename",t,n?nr(n):"unknown function"])},__cxa_begin_catch:e=>{var r=new Tr(e);return r.get_caught()||(r.set_caught(!0),Er--),r.set_rethrown(!1),wr.push(r),Bn(r.excPtr),r.get_exception_ptr()},__cxa_end_catch:()=>{$n(0,0),q(wr.length>0);var e=wr.pop();Un(e.excPtr),br=0},__cxa_find_matching_catch_2:()=>kr([]),__cxa_find_matching_catch_3:e=>kr([e]),__cxa_rethrow:()=>{var e=wr.pop();e||pe("no exception to throw");var r=e.excPtr;throw e.get_rethrown()||(wr.push(e),e.set_rethrown(!0),e.set_caught(!1),Er++),br=new be(r)},__cxa_throw:(e,r,t)=>{throw new Tr(e).init(r,t),br=new be(e),Er++,br},__cxa_uncaught_exceptions:()=>Er,__emscripten_init_main_thread_js:e=>{Pn(e,!v,1,!m,2097152,!1),dr.threadInitTLS()},__emscripten_thread_cleanup:e=>{b?postMessage({cmd:"cleanupThread",thread:e}):xe(e)},__handle_stack_overflow:e=>{var r=An(),t=Cn();pe(`stack overflow (Attempt to set SP to ${cr(e)}, with stack limits [${cr(t)} - ${cr(r)}]). If you require more stack space build with -sSTACK_SIZE=<bytes>`)},__resumeException:e=>{throw br||(br=new be(e)),br},__syscall_fcntl64:Sr,__syscall_fstat64:Pr,__syscall_ioctl:Ar,__syscall_lstat64:Cr,__syscall_newfstatat:Fr,__syscall_openat:Dr,__syscall_stat64:Or,__syscall_unlinkat:Mr,_embind_finalize_value_object:e=>{var r=$r[e];delete $r[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType)));zr([e],a,(e=>{var a={};return o.forEach(((r,t)=>{var n=r.fieldName,i=e[t],s=r.getter,l=r.getterContext,c=e[t+o.length],u=r.setter,d=r.setterContext;a[n]={read:e=>i.fromWireType(s(l,e)),write:(e,r)=>{var t=[];u(d,e,c.toWireType(t,r)),Ir(t)}}})),[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},argPackAdvance:8,readValueFromPointer:Nr,destructorFunction:n}]}))},_embind_register_bigint:(e,r,t,n,o)=>{},_embind_register_bool:(e,r,t,o)=>{Yr(e,{name:r=Hr(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:o},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(n()[e])},destructorFunction:null})},_embind_register_class:(e,r,t,n,o,a,i,s,l,c,u,d,f)=>{u=Hr(u),a=wt(o,a),s&&(s=wt(i,s)),c&&(c=wt(l,c)),f=wt(d,f);var h=st(u);ut(h,(function(){bt(`Cannot construct ${u} due to unbound types`,[n])})),zr([e,r,t],n?[n]:[],(function(r){var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:it.prototype;var i=lt(h,(function(){if(Object.getPrototypeOf(this)!==l)throw new Lr("Use 'new' to construct "+u);if(void 0===d.constructor_body)throw new Lr(u+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Lr(`Tried to invoke ctor of ${u} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),l=Object.create(o,{constructor:{value:i}});i.prototype=l;var d=new dt(u,i,l,f,t,a,s,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var p=new yt(u,d,!0,!1,!1),m=new yt(u+"*",d,!1,!1,!1),v=new yt(u+" const*",d,!1,!0,!1);return Qr[e]={pointerType:m,constPointerType:v},_t(h,i),[p,m,v]}))},_embind_register_class_constructor:(e,r,t,n,o,a)=>{q(r>0);var i=Tt(r,t);o=wt(n,o),zr([],[e],(function(e){var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Lr(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{bt(`Cannot construct ${e.name} due to unbound types`,i)},zr([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=kt(t,n,null,o,a),[]))),[]}))},_embind_register_class_function:(e,r,t,n,o,a,i,s,l)=>{var c=Tt(t,n);r=Hr(r),a=wt(o,a),zr([],[e],(function(e){var n=`${(e=e[0]).name}.${r}`;function o(){bt(`Cannot call ${n} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var u=e.registeredClass.instancePrototype,d=u[r];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===t-2?(o.argCount=t-2,o.className=e.name,u[r]=o):(ct(u,r,n),u[r].overloadTable[t-2]=o),zr([],c,(function(o){var s=kt(n,o,e,a,i,l);return void 0===u[r].overloadTable?(s.argCount=t-2,u[r]=s):u[r].overloadTable[t-2]=s,[]})),[]}))},_embind_register_class_property:(e,r,t,n,o,a,i,s,l,c)=>{r=Hr(r),o=wt(n,o),zr([],[e],(function(e){var n=`${(e=e[0]).name}.${r}`,u={get(){bt(`Cannot access ${n} due to unbound types`,[t,i])},enumerable:!0,configurable:!0};return u.set=l?()=>bt(`Cannot access ${n} due to unbound types`,[t,i]):e=>Gr(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,r,u),zr([],l?[t,i]:[t],(function(t){var i=t[0],u={get(){var r=St(this,e,n+" getter");return i.fromWireType(o(a,r))},enumerable:!0};if(l){l=wt(s,l);var d=t[1];u.set=function(r){var t=St(this,e,n+" setter"),o=[];l(c,t,d.toWireType(o,r)),Ir(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,u),[]})),[]}))},_embind_register_emval:(e,r)=>{Yr(e,{name:r=Hr(r),fromWireType:e=>{var r=Ft.toValue(e);return Ct(e),r},toWireType:(e,r)=>Ft.toHandle(r),argPackAdvance:8,readValueFromPointer:Nr,destructorFunction:null})},_embind_register_enum:(e,r,t,n)=>{function o(){}r=Hr(r),o.values={},Yr(e,{name:r,constructor:o,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,r)=>r.value,argPackAdvance:8,readValueFromPointer:Dt(r,t,n),destructorFunction:null}),ut(r,o)},_embind_register_enum_value:(e,r,t)=>{var n=Ot(e,"enum");r=Hr(r);var o=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:lt(`${n.name}_${r}`,(function(){}))}});o.values[t]=a,o[r]=a},_embind_register_float:(e,r,t)=>{Yr(e,{name:r=Hr(r),fromWireType:e=>e,toWireType:(e,r)=>{if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError(`Cannot convert ${Mt(r)} to ${this.name}`);return r},argPackAdvance:8,readValueFromPointer:$t(r,t),destructorFunction:null})},_embind_register_function:(e,r,t,n,o,a,i)=>{var s=Tt(r,t);e=Hr(e),o=wt(n,o),ut(e,(function(){bt(`Cannot call ${e} due to unbound types`,s)}),r-1),zr([],s,(function(t){var n=[t[0],null].concat(t.slice(1));return _t(e,kt(e,n,null,o,a,i),r-1),[]}))},_embind_register_integer:(e,r,t,n,o)=>{r=Hr(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned"),l=(e,t)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert "${Mt(e)}" to ${t}`);if(e<n||e>o)throw new TypeError(`Passing a number "${Mt(e)}" from JS side to C/C++ side to an argument of type "${r}", which is outside the valid range [${n}, ${o}]!`)};Yr(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return l(r,this.name),r>>>0}:function(e,r){return l(r,this.name),r},argPackAdvance:8,readValueFromPointer:It(r,t,0!==n),destructorFunction:null})},_embind_register_memory_view:(e,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=s()[e>>2],n=s()[e+4>>2];return new o(t().buffer,n,r)}Yr(e,{name:n=Hr(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(e,r)=>{var t="std::string"===(r=Hr(r));Yr(e,{name:r,fromWireType(e){var r,o=s()[e>>2],a=e+4;if(t)for(var i=a,l=0;l<=o;++l){var c=a+l;if(l==o||0==n()[c]){var u=nr(i,c-i);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),i=c+1}}else{var d=new Array(o);for(l=0;l<o;++l)d[l]=String.fromCharCode(n()[a+l]);r=d.join("")}return En(e),r},toWireType(e,r){var o;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var a="string"==typeof r;a||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||Gr("Cannot pass non-string to std::string"),o=t&&a?He(r):r.length;var i=_n(4+o+1),l=i+4;if(s()[i>>2]=o,Me(o),t&&a)tr(r,l,o+1);else if(a)for(var c=0;c<o;++c){var u=r.charCodeAt(c);u>255&&(En(l),Gr("String has UTF-16 code units that do not fit in 8 bits")),n()[l+c]=u}else for(c=0;c<o;++c)n()[l+c]=r[c];return null!==e&&e.push(En,i),i},argPackAdvance:8,readValueFromPointer:vt,destructorFunction(e){En(e)}})},_embind_register_std_wstring:(e,r,t)=>{var n,o,i,l,c;t=Hr(t),2===r?(n=Rt,o=xt,l=Lt,i=()=>a(),c=1):4===r&&(n=Wt,o=jt,l=Ut,i=()=>s(),c=2),Yr(e,{name:t,fromWireType:e=>{for(var t,o=s()[e>>2],a=i(),l=e+4,u=0;u<=o;++u){var d=e+4+u*r;if(u==o||0==a[d>>c]){var f=n(l,d-l);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),l=d+r}}return En(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Gr(`Cannot pass non-string to C++ string type ${t}`);var a=l(n),i=_n(4+a+r);return s()[i>>2]=a>>c,o(n,i+4,a+r),null!==e&&e.push(En,i),i},argPackAdvance:8,readValueFromPointer:Nr,destructorFunction(e){En(e)}})},_embind_register_value_object:(e,r,t,n,o,a)=>{$r[e]={name:Hr(r),rawConstructor:wt(t,n),rawDestructor:wt(o,a),fields:[]}},_embind_register_value_object_field:(e,r,t,n,o,a,i,s,l,c)=>{$r[e].fields.push({fieldName:Hr(r),getterReturnType:t,getter:wt(n,o),getterContext:a,setterArgumentType:i,setter:wt(s,l),setterContext:c})},_embind_register_void:(e,r)=>{Yr(e,{isVoid:!0,name:r=Hr(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},_emscripten_get_now_is_monotonic:()=>!0,_emscripten_notify_mailbox_postmessage:(e,r,t)=>{if(e==r)setTimeout((()=>zt()));else if(b)postMessage({targetThread:e,cmd:"checkMailbox"});else{var n=dr.pthreads[e];if(!n)return void I(`Cannot send message to thread with ID ${e}, unknown thread ID!`);n.postMessage({cmd:"checkMailbox"})}},_emscripten_receive_on_main_thread_js:(e,r,t,n)=>{Gt.length=t;for(var o=n>>3,a=0;a<t;a++)Gt[a]=l()[o+a];var i=vn[e];q(i.length==t,"Call args mismatch in _emscripten_receive_on_main_thread_js"),dr.currentProxiedOperationCallerThread=r;var s=i.apply(null,Gt);return dr.currentProxiedOperationCallerThread=0,s},_emscripten_thread_mailbox_await:Bt,_emscripten_thread_set_strongref:e=>{y&&dr.pthreads[e].ref()},_emval_decref:Ct,_emval_incref:e=>{e>4&&(At.get(e).refcount+=1)},_emval_take_value:(e,r)=>{var t=(e=Ot(e,"_emval_take_value")).readValueFromPointer(r);return Ft.toHandle(t)},_localtime_js:function(e,r,t){var n=Kt(e,r),o=new Date(1e3*n);i()[t>>2]=o.getSeconds(),Me(o.getSeconds()),i()[t+4>>2]=o.getMinutes(),Me(o.getMinutes()),i()[t+8>>2]=o.getHours(),Me(o.getHours()),i()[t+12>>2]=o.getDate(),Me(o.getDate()),i()[t+16>>2]=o.getMonth(),Me(o.getMonth()),i()[t+20>>2]=o.getFullYear()-1900,Me(o.getFullYear()-1900),i()[t+24>>2]=o.getDay(),Me(o.getDay());var a=0|(e=>(Yt(e.getFullYear())?Vt:qt)[e.getMonth()]+e.getDate()-1)(o);i()[t+28>>2]=a,Me(a),i()[t+36>>2]=-60*o.getTimezoneOffset(),Me(-60*o.getTimezoneOffset());var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=s.getTimezoneOffset(),u=0|(l!=c&&o.getTimezoneOffset()==Math.min(c,l));i()[t+32>>2]=u,Me(u)},_mmap_js:Xt,_munmap_js:Jt,_tzset_js:(e,r,t)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),l=o.getTimezoneOffset(),c=a.getTimezoneOffset(),u=Math.max(l,c);function d(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}s()[e>>2]=60*u,Me(60*u),i()[r>>2]=Number(l!=c),Me(Number(l!=c));var f=d(o),h=d(a),p=Qt(f),m=Qt(h);c<l?(s()[t>>2]=p,Me(p),s()[t+4>>2]=m,Me(m)):(s()[t>>2]=m,Me(m),s()[t+4>>2]=p,Me(p))},abort:()=>{pe("native code called abort()")},emscripten_check_blocking_allowed:()=>{y||v||_r("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},emscripten_date_now:()=>Date.now(),emscripten_exit_with_live_runtime:()=>{throw ne+=1,"unwind"},emscripten_get_now:Zt,emscripten_resize_heap:e=>{var r=n().length;if((e>>>=0)<=r)return!1;var t=2147483648;if(e>t)return I(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var o,a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(t,(o=Math.max(e,i))+(65536-o%65536)%65536),l=Zt(),c=en(s);if(Ie(`Heap resize call from ${r} to ${s} took ${Zt()-l} msecs. Success: ${!!c}`),c)return!0}return I(`Failed to grow the heap from ${r} bytes to ${s} bytes, not enough memory!`),!1},environ_get:nn,environ_sizes_get:on,exit:lr,fd_close:an,fd_read:sn,fd_seek:ln,fd_write:cn,invoke_dii:function(e,r,t){var n=xn();try{return yr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_diii:function(e,r,t,n){var o=xn();try{return yr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_fi:function(e,r){var t=xn();try{return yr(e)(r)}catch(e){if(Ln(t),!(e instanceof Ee))throw e;$n(1,0)}},invoke_fii:function(e,r,t){var n=xn();try{return yr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_fiii:function(e,r,t,n){var o=xn();try{return yr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_i:function(e){var r=xn();try{return yr(e)()}catch(e){if(Ln(r),!(e instanceof Ee))throw e;$n(1,0)}},invoke_idi:function(e,r,t){var n=xn();try{return yr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_ii:function(e,r){var t=xn();try{return yr(e)(r)}catch(e){if(Ln(t),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iid:function(e,r,t){var n=xn();try{return yr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iii:function(e,r,t){var n=xn();try{return yr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiid:function(e,r,t,n){var o=xn();try{return yr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiii:function(e,r,t,n){var o=xn();try{return yr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiii:function(e,r,t,n,o){var a=xn();try{return yr(e)(r,t,n,o)}catch(e){if(Ln(a),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiid:function(e,r,t,n,o,a){var i=xn();try{return yr(e)(r,t,n,o,a)}catch(e){if(Ln(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiii:function(e,r,t,n,o,a){var i=xn();try{return yr(e)(r,t,n,o,a)}catch(e){if(Ln(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiii:function(e,r,t,n,o,a,i){var s=xn();try{return yr(e)(r,t,n,o,a,i)}catch(e){if(Ln(s),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiii:function(e,r,t,n,o,a,i,s){var l=xn();try{return yr(e)(r,t,n,o,a,i,s)}catch(e){if(Ln(l),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiiii:function(e,r,t,n,o,a,i,s,l){var c=xn();try{return yr(e)(r,t,n,o,a,i,s,l)}catch(e){if(Ln(c),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u){var d=xn();try{return yr(e)(r,t,n,o,a,i,s,l,c,u)}catch(e){if(Ln(d),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d){var f=xn();try{return yr(e)(r,t,n,o,a,i,s,l,c,u,d)}catch(e){if(Ln(f),!(e instanceof Ee))throw e;$n(1,0)}},invoke_iiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f){var h=xn();try{return yr(e)(r,t,n,o,a,i,s,l,c,u,d,f)}catch(e){if(Ln(h),!(e instanceof Ee))throw e;$n(1,0)}},invoke_jiiii:function(e,r,t,n,o){var a=xn();try{return qn(e,r,t,n,o)}catch(e){if(Ln(a),!(e instanceof Ee))throw e;$n(1,0)}},invoke_v:function(e){var r=xn();try{yr(e)()}catch(e){if(Ln(r),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vi:function(e,r){var t=xn();try{yr(e)(r)}catch(e){if(Ln(t),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vid:function(e,r,t){var n=xn();try{yr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vidddddd:function(e,r,t,n,o,a,i,s){var l=xn();try{yr(e)(r,t,n,o,a,i,s)}catch(e){if(Ln(l),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vidi:function(e,r,t,n){var o=xn();try{yr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_vii:function(e,r,t){var n=xn();try{yr(e)(r,t)}catch(e){if(Ln(n),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viif:function(e,r,t,n){var o=xn();try{yr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viii:function(e,r,t,n){var o=xn();try{yr(e)(r,t,n)}catch(e){if(Ln(o),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiii:function(e,r,t,n,o){var a=xn();try{yr(e)(r,t,n,o)}catch(e){if(Ln(a),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiidi:function(e,r,t,n,o,a,i){var s=xn();try{yr(e)(r,t,n,o,a,i)}catch(e){if(Ln(s),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiif:function(e,r,t,n,o,a){var i=xn();try{yr(e)(r,t,n,o,a)}catch(e){if(Ln(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiii:function(e,r,t,n,o,a){var i=xn();try{yr(e)(r,t,n,o,a)}catch(e){if(Ln(i),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiii:function(e,r,t,n,o,a,i){var s=xn();try{yr(e)(r,t,n,o,a,i)}catch(e){if(Ln(s),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiii:function(e,r,t,n,o,a,i,s){var l=xn();try{yr(e)(r,t,n,o,a,i,s)}catch(e){if(Ln(l),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiiii:function(e,r,t,n,o,a,i,s,l){var c=xn();try{yr(e)(r,t,n,o,a,i,s,l)}catch(e){if(Ln(c),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u){var d=xn();try{yr(e)(r,t,n,o,a,i,s,l,c,u)}catch(e){if(Ln(d),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f,h){var p=xn();try{yr(e)(r,t,n,o,a,i,s,l,c,u,d,f,h)}catch(e){if(Ln(p),!(e instanceof Ee))throw e;$n(1,0)}},invoke_viiiiiiiiiiiiiii:function(e,r,t,n,o,a,i,s,l,c,u,d,f,h,p,m){var v=xn();try{yr(e)(r,t,n,o,a,i,s,l,c,u,d,f,h,p,m)}catch(e){if(Ln(v),!(e instanceof Ee))throw e;$n(1,0)}},llvm_eh_typeid_for:e=>e,memory:N||d.wasmMemory,strftime_l:(e,r,n,o,a)=>((e,r,n,o)=>{var a=s()[o+40>>2],l={tm_sec:i()[o>>2],tm_min:i()[o+4>>2],tm_hour:i()[o+8>>2],tm_mday:i()[o+12>>2],tm_mon:i()[o+16>>2],tm_year:i()[o+20>>2],tm_wday:i()[o+24>>2],tm_yday:i()[o+28>>2],tm_isdst:i()[o+32>>2],tm_gmtoff:i()[o+36>>2],tm_zone:a?nr(a):""},c=nr(n),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var d in u)c=c.replace(new RegExp(d,"g"),u[d]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function p(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function m(e,r){return p(e,r,"0")}function v(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function y(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=Yt(t.getFullYear()),o=t.getMonth(),a=(n?un:dn)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=y(t),a=y(n);return v(o,r)<=0?v(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var _={"%a":e=>f[e.tm_wday].substring(0,3),"%A":e=>f[e.tm_wday],"%b":e=>h[e.tm_mon].substring(0,3),"%B":e=>h[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>p(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":e=>m(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(Yt(e.tm_year+1900)?un:dn,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return m(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&Yt(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Yt(e.tm_year%400-1))&&r++}return m(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var d in c=c.replace(/%%/g,"\0\0"),_)c.includes(d)&&(c=c.replace(new RegExp(d,"g"),_[d](l)));var w,E,b=Ye(c=c.replace(/\0\0/g,"%"),!1);return b.length>r?0:(E=e,q((w=b).length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),t().set(w,E),b.length-1)})(e,r,n,o)},gn=function(){var e={env:yn,wasi_snapshot_preview1:yn};function r(e,r){var t,n;return gn=e.exports,n=gn._emscripten_tls_init,dr.tlsInitFunctions.push(n),q(mr=gn.__indirect_function_table,"table not found in wasm exports"),t=gn.__wasm_call_ctors,ee.unshift(t),R=r,he("wasm-instantiate"),gn}fe("wasm-instantiate");var t,n,o,a,i=d;if(d.instantiateWasm)try{return d.instantiateWasm(e,r)}catch(e){I(`Module.instantiateWasm callback failed with error: ${e}`),u(e)}return(t=M,n=me,o=e,a=function(e){q(d===i,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),i=null,r(e.instance,e.module)},t||"function"!=typeof WebAssembly.instantiateStreaming||ge(n)||_e(n)||y||"function"!=typeof fetch?ke(n,o,a):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return I(`wasm streaming compile failed: ${e}`),I("falling back to ArrayBuffer instantiation"),ke(n,o,a)}))))).catch(u),{}}(),_n=(we("__wasm_call_ctors"),we("__cxa_free_exception"),we("malloc")),wn=we("__errno_location"),En=d._free=we("free"),bn=d._fflush=we("fflush"),Tn=(d.__emscripten_tls_init=we("_emscripten_tls_init"),d._pthread_self=()=>(Tn=d._pthread_self=gn.pthread_self)()),kn=we("emscripten_builtin_memalign"),Sn=we("__getTypeName"),Pn=(d.__embind_initialize_bindings=we("_embind_initialize_bindings"),d.__emscripten_thread_init=we("_emscripten_thread_init")),An=(d.__emscripten_thread_crashed=we("_emscripten_thread_crashed"),we("emscripten_main_thread_process_queued_calls"),we("emscripten_main_runtime_thread_id"),()=>(An=gn.emscripten_stack_get_base)()),Cn=()=>(Cn=gn.emscripten_stack_get_end)(),Fn=we("_emscripten_run_on_main_thread_js"),Dn=we("_emscripten_thread_free_data"),On=d.__emscripten_thread_exit=we("_emscripten_thread_exit"),Mn=d.__emscripten_check_mailbox=we("_emscripten_check_mailbox"),$n=we("setThrew"),In=we("setTempRet0"),Nn=()=>(Nn=gn.emscripten_stack_init)(),Rn=(e,r)=>(Rn=gn.emscripten_stack_set_limits)(e,r),xn=we("stackSave"),Ln=we("stackRestore"),Wn=we("stackAlloc"),jn=()=>(jn=gn.emscripten_stack_get_current)(),Un=we("__cxa_decrement_exception_refcount"),Bn=we("__cxa_increment_exception_refcount"),zn=we("__cxa_demangle"),Hn=d.___get_exception_message=we("__get_exception_message"),Gn=we("__cxa_can_catch"),Yn=we("__cxa_is_pointer_type"),Vn=d.___set_stack_limits=we("__set_stack_limits"),qn=(d.dynCall_jii=we("dynCall_jii"),d.dynCall_viij=we("dynCall_viij"),d.dynCall_jiji=we("dynCall_jiji"),d.dynCall_viijii=we("dynCall_viijii"),d.dynCall_jiiii=we("dynCall_jiiii"));function Kn(){if(!(se>0)){if(b||(q(!b),Nn(),J()),b)return c(d),ae(),void startWorker(d);!function(){if(q(!b),d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)ie(d.preRun.shift());fr(Q)}(),se>0||(d.setStatus?(d.setStatus("Running..."),setTimeout((function(){setTimeout((function(){d.setStatus("")}),1),e()}),1)):e(),Z())}function e(){mn||(mn=!0,d.calledRun=!0,V||(ae(),c(d),d.onRuntimeInitialized&&d.onRuntimeInitialized(),q(!d._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(Z(),!b){if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),re.unshift(e);var e;fr(re)}}()))}}if(d.dynCall_iiiiij=we("dynCall_iiiiij"),d.dynCall_iiiiijj=we("dynCall_iiiiijj"),d.dynCall_iiiiiijj=we("dynCall_iiiiiijj"),d.addRunDependency=fe,d.removeRunDependency=he,d.FS_createPath=ar.createPath,d.FS_createLazyFile=ar.createLazyFile,d.FS_createDevice=ar.createDevice,d.keepRuntimeAlive=oe,d.wasmMemory=N,d.ExitStatus=Ne,d.FS_createPreloadedFile=ar.createPreloadedFile,d.FS=ar,d.FS_createDataFile=ar.createDataFile,d.FS_unlink=ar.unlink,d.PThread=dr,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePop","safeSetTimeout","asmjsMangle","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSizeCallingThread","setCanvasElementSizeMainThread","setCanvasElementSize","getCanvasSizeCallingThread","getCanvasSizeMainThread","getCanvasElementSize","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","emscripten_webgl_destroy_context_before_on_calling_thread","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","registerInheritedInstance","unregisterInheritedInstance","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var r="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",t=e;t.startsWith("_")||(t="$"+e),r+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='"+t+"')",Pe(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),_r(r)}}),Ce(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","GROWABLE_HEAP_I8","GROWABLE_HEAP_U8","GROWABLE_HEAP_I16","GROWABLE_HEAP_U16","GROWABLE_HEAP_I32","GROWABLE_HEAP_U32","GROWABLE_HEAP_F32","GROWABLE_HEAP_F64","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","setStackLimits","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","getExecutableName","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","handleAllocatorInit","HandleAllocator","wasmTable","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","jsStackTrace","stackTrace","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","incrementExceptionRefcount","decrementExceptionRefcount","getExceptionMessage","Browser","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","terminateWorker","killThread","cleanupThread","registerTLSInit","cancelThread","spawnThread","exitOnMainThread","proxyToMainThread","proxiedJSCallArgs","invokeEntryPoint","checkMailbox","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","UnboundTypeError","PureVirtualError","GenericWireTypeSize","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handles","emval_symbols","init_emval","count_emval_handles","Emval","emval_newers","emval_methodCallers","emval_registeredMethods","IDBFS"].forEach(Ce),ce=function e(){mn||Kn(),mn||(ce=e)},d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();return Kn(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=createCCP4Module:"function"==typeof define&&define.amd&&define([],(()=>createCCP4Module));