diff --git a/public/salam-wa.js b/public/salam-wa.js index bab17cd..c0f0c8e 100644 --- a/public/salam-wa.js +++ b/public/salam-wa.js @@ -1 +1 @@ -var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer",ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER,moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,r)=>{throw r},scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){if(typeof process>"u"||!process.release||process.release.name!=="node")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 nodeVersion=process.versions.node,numericVersion=nodeVersion.split(".").slice(0,3);numericVersion=numericVersion[0]*1e4+numericVersion[1]*100+numericVersion[2].split("-")[0]*1;var minVersion=16e4;if(numericVersion<16e4)throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+nodeVersion+")");var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=e=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e);return assert(Buffer.isBuffer(r)),r},readAsync=async(e,r=!0)=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e,r?void 0:"utf8");return assert(r?Buffer.isBuffer(t):typeof t=="string"),t},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(e,r)=>{throw process.exitCode=e,r}}else if(ENVIRONMENT_IS_SHELL){if(typeof process=="object"&&typeof require=="function"||typeof window=="object"||typeof WorkerGlobalScope<"u")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),!(typeof window=="object"||typeof WorkerGlobalScope<"u"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),readAsync=async e=>{if(isFileURI(e))return new Promise((t,n)=>{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=()=>{if(o.status==200||o.status==0&&o.response){t(o.response);return}n(o.status)},o.onerror=n,o.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)}}else throw new Error("environment detection error");var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,checkIncomingModuleAPI(),Module.arguments&&(arguments_=Module.arguments),legacyModuleProp("arguments","arguments_"),Module.thisProgram&&(thisProgram=Module.thisProgram),legacyModuleProp("thisProgram","thisProgram"),assert(typeof Module.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),assert(typeof Module.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),assert(typeof Module.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),assert(typeof Module.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),assert(typeof Module.read>"u","Module.read option was removed"),assert(typeof Module.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),assert(typeof Module.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),assert(typeof Module.setWindowTitle>"u","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),assert(typeof Module.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),legacyModuleProp("asm","wasmExports"),legacyModuleProp("readAsync","readAsync"),legacyModuleProp("readBinary","readBinary"),legacyModuleProp("setWindowTitle","setWindowTitle");var IDBFS="IDBFS is no longer included by default; build with -lidbfs.js",PROXYFS="PROXYFS is no longer included by default; build with -lproxyfs.js",WORKERFS="WORKERFS is no longer included by default; build with -lworkerfs.js",FETCHFS="FETCHFS is no longer included by default; build with -lfetchfs.js",ICASEFS="ICASEFS is no longer included by default; build with -licasefs.js",JSFILEFS="JSFILEFS is no longer included by default; build with -ljsfilefs.js",OPFS="OPFS is no longer included by default; build with -lopfs.js",NODEFS="NODEFS is no longer included by default; build with -lnodefs.js";assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var wasmBinary=Module.wasmBinary;legacyModuleProp("wasmBinary","wasmBinary"),typeof WebAssembly!="object"&&err("no native wasm support detected");var wasmMemory,ABORT=!1,EXITSTATUS;function assert(e,r){e||abort("Assertion failed"+(r?": "+r:""))}function _free(){abort("free() called but not included in the build - add `_free` to EXPORTED_FUNCTIONS")}var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}assert(!Module.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),assert(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support"),assert(!Module.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),assert(!Module.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function writeStackCookie(){var e=_emscripten_stack_get_end();assert((e&3)==0),e==0&&(e+=4),HEAPU32[e>>2]=34821223,HEAPU32[e+4>>2]=2310721022,HEAPU32[0]=1668509029}function checkStackCookie(){if(!ABORT){var e=_emscripten_stack_get_end();e==0&&(e+=4);var r=HEAPU32[e>>2],t=HEAPU32[e+4>>2];(r!=34821223||t!=2310721022)&&abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(t)} ${ptrToString(r)}`),HEAPU32[0]!=1668509029&&abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){assert(!runtimeInitialized),runtimeInitialized=!0,checkStackCookie(),SOCKFS.root=FS.mount(SOCKFS,{},null),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,TTY.init(),callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie(),callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(checkStackCookie(),Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(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 runDependencies=0,dependenciesFulfilled=null,runDependencyTracking={},runDependencyWatcher=null;function getUniqueRunDependency(e){for(var r=e;;){if(!runDependencyTracking[e])return e;e=r+Math.random()}}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies?.(runDependencies),e?(assert(!runDependencyTracking[e]),runDependencyTracking[e]=1,runDependencyWatcher===null&&typeof setInterval<"u"&&(runDependencyWatcher=setInterval(()=>{if(ABORT){clearInterval(runDependencyWatcher),runDependencyWatcher=null;return}var r=!1;for(var t in runDependencyTracking)r||(r=!0,err("still waiting on run dependencies:")),err(`dependency: ${t}`);r&&err("(end of list)")},1e4))):err("warning: run dependency added without ID")}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),e?(assert(runDependencyTracking[e]),delete runDependencyTracking[e]):err("warning: run dependency removed without ID"),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var r=dependenciesFulfilled;dependenciesFulfilled=null,r()}}function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0;var r=new WebAssembly.RuntimeError(e);throw r}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function createExportWrapper(e,r){return(...t)=>{assert(runtimeInitialized,`native function \`${e}\` called before runtime initialization`);var n=wasmExports[e];return assert(n,`exported native function \`${e}\` not found`),assert(t.length<=r,`native function \`${e}\` called with ${t.length} args but expects ${r}`),n(...t)}}function findWasmBinary(){var e="salam-wa.wasm";return isDataURI(e)?e:locateFile(e)}var wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(e){if(!wasmBinary)try{var r=await readAsync(e);return new Uint8Array(r)}catch{}return getBinarySync(e)}async function instantiateArrayBuffer(e,r){try{var t=await getWasmBinary(e),n=await WebAssembly.instantiate(t,r);return n}catch(o){err(`failed to asynchronously prepare wasm: ${o}`),isFileURI(wasmBinaryFile)&&err(`warning: Loading from a file URI (${wasmBinaryFile}) 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`),abort(o)}}async function instantiateAsync(e,r,t){if(!e&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(r)&&!isFileURI(r)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function")try{var n=fetch(r,{credentials:"same-origin"}),o=await WebAssembly.instantiateStreaming(n,t);return o}catch(a){err(`wasm streaming compile failed: ${a}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(r,t)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports}}async function createWasm(){function e(a,i){return wasmExports=a.exports,wasmMemory=wasmExports.memory,assert(wasmMemory,"memory not found in wasm exports"),updateMemoryViews(),addOnInit(wasmExports.__wasm_call_ctors),removeRunDependency("wasm-instantiate"),wasmExports}addRunDependency("wasm-instantiate");var r=Module;function t(a){assert(Module===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,e(a.instance)}var n=getWasmImports();if(Module.instantiateWasm)try{return Module.instantiateWasm(n,e)}catch(a){return err(`Module.instantiateWasm callback failed with error: ${a}`),!1}wasmBinaryFile??=findWasmBinary();var o=await instantiateAsync(wasmBinary,wasmBinaryFile,n);return t(o),o}var tempDouble,tempI64;if((()=>{var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,r[0]!==115||r[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})(),Module.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)");function legacyModuleProp(e,r,t=!0){Object.getOwnPropertyDescriptor(Module,e)||Object.defineProperty(Module,e,{configurable:!0,get(){let n=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)":"";abort(`\`Module.${e}\` has been replaced by \`${r}\``+n)}})}function ignoredModuleProp(e){Object.getOwnPropertyDescriptor(Module,e)&&abort(`\`Module.${e}\` was supplied but \`${e}\` not included in INCOMING_MODULE_JS_API`)}function isExportedByForceFilesystem(e){return e==="FS_createPath"||e==="FS_createDataFile"||e==="FS_createPreloadedFile"||e==="FS_unlink"||e==="addRunDependency"||e==="FS_createLazyFile"||e==="FS_createDevice"||e==="removeRunDependency"}function hookGlobalSymbolAccess(e,r){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,e)&&Object.defineProperty(globalThis,e,{configurable:!0,get(){r()}})}function missingGlobal(e,r){hookGlobalSymbolAccess(e,()=>{warnOnce(`\`${e}\` is not longer defined by emscripten. ${r}`)})}missingGlobal("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),missingGlobal("asm","Please use wasmExports instead");function missingLibrarySymbol(e){hookGlobalSymbolAccess(e,()=>{var r=`\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,t=e;t.startsWith("_")||(t="$"+e),r+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${t}')`,isExportedByForceFilesystem(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),warnOnce(r)}),unexportedRuntimeSymbol(e)}function unexportedRuntimeSymbol(e){Object.getOwnPropertyDescriptor(Module,e)||Object.defineProperty(Module,e,{configurable:!0,get(){var r=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;isExportedByForceFilesystem(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),abort(r)}})}function dbg(...e){console.warn(...e)}class ExitStatus{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)};function getValue(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return HEAP8[e];case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort(`invalid type for getValue: ${r}`)}}var noExitRuntime=Module.noExitRuntime||!0,ptrToString=e=>(assert(typeof e=="number"),e>>>=0,"0x"+e.toString(16).padStart(8,"0"));function setValue(e,r,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":HEAP8[e]=r;break;case"i8":HEAP8[e]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;case"*":HEAPU32[e>>2]=r;break;default:abort(`invalid type for setValue: ${t}`)}}var stackRestore=e=>__emscripten_stack_restore(e),stackSave=()=>_emscripten_stack_get_current(),warnOnce=e=>{warnOnce.shown||={},warnOnce.shown[e]||(warnOnce.shown[e]=1,ENVIRONMENT_IS_NODE&&(e="warning: "+e),err(e))},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return n=>crypto.getRandomValues(n);if(ENVIRONMENT_IS_NODE)try{var e=require("crypto"),r=e.randomFillSync;if(r)return n=>e.randomFillSync(n);var t=e.randomBytes;return n=>(n.set(t(n.byteLength)),n)}catch{}abort("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 } };")},randomFill=e=>(randomFill=initRandomFill())(e),PATH={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var 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=PATH.isAbs(e),t=e.substr(-1)==="/";return e=PATH.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=PATH.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"/";e=PATH.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>PATH.normalize(e.join("/")),join2:(e,r)=>PATH.normalize(e+"/"+r)},PATH_FS={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:FS.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=PATH.isAbs(o)}return r=PATH.normalizeArray(r.split("/").filter(a=>!!a),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=PATH_FS.resolve(e).substr(1),r=PATH_FS.resolve(r).substr(1);function t(d){for(var f=0;f=0&&d[v]==="";v--);return f>v?[]:d.slice(f,v-f+1)}for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(r,o));for(var a="";r>10,56320|d&1023)}}return a},FS_stdin_getChar_buffer=[],lengthBytesUTF8=e=>{for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r},stringToUTF8Array=(e,r,t,n)=>{if(assert(typeof e=="string",`stringToUTF8Array expects a string (got ${typeof e})`),!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(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|s&63}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|s&63}else{if(t+3>=a)break;s>1114111&&warnOnce("Invalid Unicode code point "+ptrToString(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|s&63}}return r[t]=0,t-o};function intArrayFromString(e,r,t){var n=t>0?t:lengthBytesUTF8(e)+1,o=new Array(n),a=stringToUTF8Array(e,o,0,o.length);return r&&(o.length=a),o}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if(ENVIRONMENT_IS_NODE){var r=256,t=Buffer.alloc(r),n=0,o=process.stdin.fd;try{n=fs.readSync(o,t,0,r)}catch(a){if(a.toString().includes("EOF"))n=0;else throw a}n>0&&(e=t.slice(0,n).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`\n`));if(!e)return null;FS_stdin_getChar_buffer=intArrayFromString(e,!0)}return FS_stdin_getChar_buffer.shift()},TTY={ttys:[],init(){},shutdown(){},register(e,r){TTY.ttys[e]={input:[],output:[],ops:r},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open(e){var r=TTY.ttys[e.node.rdev];if(!r)throw new FS.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 FS.ErrnoError(60);for(var a=0,i=0;i0&&(out(UTF8ArrayToString(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(err(UTF8ArrayToString(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output)),e.output=[])}}},zeroMemory=(e,r)=>{HEAPU8.fill(0,e,e+r)},alignMemory=(e,r)=>(assert(r,"alignment argument is required"),Math.ceil(e/r)*r),mmapAlloc=e=>{abort("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},MEMFS={ops_table:null,mount(e){return MEMFS.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(FS.isBlkdev(t)||FS.isFIFO(t))throw new FS.ErrnoError(63);MEMFS.ops_table||={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}};var o=FS.createNode(e,r,t,n);return FS.isDir(o.mode)?(o.node_ops=MEMFS.ops_table.dir.node,o.stream_ops=MEMFS.ops_table.dir.stream,o.contents={}):FS.isFile(o.mode)?(o.node_ops=MEMFS.ops_table.file.node,o.stream_ops=MEMFS.ops_table.file.stream,o.usedBytes=0,o.contents=null):FS.isLink(o.mode)?(o.node_ops=MEMFS.ops_table.link.node,o.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(o.mode)&&(o.node_ops=MEMFS.ops_table.chrdev.node,o.stream_ops=MEMFS.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),e&&(e.contents[r]=o,e.atime=e.mtime=e.ctime=o.atime),o},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t>>0),t!=0&&(r=Math.max(r,256));var o=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=FS.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,FS.isDir(e.mode)?r.size=4096:FS.isFile(e.mode)?r.size=e.usedBytes:FS.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])r[t]&&(e[t]=r[t]);r.size!==void 0&&MEMFS.resizeFileStorage(e,r.size)},lookup(e,r){throw new FS.ErrnoError(44)},mknod(e,r,t,n){return MEMFS.createNode(e,r,t,n)},rename(e,r,t){var n;try{n=FS.lookupNode(r,t)}catch{}if(n){if(FS.isDir(e.mode))for(var o in n.contents)throw new FS.ErrnoError(55);FS.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=FS.lookupNode(e,r);for(var n in t.contents)throw new FS.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,r,t){var n=MEMFS.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!FS.isLink(e.mode))throw new FS.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(assert(i>=0),i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r{var r=await readAsync(e);return assert(r,`Loading data file "${e}" failed (no arrayBuffer).`),new Uint8Array(r)},FS_createDataFile=(e,r,t,n,o,a)=>{FS.createDataFile(e,r,t,n,o,a)},preloadPlugins=Module.preloadPlugins||[],FS_handledByPreloadPlugin=(e,r,t,n)=>{typeof Browser<"u"&&Browser.init();var o=!1;return preloadPlugins.forEach(a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)}),o},FS_createPreloadedFile=(e,r,t,n,o,a,i,s,l,d)=>{var f=r?PATH_FS.resolve(PATH.join2(e,r)):e,v=getUniqueRunDependency(`cp ${f}`);function c(u){function m(p){d?.(),s||FS_createDataFile(e,r,p,n,o,l),a?.(),removeRunDependency(v)}FS_handledByPreloadPlugin(u,f,m,()=>{i?.(),removeRunDependency(v)})||m(u)}addRunDependency(v),typeof t=="string"?asyncLoad(t).then(c,i):c(t)},FS_modeStringToFlags=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},FS_getMode=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},UTF8ToString=(e,r)=>(assert(typeof e=="number",`UTF8ToString expects a number (got ${typeof e})`),e?UTF8ArrayToString(HEAPU8,e,r):""),strError=e=>UTF8ToString(_strerror(e)),ERRNO_CODES={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},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class extends Error{name="ErrnoError";constructor(e){super(runtimeInitialized?strError(e):""),this.errno=e;for(var r in ERRNO_CODES)if(ERRNO_CODES[r]===e){this.code=r;break}}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=FS.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)return{path:"",node:null};r.follow_mount??=!0,PATH.isAbs(e)||(e=FS.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter(d=>!!d&&d!=="."),o=FS.root,a="/",i=0;i>>0)%FS.nameTable.length},hashAddNode(e){var r=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[r],FS.nameTable[r]=e},hashRemoveNode(e){var r=FS.hashName(e.parent.id,e.name);if(FS.nameTable[r]===e)FS.nameTable[r]=e.name_next;else for(var t=FS.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=FS.mayLookup(e);if(t)throw new FS.ErrnoError(t);for(var n=FS.hashName(e.id,r),o=FS.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return FS.lookup(e,r)},createNode(e,r,t,n){assert(typeof e=="object");var o=new FS.FSNode(e,r,t,n);return FS.hashAddNode(o),o},destroyNode(e){FS.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return FS.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!FS.isDir(e.mode))return 54;var r=FS.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!FS.isDir(e.mode))return 54;try{var t=FS.lookupNode(e,r);return 20}catch{}return FS.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=FS.lookupNode(e,r)}catch(a){return a.errno}var o=FS.nodePermissions(e,"wx");if(o)return o;if(t){if(!FS.isDir(n.mode))return 54;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return 10}else if(FS.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&(FS.flagsToPermissionString(r)!=="r"||r&512)?31:FS.nodePermissions(e,FS.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=FS.MAX_OPEN_FDS;e++)if(!FS.streams[e])return e;throw new FS.ErrnoError(33)},getStreamChecked(e){var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(8);return r},getStream:e=>FS.streams[e],createStream(e,r=-1){return assert(r>=-1),e=Object.assign(new FS.FSStream,e),r==-1&&(r=FS.nextfd()),e.fd=r,FS.streams[r]=e,e},closeStream(e){FS.streams[e]=null},dupStream(e,r=-1){var t=FS.createStream(e,r);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(e){var r=FS.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){FS.devices[e]={stream_ops:r}},getDevice:e=>FS.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=FS.getMounts(FS.root.mount),n=0;function o(i){return assert(FS.syncFSRequests>0),FS.syncFSRequests--,r(i)}function a(i){if(i)return a.errored?void 0:(a.errored=!0,o(i));++n>=t.length&&o(null)}t.forEach(i=>{if(!i.type.syncfs)return a(null);i.type.syncfs(i,e,a)})},mount(e,r,t){if(typeof e=="string")throw e;var n=t==="/",o=!t,a;if(n&&FS.root)throw new FS.ErrnoError(10);if(!n&&!o){var i=FS.lookupPath(t,{follow_mount:!1});if(t=i.path,a=i.node,FS.isMountpoint(a))throw new FS.ErrnoError(10);if(!FS.isDir(a.mode))throw new FS.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,n?FS.root=l:a&&(a.mounted=s,a.mount&&a.mount.mounts.push(s)),l},unmount(e){var r=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(r.node))throw new FS.ErrnoError(28);var t=r.node,n=t.mounted,o=FS.getMounts(n);Object.keys(FS.nameTable).forEach(i=>{for(var s=FS.nameTable[i];s;){var l=s.name_next;o.includes(s.mount)&&FS.destroyNode(s),s=l}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);assert(a!==-1),t.mount.mounts.splice(a,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=FS.lookupPath(e,{parent:!0}),o=n.node,a=PATH.basename(e);if(!a||a==="."||a==="..")throw new FS.ErrnoError(28);var i=FS.mayCreate(o,a);if(i)throw new FS.ErrnoError(i);if(!o.node_ops.mknod)throw new FS.ErrnoError(63);return o.node_ops.mknod(o,a,r,t)},statfs(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:FS.nextInode,ffree:FS.nextInode-1,fsid:42,flags:2,namelen:255},t=FS.lookupPath(e,{follow:!0}).node;return t?.node_ops.statfs&&Object.assign(r,t.node_ops.statfs(t.mount.opts.root)),r},create(e,r=438){return r&=4095,r|=32768,FS.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,FS.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o"u"&&(t=r,r=438),r|=8192,FS.mknod(e,r,t)},symlink(e,r){if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var t=FS.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new FS.ErrnoError(44);var o=PATH.basename(r),a=FS.mayCreate(n,o);if(a)throw new FS.ErrnoError(a);if(!n.node_ops.symlink)throw new FS.ErrnoError(63);return n.node_ops.symlink(n,o,e)},rename(e,r){var t=PATH.dirname(e),n=PATH.dirname(r),o=PATH.basename(e),a=PATH.basename(r),i,s,l;if(i=FS.lookupPath(e,{parent:!0}),s=i.node,i=FS.lookupPath(r,{parent:!0}),l=i.node,!s||!l)throw new FS.ErrnoError(44);if(s.mount!==l.mount)throw new FS.ErrnoError(75);var d=FS.lookupNode(s,o),f=PATH_FS.relative(e,n);if(f.charAt(0)!==".")throw new FS.ErrnoError(28);if(f=PATH_FS.relative(r,t),f.charAt(0)!==".")throw new FS.ErrnoError(55);var v;try{v=FS.lookupNode(l,a)}catch{}if(d!==v){var c=FS.isDir(d.mode),u=FS.mayDelete(s,o,c);if(u)throw new FS.ErrnoError(u);if(u=v?FS.mayDelete(l,a,c):FS.mayCreate(l,a),u)throw new FS.ErrnoError(u);if(!s.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(d)||v&&FS.isMountpoint(v))throw new FS.ErrnoError(10);if(l!==s&&(u=FS.nodePermissions(s,"w"),u))throw new FS.ErrnoError(u);FS.hashRemoveNode(d);try{s.node_ops.rename(d,l,a),d.parent=l}catch(m){throw m}finally{FS.hashAddNode(d)}}},rmdir(e){var r=FS.lookupPath(e,{parent:!0}),t=r.node,n=PATH.basename(e),o=FS.lookupNode(t,n),a=FS.mayDelete(t,n,!0);if(a)throw new FS.ErrnoError(a);if(!t.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(o))throw new FS.ErrnoError(10);t.node_ops.rmdir(t,n),FS.destroyNode(o)},readdir(e){var r=FS.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new FS.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=FS.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new FS.ErrnoError(44);var n=PATH.basename(e),o=FS.lookupNode(t,n),a=FS.mayDelete(t,n,!1);if(a)throw new FS.ErrnoError(a);if(!t.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(o))throw new FS.ErrnoError(10);t.node_ops.unlink(t,n),FS.destroyNode(o)},readlink(e){var r=FS.lookupPath(e),t=r.node;if(!t)throw new FS.ErrnoError(44);if(!t.node_ops.readlink)throw new FS.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r){var t=FS.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new FS.ErrnoError(44);if(!n.node_ops.getattr)throw new FS.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return FS.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var o=FS.lookupPath(e,{follow:!t});n=o.node}else n=e;if(!n.node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,ctime:Date.now()})},lchmod(e,r){FS.chmod(e,r,!0)},fchmod(e,r){var t=FS.getStreamChecked(e);FS.chmod(t.node,r)},chown(e,r,t,n){var o;if(typeof e=="string"){var a=FS.lookupPath(e,{follow:!n});o=a.node}else o=e;if(!o.node_ops.setattr)throw new FS.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){FS.chown(e,r,t,!0)},fchown(e,r,t){var n=FS.getStreamChecked(e);FS.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new FS.ErrnoError(28);var t;if(typeof e=="string"){var n=FS.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(t.mode))throw new FS.ErrnoError(31);if(!FS.isFile(t.mode))throw new FS.ErrnoError(28);var o=FS.nodePermissions(t,"w");if(o)throw new FS.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=FS.getStreamChecked(e);if(!(t.flags&2097155))throw new FS.ErrnoError(28);FS.truncate(t.node,r)},utime(e,r,t){var n=FS.lookupPath(e,{follow:!0}),o=n.node;o.node_ops.setattr(o,{atime:r,mtime:t})},open(e,r,t=438){if(e==="")throw new FS.ErrnoError(44);r=typeof r=="string"?FS_modeStringToFlags(r):r,r&64?t=t&4095|32768:t=0;var n;if(typeof e=="object")n=e;else{var o=FS.lookupPath(e,{follow:!(r&131072),noent_okay:!0});n=o.node,e=o.path}var a=!1;if(r&64)if(n){if(r&128)throw new FS.ErrnoError(20)}else n=FS.mknod(e,t,0),a=!0;if(!n)throw new FS.ErrnoError(44);if(FS.isChrdev(n.mode)&&(r&=-513),r&65536&&!FS.isDir(n.mode))throw new FS.ErrnoError(54);if(!a){var i=FS.mayOpen(n,r);if(i)throw new FS.ErrnoError(i)}r&512&&!a&&FS.truncate(n,0),r&=-131713;var s=FS.createStream({node:n,path:FS.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),Module.logReadFiles&&!(r&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),s},close(e){if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{FS.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(assert(t>=0),n<0||o<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if((e.flags&2097155)===1)throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var a=typeof o<"u";if(!a)o=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);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(assert(t>=0),n<0||o<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&e.flags&1024&&FS.llseek(e,0,2);var i=typeof o<"u";if(!i)o=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(r<0||t<=0)throw new FS.ErrnoError(28);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(n&2&&!(o&2)&&(e.flags&2097155)!==2)throw new FS.ErrnoError(2);if((e.flags&2097155)===1)throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);if(!r)throw new FS.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,o)},msync(e,r,t,n,o){return assert(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=FS.open(e,r.flags),o=FS.stat(e),a=o.size,i=new Uint8Array(a);return FS.read(n,i,0,a,0),r.encoding==="utf8"?t=UTF8ArrayToString(i):r.encoding==="binary"&&(t=i),FS.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=FS.open(e,t.flags,t.mode);if(typeof r=="string"){var o=new Uint8Array(lengthBytesUTF8(r)+1),a=stringToUTF8Array(r,o,0,o.length);FS.write(n,o,0,a,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))FS.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");FS.close(n)},cwd:()=>FS.currentPath,chdir(e){var r=FS.lookupPath(e,{follow:!0});if(r.node===null)throw new FS.ErrnoError(44);if(!FS.isDir(r.node.mode))throw new FS.ErrnoError(54);var t=FS.nodePermissions(r.node,"x");if(t)throw new FS.ErrnoError(t);FS.currentPath=r.path},createDefaultDirectories(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(n,o,a,i,s)=>i,llseek:()=>0}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=randomFill(e).byteLength),e[--r]);FS.createDevice("/dev","random",t),FS.createDevice("/dev","urandom",t),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var r=FS.createNode(e,"fd",16895,73);return r.stream_ops={llseek:MEMFS.stream_ops.llseek},r.node_ops={lookup(t,n){var o=+n,a=FS.getStreamChecked(o),i={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path},id:o+1};return i.parent=i,i},readdir(){return Array.from(FS.streams.entries()).filter(([t,n])=>n).map(([t,n])=>t.toString())}},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?FS.createDevice("/dev","stdin",e):FS.symlink("/dev/tty","/dev/stdin"),r?FS.createDevice("/dev","stdout",null,r):FS.symlink("/dev/tty","/dev/stdout"),t?FS.createDevice("/dev","stderr",null,t):FS.symlink("/dev/tty1","/dev/stderr");var n=FS.open("/dev/stdin",0),o=FS.open("/dev/stdout",1),a=FS.open("/dev/stderr",1);assert(n.fd===0,`invalid handle for stdin (${n.fd})`),assert(o.fd===1,`invalid handle for stdout (${o.fd})`),assert(a.fd===2,`invalid handle for stderr (${a.fd})`)},staticInit(){FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},init(e,r,t){assert(!FS.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)"),FS.initialized=!0,e??=Module.stdin,r??=Module.stdout,t??=Module.stderr,FS.createStandardStreams(e,r,t)},quit(){FS.initialized=!1,_fflush(0);for(var e=0;ethis.length-1||u<0)){var m=u%this.chunkSize,p=u/this.chunkSize|0;return this.getter(p)[m]}}setDataGetter(u){this.getter=u}cacheLength(){var u=new XMLHttpRequest;if(u.open("HEAD",t,!1),u.send(null),!(u.status>=200&&u.status<300||u.status===304))throw new Error("Couldn't load "+t+". Status: "+u.status);var m=Number(u.getResponseHeader("Content-length")),p,_=(p=u.getResponseHeader("Accept-Ranges"))&&p==="bytes",g=(p=u.getResponseHeader("Content-Encoding"))&&p==="gzip",w=1024*1024;_||(w=m);var E=(y,b)=>{if(y>b)throw new Error("invalid range ("+y+", "+b+") or no bytes requested!");if(b>m-1)throw new Error("only "+m+" bytes available! programmer error!");var h=new XMLHttpRequest;if(h.open("GET",t,!1),m!==w&&h.setRequestHeader("Range","bytes="+y+"-"+b),h.responseType="arraybuffer",h.overrideMimeType&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send(null),!(h.status>=200&&h.status<300||h.status===304))throw new Error("Couldn't load "+t+". Status: "+h.status);return h.response!==void 0?new Uint8Array(h.response||[]):intArrayFromString(h.responseText||"",!0)},S=this;S.setDataGetter(y=>{var b=y*w,h=(y+1)*w-1;if(h=Math.min(h,m-1),typeof S.chunks[y]>"u"&&(S.chunks[y]=E(b,h)),typeof S.chunks[y]>"u")throw new Error("doXHR failed!");return S.chunks[y]}),(g||!m)&&(w=m=1,m=this.getter(0).length,w=m,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=m,this._chunkSize=w,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a,s={isDevice:!1,contents:i}}else var s={isDevice:!1,url:t};var l=FS.createFile(e,r,s,n,o);s.contents?l.contents=s.contents:s.url&&(l.contents=null,l.url=s.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var d={},f=Object.keys(l.stream_ops);f.forEach(c=>{var u=l.stream_ops[c];d[c]=(...m)=>(FS.forceLoadFile(l),u(...m))});function v(c,u,m,p,_){var g=c.node.contents;if(_>=g.length)return 0;var w=Math.min(g.length-_,p);if(assert(w>=0),g.slice)for(var E=0;E(FS.forceLoadFile(l),v(c,u,m,p,_)),d.mmap=(c,u,m,p,_)=>{FS.forceLoadFile(l);var g=mmapAlloc(u);if(!g)throw new FS.ErrnoError(48);return v(c,HEAP8,g,u,m),{ptr:g,allocated:!0}},l.stream_ops=d,l},absolutePath(){abort("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){abort("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){abort("FS.createLink has been removed; use FS.symlink instead")},joinPath(){abort("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){abort("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){abort("FS.standardizePath has been removed; use PATH.normalize instead")}},SOCKFS={websocketArgs:{},callbacks:{},on(e,r){SOCKFS.callbacks[e]=r},emit(e,r){SOCKFS.callbacks[e]?.(r)},mount(e){return SOCKFS.websocketArgs=Module.websocket||{},(Module.websocket??={}).on=SOCKFS.on,FS.createNode(null,"/",16895,0)},createSocket(e,r,t){r&=-526337;var n=r==1;if(n&&t&&t!=6)throw new FS.ErrnoError(66);var o={family:e,type:r,protocol:t,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops},a=SOCKFS.nextname(),i=FS.createNode(SOCKFS.root,a,49152,0);i.sock=o;var s=FS.createStream({path:a,node:i,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return o.stream=s,o},getSocket(e){var r=FS.getStream(e);return!r||!FS.isSocket(r.node.mode)?null:r.node.sock},stream_ops:{poll(e){var r=e.node.sock;return r.sock_ops.poll(r)},ioctl(e,r,t){var n=e.node.sock;return n.sock_ops.ioctl(n,r,t)},read(e,r,t,n,o){var a=e.node.sock,i=a.sock_ops.recvmsg(a,n);return i?(r.set(i.buffer,t),i.buffer.length):0},write(e,r,t,n,o){var a=e.node.sock;return a.sock_ops.sendmsg(a,r,t,n)},close(e){var r=e.node.sock;r.sock_ops.close(r)}},nextname(){return SOCKFS.nextname.current||(SOCKFS.nextname.current=0),`socket[${SOCKFS.nextname.current++}]`},websocket_sock_ops:{createPeer(e,r,t){var n;if(typeof r=="object"&&(n=r,r=null,t=null),n)if(n._socket)r=n._socket.remoteAddress,t=n._socket.remotePort;else{var o=/ws[s]?:\/\/([^:]+):(\d+)/.exec(n.url);if(!o)throw new Error("WebSocket URL must be in the format ws(s)://address:port");r=o[1],t=parseInt(o[2],10)}else try{var a="ws:#".replace("#","//"),i="binary",s=void 0;if(SOCKFS.websocketArgs.url&&(a=SOCKFS.websocketArgs.url),SOCKFS.websocketArgs.subprotocol?i=SOCKFS.websocketArgs.subprotocol:SOCKFS.websocketArgs.subprotocol===null&&(i="null"),a==="ws://"||a==="wss://"){var l=r.split("/");a=a+l[0]+":"+t+"/"+l.slice(1).join("/")}i!=="null"&&(i=i.replace(/^ +| +$/g,"").split(/ *, */),s=i);var d;ENVIRONMENT_IS_NODE?d=require("ws"):d=WebSocket,n=new d(a,s),n.binaryType="arraybuffer"}catch{throw new FS.ErrnoError(23)}var f={addr:r,port:t,socket:n,msg_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,f),SOCKFS.websocket_sock_ops.handlePeerEvents(e,f),e.type===2&&typeof e.sport<"u"&&f.msg_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),f},getPeer(e,r,t){return e.peers[r+":"+t]},addPeer(e,r){e.peers[r.addr+":"+r.port]=r},removePeer(e,r){delete e.peers[r.addr+":"+r.port]},handlePeerEvents(e,r){var t=!0,n=function(){e.connecting=!1,SOCKFS.emit("open",e.stream.fd);try{for(var a=r.msg_send_queue.shift();a;)r.socket.send(a),a=r.msg_send_queue.shift()}catch{r.socket.close()}};function o(a){if(typeof a=="string"){var i=new TextEncoder;a=i.encode(a)}else{if(assert(a.byteLength!==void 0),a.byteLength==0)return;a=new Uint8Array(a)}var s=t;if(t=!1,s&&a.length===10&&a[0]===255&&a[1]===255&&a[2]===255&&a[3]===255&&a[4]===112&&a[5]===111&&a[6]===114&&a[7]===116){var l=a[8]<<8|a[9];SOCKFS.websocket_sock_ops.removePeer(e,r),r.port=l,SOCKFS.websocket_sock_ops.addPeer(e,r);return}e.recv_queue.push({addr:r.addr,port:r.port,data:a}),SOCKFS.emit("message",e.stream.fd)}ENVIRONMENT_IS_NODE?(r.socket.on("open",n),r.socket.on("message",function(a,i){i&&o(new Uint8Array(a).buffer)}),r.socket.on("close",function(){SOCKFS.emit("close",e.stream.fd)}),r.socket.on("error",function(a){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(r.socket.onopen=n,r.socket.onclose=function(){SOCKFS.emit("close",e.stream.fd)},r.socket.onmessage=function(i){o(i.data)},r.socket.onerror=function(a){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})},poll(e){if(e.type===1&&e.server)return e.pending.length?65:0;var r=0,t=e.type===1?SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport):null;return(e.recv_queue.length||!t||t&&t.socket.readyState===t.socket.CLOSING||t&&t.socket.readyState===t.socket.CLOSED)&&(r|=65),(!t||t&&t.socket.readyState===t.socket.OPEN)&&(r|=4),(t&&t.socket.readyState===t.socket.CLOSING||t&&t.socket.readyState===t.socket.CLOSED)&&(e.connecting?r|=4:r|=16),r},ioctl(e,r,t){switch(r){case 21531:var n=0;return e.recv_queue.length&&(n=e.recv_queue[0].data.length),HEAP32[t>>2]=n,0;default:return 28}},close(e){if(e.server){try{e.server.close()}catch{}e.server=null}for(var r=Object.keys(e.peers),t=0;t{var r=SOCKFS.getSocket(e);if(!r)throw new FS.ErrnoError(8);return r},Sockets={BUFFER_SIZE:10240,MAX_BUFFER_SIZE:10485760,nextFd:1,fds:{},nextport:1,maxport:65535,peer:null,connections:{},portmap:{},localAddr:4261412874,addrPool:[33554442,50331658,67108874,83886090,100663306,117440522,134217738,150994954,167772170,184549386,201326602,218103818,234881034]},inetNtop4=e=>(e&255)+"."+(e>>8&255)+"."+(e>>16&255)+"."+(e>>24&255),inetNtop6=e=>{var r="",t=0,n=0,o=0,a=0,i=0,s=0,l=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],d=!0,f="";for(s=0;s<5;s++)if(l[s]!==0){d=!1;break}if(d){if(f=inetNtop4(l[6]|l[7]<<16),l[5]===-1)return r="::ffff:",r+=f,r;if(l[5]===0)return r="::",f==="0.0.0.0"&&(f=""),f==="0.0.0.1"&&(f="1"),r+=f,r}for(t=0;t<8;t++)l[t]===0&&(t-o>1&&(i=0),o=t,i++),i>n&&(n=i,a=t-n+1);for(t=0;t<8;t++){if(n>1&&l[t]===0&&t>=a&&t{var t=HEAP16[e>>1],n=_ntohs(HEAPU16[e+2>>1]),o;switch(t){case 2:if(r!==16)return{errno:28};o=HEAP32[e+4>>2],o=inetNtop4(o);break;case 10:if(r!==28)return{errno:28};o=[HEAP32[e+8>>2],HEAP32[e+12>>2],HEAP32[e+16>>2],HEAP32[e+20>>2]],o=inetNtop6(o);break;default:return{errno:5}}return{family:t,addr:o,port:n}},inetPton4=e=>{for(var r=e.split("."),t=0;t<4;t++){var n=Number(r[t]);if(isNaN(n))return null;r[t]=n}return(r[0]|r[1]<<8|r[2]<<16|r[3]<<24)>>>0},jstoi_q=e=>parseInt(e),inetPton6=e=>{var r,t,n,o,a,i=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,s=[];if(!i.test(e))return null;if(e==="::")return[0,0,0,0,0,0,0,0];for(e.startsWith("::")?e=e.replace("::","Z:"):e=e.replace("::",":Z:"),e.indexOf(".")>0?(e=e.replace(new RegExp("[.]","g"),":"),r=e.split(":"),r[r.length-4]=jstoi_q(r[r.length-4])+jstoi_q(r[r.length-3])*256,r[r.length-3]=jstoi_q(r[r.length-2])+jstoi_q(r[r.length-1])*256,r=r.slice(0,r.length-2)):r=e.split(":"),n=0,o=0,t=0;t{var t=readSockaddr(e,r);if(t.errno)throw new FS.ErrnoError(t.errno);return t.addr=DNS.lookup_addr(t.addr)||t.addr,t};function ___syscall_connect(e,r,t,n,o,a){try{var i=getSocketFromFD(e),s=getSocketAddress(r,t);return i.sock_ops.connect(i,s.addr,s.port),0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}var syscallGetVarargI=()=>{assert(SYSCALLS.varargs!=null);var e=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,e},syscallGetVarargP=syscallGetVarargI,SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(PATH.isAbs(r))return r;var n;if(e===-100)n=FS.cwd();else{var o=SYSCALLS.getStreamFromFD(e);n=o.path}if(r.length==0){if(!t)throw new FS.ErrnoError(44);return n}return n+"/"+r},doStat(e,r,t){var n=e(r);HEAP32[t>>2]=n.dev,HEAP32[t+4>>2]=n.mode,HEAPU32[t+8>>2]=n.nlink,HEAP32[t+12>>2]=n.uid,HEAP32[t+16>>2]=n.gid,HEAP32[t+20>>2]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+24>>2]=tempI64[0],HEAP32[t+28>>2]=tempI64[1],HEAP32[t+32>>2]=4096,HEAP32[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return tempI64=[Math.floor(o/1e3)>>>0,(tempDouble=Math.floor(o/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+40>>2]=tempI64[0],HEAP32[t+44>>2]=tempI64[1],HEAPU32[t+48>>2]=o%1e3*1e3*1e3,tempI64=[Math.floor(a/1e3)>>>0,(tempDouble=Math.floor(a/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+56>>2]=tempI64[0],HEAP32[t+60>>2]=tempI64[1],HEAPU32[t+64>>2]=a%1e3*1e3*1e3,tempI64=[Math.floor(i/1e3)>>>0,(tempDouble=Math.floor(i/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+72>>2]=tempI64[0],HEAP32[t+76>>2]=tempI64[1],HEAPU32[t+80>>2]=i%1e3*1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+88>>2]=tempI64[0],HEAP32[t+92>>2]=tempI64[1],0},doMsync(e,r,t,n,o){if(!FS.isFile(r.node.mode))throw new FS.ErrnoError(43);if(n&2)return 0;var a=HEAPU8.slice(e,e+t);FS.msync(r,a,o,t,n)},getStreamFromFD(e){var r=FS.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=UTF8ToString(e);return r}};function ___syscall_fcntl64(e,r,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD(e);switch(r){case 0:{var o=syscallGetVarargI();if(o<0)return-28;for(;FS.streams[o];)o++;var a;return a=FS.dupStream(n,o),a.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var o=syscallGetVarargI();return n.flags|=o,0}case 12:{var o=syscallGetVarargP(),i=0;return HEAP16[o+i>>1]=2,0}case 13:case 14:return 0}return-28}catch(s){if(typeof FS>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function ___syscall_ioctl(e,r,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=syscallGetVarargP();HEAP32[a>>2]=o.c_iflag||0,HEAP32[a+4>>2]=o.c_oflag||0,HEAP32[a+8>>2]=o.c_cflag||0,HEAP32[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)HEAP8[a+i+17]=o.c_cc[i]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var a=syscallGetVarargP(),s=HEAP32[a>>2],l=HEAP32[a+4>>2],d=HEAP32[a+8>>2],f=HEAP32[a+12>>2],v=[],i=0;i<32;i++)v.push(HEAP8[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:l,c_cflag:d,c_lflag:f,c_cc:v})}return 0}case 21519:{if(!n.tty)return-59;var a=syscallGetVarargP();return HEAP32[a>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var a=syscallGetVarargP();return FS.ioctl(n,r,a)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var c=n.tty.ops.ioctl_tiocgwinsz(n.tty),a=syscallGetVarargP();HEAP16[a>>1]=c[0],HEAP16[a+2>>1]=c[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function ___syscall_openat(e,r,t,n){SYSCALLS.varargs=n;try{r=SYSCALLS.getStr(r),r=SYSCALLS.calculateAt(e,r);var o=n?syscallGetVarargI():0;return FS.open(r,t,o).fd}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}var writeSockaddr=(e,r,t,n,o)=>{switch(r){case 2:t=inetPton4(t),zeroMemory(e,16),o&&(HEAP32[o>>2]=16),HEAP16[e>>1]=r,HEAP32[e+4>>2]=t,HEAP16[e+2>>1]=_htons(n);break;case 10:t=inetPton6(t),zeroMemory(e,28),o&&(HEAP32[o>>2]=28),HEAP32[e>>2]=r,HEAP32[e+8>>2]=t[0],HEAP32[e+12>>2]=t[1],HEAP32[e+16>>2]=t[2],HEAP32[e+20>>2]=t[3],HEAP16[e+2>>1]=_htons(n);break;default:return 5}return 0};function ___syscall_recvfrom(e,r,t,n,o,a){try{var i=getSocketFromFD(e),s=i.sock_ops.recvmsg(i,t);if(!s)return 0;if(o){var l=writeSockaddr(o,i.family,DNS.lookup_name(s.addr),s.port,a);assert(!l)}return HEAPU8.set(s.buffer,r),s.buffer.byteLength}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}function ___syscall_sendto(e,r,t,n,o,a){try{var i=getSocketFromFD(e);if(!o)return FS.write(i.stream,HEAP8,r,t);var s=getSocketAddress(o,a);return i.sock_ops.sendmsg(i,HEAP8,r,t,s.addr,s.port)}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}function ___syscall_socket(e,r,t){try{var n=SOCKFS.createSocket(e,r,t);return assert(n.stream.fd<64),n.stream.fd}catch(o){if(typeof FS>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}var __emscripten_memcpy_js=(e,r,t)=>HEAPU8.copyWithin(e,r,r+t),getHeapMax=()=>2147483648,growMemory=e=>{var r=wasmMemory.buffer,t=(e-r.byteLength+65535)/65536|0;try{return wasmMemory.grow(t),updateMemoryViews(),1}catch(n){err(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},_emscripten_resize_heap=e=>{var r=HEAPU8.length;e>>>=0,assert(e>r);var t=getHeapMax();if(e>t)return err(`Cannot enlarge memory, requested ${e} bytes, but the limit is ${t} bytes!`),!1;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var a=Math.min(t,alignMemory(Math.max(e,o),65536)),i=growMemory(a);if(i)return!0}return err(`Failed to grow the heap from ${r} bytes to ${a} bytes, not enough memory!`),!1},ENV={},getExecutableName=()=>thisProgram||"./this.program",getEnvStrings=()=>{if(!getEnvStrings.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:getExecutableName()};for(var t in ENV)ENV[t]===void 0?delete r[t]:r[t]=ENV[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);getEnvStrings.strings=n}return getEnvStrings.strings},stringToAscii=(e,r)=>{for(var t=0;t{var t=0;return getEnvStrings().forEach((n,o)=>{var a=r+t;HEAPU32[e+o*4>>2]=a,stringToAscii(n,a),t+=n.length+1}),0},_environ_sizes_get=(e,r)=>{var t=getEnvStrings();HEAPU32[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),HEAPU32[r>>2]=n,0},runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},exitJS=(e,r)=>{if(EXITSTATUS=e,checkUnflushedContent(),keepRuntimeAlive()&&!r){var t=`program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${runtimeKeepaliveCounter}) 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)`;err(t)}_proc_exit(e)},_exit=exitJS;function _fd_close(e){try{var r=SYSCALLS.getStreamFromFD(e);return FS.close(r),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var doReadv=(e,r,t,n)=>{for(var o=0,a=0;a>2],s=HEAPU32[r+4>>2];r+=8;var l=FS.read(e,HEAP8,i,s,n);if(l<0)return-1;if(o+=l,l>2]=a,0}catch(i){if(typeof FS>"u"||i.name!=="ErrnoError")throw i;return i.errno}}var convertI32PairToI53Checked=(e,r)=>(assert(e==e>>>0||e==(e|0)),assert(r===(r|0)),r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN);function _fd_seek(e,r,t,n,o){var a=convertI32PairToI53Checked(r,t);try{if(isNaN(a))return 61;var i=SYSCALLS.getStreamFromFD(e);return FS.llseek(i,a,n),tempI64=[i.position>>>0,(tempDouble=i.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[o>>2]=tempI64[0],HEAP32[o+4>>2]=tempI64[1],i.getdents&&a===0&&n===0&&(i.getdents=null),0}catch(s){if(typeof FS>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var doWritev=(e,r,t,n)=>{for(var o=0,a=0;a>2],s=HEAPU32[r+4>>2];r+=8;var l=FS.write(e,HEAP8,i,s,n);if(l<0)return-1;if(o+=l,l>2]=a,0}catch(i){if(typeof FS>"u"||i.name!=="ErrnoError")throw i;return i.errno}}var _getaddrinfo=(e,r,t,n)=>{var o=[],a=null,i=0,s=0,l=0,d=0,f=0,v=0,c,u;function m(p,_,g,w,E,S){var y,b,h,k;return b=p===10?28:16,E=p===10?inetNtop6(E):inetNtop4(E),y=_malloc(b),k=writeSockaddr(y,p,E,S),assert(!k),h=_malloc(32),HEAP32[h+4>>2]=p,HEAP32[h+8>>2]=_,HEAP32[h+12>>2]=g,HEAPU32[h+24>>2]=w,HEAPU32[h+20>>2]=y,p===10?HEAP32[h+16>>2]=28:HEAP32[h+16>>2]=16,HEAP32[h+28>>2]=0,h}if(t&&(l=HEAP32[t>>2],d=HEAP32[t+4>>2],f=HEAP32[t+8>>2],v=HEAP32[t+12>>2]),f&&!v&&(v=f===2?17:6),!f&&v&&(f=v===17?2:1),v===0&&(v=6),f===0&&(f=1),!e&&!r)return-2;if(l&-1088||t!==0&&HEAP32[t>>2]&2&&!e)return-1;if(l&32)return-2;if(f!==0&&f!==1&&f!==2)return-7;if(d!==0&&d!==2&&d!==10)return-6;if(r&&(r=UTF8ToString(r),s=parseInt(r,10),isNaN(s)))return l&1024?-2:-8;if(!e)return d===0&&(d=2),l&1||(d===2?i=_htonl(2130706433):i=[0,0,0,_htonl(1)]),c=m(d,f,v,null,i,s),HEAPU32[n>>2]=c,0;if(e=UTF8ToString(e),i=inetPton4(e),i!==null)if(d===0||d===2)d=2;else if(d===10&&l&8)i=[0,0,_htonl(65535),i],d=10;else return-2;else if(i=inetPton6(e),i!==null)if(d===0||d===10)d=10;else return-2;return i!=null?(c=m(d,f,v,e,i,s),HEAPU32[n>>2]=c,0):l&4?-2:(e=DNS.lookup_name(e),i=inetPton4(e),d===0?d=2:d===10&&(i=[0,0,_htonl(65535),i]),c=m(d,f,v,null,i,s),HEAPU32[n>>2]=c,0)},handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;checkStackCookie(),e instanceof WebAssembly.RuntimeError&&_emscripten_stack_get_current()<=0&&err("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 8388608)"),quit_(1,e)},stringToUTF8=(e,r,t)=>(assert(typeof t=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),stringToUTF8Array(e,HEAPU8,r,t)),stackAlloc=e=>__emscripten_stack_alloc(e),stringToUTF8OnStack=e=>{var r=lengthBytesUTF8(e)+1,t=stackAlloc(r);return stringToUTF8(e,t,r),t};FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit();function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings")}var wasmImports={__syscall_connect:___syscall_connect,__syscall_fcntl64:___syscall_fcntl64,__syscall_ioctl:___syscall_ioctl,__syscall_openat:___syscall_openat,__syscall_recvfrom:___syscall_recvfrom,__syscall_sendto:___syscall_sendto,__syscall_socket:___syscall_socket,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_resize_heap:_emscripten_resize_heap,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_read:_fd_read,fd_seek:_fd_seek,fd_write:_fd_write,getaddrinfo:_getaddrinfo},wasmExports;createWasm();var ___wasm_call_ctors=createExportWrapper("__wasm_call_ctors",0),_malloc=createExportWrapper("malloc",1),_main=Module._main=createExportWrapper("__main_argc_argv",2),_fflush=createExportWrapper("fflush",1),_htonl=createExportWrapper("htonl",1),_htons=createExportWrapper("htons",1),_ntohs=createExportWrapper("ntohs",1),_strerror=createExportWrapper("strerror",1),_emscripten_stack_init=()=>(_emscripten_stack_init=wasmExports.emscripten_stack_init)(),_emscripten_stack_get_free=()=>(_emscripten_stack_get_free=wasmExports.emscripten_stack_get_free)(),_emscripten_stack_get_base=()=>(_emscripten_stack_get_base=wasmExports.emscripten_stack_get_base)(),_emscripten_stack_get_end=()=>(_emscripten_stack_get_end=wasmExports.emscripten_stack_get_end)(),__emscripten_stack_restore=e=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),dynCall_jiji=Module.dynCall_jiji=createExportWrapper("dynCall_jiji",5);Module.callMain=callMain;var missingLibrarySymbols=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","getTempRet0","setTempRet0","emscriptenLog","readEmAsmArgs","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","HandleAllocator","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","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","safeSetTimeout","setImmediateWrapped","safeRequestAnimationFrame","clearImmediateWrapped","polyfillSetImmediate","registerPostMainLoop","registerPreMainLoop","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","Browser_asyncPrepareDataCounter","isLeapYear","ydayFromDate","arraySum","addDays","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","webgl_enable_EXT_polygon_offset_clamp","webgl_enable_EXT_clip_control","webgl_enable_WEBGL_polygon_mode","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace"];missingLibrarySymbols.forEach(missingLibrarySymbol);var unexportedSymbols=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","out","err","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","stackSave","stackRestore","stackAlloc","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","ERRNO_CODES","strError","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","Protocols","Sockets","timers","warnOnce","readEmAsmArgsArray","jstoi_q","jstoi_s","getExecutableName","handleException","keepRuntimeAlive","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToUTF8OnStack","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","doReadv","doWritev","initRandomFill","randomFill","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","getPreloadedImageData__data","wget","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","SYSCALLS","getSocketFromFD","getSocketAddress","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS_createPath","FS_createDevice","FS_readFile","FS","FS_createDataFile","FS_createLazyFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","print","printErr"];unexportedSymbols.forEach(unexportedRuntimeSymbol);var calledRun;dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)};function callMain(e=[]){assert(runDependencies==0,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'),assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");var r=_main;e.unshift(thisProgram);var t=e.length,n=stackAlloc((t+1)*4),o=n;e.forEach(i=>{HEAPU32[o>>2]=stringToUTF8OnStack(i),o+=4}),HEAPU32[o>>2]=0;try{var a=r(t,n);return exitJS(a,!0),a}catch(i){return handleException(i)}}function stackCheckInit(){_emscripten_stack_init(),writeStackCookie()}function run(e=arguments_){if(runDependencies>0||(stackCheckInit(),preRun(),runDependencies>0))return;function r(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),Module.onRuntimeInitialized?.(),shouldRunNow&&callMain(e),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),r()},1)):r(),checkStackCookie()}function checkUnflushedContent(){var e=out,r=err,t=!1;out=err=n=>{t=!0};try{_fflush(0),["stdout","stderr"].forEach(n=>{var o=FS.analyzePath("/dev/"+n);if(o){var a=o.object,i=a.rdev,s=TTY.ttys[i];s?.output?.length&&(t=!0)}})}catch{}out=e,err=r,t&&warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.")}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run(); +var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer",ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER,moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,r)=>{throw r},scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){if(typeof process>"u"||!process.release||process.release.name!=="node")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 nodeVersion=process.versions.node,numericVersion=nodeVersion.split(".").slice(0,3);numericVersion=numericVersion[0]*1e4+numericVersion[1]*100+numericVersion[2].split("-")[0]*1;var minVersion=16e4;if(numericVersion<16e4)throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+nodeVersion+")");var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=e=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e);return assert(Buffer.isBuffer(r)),r},readAsync=async(e,r=!0)=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e,r?void 0:"utf8");return assert(r?Buffer.isBuffer(t):typeof t=="string"),t},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(e,r)=>{throw process.exitCode=e,r}}else if(ENVIRONMENT_IS_SHELL){if(typeof process=="object"&&typeof require=="function"||typeof window=="object"||typeof WorkerGlobalScope<"u")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),!(typeof window=="object"||typeof WorkerGlobalScope<"u"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),readAsync=async e=>{if(isFileURI(e))return new Promise((t,n)=>{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=()=>{if(o.status==200||o.status==0&&o.response){t(o.response);return}n(o.status)},o.onerror=n,o.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)}}else throw new Error("environment detection error");var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,checkIncomingModuleAPI(),Module.arguments&&(arguments_=Module.arguments),legacyModuleProp("arguments","arguments_"),Module.thisProgram&&(thisProgram=Module.thisProgram),legacyModuleProp("thisProgram","thisProgram"),assert(typeof Module.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),assert(typeof Module.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),assert(typeof Module.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),assert(typeof Module.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),assert(typeof Module.read>"u","Module.read option was removed"),assert(typeof Module.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),assert(typeof Module.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),assert(typeof Module.setWindowTitle>"u","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),assert(typeof Module.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),legacyModuleProp("asm","wasmExports"),legacyModuleProp("readAsync","readAsync"),legacyModuleProp("readBinary","readBinary"),legacyModuleProp("setWindowTitle","setWindowTitle");var IDBFS="IDBFS is no longer included by default; build with -lidbfs.js",PROXYFS="PROXYFS is no longer included by default; build with -lproxyfs.js",WORKERFS="WORKERFS is no longer included by default; build with -lworkerfs.js",FETCHFS="FETCHFS is no longer included by default; build with -lfetchfs.js",ICASEFS="ICASEFS is no longer included by default; build with -licasefs.js",JSFILEFS="JSFILEFS is no longer included by default; build with -ljsfilefs.js",OPFS="OPFS is no longer included by default; build with -lopfs.js",NODEFS="NODEFS is no longer included by default; build with -lnodefs.js";assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var wasmBinary=Module.wasmBinary;legacyModuleProp("wasmBinary","wasmBinary"),typeof WebAssembly!="object"&&err("no native wasm support detected");var wasmMemory,ABORT=!1,EXITSTATUS;function assert(e,r){e||abort("Assertion failed"+(r?": "+r:""))}function _free(){abort("free() called but not included in the build - add `_free` to EXPORTED_FUNCTIONS")}var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}assert(!Module.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),assert(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support"),assert(!Module.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),assert(!Module.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function writeStackCookie(){var e=_emscripten_stack_get_end();assert((e&3)==0),e==0&&(e+=4),HEAPU32[e>>2]=34821223,HEAPU32[e+4>>2]=2310721022,HEAPU32[0]=1668509029}function checkStackCookie(){if(!ABORT){var e=_emscripten_stack_get_end();e==0&&(e+=4);var r=HEAPU32[e>>2],t=HEAPU32[e+4>>2];(r!=34821223||t!=2310721022)&&abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(t)} ${ptrToString(r)}`),HEAPU32[0]!=1668509029&&abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var __ATPRERUN__=[],__ATINIT__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){assert(!runtimeInitialized),runtimeInitialized=!0,checkStackCookie(),SOCKFS.root=FS.mount(SOCKFS,{},null),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,TTY.init(),callRuntimeCallbacks(__ATINIT__)}function postRun(){if(checkStackCookie(),Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnExit(e){}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(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 runDependencies=0,dependenciesFulfilled=null,runDependencyTracking={},runDependencyWatcher=null;function getUniqueRunDependency(e){for(var r=e;;){if(!runDependencyTracking[e])return e;e=r+Math.random()}}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies?.(runDependencies),e?(assert(!runDependencyTracking[e]),runDependencyTracking[e]=1,runDependencyWatcher===null&&typeof setInterval<"u"&&(runDependencyWatcher=setInterval(()=>{if(ABORT){clearInterval(runDependencyWatcher),runDependencyWatcher=null;return}var r=!1;for(var t in runDependencyTracking)r||(r=!0,err("still waiting on run dependencies:")),err(`dependency: ${t}`);r&&err("(end of list)")},1e4))):err("warning: run dependency added without ID")}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),e?(assert(runDependencyTracking[e]),delete runDependencyTracking[e]):err("warning: run dependency removed without ID"),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var r=dependenciesFulfilled;dependenciesFulfilled=null,r()}}function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0;var r=new WebAssembly.RuntimeError(e);throw r}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function createExportWrapper(e,r){return(...t)=>{assert(runtimeInitialized,`native function \`${e}\` called before runtime initialization`);var n=wasmExports[e];return assert(n,`exported native function \`${e}\` not found`),assert(t.length<=r,`native function \`${e}\` called with ${t.length} args but expects ${r}`),n(...t)}}function findWasmBinary(){var e="salam-wa.wasm";return isDataURI(e)?e:locateFile(e)}var wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(e){if(!wasmBinary)try{var r=await readAsync(e);return new Uint8Array(r)}catch{}return getBinarySync(e)}async function instantiateArrayBuffer(e,r){try{var t=await getWasmBinary(e),n=await WebAssembly.instantiate(t,r);return n}catch(o){err(`failed to asynchronously prepare wasm: ${o}`),isFileURI(wasmBinaryFile)&&err(`warning: Loading from a file URI (${wasmBinaryFile}) 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`),abort(o)}}async function instantiateAsync(e,r,t){if(!e&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(r)&&!isFileURI(r)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function")try{var n=fetch(r,{credentials:"same-origin"}),o=await WebAssembly.instantiateStreaming(n,t);return o}catch(a){err(`wasm streaming compile failed: ${a}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(r,t)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports}}async function createWasm(){function e(a,i){return wasmExports=a.exports,wasmMemory=wasmExports.memory,assert(wasmMemory,"memory not found in wasm exports"),updateMemoryViews(),addOnInit(wasmExports.__wasm_call_ctors),removeRunDependency("wasm-instantiate"),wasmExports}addRunDependency("wasm-instantiate");var r=Module;function t(a){assert(Module===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,e(a.instance)}var n=getWasmImports();if(Module.instantiateWasm)try{return Module.instantiateWasm(n,e)}catch(a){return err(`Module.instantiateWasm callback failed with error: ${a}`),!1}wasmBinaryFile??=findWasmBinary();var o=await instantiateAsync(wasmBinary,wasmBinaryFile,n);return t(o),o}var tempDouble,tempI64;if((()=>{var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,r[0]!==115||r[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})(),Module.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)");function legacyModuleProp(e,r,t=!0){Object.getOwnPropertyDescriptor(Module,e)||Object.defineProperty(Module,e,{configurable:!0,get(){let n=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)":"";abort(`\`Module.${e}\` has been replaced by \`${r}\``+n)}})}function ignoredModuleProp(e){Object.getOwnPropertyDescriptor(Module,e)&&abort(`\`Module.${e}\` was supplied but \`${e}\` not included in INCOMING_MODULE_JS_API`)}function isExportedByForceFilesystem(e){return e==="FS_createPath"||e==="FS_createDataFile"||e==="FS_createPreloadedFile"||e==="FS_unlink"||e==="addRunDependency"||e==="FS_createLazyFile"||e==="FS_createDevice"||e==="removeRunDependency"}function hookGlobalSymbolAccess(e,r){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,e)&&Object.defineProperty(globalThis,e,{configurable:!0,get(){r()}})}function missingGlobal(e,r){hookGlobalSymbolAccess(e,()=>{warnOnce(`\`${e}\` is not longer defined by emscripten. ${r}`)})}missingGlobal("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),missingGlobal("asm","Please use wasmExports instead");function missingLibrarySymbol(e){hookGlobalSymbolAccess(e,()=>{var r=`\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,t=e;t.startsWith("_")||(t="$"+e),r+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${t}')`,isExportedByForceFilesystem(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),warnOnce(r)}),unexportedRuntimeSymbol(e)}function unexportedRuntimeSymbol(e){Object.getOwnPropertyDescriptor(Module,e)||Object.defineProperty(Module,e,{configurable:!0,get(){var r=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;isExportedByForceFilesystem(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),abort(r)}})}function dbg(...e){console.warn(...e)}class ExitStatus{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)};function getValue(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return HEAP8[e];case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort(`invalid type for getValue: ${r}`)}}var noExitRuntime=Module.noExitRuntime||!0,ptrToString=e=>(assert(typeof e=="number"),e>>>=0,"0x"+e.toString(16).padStart(8,"0"));function setValue(e,r,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":HEAP8[e]=r;break;case"i8":HEAP8[e]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;case"*":HEAPU32[e>>2]=r;break;default:abort(`invalid type for setValue: ${t}`)}}var stackRestore=e=>__emscripten_stack_restore(e),stackSave=()=>_emscripten_stack_get_current(),warnOnce=e=>{warnOnce.shown||={},warnOnce.shown[e]||(warnOnce.shown[e]=1,ENVIRONMENT_IS_NODE&&(e="warning: "+e),err(e))},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return n=>crypto.getRandomValues(n);if(ENVIRONMENT_IS_NODE)try{var e=require("crypto"),r=e.randomFillSync;if(r)return n=>e.randomFillSync(n);var t=e.randomBytes;return n=>(n.set(t(n.byteLength)),n)}catch{}abort("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 } };")},randomFill=e=>(randomFill=initRandomFill())(e),PATH={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var 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=PATH.isAbs(e),t=e.substr(-1)==="/";return e=PATH.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=PATH.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"/";e=PATH.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>PATH.normalize(e.join("/")),join2:(e,r)=>PATH.normalize(e+"/"+r)},PATH_FS={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:FS.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=PATH.isAbs(o)}return r=PATH.normalizeArray(r.split("/").filter(a=>!!a),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=PATH_FS.resolve(e).substr(1),r=PATH_FS.resolve(r).substr(1);function t(d){for(var f=0;f=0&&d[v]==="";v--);return f>v?[]:d.slice(f,v-f+1)}for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(r,o));for(var a="";r>10,56320|d&1023)}}return a},FS_stdin_getChar_buffer=[],lengthBytesUTF8=e=>{for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r},stringToUTF8Array=(e,r,t,n)=>{if(assert(typeof e=="string",`stringToUTF8Array expects a string (got ${typeof e})`),!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(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|s&63}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|s&63}else{if(t+3>=a)break;s>1114111&&warnOnce("Invalid Unicode code point "+ptrToString(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|s&63}}return r[t]=0,t-o};function intArrayFromString(e,r,t){var n=t>0?t:lengthBytesUTF8(e)+1,o=new Array(n),a=stringToUTF8Array(e,o,0,o.length);return r&&(o.length=a),o}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if(ENVIRONMENT_IS_NODE){var r=256,t=Buffer.alloc(r),n=0,o=process.stdin.fd;try{n=fs.readSync(o,t,0,r)}catch(a){if(a.toString().includes("EOF"))n=0;else throw a}n>0&&(e=t.slice(0,n).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`\n`));if(!e)return null;FS_stdin_getChar_buffer=intArrayFromString(e,!0)}return FS_stdin_getChar_buffer.shift()},TTY={ttys:[],init(){},shutdown(){},register(e,r){TTY.ttys[e]={input:[],output:[],ops:r},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open(e){var r=TTY.ttys[e.node.rdev];if(!r)throw new FS.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 FS.ErrnoError(60);for(var a=0,i=0;i0&&(out(UTF8ArrayToString(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(err(UTF8ArrayToString(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output)),e.output=[])}}},zeroMemory=(e,r)=>{HEAPU8.fill(0,e,e+r)},alignMemory=(e,r)=>(assert(r,"alignment argument is required"),Math.ceil(e/r)*r),mmapAlloc=e=>{abort("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},MEMFS={ops_table:null,mount(e){return MEMFS.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(FS.isBlkdev(t)||FS.isFIFO(t))throw new FS.ErrnoError(63);MEMFS.ops_table||={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}};var o=FS.createNode(e,r,t,n);return FS.isDir(o.mode)?(o.node_ops=MEMFS.ops_table.dir.node,o.stream_ops=MEMFS.ops_table.dir.stream,o.contents={}):FS.isFile(o.mode)?(o.node_ops=MEMFS.ops_table.file.node,o.stream_ops=MEMFS.ops_table.file.stream,o.usedBytes=0,o.contents=null):FS.isLink(o.mode)?(o.node_ops=MEMFS.ops_table.link.node,o.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(o.mode)&&(o.node_ops=MEMFS.ops_table.chrdev.node,o.stream_ops=MEMFS.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),e&&(e.contents[r]=o,e.atime=e.mtime=e.ctime=o.atime),o},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t>>0),t!=0&&(r=Math.max(r,256));var o=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=FS.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,FS.isDir(e.mode)?r.size=4096:FS.isFile(e.mode)?r.size=e.usedBytes:FS.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])r[t]&&(e[t]=r[t]);r.size!==void 0&&MEMFS.resizeFileStorage(e,r.size)},lookup(e,r){throw new FS.ErrnoError(44)},mknod(e,r,t,n){return MEMFS.createNode(e,r,t,n)},rename(e,r,t){var n;try{n=FS.lookupNode(r,t)}catch{}if(n){if(FS.isDir(e.mode))for(var o in n.contents)throw new FS.ErrnoError(55);FS.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=FS.lookupNode(e,r);for(var n in t.contents)throw new FS.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,r,t){var n=MEMFS.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!FS.isLink(e.mode))throw new FS.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(assert(i>=0),i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r{var r=await readAsync(e);return assert(r,`Loading data file "${e}" failed (no arrayBuffer).`),new Uint8Array(r)},FS_createDataFile=(e,r,t,n,o,a)=>{FS.createDataFile(e,r,t,n,o,a)},preloadPlugins=Module.preloadPlugins||[],FS_handledByPreloadPlugin=(e,r,t,n)=>{typeof Browser<"u"&&Browser.init();var o=!1;return preloadPlugins.forEach(a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)}),o},FS_createPreloadedFile=(e,r,t,n,o,a,i,s,l,d)=>{var f=r?PATH_FS.resolve(PATH.join2(e,r)):e,v=getUniqueRunDependency(`cp ${f}`);function c(u){function m(p){d?.(),s||FS_createDataFile(e,r,p,n,o,l),a?.(),removeRunDependency(v)}FS_handledByPreloadPlugin(u,f,m,()=>{i?.(),removeRunDependency(v)})||m(u)}addRunDependency(v),typeof t=="string"?asyncLoad(t).then(c,i):c(t)},FS_modeStringToFlags=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},FS_getMode=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},UTF8ToString=(e,r)=>(assert(typeof e=="number",`UTF8ToString expects a number (got ${typeof e})`),e?UTF8ArrayToString(HEAPU8,e,r):""),strError=e=>UTF8ToString(_strerror(e)),ERRNO_CODES={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},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class extends Error{name="ErrnoError";constructor(e){super(runtimeInitialized?strError(e):""),this.errno=e;for(var r in ERRNO_CODES)if(ERRNO_CODES[r]===e){this.code=r;break}}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=FS.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)return{path:"",node:null};r.follow_mount??=!0,PATH.isAbs(e)||(e=FS.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter(d=>!!d&&d!=="."),o=FS.root,a="/",i=0;i>>0)%FS.nameTable.length},hashAddNode(e){var r=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[r],FS.nameTable[r]=e},hashRemoveNode(e){var r=FS.hashName(e.parent.id,e.name);if(FS.nameTable[r]===e)FS.nameTable[r]=e.name_next;else for(var t=FS.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=FS.mayLookup(e);if(t)throw new FS.ErrnoError(t);for(var n=FS.hashName(e.id,r),o=FS.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return FS.lookup(e,r)},createNode(e,r,t,n){assert(typeof e=="object");var o=new FS.FSNode(e,r,t,n);return FS.hashAddNode(o),o},destroyNode(e){FS.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return FS.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!FS.isDir(e.mode))return 54;var r=FS.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!FS.isDir(e.mode))return 54;try{var t=FS.lookupNode(e,r);return 20}catch{}return FS.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=FS.lookupNode(e,r)}catch(a){return a.errno}var o=FS.nodePermissions(e,"wx");if(o)return o;if(t){if(!FS.isDir(n.mode))return 54;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return 10}else if(FS.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&(FS.flagsToPermissionString(r)!=="r"||r&512)?31:FS.nodePermissions(e,FS.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=FS.MAX_OPEN_FDS;e++)if(!FS.streams[e])return e;throw new FS.ErrnoError(33)},getStreamChecked(e){var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(8);return r},getStream:e=>FS.streams[e],createStream(e,r=-1){return assert(r>=-1),e=Object.assign(new FS.FSStream,e),r==-1&&(r=FS.nextfd()),e.fd=r,FS.streams[r]=e,e},closeStream(e){FS.streams[e]=null},dupStream(e,r=-1){var t=FS.createStream(e,r);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(e){var r=FS.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){FS.devices[e]={stream_ops:r}},getDevice:e=>FS.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=FS.getMounts(FS.root.mount),n=0;function o(i){return assert(FS.syncFSRequests>0),FS.syncFSRequests--,r(i)}function a(i){if(i)return a.errored?void 0:(a.errored=!0,o(i));++n>=t.length&&o(null)}t.forEach(i=>{if(!i.type.syncfs)return a(null);i.type.syncfs(i,e,a)})},mount(e,r,t){if(typeof e=="string")throw e;var n=t==="/",o=!t,a;if(n&&FS.root)throw new FS.ErrnoError(10);if(!n&&!o){var i=FS.lookupPath(t,{follow_mount:!1});if(t=i.path,a=i.node,FS.isMountpoint(a))throw new FS.ErrnoError(10);if(!FS.isDir(a.mode))throw new FS.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,n?FS.root=l:a&&(a.mounted=s,a.mount&&a.mount.mounts.push(s)),l},unmount(e){var r=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(r.node))throw new FS.ErrnoError(28);var t=r.node,n=t.mounted,o=FS.getMounts(n);Object.keys(FS.nameTable).forEach(i=>{for(var s=FS.nameTable[i];s;){var l=s.name_next;o.includes(s.mount)&&FS.destroyNode(s),s=l}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);assert(a!==-1),t.mount.mounts.splice(a,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=FS.lookupPath(e,{parent:!0}),o=n.node,a=PATH.basename(e);if(!a||a==="."||a==="..")throw new FS.ErrnoError(28);var i=FS.mayCreate(o,a);if(i)throw new FS.ErrnoError(i);if(!o.node_ops.mknod)throw new FS.ErrnoError(63);return o.node_ops.mknod(o,a,r,t)},statfs(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:FS.nextInode,ffree:FS.nextInode-1,fsid:42,flags:2,namelen:255},t=FS.lookupPath(e,{follow:!0}).node;return t?.node_ops.statfs&&Object.assign(r,t.node_ops.statfs(t.mount.opts.root)),r},create(e,r=438){return r&=4095,r|=32768,FS.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,FS.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o"u"&&(t=r,r=438),r|=8192,FS.mknod(e,r,t)},symlink(e,r){if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var t=FS.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new FS.ErrnoError(44);var o=PATH.basename(r),a=FS.mayCreate(n,o);if(a)throw new FS.ErrnoError(a);if(!n.node_ops.symlink)throw new FS.ErrnoError(63);return n.node_ops.symlink(n,o,e)},rename(e,r){var t=PATH.dirname(e),n=PATH.dirname(r),o=PATH.basename(e),a=PATH.basename(r),i,s,l;if(i=FS.lookupPath(e,{parent:!0}),s=i.node,i=FS.lookupPath(r,{parent:!0}),l=i.node,!s||!l)throw new FS.ErrnoError(44);if(s.mount!==l.mount)throw new FS.ErrnoError(75);var d=FS.lookupNode(s,o),f=PATH_FS.relative(e,n);if(f.charAt(0)!==".")throw new FS.ErrnoError(28);if(f=PATH_FS.relative(r,t),f.charAt(0)!==".")throw new FS.ErrnoError(55);var v;try{v=FS.lookupNode(l,a)}catch{}if(d!==v){var c=FS.isDir(d.mode),u=FS.mayDelete(s,o,c);if(u)throw new FS.ErrnoError(u);if(u=v?FS.mayDelete(l,a,c):FS.mayCreate(l,a),u)throw new FS.ErrnoError(u);if(!s.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(d)||v&&FS.isMountpoint(v))throw new FS.ErrnoError(10);if(l!==s&&(u=FS.nodePermissions(s,"w"),u))throw new FS.ErrnoError(u);FS.hashRemoveNode(d);try{s.node_ops.rename(d,l,a),d.parent=l}catch(m){throw m}finally{FS.hashAddNode(d)}}},rmdir(e){var r=FS.lookupPath(e,{parent:!0}),t=r.node,n=PATH.basename(e),o=FS.lookupNode(t,n),a=FS.mayDelete(t,n,!0);if(a)throw new FS.ErrnoError(a);if(!t.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(o))throw new FS.ErrnoError(10);t.node_ops.rmdir(t,n),FS.destroyNode(o)},readdir(e){var r=FS.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new FS.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=FS.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new FS.ErrnoError(44);var n=PATH.basename(e),o=FS.lookupNode(t,n),a=FS.mayDelete(t,n,!1);if(a)throw new FS.ErrnoError(a);if(!t.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(o))throw new FS.ErrnoError(10);t.node_ops.unlink(t,n),FS.destroyNode(o)},readlink(e){var r=FS.lookupPath(e),t=r.node;if(!t)throw new FS.ErrnoError(44);if(!t.node_ops.readlink)throw new FS.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r){var t=FS.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new FS.ErrnoError(44);if(!n.node_ops.getattr)throw new FS.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return FS.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var o=FS.lookupPath(e,{follow:!t});n=o.node}else n=e;if(!n.node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,ctime:Date.now()})},lchmod(e,r){FS.chmod(e,r,!0)},fchmod(e,r){var t=FS.getStreamChecked(e);FS.chmod(t.node,r)},chown(e,r,t,n){var o;if(typeof e=="string"){var a=FS.lookupPath(e,{follow:!n});o=a.node}else o=e;if(!o.node_ops.setattr)throw new FS.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){FS.chown(e,r,t,!0)},fchown(e,r,t){var n=FS.getStreamChecked(e);FS.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new FS.ErrnoError(28);var t;if(typeof e=="string"){var n=FS.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(t.mode))throw new FS.ErrnoError(31);if(!FS.isFile(t.mode))throw new FS.ErrnoError(28);var o=FS.nodePermissions(t,"w");if(o)throw new FS.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=FS.getStreamChecked(e);if(!(t.flags&2097155))throw new FS.ErrnoError(28);FS.truncate(t.node,r)},utime(e,r,t){var n=FS.lookupPath(e,{follow:!0}),o=n.node;o.node_ops.setattr(o,{atime:r,mtime:t})},open(e,r,t=438){if(e==="")throw new FS.ErrnoError(44);r=typeof r=="string"?FS_modeStringToFlags(r):r,r&64?t=t&4095|32768:t=0;var n;if(typeof e=="object")n=e;else{var o=FS.lookupPath(e,{follow:!(r&131072),noent_okay:!0});n=o.node,e=o.path}var a=!1;if(r&64)if(n){if(r&128)throw new FS.ErrnoError(20)}else n=FS.mknod(e,t,0),a=!0;if(!n)throw new FS.ErrnoError(44);if(FS.isChrdev(n.mode)&&(r&=-513),r&65536&&!FS.isDir(n.mode))throw new FS.ErrnoError(54);if(!a){var i=FS.mayOpen(n,r);if(i)throw new FS.ErrnoError(i)}r&512&&!a&&FS.truncate(n,0),r&=-131713;var s=FS.createStream({node:n,path:FS.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),Module.logReadFiles&&!(r&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),s},close(e){if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{FS.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(assert(t>=0),n<0||o<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if((e.flags&2097155)===1)throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var a=typeof o<"u";if(!a)o=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);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(assert(t>=0),n<0||o<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&e.flags&1024&&FS.llseek(e,0,2);var i=typeof o<"u";if(!i)o=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(r<0||t<=0)throw new FS.ErrnoError(28);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(n&2&&!(o&2)&&(e.flags&2097155)!==2)throw new FS.ErrnoError(2);if((e.flags&2097155)===1)throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);if(!r)throw new FS.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,o)},msync(e,r,t,n,o){return assert(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=FS.open(e,r.flags),o=FS.stat(e),a=o.size,i=new Uint8Array(a);return FS.read(n,i,0,a,0),r.encoding==="utf8"?t=UTF8ArrayToString(i):r.encoding==="binary"&&(t=i),FS.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=FS.open(e,t.flags,t.mode);if(typeof r=="string"){var o=new Uint8Array(lengthBytesUTF8(r)+1),a=stringToUTF8Array(r,o,0,o.length);FS.write(n,o,0,a,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))FS.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");FS.close(n)},cwd:()=>FS.currentPath,chdir(e){var r=FS.lookupPath(e,{follow:!0});if(r.node===null)throw new FS.ErrnoError(44);if(!FS.isDir(r.node.mode))throw new FS.ErrnoError(54);var t=FS.nodePermissions(r.node,"x");if(t)throw new FS.ErrnoError(t);FS.currentPath=r.path},createDefaultDirectories(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(n,o,a,i,s)=>i,llseek:()=>0}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=randomFill(e).byteLength),e[--r]);FS.createDevice("/dev","random",t),FS.createDevice("/dev","urandom",t),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var r=FS.createNode(e,"fd",16895,73);return r.stream_ops={llseek:MEMFS.stream_ops.llseek},r.node_ops={lookup(t,n){var o=+n,a=FS.getStreamChecked(o),i={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path},id:o+1};return i.parent=i,i},readdir(){return Array.from(FS.streams.entries()).filter(([t,n])=>n).map(([t,n])=>t.toString())}},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?FS.createDevice("/dev","stdin",e):FS.symlink("/dev/tty","/dev/stdin"),r?FS.createDevice("/dev","stdout",null,r):FS.symlink("/dev/tty","/dev/stdout"),t?FS.createDevice("/dev","stderr",null,t):FS.symlink("/dev/tty1","/dev/stderr");var n=FS.open("/dev/stdin",0),o=FS.open("/dev/stdout",1),a=FS.open("/dev/stderr",1);assert(n.fd===0,`invalid handle for stdin (${n.fd})`),assert(o.fd===1,`invalid handle for stdout (${o.fd})`),assert(a.fd===2,`invalid handle for stderr (${a.fd})`)},staticInit(){FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},init(e,r,t){assert(!FS.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)"),FS.initialized=!0,e??=Module.stdin,r??=Module.stdout,t??=Module.stderr,FS.createStandardStreams(e,r,t)},quit(){FS.initialized=!1,_fflush(0);for(var e=0;ethis.length-1||u<0)){var m=u%this.chunkSize,p=u/this.chunkSize|0;return this.getter(p)[m]}}setDataGetter(u){this.getter=u}cacheLength(){var u=new XMLHttpRequest;if(u.open("HEAD",t,!1),u.send(null),!(u.status>=200&&u.status<300||u.status===304))throw new Error("Couldn't load "+t+". Status: "+u.status);var m=Number(u.getResponseHeader("Content-length")),p,_=(p=u.getResponseHeader("Accept-Ranges"))&&p==="bytes",g=(p=u.getResponseHeader("Content-Encoding"))&&p==="gzip",w=1024*1024;_||(w=m);var E=(y,b)=>{if(y>b)throw new Error("invalid range ("+y+", "+b+") or no bytes requested!");if(b>m-1)throw new Error("only "+m+" bytes available! programmer error!");var h=new XMLHttpRequest;if(h.open("GET",t,!1),m!==w&&h.setRequestHeader("Range","bytes="+y+"-"+b),h.responseType="arraybuffer",h.overrideMimeType&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send(null),!(h.status>=200&&h.status<300||h.status===304))throw new Error("Couldn't load "+t+". Status: "+h.status);return h.response!==void 0?new Uint8Array(h.response||[]):intArrayFromString(h.responseText||"",!0)},S=this;S.setDataGetter(y=>{var b=y*w,h=(y+1)*w-1;if(h=Math.min(h,m-1),typeof S.chunks[y]>"u"&&(S.chunks[y]=E(b,h)),typeof S.chunks[y]>"u")throw new Error("doXHR failed!");return S.chunks[y]}),(g||!m)&&(w=m=1,m=this.getter(0).length,w=m,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=m,this._chunkSize=w,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a,s={isDevice:!1,contents:i}}else var s={isDevice:!1,url:t};var l=FS.createFile(e,r,s,n,o);s.contents?l.contents=s.contents:s.url&&(l.contents=null,l.url=s.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var d={},f=Object.keys(l.stream_ops);f.forEach(c=>{var u=l.stream_ops[c];d[c]=(...m)=>(FS.forceLoadFile(l),u(...m))});function v(c,u,m,p,_){var g=c.node.contents;if(_>=g.length)return 0;var w=Math.min(g.length-_,p);if(assert(w>=0),g.slice)for(var E=0;E(FS.forceLoadFile(l),v(c,u,m,p,_)),d.mmap=(c,u,m,p,_)=>{FS.forceLoadFile(l);var g=mmapAlloc(u);if(!g)throw new FS.ErrnoError(48);return v(c,HEAP8,g,u,m),{ptr:g,allocated:!0}},l.stream_ops=d,l},absolutePath(){abort("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){abort("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){abort("FS.createLink has been removed; use FS.symlink instead")},joinPath(){abort("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){abort("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){abort("FS.standardizePath has been removed; use PATH.normalize instead")}},SOCKFS={websocketArgs:{},callbacks:{},on(e,r){SOCKFS.callbacks[e]=r},emit(e,r){SOCKFS.callbacks[e]?.(r)},mount(e){return SOCKFS.websocketArgs=Module.websocket||{},(Module.websocket??={}).on=SOCKFS.on,FS.createNode(null,"/",16895,0)},createSocket(e,r,t){r&=-526337;var n=r==1;if(n&&t&&t!=6)throw new FS.ErrnoError(66);var o={family:e,type:r,protocol:t,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops},a=SOCKFS.nextname(),i=FS.createNode(SOCKFS.root,a,49152,0);i.sock=o;var s=FS.createStream({path:a,node:i,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return o.stream=s,o},getSocket(e){var r=FS.getStream(e);return!r||!FS.isSocket(r.node.mode)?null:r.node.sock},stream_ops:{poll(e){var r=e.node.sock;return r.sock_ops.poll(r)},ioctl(e,r,t){var n=e.node.sock;return n.sock_ops.ioctl(n,r,t)},read(e,r,t,n,o){var a=e.node.sock,i=a.sock_ops.recvmsg(a,n);return i?(r.set(i.buffer,t),i.buffer.length):0},write(e,r,t,n,o){var a=e.node.sock;return a.sock_ops.sendmsg(a,r,t,n)},close(e){var r=e.node.sock;r.sock_ops.close(r)}},nextname(){return SOCKFS.nextname.current||(SOCKFS.nextname.current=0),`socket[${SOCKFS.nextname.current++}]`},websocket_sock_ops:{createPeer(e,r,t){var n;if(typeof r=="object"&&(n=r,r=null,t=null),n)if(n._socket)r=n._socket.remoteAddress,t=n._socket.remotePort;else{var o=/ws[s]?:\/\/([^:]+):(\d+)/.exec(n.url);if(!o)throw new Error("WebSocket URL must be in the format ws(s)://address:port");r=o[1],t=parseInt(o[2],10)}else try{var a="ws:#".replace("#","//"),i="binary",s=void 0;if(SOCKFS.websocketArgs.url&&(a=SOCKFS.websocketArgs.url),SOCKFS.websocketArgs.subprotocol?i=SOCKFS.websocketArgs.subprotocol:SOCKFS.websocketArgs.subprotocol===null&&(i="null"),a==="ws://"||a==="wss://"){var l=r.split("/");a=a+l[0]+":"+t+"/"+l.slice(1).join("/")}i!=="null"&&(i=i.replace(/^ +| +$/g,"").split(/ *, */),s=i);var d;ENVIRONMENT_IS_NODE?d=require("ws"):d=WebSocket,n=new d(a,s),n.binaryType="arraybuffer"}catch{throw new FS.ErrnoError(23)}var f={addr:r,port:t,socket:n,msg_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,f),SOCKFS.websocket_sock_ops.handlePeerEvents(e,f),e.type===2&&typeof e.sport<"u"&&f.msg_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),f},getPeer(e,r,t){return e.peers[r+":"+t]},addPeer(e,r){e.peers[r.addr+":"+r.port]=r},removePeer(e,r){delete e.peers[r.addr+":"+r.port]},handlePeerEvents(e,r){var t=!0,n=function(){e.connecting=!1,SOCKFS.emit("open",e.stream.fd);try{for(var a=r.msg_send_queue.shift();a;)r.socket.send(a),a=r.msg_send_queue.shift()}catch{r.socket.close()}};function o(a){if(typeof a=="string"){var i=new TextEncoder;a=i.encode(a)}else{if(assert(a.byteLength!==void 0),a.byteLength==0)return;a=new Uint8Array(a)}var s=t;if(t=!1,s&&a.length===10&&a[0]===255&&a[1]===255&&a[2]===255&&a[3]===255&&a[4]===112&&a[5]===111&&a[6]===114&&a[7]===116){var l=a[8]<<8|a[9];SOCKFS.websocket_sock_ops.removePeer(e,r),r.port=l,SOCKFS.websocket_sock_ops.addPeer(e,r);return}e.recv_queue.push({addr:r.addr,port:r.port,data:a}),SOCKFS.emit("message",e.stream.fd)}ENVIRONMENT_IS_NODE?(r.socket.on("open",n),r.socket.on("message",function(a,i){i&&o(new Uint8Array(a).buffer)}),r.socket.on("close",function(){SOCKFS.emit("close",e.stream.fd)}),r.socket.on("error",function(a){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(r.socket.onopen=n,r.socket.onclose=function(){SOCKFS.emit("close",e.stream.fd)},r.socket.onmessage=function(i){o(i.data)},r.socket.onerror=function(a){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})},poll(e){if(e.type===1&&e.server)return e.pending.length?65:0;var r=0,t=e.type===1?SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport):null;return(e.recv_queue.length||!t||t&&t.socket.readyState===t.socket.CLOSING||t&&t.socket.readyState===t.socket.CLOSED)&&(r|=65),(!t||t&&t.socket.readyState===t.socket.OPEN)&&(r|=4),(t&&t.socket.readyState===t.socket.CLOSING||t&&t.socket.readyState===t.socket.CLOSED)&&(e.connecting?r|=4:r|=16),r},ioctl(e,r,t){switch(r){case 21531:var n=0;return e.recv_queue.length&&(n=e.recv_queue[0].data.length),HEAP32[t>>2]=n,0;default:return 28}},close(e){if(e.server){try{e.server.close()}catch{}e.server=null}for(var r=Object.keys(e.peers),t=0;t{var r=SOCKFS.getSocket(e);if(!r)throw new FS.ErrnoError(8);return r},Sockets={BUFFER_SIZE:10240,MAX_BUFFER_SIZE:10485760,nextFd:1,fds:{},nextport:1,maxport:65535,peer:null,connections:{},portmap:{},localAddr:4261412874,addrPool:[33554442,50331658,67108874,83886090,100663306,117440522,134217738,150994954,167772170,184549386,201326602,218103818,234881034]},inetNtop4=e=>(e&255)+"."+(e>>8&255)+"."+(e>>16&255)+"."+(e>>24&255),inetNtop6=e=>{var r="",t=0,n=0,o=0,a=0,i=0,s=0,l=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],d=!0,f="";for(s=0;s<5;s++)if(l[s]!==0){d=!1;break}if(d){if(f=inetNtop4(l[6]|l[7]<<16),l[5]===-1)return r="::ffff:",r+=f,r;if(l[5]===0)return r="::",f==="0.0.0.0"&&(f=""),f==="0.0.0.1"&&(f="1"),r+=f,r}for(t=0;t<8;t++)l[t]===0&&(t-o>1&&(i=0),o=t,i++),i>n&&(n=i,a=t-n+1);for(t=0;t<8;t++){if(n>1&&l[t]===0&&t>=a&&t{var t=HEAP16[e>>1],n=_ntohs(HEAPU16[e+2>>1]),o;switch(t){case 2:if(r!==16)return{errno:28};o=HEAP32[e+4>>2],o=inetNtop4(o);break;case 10:if(r!==28)return{errno:28};o=[HEAP32[e+8>>2],HEAP32[e+12>>2],HEAP32[e+16>>2],HEAP32[e+20>>2]],o=inetNtop6(o);break;default:return{errno:5}}return{family:t,addr:o,port:n}},inetPton4=e=>{for(var r=e.split("."),t=0;t<4;t++){var n=Number(r[t]);if(isNaN(n))return null;r[t]=n}return(r[0]|r[1]<<8|r[2]<<16|r[3]<<24)>>>0},jstoi_q=e=>parseInt(e),inetPton6=e=>{var r,t,n,o,a,i=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,s=[];if(!i.test(e))return null;if(e==="::")return[0,0,0,0,0,0,0,0];for(e.startsWith("::")?e=e.replace("::","Z:"):e=e.replace("::",":Z:"),e.indexOf(".")>0?(e=e.replace(new RegExp("[.]","g"),":"),r=e.split(":"),r[r.length-4]=jstoi_q(r[r.length-4])+jstoi_q(r[r.length-3])*256,r[r.length-3]=jstoi_q(r[r.length-2])+jstoi_q(r[r.length-1])*256,r=r.slice(0,r.length-2)):r=e.split(":"),n=0,o=0,t=0;t{var t=readSockaddr(e,r);if(t.errno)throw new FS.ErrnoError(t.errno);return t.addr=DNS.lookup_addr(t.addr)||t.addr,t};function ___syscall_connect(e,r,t,n,o,a){try{var i=getSocketFromFD(e),s=getSocketAddress(r,t);return i.sock_ops.connect(i,s.addr,s.port),0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}var syscallGetVarargI=()=>{assert(SYSCALLS.varargs!=null);var e=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,e},syscallGetVarargP=syscallGetVarargI,SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(PATH.isAbs(r))return r;var n;if(e===-100)n=FS.cwd();else{var o=SYSCALLS.getStreamFromFD(e);n=o.path}if(r.length==0){if(!t)throw new FS.ErrnoError(44);return n}return n+"/"+r},doStat(e,r,t){var n=e(r);HEAP32[t>>2]=n.dev,HEAP32[t+4>>2]=n.mode,HEAPU32[t+8>>2]=n.nlink,HEAP32[t+12>>2]=n.uid,HEAP32[t+16>>2]=n.gid,HEAP32[t+20>>2]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+24>>2]=tempI64[0],HEAP32[t+28>>2]=tempI64[1],HEAP32[t+32>>2]=4096,HEAP32[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return tempI64=[Math.floor(o/1e3)>>>0,(tempDouble=Math.floor(o/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+40>>2]=tempI64[0],HEAP32[t+44>>2]=tempI64[1],HEAPU32[t+48>>2]=o%1e3*1e3*1e3,tempI64=[Math.floor(a/1e3)>>>0,(tempDouble=Math.floor(a/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+56>>2]=tempI64[0],HEAP32[t+60>>2]=tempI64[1],HEAPU32[t+64>>2]=a%1e3*1e3*1e3,tempI64=[Math.floor(i/1e3)>>>0,(tempDouble=Math.floor(i/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+72>>2]=tempI64[0],HEAP32[t+76>>2]=tempI64[1],HEAPU32[t+80>>2]=i%1e3*1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+88>>2]=tempI64[0],HEAP32[t+92>>2]=tempI64[1],0},doMsync(e,r,t,n,o){if(!FS.isFile(r.node.mode))throw new FS.ErrnoError(43);if(n&2)return 0;var a=HEAPU8.slice(e,e+t);FS.msync(r,a,o,t,n)},getStreamFromFD(e){var r=FS.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=UTF8ToString(e);return r}};function ___syscall_fcntl64(e,r,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD(e);switch(r){case 0:{var o=syscallGetVarargI();if(o<0)return-28;for(;FS.streams[o];)o++;var a;return a=FS.dupStream(n,o),a.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var o=syscallGetVarargI();return n.flags|=o,0}case 12:{var o=syscallGetVarargP(),i=0;return HEAP16[o+i>>1]=2,0}case 13:case 14:return 0}return-28}catch(s){if(typeof FS>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function ___syscall_ioctl(e,r,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=syscallGetVarargP();HEAP32[a>>2]=o.c_iflag||0,HEAP32[a+4>>2]=o.c_oflag||0,HEAP32[a+8>>2]=o.c_cflag||0,HEAP32[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)HEAP8[a+i+17]=o.c_cc[i]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var a=syscallGetVarargP(),s=HEAP32[a>>2],l=HEAP32[a+4>>2],d=HEAP32[a+8>>2],f=HEAP32[a+12>>2],v=[],i=0;i<32;i++)v.push(HEAP8[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:l,c_cflag:d,c_lflag:f,c_cc:v})}return 0}case 21519:{if(!n.tty)return-59;var a=syscallGetVarargP();return HEAP32[a>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var a=syscallGetVarargP();return FS.ioctl(n,r,a)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var c=n.tty.ops.ioctl_tiocgwinsz(n.tty),a=syscallGetVarargP();HEAP16[a>>1]=c[0],HEAP16[a+2>>1]=c[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function ___syscall_openat(e,r,t,n){SYSCALLS.varargs=n;try{r=SYSCALLS.getStr(r),r=SYSCALLS.calculateAt(e,r);var o=n?syscallGetVarargI():0;return FS.open(r,t,o).fd}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}var writeSockaddr=(e,r,t,n,o)=>{switch(r){case 2:t=inetPton4(t),zeroMemory(e,16),o&&(HEAP32[o>>2]=16),HEAP16[e>>1]=r,HEAP32[e+4>>2]=t,HEAP16[e+2>>1]=_htons(n);break;case 10:t=inetPton6(t),zeroMemory(e,28),o&&(HEAP32[o>>2]=28),HEAP32[e>>2]=r,HEAP32[e+8>>2]=t[0],HEAP32[e+12>>2]=t[1],HEAP32[e+16>>2]=t[2],HEAP32[e+20>>2]=t[3],HEAP16[e+2>>1]=_htons(n);break;default:return 5}return 0};function ___syscall_recvfrom(e,r,t,n,o,a){try{var i=getSocketFromFD(e),s=i.sock_ops.recvmsg(i,t);if(!s)return 0;if(o){var l=writeSockaddr(o,i.family,DNS.lookup_name(s.addr),s.port,a);assert(!l)}return HEAPU8.set(s.buffer,r),s.buffer.byteLength}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}function ___syscall_sendto(e,r,t,n,o,a){try{var i=getSocketFromFD(e);if(!o)return FS.write(i.stream,HEAP8,r,t);var s=getSocketAddress(o,a);return i.sock_ops.sendmsg(i,HEAP8,r,t,s.addr,s.port)}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}function ___syscall_socket(e,r,t){try{var n=SOCKFS.createSocket(e,r,t);return assert(n.stream.fd<64),n.stream.fd}catch(o){if(typeof FS>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}var __emscripten_memcpy_js=(e,r,t)=>HEAPU8.copyWithin(e,r,r+t),getHeapMax=()=>2147483648,growMemory=e=>{var r=wasmMemory.buffer,t=(e-r.byteLength+65535)/65536|0;try{return wasmMemory.grow(t),updateMemoryViews(),1}catch(n){err(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},_emscripten_resize_heap=e=>{var r=HEAPU8.length;e>>>=0,assert(e>r);var t=getHeapMax();if(e>t)return err(`Cannot enlarge memory, requested ${e} bytes, but the limit is ${t} bytes!`),!1;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var a=Math.min(t,alignMemory(Math.max(e,o),65536)),i=growMemory(a);if(i)return!0}return err(`Failed to grow the heap from ${r} bytes to ${a} bytes, not enough memory!`),!1},ENV={},getExecutableName=()=>thisProgram||"./this.program",getEnvStrings=()=>{if(!getEnvStrings.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:getExecutableName()};for(var t in ENV)ENV[t]===void 0?delete r[t]:r[t]=ENV[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);getEnvStrings.strings=n}return getEnvStrings.strings},stringToAscii=(e,r)=>{for(var t=0;t{var t=0;return getEnvStrings().forEach((n,o)=>{var a=r+t;HEAPU32[e+o*4>>2]=a,stringToAscii(n,a),t+=n.length+1}),0},_environ_sizes_get=(e,r)=>{var t=getEnvStrings();HEAPU32[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),HEAPU32[r>>2]=n,0},runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},exitJS=(e,r)=>{if(EXITSTATUS=e,checkUnflushedContent(),keepRuntimeAlive()&&!r){var t=`program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${runtimeKeepaliveCounter}) 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)`;err(t)}_proc_exit(e)},_exit=exitJS;function _fd_close(e){try{var r=SYSCALLS.getStreamFromFD(e);return FS.close(r),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var doReadv=(e,r,t,n)=>{for(var o=0,a=0;a>2],s=HEAPU32[r+4>>2];r+=8;var l=FS.read(e,HEAP8,i,s,n);if(l<0)return-1;if(o+=l,l>2]=a,0}catch(i){if(typeof FS>"u"||i.name!=="ErrnoError")throw i;return i.errno}}var convertI32PairToI53Checked=(e,r)=>(assert(e==e>>>0||e==(e|0)),assert(r===(r|0)),r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN);function _fd_seek(e,r,t,n,o){var a=convertI32PairToI53Checked(r,t);try{if(isNaN(a))return 61;var i=SYSCALLS.getStreamFromFD(e);return FS.llseek(i,a,n),tempI64=[i.position>>>0,(tempDouble=i.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[o>>2]=tempI64[0],HEAP32[o+4>>2]=tempI64[1],i.getdents&&a===0&&n===0&&(i.getdents=null),0}catch(s){if(typeof FS>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var doWritev=(e,r,t,n)=>{for(var o=0,a=0;a>2],s=HEAPU32[r+4>>2];r+=8;var l=FS.write(e,HEAP8,i,s,n);if(l<0)return-1;if(o+=l,l>2]=a,0}catch(i){if(typeof FS>"u"||i.name!=="ErrnoError")throw i;return i.errno}}var _getaddrinfo=(e,r,t,n)=>{var o=[],a=null,i=0,s=0,l=0,d=0,f=0,v=0,c,u;function m(p,_,g,w,E,S){var y,b,h,k;return b=p===10?28:16,E=p===10?inetNtop6(E):inetNtop4(E),y=_malloc(b),k=writeSockaddr(y,p,E,S),assert(!k),h=_malloc(32),HEAP32[h+4>>2]=p,HEAP32[h+8>>2]=_,HEAP32[h+12>>2]=g,HEAPU32[h+24>>2]=w,HEAPU32[h+20>>2]=y,p===10?HEAP32[h+16>>2]=28:HEAP32[h+16>>2]=16,HEAP32[h+28>>2]=0,h}if(t&&(l=HEAP32[t>>2],d=HEAP32[t+4>>2],f=HEAP32[t+8>>2],v=HEAP32[t+12>>2]),f&&!v&&(v=f===2?17:6),!f&&v&&(f=v===17?2:1),v===0&&(v=6),f===0&&(f=1),!e&&!r)return-2;if(l&-1088||t!==0&&HEAP32[t>>2]&2&&!e)return-1;if(l&32)return-2;if(f!==0&&f!==1&&f!==2)return-7;if(d!==0&&d!==2&&d!==10)return-6;if(r&&(r=UTF8ToString(r),s=parseInt(r,10),isNaN(s)))return l&1024?-2:-8;if(!e)return d===0&&(d=2),l&1||(d===2?i=_htonl(2130706433):i=[0,0,0,_htonl(1)]),c=m(d,f,v,null,i,s),HEAPU32[n>>2]=c,0;if(e=UTF8ToString(e),i=inetPton4(e),i!==null)if(d===0||d===2)d=2;else if(d===10&&l&8)i=[0,0,_htonl(65535),i],d=10;else return-2;else if(i=inetPton6(e),i!==null)if(d===0||d===10)d=10;else return-2;return i!=null?(c=m(d,f,v,e,i,s),HEAPU32[n>>2]=c,0):l&4?-2:(e=DNS.lookup_name(e),i=inetPton4(e),d===0?d=2:d===10&&(i=[0,0,_htonl(65535),i]),c=m(d,f,v,null,i,s),HEAPU32[n>>2]=c,0)},stringToUTF8=(e,r,t)=>(assert(typeof t=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),stringToUTF8Array(e,HEAPU8,r,t)),stackAlloc=e=>__emscripten_stack_alloc(e),stringToUTF8OnStack=e=>{var r=lengthBytesUTF8(e)+1,t=stackAlloc(r);return stringToUTF8(e,t,r),t};FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit();function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings")}var wasmImports={__syscall_connect:___syscall_connect,__syscall_fcntl64:___syscall_fcntl64,__syscall_ioctl:___syscall_ioctl,__syscall_openat:___syscall_openat,__syscall_recvfrom:___syscall_recvfrom,__syscall_sendto:___syscall_sendto,__syscall_socket:___syscall_socket,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_resize_heap:_emscripten_resize_heap,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_read:_fd_read,fd_seek:_fd_seek,fd_write:_fd_write,getaddrinfo:_getaddrinfo},wasmExports;createWasm();var ___wasm_call_ctors=createExportWrapper("__wasm_call_ctors",0),_malloc=createExportWrapper("malloc",1),_run=Module._run=createExportWrapper("run",4),_main=createExportWrapper("__main_argc_argv",2),_fflush=createExportWrapper("fflush",1),_htonl=createExportWrapper("htonl",1),_htons=createExportWrapper("htons",1),_ntohs=createExportWrapper("ntohs",1),_strerror=createExportWrapper("strerror",1),_emscripten_stack_init=()=>(_emscripten_stack_init=wasmExports.emscripten_stack_init)(),_emscripten_stack_get_free=()=>(_emscripten_stack_get_free=wasmExports.emscripten_stack_get_free)(),_emscripten_stack_get_base=()=>(_emscripten_stack_get_base=wasmExports.emscripten_stack_get_base)(),_emscripten_stack_get_end=()=>(_emscripten_stack_get_end=wasmExports.emscripten_stack_get_end)(),__emscripten_stack_restore=e=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),dynCall_jiji=Module.dynCall_jiji=createExportWrapper("dynCall_jiji",5),missingLibrarySymbols=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","getTempRet0","setTempRet0","emscriptenLog","readEmAsmArgs","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","HandleAllocator","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","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","safeSetTimeout","setImmediateWrapped","safeRequestAnimationFrame","clearImmediateWrapped","polyfillSetImmediate","registerPostMainLoop","registerPreMainLoop","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","Browser_asyncPrepareDataCounter","isLeapYear","ydayFromDate","arraySum","addDays","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","webgl_enable_EXT_polygon_offset_clamp","webgl_enable_EXT_clip_control","webgl_enable_WEBGL_polygon_mode","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace"];missingLibrarySymbols.forEach(missingLibrarySymbol);var unexportedSymbols=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","out","err","callMain","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","stackSave","stackRestore","stackAlloc","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","ERRNO_CODES","strError","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","Protocols","Sockets","timers","warnOnce","readEmAsmArgsArray","jstoi_q","jstoi_s","getExecutableName","keepRuntimeAlive","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToUTF8OnStack","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","doReadv","doWritev","initRandomFill","randomFill","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","getPreloadedImageData__data","wget","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","SYSCALLS","getSocketFromFD","getSocketAddress","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS_createPath","FS_createDevice","FS_readFile","FS","FS_createDataFile","FS_createLazyFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","print","printErr"];unexportedSymbols.forEach(unexportedRuntimeSymbol);var calledRun;dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)};function stackCheckInit(){_emscripten_stack_init(),writeStackCookie()}function run(e=arguments_){if(runDependencies>0||(stackCheckInit(),preRun(),runDependencies>0))return;function r(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),Module.onRuntimeInitialized?.(),assert(!Module._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),r()},1)):r(),checkStackCookie()}function checkUnflushedContent(){var e=out,r=err,t=!1;out=err=n=>{t=!0};try{_fflush(0),["stdout","stderr"].forEach(n=>{var o=FS.analyzePath("/dev/"+n);if(o){var a=o.object,i=a.rdev,s=TTY.ttys[i];s?.output?.length&&(t=!0)}})}catch{}out=e,err=r,t&&warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.")}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();run(); diff --git a/public/salam-wa.wasm b/public/salam-wa.wasm index e1e0d9e..e7d5069 100644 Binary files a/public/salam-wa.wasm and b/public/salam-wa.wasm differ