@php-wasm/node 0.1.11 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";var ya=Object.defineProperty;var hu=Object.getOwnPropertyDescriptor;var yu=Object.getOwnPropertyNames;var Eu=Object.prototype.hasOwnProperty;var Oi=(x,A)=>()=>(x&&(A=x(x=0)),A);var hi=(x,A)=>()=>(A||x((A={exports:{}}).exports,A),A.exports),gi=(x,A)=>{for(var I in A)ya(x,I,{get:A[I],enumerable:!0})},wu=(x,A,I,f)=>{if(A&&typeof A=="object"||typeof A=="function")for(let K of yu(A))!Eu.call(x,K)&&K!==I&&ya(x,K,{get:()=>A[K],enumerable:!(f=hu(A,K))||f.enumerable});return x};var Si=x=>wu(ya({},"__esModule",{value:!0}),x);var Pi=hi((oc,Wa)=>{"use strict";Wa.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Wi=hi((ic,ta)=>{"use strict";var{EMPTY_BUFFER:gu}=Pi(),Ea=Buffer[Symbol.species];function Su(x,A){if(x.length===0)return gu;if(x.length===1)return x[0];let I=Buffer.allocUnsafe(A),f=0;for(let K=0;K<x.length;K++){let $=x[K];I.set($,f),f+=$.length}return f<A?new Ea(I.buffer,I.byteOffset,f):I}function Ya(x,A,I,f,K){for(let $=0;$<K;$++)I[f+$]=x[$]^A[$&3]}function ja(x,A){for(let I=0;I<x.length;I++)x[I]^=A[I&3]}function bu(x){return x.length===x.buffer.byteLength?x.buffer:x.buffer.slice(x.byteOffset,x.byteOffset+x.length)}function wa(x){if(wa.readOnly=!0,Buffer.isBuffer(x))return x;let A;return x instanceof ArrayBuffer?A=new Ea(x):ArrayBuffer.isView(x)?A=new Ea(x.buffer,x.byteOffset,x.byteLength):(A=Buffer.from(x),wa.readOnly=!1),A}ta.exports={concat:Su,mask:Ya,toArrayBuffer:bu,toBuffer:wa,unmask:ja};if(!process.env.WS_NO_BUFFER_UTIL)try{let x=require("bufferutil");ta.exports.mask=function(A,I,f,K,$){$<48?Ya(A,I,f,K,$):x.mask(A,I,f,K,$)},ta.exports.unmask=function(A,I){A.length<32?ja(A,I):x.unmask(A,I)}}catch{}});var Ga=hi((ac,Va)=>{"use strict";var qa=Symbol("kDone"),ga=Symbol("kRun"),Sa=class{constructor(A){this[qa]=()=>{this.pending--,this[ga]()},this.concurrency=A||1/0,this.jobs=[],this.pending=0}add(A){this.jobs.push(A),this[ga]()}[ga](){if(this.pending!==this.concurrency&&this.jobs.length){let A=this.jobs.shift();this.pending++,A(this[qa])}}};Va.exports=Sa});var qi=hi((sc,$a)=>{"use strict";var Yi=require("zlib"),Ka=Wi(),ku=Ga(),{kStatusCode:Xa}=Pi(),Ou=Buffer[Symbol.species],Du=Buffer.from([0,0,255,255]),ia=Symbol("permessage-deflate"),Di=Symbol("total-length"),ji=Symbol("callback"),Ri=Symbol("buffers"),oa=Symbol("error"),na,ba=class{constructor(A,I,f){if(this._maxPayload=f|0,this._options=A||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!I,this._deflate=null,this._inflate=null,this.params=null,!na){let K=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;na=new ku(K)}}static get extensionName(){return"permessage-deflate"}offer(){let A={};return this._options.serverNoContextTakeover&&(A.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(A.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(A.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?A.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(A.client_max_window_bits=!0),A}accept(A){return A=this.normalizeParams(A),this.params=this._isServer?this.acceptAsServer(A):this.acceptAsClient(A),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let A=this._deflate[ji];this._deflate.close(),this._deflate=null,A&&A(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(A){let I=this._options,f=A.find(K=>!(I.serverNoContextTakeover===!1&&K.server_no_context_takeover||K.server_max_window_bits&&(I.serverMaxWindowBits===!1||typeof I.serverMaxWindowBits=="number"&&I.serverMaxWindowBits>K.server_max_window_bits)||typeof I.clientMaxWindowBits=="number"&&!K.client_max_window_bits));if(!f)throw new Error("None of the extension offers can be accepted");return I.serverNoContextTakeover&&(f.server_no_context_takeover=!0),I.clientNoContextTakeover&&(f.client_no_context_takeover=!0),typeof I.serverMaxWindowBits=="number"&&(f.server_max_window_bits=I.serverMaxWindowBits),typeof I.clientMaxWindowBits=="number"?f.client_max_window_bits=I.clientMaxWindowBits:(f.client_max_window_bits===!0||I.clientMaxWindowBits===!1)&&delete f.client_max_window_bits,f}acceptAsClient(A){let I=A[0];if(this._options.clientNoContextTakeover===!1&&I.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!I.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(I.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&I.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return I}normalizeParams(A){return A.forEach(I=>{Object.keys(I).forEach(f=>{let K=I[f];if(K.length>1)throw new Error(`Parameter "${f}" must have only a single value`);if(K=K[0],f==="client_max_window_bits"){if(K!==!0){let $=+K;if(!Number.isInteger($)||$<8||$>15)throw new TypeError(`Invalid value for parameter "${f}": ${K}`);K=$}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${f}": ${K}`)}else if(f==="server_max_window_bits"){let $=+K;if(!Number.isInteger($)||$<8||$>15)throw new TypeError(`Invalid value for parameter "${f}": ${K}`);K=$}else if(f==="client_no_context_takeover"||f==="server_no_context_takeover"){if(K!==!0)throw new TypeError(`Invalid value for parameter "${f}": ${K}`)}else throw new Error(`Unknown parameter "${f}"`);I[f]=K})}),A}decompress(A,I,f){na.add(K=>{this._decompress(A,I,($,ie)=>{K(),f($,ie)})})}compress(A,I,f){na.add(K=>{this._compress(A,I,($,ie)=>{K(),f($,ie)})})}_decompress(A,I,f){let K=this._isServer?"client":"server";if(!this._inflate){let $=`${K}_max_window_bits`,ie=typeof this.params[$]!="number"?Yi.Z_DEFAULT_WINDOWBITS:this.params[$];this._inflate=Yi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:ie}),this._inflate[ia]=this,this._inflate[Di]=0,this._inflate[Ri]=[],this._inflate.on("error",Tu),this._inflate.on("data",Za)}this._inflate[ji]=f,this._inflate.write(A),I&&this._inflate.write(Du),this._inflate.flush(()=>{let $=this._inflate[oa];if($){this._inflate.close(),this._inflate=null,f($);return}let ie=Ka.concat(this._inflate[Ri],this._inflate[Di]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Di]=0,this._inflate[Ri]=[],I&&this.params[`${K}_no_context_takeover`]&&this._inflate.reset()),f(null,ie)})}_compress(A,I,f){let K=this._isServer?"server":"client";if(!this._deflate){let $=`${K}_max_window_bits`,ie=typeof this.params[$]!="number"?Yi.Z_DEFAULT_WINDOWBITS:this.params[$];this._deflate=Yi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:ie}),this._deflate[Di]=0,this._deflate[Ri]=[],this._deflate.on("data",Nu)}this._deflate[ji]=f,this._deflate.write(A),this._deflate.flush(Yi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let $=Ka.concat(this._deflate[Ri],this._deflate[Di]);I&&($=new Ou($.buffer,$.byteOffset,$.length-4)),this._deflate[ji]=null,this._deflate[Di]=0,this._deflate[Ri]=[],I&&this.params[`${K}_no_context_takeover`]&&this._deflate.reset(),f(null,$)})}};$a.exports=ba;function Nu(x){this[Ri].push(x),this[Di]+=x.length}function Za(x){if(this[Di]+=x.length,this[ia]._maxPayload<1||this[Di]<=this[ia]._maxPayload){this[Ri].push(x);return}this[oa]=new RangeError("Max payload size exceeded"),this[oa].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[oa][Xa]=1009,this.removeListener("data",Za),this.reset()}function Tu(x){this[ia]._inflate=null,x[Xa]=1007,this[ji](x)}});var Vi=hi((uc,aa)=>{"use strict";var{isUtf8:Ja}=require("buffer"),Au=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Fu(x){return x>=1e3&&x<=1014&&x!==1004&&x!==1005&&x!==1006||x>=3e3&&x<=4999}function ka(x){let A=x.length,I=0;for(;I<A;)if(!(x[I]&128))I++;else if((x[I]&224)===192){if(I+1===A||(x[I+1]&192)!==128||(x[I]&254)===192)return!1;I+=2}else if((x[I]&240)===224){if(I+2>=A||(x[I+1]&192)!==128||(x[I+2]&192)!==128||x[I]===224&&(x[I+1]&224)===128||x[I]===237&&(x[I+1]&224)===160)return!1;I+=3}else if((x[I]&248)===240){if(I+3>=A||(x[I+1]&192)!==128||(x[I+2]&192)!==128||(x[I+3]&192)!==128||x[I]===240&&(x[I+1]&240)===128||x[I]===244&&x[I+1]>143||x[I]>244)return!1;I+=4}else return!1;return!0}aa.exports={isValidStatusCode:Fu,isValidUTF8:ka,tokenChars:Au};if(Ja)aa.exports.isValidUTF8=function(x){return x.length<24?ka(x):Ja(x)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let x=require("utf-8-validate");aa.exports.isValidUTF8=function(A){return A.length<32?ka(A):x(A)}}catch{}});var Ta=hi((fc,is)=>{"use strict";var{Writable:Cu}=require("stream"),Qa=qi(),{BINARY_TYPES:Pu,EMPTY_BUFFER:es,kStatusCode:Ru,kWebSocket:Mu}=Pi(),{concat:Oa,toArrayBuffer:Lu,unmask:Uu}=Wi(),{isValidStatusCode:Iu,isValidUTF8:rs}=Vi(),sa=Buffer[Symbol.species],Gi=0,ts=1,ns=2,os=3,Da=4,Bu=5,Na=class extends Cu{constructor(A={}){super(),this._binaryType=A.binaryType||Pu[0],this._extensions=A.extensions||{},this._isServer=!!A.isServer,this._maxPayload=A.maxPayload|0,this._skipUTF8Validation=!!A.skipUTF8Validation,this[Mu]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=Gi,this._loop=!1}_write(A,I,f){if(this._opcode===8&&this._state==Gi)return f();this._bufferedBytes+=A.length,this._buffers.push(A),this.startLoop(f)}consume(A){if(this._bufferedBytes-=A,A===this._buffers[0].length)return this._buffers.shift();if(A<this._buffers[0].length){let f=this._buffers[0];return this._buffers[0]=new sa(f.buffer,f.byteOffset+A,f.length-A),new sa(f.buffer,f.byteOffset,A)}let I=Buffer.allocUnsafe(A);do{let f=this._buffers[0],K=I.length-A;A>=f.length?I.set(this._buffers.shift(),K):(I.set(new Uint8Array(f.buffer,f.byteOffset,A),K),this._buffers[0]=new sa(f.buffer,f.byteOffset+A,f.length-A)),A-=f.length}while(A>0);return I}startLoop(A){let I;this._loop=!0;do switch(this._state){case Gi:I=this.getInfo();break;case ts:I=this.getPayloadLength16();break;case ns:I=this.getPayloadLength64();break;case os:this.getMask();break;case Da:I=this.getData(A);break;default:this._loop=!1;return}while(this._loop);A(I)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let A=this.consume(2);if(A[0]&48)return this._loop=!1,zn(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let I=(A[0]&64)===64;if(I&&!this._extensions[Qa.extensionName])return this._loop=!1,zn(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(A[0]&128)===128,this._opcode=A[0]&15,this._payloadLength=A[1]&127,this._opcode===0){if(I)return this._loop=!1,zn(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,zn(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,zn(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=I}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,zn(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(I)return this._loop=!1,zn(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1)return this._loop=!1,zn(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,zn(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(A[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,zn(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,zn(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=ts;else if(this._payloadLength===127)this._state=ns;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let A=this.consume(8),I=A.readUInt32BE(0);return I>Math.pow(2,53-32)-1?(this._loop=!1,zn(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=I*Math.pow(2,32)+A.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,zn(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=os:this._state=Da}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Da}getData(A){let I=es;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}I=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&Uu(I,this._mask)}if(this._opcode>7)return this.controlMessage(I);if(this._compressed){this._state=Bu,this.decompress(I,A);return}return I.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(I)),this.dataMessage()}decompress(A,I){this._extensions[Qa.extensionName].decompress(A,this._fin,(K,$)=>{if(K)return I(K);if($.length){if(this._messageLength+=$.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return I(zn(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push($)}let ie=this.dataMessage();if(ie)return I(ie);this.startLoop(I)})}dataMessage(){if(this._fin){let A=this._messageLength,I=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let f;this._binaryType==="nodebuffer"?f=Oa(I,A):this._binaryType==="arraybuffer"?f=Lu(Oa(I,A)):f=I,this.emit("message",f,!0)}else{let f=Oa(I,A);if(!this._skipUTF8Validation&&!rs(f))return this._loop=!1,zn(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",f,!1)}}this._state=Gi}controlMessage(A){if(this._opcode===8)if(this._loop=!1,A.length===0)this.emit("conclude",1005,es),this.end();else{let I=A.readUInt16BE(0);if(!Iu(I))return zn(RangeError,`invalid status code ${I}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let f=new sa(A.buffer,A.byteOffset+2,A.length-2);if(!this._skipUTF8Validation&&!rs(f))return zn(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",I,f),this.end()}else this._opcode===9?this.emit("ping",A):this.emit("pong",A);this._state=Gi}};is.exports=Na;function zn(x,A,I,f,K){let $=new x(I?`Invalid WebSocket frame: ${A}`:A);return Error.captureStackTrace($,zn),$.code=K,$[Ru]=f,$}});var Aa=hi((dc,us)=>{"use strict";var cc=require("net"),lc=require("tls"),{randomFillSync:xu}=require("crypto"),as=qi(),{EMPTY_BUFFER:zu}=Pi(),{isValidStatusCode:Hu}=Vi(),{mask:ss,toBuffer:xi}=Wi(),wi=Symbol("kByteLength"),Wu=Buffer.alloc(4),bi=class{constructor(A,I,f){this._extensions=I||{},f&&(this._generateMask=f,this._maskBuffer=Buffer.alloc(4)),this._socket=A,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(A,I){let f,K=!1,$=2,ie=!1;I.mask&&(f=I.maskBuffer||Wu,I.generateMask?I.generateMask(f):xu(f,0,4),ie=(f[0]|f[1]|f[2]|f[3])===0,$=6);let _e;typeof A=="string"?(!I.mask||ie)&&I[wi]!==void 0?_e=I[wi]:(A=Buffer.from(A),_e=A.length):(_e=A.length,K=I.mask&&I.readOnly&&!ie);let Ee=_e;_e>=65536?($+=8,Ee=127):_e>125&&($+=2,Ee=126);let pe=Buffer.allocUnsafe(K?_e+$:$);return pe[0]=I.fin?I.opcode|128:I.opcode,I.rsv1&&(pe[0]|=64),pe[1]=Ee,Ee===126?pe.writeUInt16BE(_e,2):Ee===127&&(pe[2]=pe[3]=0,pe.writeUIntBE(_e,4,6)),I.mask?(pe[1]|=128,pe[$-4]=f[0],pe[$-3]=f[1],pe[$-2]=f[2],pe[$-1]=f[3],ie?[pe,A]:K?(ss(A,f,pe,$,_e),[pe]):(ss(A,f,A,0,_e),[pe,A])):[pe,A]}close(A,I,f,K){let $;if(A===void 0)$=zu;else{if(typeof A!="number"||!Hu(A))throw new TypeError("First argument must be a valid error code number");if(I===void 0||!I.length)$=Buffer.allocUnsafe(2),$.writeUInt16BE(A,0);else{let _e=Buffer.byteLength(I);if(_e>123)throw new RangeError("The message must not be greater than 123 bytes");$=Buffer.allocUnsafe(2+_e),$.writeUInt16BE(A,0),typeof I=="string"?$.write(I,2):$.set(I,2)}}let ie={[wi]:$.length,fin:!0,generateMask:this._generateMask,mask:f,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,$,!1,ie,K]):this.sendFrame(bi.frame($,ie),K)}ping(A,I,f){let K,$;if(typeof A=="string"?(K=Buffer.byteLength(A),$=!1):(A=xi(A),K=A.length,$=xi.readOnly),K>125)throw new RangeError("The data size must not be greater than 125 bytes");let ie={[wi]:K,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:9,readOnly:$,rsv1:!1};this._deflating?this.enqueue([this.dispatch,A,!1,ie,f]):this.sendFrame(bi.frame(A,ie),f)}pong(A,I,f){let K,$;if(typeof A=="string"?(K=Buffer.byteLength(A),$=!1):(A=xi(A),K=A.length,$=xi.readOnly),K>125)throw new RangeError("The data size must not be greater than 125 bytes");let ie={[wi]:K,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:10,readOnly:$,rsv1:!1};this._deflating?this.enqueue([this.dispatch,A,!1,ie,f]):this.sendFrame(bi.frame(A,ie),f)}send(A,I,f){let K=this._extensions[as.extensionName],$=I.binary?2:1,ie=I.compress,_e,Ee;if(typeof A=="string"?(_e=Buffer.byteLength(A),Ee=!1):(A=xi(A),_e=A.length,Ee=xi.readOnly),this._firstFragment?(this._firstFragment=!1,ie&&K&&K.params[K._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(ie=_e>=K._threshold),this._compress=ie):(ie=!1,$=0),I.fin&&(this._firstFragment=!0),K){let pe={[wi]:_e,fin:I.fin,generateMask:this._generateMask,mask:I.mask,maskBuffer:this._maskBuffer,opcode:$,readOnly:Ee,rsv1:ie};this._deflating?this.enqueue([this.dispatch,A,this._compress,pe,f]):this.dispatch(A,this._compress,pe,f)}else this.sendFrame(bi.frame(A,{[wi]:_e,fin:I.fin,generateMask:this._generateMask,mask:I.mask,maskBuffer:this._maskBuffer,opcode:$,readOnly:Ee,rsv1:!1}),f)}dispatch(A,I,f,K){if(!I){this.sendFrame(bi.frame(A,f),K);return}let $=this._extensions[as.extensionName];this._bufferedBytes+=f[wi],this._deflating=!0,$.compress(A,f.fin,(ie,_e)=>{if(this._socket.destroyed){let Ee=new Error("The socket was closed while data was being compressed");typeof K=="function"&&K(Ee);for(let pe=0;pe<this._queue.length;pe++){let te=this._queue[pe],ve=te[te.length-1];typeof ve=="function"&&ve(Ee)}return}this._bufferedBytes-=f[wi],this._deflating=!1,f.readOnly=!1,this.sendFrame(bi.frame(_e,f),K),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let A=this._queue.shift();this._bufferedBytes-=A[3][wi],Reflect.apply(A[0],this,A.slice(1))}}enqueue(A){this._bufferedBytes+=A[3][wi],this._queue.push(A)}sendFrame(A,I){A.length===2?(this._socket.cork(),this._socket.write(A[0]),this._socket.write(A[1],I),this._socket.uncork()):this._socket.write(A[0],I)}};us.exports=bi});var hs=hi((_c,ps)=>{"use strict";var{kForOnEventAttribute:Ki,kListener:Fa}=Pi(),fs=Symbol("kCode"),cs=Symbol("kData"),ls=Symbol("kError"),ds=Symbol("kMessage"),_s=Symbol("kReason"),zi=Symbol("kTarget"),ms=Symbol("kType"),vs=Symbol("kWasClean"),Ni=class{constructor(A){this[zi]=null,this[ms]=A}get target(){return this[zi]}get type(){return this[ms]}};Object.defineProperty(Ni.prototype,"target",{enumerable:!0});Object.defineProperty(Ni.prototype,"type",{enumerable:!0});var Li=class extends Ni{constructor(A,I={}){super(A),this[fs]=I.code===void 0?0:I.code,this[_s]=I.reason===void 0?"":I.reason,this[vs]=I.wasClean===void 0?!1:I.wasClean}get code(){return this[fs]}get reason(){return this[_s]}get wasClean(){return this[vs]}};Object.defineProperty(Li.prototype,"code",{enumerable:!0});Object.defineProperty(Li.prototype,"reason",{enumerable:!0});Object.defineProperty(Li.prototype,"wasClean",{enumerable:!0});var Hi=class extends Ni{constructor(A,I={}){super(A),this[ls]=I.error===void 0?null:I.error,this[ds]=I.message===void 0?"":I.message}get error(){return this[ls]}get message(){return this[ds]}};Object.defineProperty(Hi.prototype,"error",{enumerable:!0});Object.defineProperty(Hi.prototype,"message",{enumerable:!0});var Xi=class extends Ni{constructor(A,I={}){super(A),this[cs]=I.data===void 0?null:I.data}get data(){return this[cs]}};Object.defineProperty(Xi.prototype,"data",{enumerable:!0});var Yu={addEventListener(x,A,I={}){for(let K of this.listeners(x))if(!I[Ki]&&K[Fa]===A&&!K[Ki])return;let f;if(x==="message")f=function($,ie){let _e=new Xi("message",{data:ie?$:$.toString()});_e[zi]=this,ua(A,this,_e)};else if(x==="close")f=function($,ie){let _e=new Li("close",{code:$,reason:ie.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});_e[zi]=this,ua(A,this,_e)};else if(x==="error")f=function($){let ie=new Hi("error",{error:$,message:$.message});ie[zi]=this,ua(A,this,ie)};else if(x==="open")f=function(){let $=new Ni("open");$[zi]=this,ua(A,this,$)};else return;f[Ki]=!!I[Ki],f[Fa]=A,I.once?this.once(x,f):this.on(x,f)},removeEventListener(x,A){for(let I of this.listeners(x))if(I[Fa]===A&&!I[Ki]){this.removeListener(x,I);break}}};ps.exports={CloseEvent:Li,ErrorEvent:Hi,Event:Ni,EventTarget:Yu,MessageEvent:Xi};function ua(x,A,I){typeof x=="object"&&x.handleEvent?x.handleEvent.call(x,I):x.call(A,I)}});var Ca=hi((mc,ys)=>{"use strict";var{tokenChars:Zi}=Vi();function ki(x,A,I){x[A]===void 0?x[A]=[I]:x[A].push(I)}function ju(x){let A=Object.create(null),I=Object.create(null),f=!1,K=!1,$=!1,ie,_e,Ee=-1,pe=-1,te=-1,ve=0;for(;ve<x.length;ve++)if(pe=x.charCodeAt(ve),ie===void 0)if(te===-1&&Zi[pe]===1)Ee===-1&&(Ee=ve);else if(ve!==0&&(pe===32||pe===9))te===-1&&Ee!==-1&&(te=ve);else if(pe===59||pe===44){if(Ee===-1)throw new SyntaxError(`Unexpected character at index ${ve}`);te===-1&&(te=ve);let We=x.slice(Ee,te);pe===44?(ki(A,We,I),I=Object.create(null)):ie=We,Ee=te=-1}else throw new SyntaxError(`Unexpected character at index ${ve}`);else if(_e===void 0)if(te===-1&&Zi[pe]===1)Ee===-1&&(Ee=ve);else if(pe===32||pe===9)te===-1&&Ee!==-1&&(te=ve);else if(pe===59||pe===44){if(Ee===-1)throw new SyntaxError(`Unexpected character at index ${ve}`);te===-1&&(te=ve),ki(I,x.slice(Ee,te),!0),pe===44&&(ki(A,ie,I),I=Object.create(null),ie=void 0),Ee=te=-1}else if(pe===61&&Ee!==-1&&te===-1)_e=x.slice(Ee,ve),Ee=te=-1;else throw new SyntaxError(`Unexpected character at index ${ve}`);else if(K){if(Zi[pe]!==1)throw new SyntaxError(`Unexpected character at index ${ve}`);Ee===-1?Ee=ve:f||(f=!0),K=!1}else if($)if(Zi[pe]===1)Ee===-1&&(Ee=ve);else if(pe===34&&Ee!==-1)$=!1,te=ve;else if(pe===92)K=!0;else throw new SyntaxError(`Unexpected character at index ${ve}`);else if(pe===34&&x.charCodeAt(ve-1)===61)$=!0;else if(te===-1&&Zi[pe]===1)Ee===-1&&(Ee=ve);else if(Ee!==-1&&(pe===32||pe===9))te===-1&&(te=ve);else if(pe===59||pe===44){if(Ee===-1)throw new SyntaxError(`Unexpected character at index ${ve}`);te===-1&&(te=ve);let We=x.slice(Ee,te);f&&(We=We.replace(/\\/g,""),f=!1),ki(I,_e,We),pe===44&&(ki(A,ie,I),I=Object.create(null),ie=void 0),_e=void 0,Ee=te=-1}else throw new SyntaxError(`Unexpected character at index ${ve}`);if(Ee===-1||$||pe===32||pe===9)throw new SyntaxError("Unexpected end of input");te===-1&&(te=ve);let Nr=x.slice(Ee,te);return ie===void 0?ki(A,Nr,I):(_e===void 0?ki(I,Nr,!0):f?ki(I,_e,Nr.replace(/\\/g,"")):ki(I,_e,Nr),ki(A,ie,I)),A}function qu(x){return Object.keys(x).map(A=>{let I=x[A];return Array.isArray(I)||(I=[I]),I.map(f=>[A].concat(Object.keys(f).map(K=>{let $=f[K];return Array.isArray($)||($=[$]),$.map(ie=>ie===!0?K:`${K}=${ie}`).join("; ")})).join("; ")).join(", ")}).join(", ")}ys.exports={format:qu,parse:ju}});var Ua=hi((pc,As)=>{"use strict";var Vu=require("events"),Gu=require("https"),Ku=require("http"),gs=require("net"),Xu=require("tls"),{randomBytes:Zu,createHash:$u}=require("crypto"),{Readable:vc}=require("stream"),{URL:Pa}=require("url"),Mi=qi(),Ju=Ta(),Qu=Aa(),{BINARY_TYPES:Es,EMPTY_BUFFER:fa,GUID:ef,kForOnEventAttribute:Ra,kListener:rf,kStatusCode:tf,kWebSocket:vi,NOOP:Ss}=Pi(),{EventTarget:{addEventListener:nf,removeEventListener:of}}=hs(),{format:af,parse:sf}=Ca(),{toBuffer:uf}=Wi(),ff=30*1e3,bs=Symbol("kAborted"),Ma=[8,13],Ti=["CONNECTING","OPEN","CLOSING","CLOSED"],cf=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,pr=class extends Vu{constructor(A,I,f){super(),this._binaryType=Es[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=fa,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=pr.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,A!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,I===void 0?I=[]:Array.isArray(I)||(typeof I=="object"&&I!==null?(f=I,I=[]):I=[I]),ks(this,A,I,f)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(A){Es.includes(A)&&(this._binaryType=A,this._receiver&&(this._receiver._binaryType=A))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(A,I,f){let K=new Ju({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:f.maxPayload,skipUTF8Validation:f.skipUTF8Validation});this._sender=new Qu(A,this._extensions,f.generateMask),this._receiver=K,this._socket=A,K[vi]=this,A[vi]=this,K.on("conclude",_f),K.on("drain",mf),K.on("error",vf),K.on("message",pf),K.on("ping",hf),K.on("pong",yf),A.setTimeout(0),A.setNoDelay(),I.length>0&&A.unshift(I),A.on("close",Ds),A.on("data",la),A.on("end",Ns),A.on("error",Ts),this._readyState=pr.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=pr.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Mi.extensionName]&&this._extensions[Mi.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=pr.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(A,I){if(this.readyState!==pr.CLOSED){if(this.readyState===pr.CONNECTING){let f="WebSocket was closed before the connection was established";yi(this,this._req,f);return}if(this.readyState===pr.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=pr.CLOSING,this._sender.close(A,I,!this._isServer,f=>{f||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),ff)}}pause(){this.readyState===pr.CONNECTING||this.readyState===pr.CLOSED||(this._paused=!0,this._socket.pause())}ping(A,I,f){if(this.readyState===pr.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof A=="function"?(f=A,A=I=void 0):typeof I=="function"&&(f=I,I=void 0),typeof A=="number"&&(A=A.toString()),this.readyState!==pr.OPEN){La(this,A,f);return}I===void 0&&(I=!this._isServer),this._sender.ping(A||fa,I,f)}pong(A,I,f){if(this.readyState===pr.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof A=="function"?(f=A,A=I=void 0):typeof I=="function"&&(f=I,I=void 0),typeof A=="number"&&(A=A.toString()),this.readyState!==pr.OPEN){La(this,A,f);return}I===void 0&&(I=!this._isServer),this._sender.pong(A||fa,I,f)}resume(){this.readyState===pr.CONNECTING||this.readyState===pr.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(A,I,f){if(this.readyState===pr.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof I=="function"&&(f=I,I={}),typeof A=="number"&&(A=A.toString()),this.readyState!==pr.OPEN){La(this,A,f);return}let K={binary:typeof A!="string",mask:!this._isServer,compress:!0,fin:!0,...I};this._extensions[Mi.extensionName]||(K.compress=!1),this._sender.send(A||fa,K,f)}terminate(){if(this.readyState!==pr.CLOSED){if(this.readyState===pr.CONNECTING){let A="WebSocket was closed before the connection was established";yi(this,this._req,A);return}this._socket&&(this._readyState=pr.CLOSING,this._socket.destroy())}}};Object.defineProperty(pr,"CONNECTING",{enumerable:!0,value:Ti.indexOf("CONNECTING")});Object.defineProperty(pr.prototype,"CONNECTING",{enumerable:!0,value:Ti.indexOf("CONNECTING")});Object.defineProperty(pr,"OPEN",{enumerable:!0,value:Ti.indexOf("OPEN")});Object.defineProperty(pr.prototype,"OPEN",{enumerable:!0,value:Ti.indexOf("OPEN")});Object.defineProperty(pr,"CLOSING",{enumerable:!0,value:Ti.indexOf("CLOSING")});Object.defineProperty(pr.prototype,"CLOSING",{enumerable:!0,value:Ti.indexOf("CLOSING")});Object.defineProperty(pr,"CLOSED",{enumerable:!0,value:Ti.indexOf("CLOSED")});Object.defineProperty(pr.prototype,"CLOSED",{enumerable:!0,value:Ti.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(x=>{Object.defineProperty(pr.prototype,x,{enumerable:!0})});["open","error","close","message"].forEach(x=>{Object.defineProperty(pr.prototype,`on${x}`,{enumerable:!0,get(){for(let A of this.listeners(x))if(A[Ra])return A[rf];return null},set(A){for(let I of this.listeners(x))if(I[Ra]){this.removeListener(x,I);break}typeof A=="function"&&this.addEventListener(x,A,{[Ra]:!0})}})});pr.prototype.addEventListener=nf;pr.prototype.removeEventListener=of;As.exports=pr;function ks(x,A,I,f){let K={protocolVersion:Ma[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...f,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(!Ma.includes(K.protocolVersion))throw new RangeError(`Unsupported protocol version: ${K.protocolVersion} (supported versions: ${Ma.join(", ")})`);let $;if(A instanceof Pa)$=A,x._url=A.href;else{try{$=new Pa(A)}catch{throw new SyntaxError(`Invalid URL: ${A}`)}x._url=A}let ie=$.protocol==="wss:",_e=$.protocol==="ws+unix:",Ee;if($.protocol!=="ws:"&&!ie&&!_e?Ee=`The URL's protocol must be one of "ws:", "wss:", or "ws+unix:"`:_e&&!$.pathname?Ee="The URL's pathname is empty":$.hash&&(Ee="The URL contains a fragment identifier"),Ee){let Re=new SyntaxError(Ee);if(x._redirects===0)throw Re;ca(x,Re);return}let pe=ie?443:80,te=Zu(16).toString("base64"),ve=ie?Gu.request:Ku.request,Nr=new Set,We;if(K.createConnection=ie?df:lf,K.defaultPort=K.defaultPort||pe,K.port=$.port||pe,K.host=$.hostname.startsWith("[")?$.hostname.slice(1,-1):$.hostname,K.headers={...K.headers,"Sec-WebSocket-Version":K.protocolVersion,"Sec-WebSocket-Key":te,Connection:"Upgrade",Upgrade:"websocket"},K.path=$.pathname+$.search,K.timeout=K.handshakeTimeout,K.perMessageDeflate&&(We=new Mi(K.perMessageDeflate!==!0?K.perMessageDeflate:{},!1,K.maxPayload),K.headers["Sec-WebSocket-Extensions"]=af({[Mi.extensionName]:We.offer()})),I.length){for(let Re of I){if(typeof Re!="string"||!cf.test(Re)||Nr.has(Re))throw new SyntaxError("An invalid or duplicated subprotocol was specified");Nr.add(Re)}K.headers["Sec-WebSocket-Protocol"]=I.join(",")}if(K.origin&&(K.protocolVersion<13?K.headers["Sec-WebSocket-Origin"]=K.origin:K.headers.Origin=K.origin),($.username||$.password)&&(K.auth=`${$.username}:${$.password}`),_e){let Re=K.path.split(":");K.socketPath=Re[0],K.path=Re[1]}let ar;if(K.followRedirects){if(x._redirects===0){x._originalIpc=_e,x._originalSecure=ie,x._originalHostOrSocketPath=_e?K.socketPath:$.host;let Re=f&&f.headers;if(f={...f,headers:{}},Re)for(let[Wr,J]of Object.entries(Re))f.headers[Wr.toLowerCase()]=J}else if(x.listenerCount("redirect")===0){let Re=_e?x._originalIpc?K.socketPath===x._originalHostOrSocketPath:!1:x._originalIpc?!1:$.host===x._originalHostOrSocketPath;(!Re||x._originalSecure&&!ie)&&(delete K.headers.authorization,delete K.headers.cookie,Re||delete K.headers.host,K.auth=void 0)}K.auth&&!f.headers.authorization&&(f.headers.authorization="Basic "+Buffer.from(K.auth).toString("base64")),ar=x._req=ve(K),x._redirects&&x.emit("redirect",x.url,ar)}else ar=x._req=ve(K);K.timeout&&ar.on("timeout",()=>{yi(x,ar,"Opening handshake has timed out")}),ar.on("error",Re=>{ar===null||ar[bs]||(ar=x._req=null,ca(x,Re))}),ar.on("response",Re=>{let Wr=Re.headers.location,J=Re.statusCode;if(Wr&&K.followRedirects&&J>=300&&J<400){if(++x._redirects>K.maxRedirects){yi(x,ar,"Maximum redirects exceeded");return}ar.abort();let Me;try{Me=new Pa(Wr,A)}catch{let er=new SyntaxError(`Invalid URL: ${Wr}`);ca(x,er);return}ks(x,Me,I,f)}else x.emit("unexpected-response",ar,Re)||yi(x,ar,`Unexpected server response: ${Re.statusCode}`)}),ar.on("upgrade",(Re,Wr,J)=>{if(x.emit("upgrade",Re),x.readyState!==pr.CONNECTING)return;if(ar=x._req=null,Re.headers.upgrade.toLowerCase()!=="websocket"){yi(x,Wr,"Invalid Upgrade header");return}let Me=$u("sha1").update(te+ef).digest("base64");if(Re.headers["sec-websocket-accept"]!==Me){yi(x,Wr,"Invalid Sec-WebSocket-Accept header");return}let yr=Re.headers["sec-websocket-protocol"],er;if(yr!==void 0?Nr.size?Nr.has(yr)||(er="Server sent an invalid subprotocol"):er="Server sent a subprotocol but none was requested":Nr.size&&(er="Server sent no subprotocol"),er){yi(x,Wr,er);return}yr&&(x._protocol=yr);let fe=Re.headers["sec-websocket-extensions"];if(fe!==void 0){if(!We){yi(x,Wr,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let qe;try{qe=sf(fe)}catch{yi(x,Wr,"Invalid Sec-WebSocket-Extensions header");return}let cn=Object.keys(qe);if(cn.length!==1||cn[0]!==Mi.extensionName){yi(x,Wr,"Server indicated an extension that was not requested");return}try{We.accept(qe[Mi.extensionName])}catch{yi(x,Wr,"Invalid Sec-WebSocket-Extensions header");return}x._extensions[Mi.extensionName]=We}x.setSocket(Wr,J,{generateMask:K.generateMask,maxPayload:K.maxPayload,skipUTF8Validation:K.skipUTF8Validation})}),K.finishRequest?K.finishRequest(ar,x):ar.end()}function ca(x,A){x._readyState=pr.CLOSING,x.emit("error",A),x.emitClose()}function lf(x){return x.path=x.socketPath,gs.connect(x)}function df(x){return x.path=void 0,!x.servername&&x.servername!==""&&(x.servername=gs.isIP(x.host)?"":x.host),Xu.connect(x)}function yi(x,A,I){x._readyState=pr.CLOSING;let f=new Error(I);Error.captureStackTrace(f,yi),A.setHeader?(A[bs]=!0,A.abort(),A.socket&&!A.socket.destroyed&&A.socket.destroy(),process.nextTick(ca,x,f)):(A.destroy(f),A.once("error",x.emit.bind(x,"error")),A.once("close",x.emitClose.bind(x)))}function La(x,A,I){if(A){let f=uf(A).length;x._socket?x._sender._bufferedBytes+=f:x._bufferedAmount+=f}if(I){let f=new Error(`WebSocket is not open: readyState ${x.readyState} (${Ti[x.readyState]})`);process.nextTick(I,f)}}function _f(x,A){let I=this[vi];I._closeFrameReceived=!0,I._closeMessage=A,I._closeCode=x,I._socket[vi]!==void 0&&(I._socket.removeListener("data",la),process.nextTick(Os,I._socket),x===1005?I.close():I.close(x,A))}function mf(){let x=this[vi];x.isPaused||x._socket.resume()}function vf(x){let A=this[vi];A._socket[vi]!==void 0&&(A._socket.removeListener("data",la),process.nextTick(Os,A._socket),A.close(x[tf])),A.emit("error",x)}function ws(){this[vi].emitClose()}function pf(x,A){this[vi].emit("message",x,A)}function hf(x){let A=this[vi];A.pong(x,!A._isServer,Ss),A.emit("ping",x)}function yf(x){this[vi].emit("pong",x)}function Os(x){x.resume()}function Ds(){let x=this[vi];this.removeListener("close",Ds),this.removeListener("data",la),this.removeListener("end",Ns),x._readyState=pr.CLOSING;let A;!this._readableState.endEmitted&&!x._closeFrameReceived&&!x._receiver._writableState.errorEmitted&&(A=x._socket.read())!==null&&x._receiver.write(A),x._receiver.end(),this[vi]=void 0,clearTimeout(x._closeTimer),x._receiver._writableState.finished||x._receiver._writableState.errorEmitted?x.emitClose():(x._receiver.on("error",ws),x._receiver.on("finish",ws))}function la(x){this[vi]._receiver.write(x)||this.pause()}function Ns(){let x=this[vi];x._readyState=pr.CLOSING,x._receiver.end(),this.end()}function Ts(){let x=this[vi];this.removeListener("error",Ts),this.on("error",Ss),x&&(x._readyState=pr.CLOSING,this.destroy())}});var Rs=hi((hc,Ps)=>{"use strict";var{Duplex:Ef}=require("stream");function Fs(x){x.emit("close")}function wf(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Cs(x){this.removeListener("error",Cs),this.destroy(),this.listenerCount("error")===0&&this.emit("error",x)}function gf(x,A){let I=!0,f=new Ef({...A,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return x.on("message",function($,ie){let _e=!ie&&f._readableState.objectMode?$.toString():$;f.push(_e)||x.pause()}),x.once("error",function($){f.destroyed||(I=!1,f.destroy($))}),x.once("close",function(){f.destroyed||f.push(null)}),f._destroy=function(K,$){if(x.readyState===x.CLOSED){$(K),process.nextTick(Fs,f);return}let ie=!1;x.once("error",function(Ee){ie=!0,$(Ee)}),x.once("close",function(){ie||$(K),process.nextTick(Fs,f)}),I&&x.terminate()},f._final=function(K){if(x.readyState===x.CONNECTING){x.once("open",function(){f._final(K)});return}x._socket!==null&&(x._socket._writableState.finished?(K(),f._readableState.endEmitted&&f.destroy()):(x._socket.once("finish",function(){K()}),x.close()))},f._read=function(){x.isPaused&&x.resume()},f._write=function(K,$,ie){if(x.readyState===x.CONNECTING){x.once("open",function(){f._write(K,$,ie)});return}x.send(K,ie)},f.on("end",wf),f.on("error",Cs),f}Ps.exports=gf});var Ls=hi((yc,Ms)=>{"use strict";var{tokenChars:Sf}=Vi();function bf(x){let A=new Set,I=-1,f=-1,K=0;for(K;K<x.length;K++){let ie=x.charCodeAt(K);if(f===-1&&Sf[ie]===1)I===-1&&(I=K);else if(K!==0&&(ie===32||ie===9))f===-1&&I!==-1&&(f=K);else if(ie===44){if(I===-1)throw new SyntaxError(`Unexpected character at index ${K}`);f===-1&&(f=K);let _e=x.slice(I,f);if(A.has(_e))throw new SyntaxError(`The "${_e}" subprotocol is duplicated`);A.add(_e),I=f=-1}else throw new SyntaxError(`Unexpected character at index ${K}`)}if(I===-1||f!==-1)throw new SyntaxError("Unexpected end of input");let $=x.slice(I,K);if(A.has($))throw new SyntaxError(`The "${$}" subprotocol is duplicated`);return A.add($),A}Ms.exports={parse:bf}});var Ws=hi((Sc,Hs)=>{"use strict";var kf=require("events"),da=require("http"),Ec=require("https"),wc=require("net"),gc=require("tls"),{createHash:Of}=require("crypto"),Us=Ca(),Ui=qi(),Df=Ls(),Nf=Ua(),{GUID:Tf,kWebSocket:Af}=Pi(),Ff=/^[+/0-9A-Za-z]{22}==$/,Is=0,Bs=1,zs=2,Ia=class extends kf{constructor(A,I){if(super(),A={maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Nf,...A},A.port==null&&!A.server&&!A.noServer||A.port!=null&&(A.server||A.noServer)||A.server&&A.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(A.port!=null?(this._server=da.createServer((f,K)=>{let $=da.STATUS_CODES[426];K.writeHead(426,{"Content-Length":$.length,"Content-Type":"text/plain"}),K.end($)}),this._server.listen(A.port,A.host,A.backlog,I)):A.server&&(this._server=A.server),this._server){let f=this.emit.bind(this,"connection");this._removeListeners=Cf(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(K,$,ie)=>{this.handleUpgrade(K,$,ie,f)}})}A.perMessageDeflate===!0&&(A.perMessageDeflate={}),A.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=A,this._state=Is}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(A){if(this._state===zs){A&&this.once("close",()=>{A(new Error("The server is not running"))}),process.nextTick($i,this);return}if(A&&this.once("close",A),this._state!==Bs)if(this._state=Bs,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick($i,this):process.nextTick($i,this);else{let I=this._server;this._removeListeners(),this._removeListeners=this._server=null,I.close(()=>{$i(this)})}}shouldHandle(A){if(this.options.path){let I=A.url.indexOf("?");if((I!==-1?A.url.slice(0,I):A.url)!==this.options.path)return!1}return!0}handleUpgrade(A,I,f,K){I.on("error",xs);let $=A.headers["sec-websocket-key"],ie=+A.headers["sec-websocket-version"];if(A.method!=="GET"){Ii(this,A,I,405,"Invalid HTTP method");return}if(A.headers.upgrade.toLowerCase()!=="websocket"){Ii(this,A,I,400,"Invalid Upgrade header");return}if(!$||!Ff.test($)){Ii(this,A,I,400,"Missing or invalid Sec-WebSocket-Key header");return}if(ie!==8&&ie!==13){Ii(this,A,I,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(A)){Ji(I,400);return}let _e=A.headers["sec-websocket-protocol"],Ee=new Set;if(_e!==void 0)try{Ee=Df.parse(_e)}catch{Ii(this,A,I,400,"Invalid Sec-WebSocket-Protocol header");return}let pe=A.headers["sec-websocket-extensions"],te={};if(this.options.perMessageDeflate&&pe!==void 0){let ve=new Ui(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let Nr=Us.parse(pe);Nr[Ui.extensionName]&&(ve.accept(Nr[Ui.extensionName]),te[Ui.extensionName]=ve)}catch{Ii(this,A,I,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let ve={origin:A.headers[`${ie===8?"sec-websocket-origin":"origin"}`],secure:!!(A.socket.authorized||A.socket.encrypted),req:A};if(this.options.verifyClient.length===2){this.options.verifyClient(ve,(Nr,We,ar,Re)=>{if(!Nr)return Ji(I,We||401,ar,Re);this.completeUpgrade(te,$,Ee,A,I,f,K)});return}if(!this.options.verifyClient(ve))return Ji(I,401)}this.completeUpgrade(te,$,Ee,A,I,f,K)}completeUpgrade(A,I,f,K,$,ie,_e){if(!$.readable||!$.writable)return $.destroy();if($[Af])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Is)return Ji($,503);let pe=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Of("sha1").update(I+Tf).digest("base64")}`],te=new this.options.WebSocket(null);if(f.size){let ve=this.options.handleProtocols?this.options.handleProtocols(f,K):f.values().next().value;ve&&(pe.push(`Sec-WebSocket-Protocol: ${ve}`),te._protocol=ve)}if(A[Ui.extensionName]){let ve=A[Ui.extensionName].params,Nr=Us.format({[Ui.extensionName]:[ve]});pe.push(`Sec-WebSocket-Extensions: ${Nr}`),te._extensions=A}this.emit("headers",pe,K),$.write(pe.concat(`\r
2
+ `).join(`\r
3
+ `)),$.removeListener("error",xs),te.setSocket($,ie,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(te),te.on("close",()=>{this.clients.delete(te),this._shouldEmitClose&&!this.clients.size&&process.nextTick($i,this)})),_e(te,K)}};Hs.exports=Ia;function Cf(x,A){for(let I of Object.keys(A))x.on(I,A[I]);return function(){for(let f of Object.keys(A))x.removeListener(f,A[f])}}function $i(x){x._state=zs,x.emit("close")}function xs(){this.destroy()}function Ji(x,A,I,f){I=I||da.STATUS_CODES[A],f={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(I),...f},x.once("finish",x.destroy),x.end(`HTTP/1.1 ${A} ${da.STATUS_CODES[A]}\r
4
+ `+Object.keys(f).map(K=>`${K}: ${f[K]}`).join(`\r
5
+ `)+`\r
6
+ \r
7
+ `+I)}function Ii(x,A,I,f,K){if(x.listenerCount("wsClientError")){let $=new Error(K);Error.captureStackTrace($,Ii),x.emit("wsClientError",$,I,A)}else Ji(I,f,K)}});var An=hi((bc,Ys)=>{"use strict";var Ai=Ua();Ai.createWebSocketStream=Rs();Ai.Server=Ws();Ai.Receiver=Ta();Ai.Sender=Aa();Ai.WebSocket=Ai;Ai.WebSocketServer=Ai.Server;Ys.exports=Ai});var qs={};gi(qs,{default:()=>Rf,dependenciesTotalSize:()=>Pf,dependencyFilename:()=>js});function Rf(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(u,c)=>{throw c},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(u){return f.locateFile?f.locateFile(u,ve):ve+u}var We,ar,Re;function Wr(u){if(u instanceof Ur)return;fe("exiting due to exception: "+u)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(u,c)=>(yr(),u=Me.normalize(u),J.readFileSync(u,c?void 0:"utf8")),Re=u=>{var c=We(u,!0);return c.buffer||(c=new Uint8Array(c)),c},ar=(u,c,m)=>{yr(),u=Me.normalize(u),J.readFile(u,function(y,b){y?m(y):c(b.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(u){if(!(u instanceof Ur))throw u}),process.on("unhandledRejection",function(u){throw u}),_e=(u,c)=>{if(Mr())throw process.exitCode=u,c;Wr(c),process.exit(u)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(u,c){u||me(c)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(u,c,m){for(var y=c+m,b=c;u[b]&&!(b>=y);)++b;if(b-c>16&&u.buffer&&ct)return ct.decode(u.subarray(c,b));for(var d="";c<b;){var p=u[c++];if(!(p&128)){d+=String.fromCharCode(p);continue}var n=u[c++]&63;if((p&224)==192){d+=String.fromCharCode((p&31)<<6|n);continue}var r=u[c++]&63;if((p&240)==224?p=(p&15)<<12|n<<6|r:p=(p&7)<<18|n<<12|r<<6|u[c++]&63,p<65536)d+=String.fromCharCode(p);else{var e=p-65536;d+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return d}function ne(u,c){return u?ze(le,u,c):""}function Ze(u,c,m,y){if(!(y>0))return 0;for(var b=m,d=m+y-1,p=0;p<u.length;++p){var n=u.charCodeAt(p);if(n>=55296&&n<=57343){var r=u.charCodeAt(++p);n=65536+((n&1023)<<10)|r&1023}if(n<=127){if(m>=d)break;c[m++]=n}else if(n<=2047){if(m+1>=d)break;c[m++]=192|n>>6,c[m++]=128|n&63}else if(n<=65535){if(m+2>=d)break;c[m++]=224|n>>12,c[m++]=128|n>>6&63,c[m++]=128|n&63}else{if(m+3>=d)break;c[m++]=240|n>>18,c[m++]=128|n>>12&63,c[m++]=128|n>>6&63,c[m++]=128|n&63}}return c[m]=0,m-b}function Fe(u,c,m){return Ze(u,le,c,m)}function Ce(u){for(var c=0,m=0;m<u.length;++m){var y=u.charCodeAt(m);y<=127?c++:y<=2047?c+=2:y>=55296&&y<=57343?(c+=4,++m):c+=3}return c}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(u){Rr=u,f.HEAP8=ee=new Int8Array(u),f.HEAP16=we=new Int16Array(u),f.HEAP32=E=new Int32Array(u),f.HEAPU8=le=new Uint8Array(u),f.HEAPU16=lt=new Uint16Array(u),f.HEAPU32=j=new Uint32Array(u),f.HEAPF32=Hn=new Float32Array(u),f.HEAPF64=dt=new Float64Array(u)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!v.init.initialized&&v.init(),v.ignorePermissions=!1,gr.init(),he.root=v.mount(he,{},null),Se.root=v.mount(Se,{},null),_r(vt)}function Kn(){fr(),_r(Wn),v.quit(),gr.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(u){mt.unshift(u)}function $n(u){vt.unshift(u)}function Jn(u){pt.unshift(u)}var Pe=0,Lr=null,$e=null;function Ci(u){return u}function dr(u){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(u){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var c=$e;$e=null,c()}}function me(u){f.onAbort&&f.onAbort(u),u="Aborted("+u+")",fe(u),Tr=!0,Pr=1,u+=". Build with -sASSERTIONS for more info.";var c=new WebAssembly.RuntimeError(u);throw c}var Qn="data:application/octet-stream;base64,";function ht(u){return u.startsWith(Qn)}var de;de=js,ht(de)||(de=Nr(de));function yt(u){try{if(u==de&&qe)return new Uint8Array(qe);if(Re)return Re(u);throw"both async and sync fetching of the wasm failed"}catch(c){me(c)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(u){if(!u.ok)throw"failed to load wasm binary file at '"+de+"'";return u.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var u={a:mr};function c(p,n){var r=p.exports;f.asm=r,ir=f.asm.$a,_t(ir.buffer),ln=f.asm.lb,$n(f.asm.ab),Je("wasm-instantiate")}dr("wasm-instantiate");function m(p){c(p.instance)}function y(p){return eo().then(function(n){return WebAssembly.instantiate(n,u)}).then(function(n){return n}).then(p,function(n){fe("failed to asynchronously prepare wasm: "+n),me(n)})}function b(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(p){var n=WebAssembly.instantiateStreaming(p,u);return n.then(m,function(r){return fe("wasm streaming compile failed: "+r),fe("falling back to ArrayBuffer instantiation"),y(m)})}):y(m)}if(f.instantiateWasm)try{var d=f.instantiateWasm(u,c);return d}catch(p){return fe("Module.instantiateWasm callback failed with error: "+p),!1}return b(),{}}var U,Z;function Ur(u){this.name="ExitStatus",this.message="Program terminated with exit("+u+")",this.status=u}function _r(u){for(;u.length>0;)u.shift()(f)}function Et(u,c){ee.set(u,c)}function to(u,c,m,y){me("Assertion failed: "+ne(u)+", at: "+[c?ne(c):"unknown filename",m,y?ne(y):"unknown function"])}var wt=[];function Y(u){var c=wt[u];return c||(u>=wt.length&&(wt.length=u+1),wt[u]=c=ln.get(u)),c}function no(u,c){Y(u)(c)}var Q={isAbs:u=>u.charAt(0)==="/",splitPath:u=>{var c=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return c.exec(u).slice(1)},normalizeArray:(u,c)=>{for(var m=0,y=u.length-1;y>=0;y--){var b=u[y];b==="."?u.splice(y,1):b===".."?(u.splice(y,1),m++):m&&(u.splice(y,1),m--)}if(c)for(;m;m--)u.unshift("..");return u},normalize:u=>{var c=Q.isAbs(u),m=u.substr(-1)==="/";return u=Q.normalizeArray(u.split("/").filter(y=>!!y),!c).join("/"),!u&&!c&&(u="."),u&&m&&(u+="/"),(c?"/":"")+u},dirname:u=>{var c=Q.splitPath(u),m=c[0],y=c[1];return!m&&!y?".":(y&&(y=y.substr(0,y.length-1)),m+y)},basename:u=>{if(u==="/")return"/";u=Q.normalize(u),u=u.replace(/\/$/,"");var c=u.lastIndexOf("/");return c===-1?u:u.substr(c+1)},join:function(){var u=Array.prototype.slice.call(arguments);return Q.normalize(u.join("/"))},join2:(u,c)=>Q.normalize(u+"/"+c)};function Er(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var u=new Uint8Array(1);return()=>(crypto.getRandomValues(u),u[0])}else if(te)try{var c=require("crypto");return()=>c.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var ge={resolve:function(){for(var u="",c=!1,m=arguments.length-1;m>=-1&&!c;m--){var y=m>=0?arguments[m]:v.cwd();if(typeof y!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!y)return"";u=y+"/"+u,c=Q.isAbs(y)}return u=Q.normalizeArray(u.split("/").filter(b=>!!b),!c).join("/"),(c?"/":"")+u||"."},relative:(u,c)=>{u=ge.resolve(u).substr(1),c=ge.resolve(c).substr(1);function m(e){for(var o=0;o<e.length&&e[o]==="";o++);for(var t=e.length-1;t>=0&&e[t]==="";t--);return o>t?[]:e.slice(o,t-o+1)}for(var y=m(u.split("/")),b=m(c.split("/")),d=Math.min(y.length,b.length),p=d,n=0;n<d;n++)if(y[n]!==b[n]){p=n;break}for(var r=[],n=p;n<y.length;n++)r.push("..");return r=r.concat(b.slice(p)),r.join("/")}};function wr(u,c,m){var y=m>0?m:Ce(u)+1,b=new Array(y),d=Ze(u,b,0,b.length);return c&&(b.length=d),b}var gr={ttys:[],init:function(){},shutdown:function(){},register:function(u,c){gr.ttys[u]={input:[],output:[],ops:c},v.registerDevice(u,gr.stream_ops)},stream_ops:{open:function(u){var c=gr.ttys[u.node.rdev];if(!c)throw new v.ErrnoError(43);u.tty=c,u.seekable=!1},close:function(u){u.tty.ops.fsync(u.tty)},fsync:function(u){u.tty.ops.fsync(u.tty)},read:function(u,c,m,y,b){if(!u.tty||!u.tty.ops.get_char)throw new v.ErrnoError(60);for(var d=0,p=0;p<y;p++){var n;try{n=u.tty.ops.get_char(u.tty)}catch{throw new v.ErrnoError(29)}if(n===void 0&&d===0)throw new v.ErrnoError(6);if(n==null)break;d++,c[m+p]=n}return d&&(u.node.timestamp=Date.now()),d},write:function(u,c,m,y,b){if(!u.tty||!u.tty.ops.put_char)throw new v.ErrnoError(60);try{for(var d=0;d<y;d++)u.tty.ops.put_char(u.tty,c[m+d])}catch{throw new v.ErrnoError(29)}return y&&(u.node.timestamp=Date.now()),d}},default_tty_ops:{get_char:function(u){if(!u.input.length){var c=null;if(te){var m=256,y=Buffer.alloc(m),b=0;try{b=J.readSync(process.stdin.fd,y,0,m,-1)}catch(d){if(d.toString().includes("EOF"))b=0;else throw d}b>0?c=y.slice(0,b).toString("utf-8"):c=null}else typeof window<"u"&&typeof window.prompt=="function"?(c=window.prompt("Input: "),c!==null&&(c+=`
8
+ `)):typeof readline=="function"&&(c=readline(),c!==null&&(c+=`
9
+ `));if(!c)return null;u.input=wr(c,!0)}return u.input.shift()},put_char:function(u,c){c===null||c===10?(er(ze(u.output,0)),u.output=[]):c!=0&&u.output.push(c)},fsync:function(u){u.output&&u.output.length>0&&(er(ze(u.output,0)),u.output=[])}},default_tty1_ops:{put_char:function(u,c){c===null||c===10?(fe(ze(u.output,0)),u.output=[]):c!=0&&u.output.push(c)},fsync:function(u){u.output&&u.output.length>0&&(fe(ze(u.output,0)),u.output=[])}}};function Ir(u,c){return le.fill(0,u,u+c),u}function G(u,c){return Math.ceil(u/c)*c}function Ct(u){u=G(u,65536);var c=cr(65536,u);return c?Ir(c,u):0}var re={ops_table:null,mount:function(u){return re.createNode(null,"/",16895,0)},createNode:function(u,c,m,y){if(v.isBlkdev(m)||v.isFIFO(m))throw new v.ErrnoError(63);re.ops_table||(re.ops_table={dir:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,lookup:re.node_ops.lookup,mknod:re.node_ops.mknod,rename:re.node_ops.rename,unlink:re.node_ops.unlink,rmdir:re.node_ops.rmdir,readdir:re.node_ops.readdir,symlink:re.node_ops.symlink},stream:{llseek:re.stream_ops.llseek}},file:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:{llseek:re.stream_ops.llseek,read:re.stream_ops.read,write:re.stream_ops.write,allocate:re.stream_ops.allocate,mmap:re.stream_ops.mmap,msync:re.stream_ops.msync}},link:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,readlink:re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:v.chrdev_stream_ops}});var b=v.createNode(u,c,m,y);return v.isDir(b.mode)?(b.node_ops=re.ops_table.dir.node,b.stream_ops=re.ops_table.dir.stream,b.contents={}):v.isFile(b.mode)?(b.node_ops=re.ops_table.file.node,b.stream_ops=re.ops_table.file.stream,b.usedBytes=0,b.contents=null):v.isLink(b.mode)?(b.node_ops=re.ops_table.link.node,b.stream_ops=re.ops_table.link.stream):v.isChrdev(b.mode)&&(b.node_ops=re.ops_table.chrdev.node,b.stream_ops=re.ops_table.chrdev.stream),b.timestamp=Date.now(),u&&(u.contents[c]=b,u.timestamp=b.timestamp),b},getFileDataAsTypedArray:function(u){return u.contents?u.contents.subarray?u.contents.subarray(0,u.usedBytes):new Uint8Array(u.contents):new Uint8Array(0)},expandFileStorage:function(u,c){var m=u.contents?u.contents.length:0;if(!(m>=c)){var y=1024*1024;c=Math.max(c,m*(m<y?2:1.125)>>>0),m!=0&&(c=Math.max(c,256));var b=u.contents;u.contents=new Uint8Array(c),u.usedBytes>0&&u.contents.set(b.subarray(0,u.usedBytes),0)}},resizeFileStorage:function(u,c){if(u.usedBytes!=c)if(c==0)u.contents=null,u.usedBytes=0;else{var m=u.contents;u.contents=new Uint8Array(c),m&&u.contents.set(m.subarray(0,Math.min(c,u.usedBytes))),u.usedBytes=c}},node_ops:{getattr:function(u){var c={};return c.dev=v.isChrdev(u.mode)?u.id:1,c.ino=u.id,c.mode=u.mode,c.nlink=1,c.uid=0,c.gid=0,c.rdev=u.rdev,v.isDir(u.mode)?c.size=4096:v.isFile(u.mode)?c.size=u.usedBytes:v.isLink(u.mode)?c.size=u.link.length:c.size=0,c.atime=new Date(u.timestamp),c.mtime=new Date(u.timestamp),c.ctime=new Date(u.timestamp),c.blksize=4096,c.blocks=Math.ceil(c.size/c.blksize),c},setattr:function(u,c){c.mode!==void 0&&(u.mode=c.mode),c.timestamp!==void 0&&(u.timestamp=c.timestamp),c.size!==void 0&&re.resizeFileStorage(u,c.size)},lookup:function(u,c){throw v.genericErrors[44]},mknod:function(u,c,m,y){return re.createNode(u,c,m,y)},rename:function(u,c,m){if(v.isDir(u.mode)){var y;try{y=v.lookupNode(c,m)}catch{}if(y)for(var b in y.contents)throw new v.ErrnoError(55)}delete u.parent.contents[u.name],u.parent.timestamp=Date.now(),u.name=m,c.contents[m]=u,c.timestamp=u.parent.timestamp,u.parent=c},unlink:function(u,c){delete u.contents[c],u.timestamp=Date.now()},rmdir:function(u,c){var m=v.lookupNode(u,c);for(var y in m.contents)throw new v.ErrnoError(55);delete u.contents[c],u.timestamp=Date.now()},readdir:function(u){var c=[".",".."];for(var m in u.contents)u.contents.hasOwnProperty(m)&&c.push(m);return c},symlink:function(u,c,m){var y=re.createNode(u,c,41471,0);return y.link=m,y},readlink:function(u){if(!v.isLink(u.mode))throw new v.ErrnoError(28);return u.link}},stream_ops:{read:function(u,c,m,y,b){var d=u.node.contents;if(b>=u.node.usedBytes)return 0;var p=Math.min(u.node.usedBytes-b,y);if(p>8&&d.subarray)c.set(d.subarray(b,b+p),m);else for(var n=0;n<p;n++)c[m+n]=d[b+n];return p},write:function(u,c,m,y,b,d){if(c.buffer===ee.buffer&&(d=!1),!y)return 0;var p=u.node;if(p.timestamp=Date.now(),c.subarray&&(!p.contents||p.contents.subarray)){if(d)return p.contents=c.subarray(m,m+y),p.usedBytes=y,y;if(p.usedBytes===0&&b===0)return p.contents=c.slice(m,m+y),p.usedBytes=y,y;if(b+y<=p.usedBytes)return p.contents.set(c.subarray(m,m+y),b),y}if(re.expandFileStorage(p,b+y),p.contents.subarray&&c.subarray)p.contents.set(c.subarray(m,m+y),b);else for(var n=0;n<y;n++)p.contents[b+n]=c[m+n];return p.usedBytes=Math.max(p.usedBytes,b+y),y},llseek:function(u,c,m){var y=c;if(m===1?y+=u.position:m===2&&v.isFile(u.node.mode)&&(y+=u.node.usedBytes),y<0)throw new v.ErrnoError(28);return y},allocate:function(u,c,m){re.expandFileStorage(u.node,c+m),u.node.usedBytes=Math.max(u.node.usedBytes,c+m)},mmap:function(u,c,m,y,b){if(!v.isFile(u.node.mode))throw new v.ErrnoError(43);var d,p,n=u.node.contents;if(!(b&2)&&n.buffer===Rr)p=!1,d=n.byteOffset;else{if((m>0||m+c<n.length)&&(n.subarray?n=n.subarray(m,m+c):n=Array.prototype.slice.call(n,m,m+c)),p=!0,d=Ct(c),!d)throw new v.ErrnoError(48);ee.set(n,d)}return{ptr:d,allocated:p}},msync:function(u,c,m,y,b){return re.stream_ops.write(u,c,0,y,m,!1),0}}};function V(u,c,m,y){var b=y?"":"al "+u;ar(u,d=>{Le(d,'Loading data file "'+u+'" failed (no arrayBuffer).'),c(new Uint8Array(d)),b&&Je(b)},d=>{if(m)m();else throw'Loading data file "'+u+'" failed.'}),b&&dr(b)}var i={},C={isWindows:!1,staticInit:()=>{C.isWindows=!!process.platform.match(/^win/);var u=process.binding("constants");u.fs&&(u=u.fs),C.flagsForNodeMap={1024:u.O_APPEND,64:u.O_CREAT,128:u.O_EXCL,256:u.O_NOCTTY,0:u.O_RDONLY,2:u.O_RDWR,4096:u.O_SYNC,512:u.O_TRUNC,1:u.O_WRONLY,131072:u.O_NOFOLLOW}},convertNodeCode:u=>{var c=u.code;return i[c]},mount:u=>C.createNode(null,"/",C.getMode(u.opts.root),0),createNode:(u,c,m,y)=>{if(!v.isDir(m)&&!v.isFile(m)&&!v.isLink(m))throw new v.ErrnoError(28);var b=v.createNode(u,c,m);return b.node_ops=C.node_ops,b.stream_ops=C.stream_ops,b},getMode:u=>{var c;try{c=J.lstatSync(u),C.isWindows&&(c.mode=c.mode|(c.mode&292)>>2)}catch(m){throw m.code?new v.ErrnoError(C.convertNodeCode(m)):m}return c.mode},realPath:u=>{for(var c=[];u.parent!==u;)c.push(u.name),u=u.parent;return c.push(u.mount.opts.root),c.reverse(),Q.join.apply(null,c)},flagsForNode:u=>{u&=-2097153,u&=-2049,u&=-32769,u&=-524289,u&=-65537;var c=0;for(var m in C.flagsForNodeMap)u&m&&(c|=C.flagsForNodeMap[m],u^=m);if(u)throw new v.ErrnoError(28);return c},node_ops:{getattr:u=>{var c=C.realPath(u),m;try{m=J.lstatSync(c)}catch(y){throw y.code?new v.ErrnoError(C.convertNodeCode(y)):y}return C.isWindows&&!m.blksize&&(m.blksize=4096),C.isWindows&&!m.blocks&&(m.blocks=(m.size+m.blksize-1)/m.blksize|0),{dev:m.dev,ino:m.ino,mode:m.mode,nlink:m.nlink,uid:m.uid,gid:m.gid,rdev:m.rdev,size:m.size,atime:m.atime,mtime:m.mtime,ctime:m.ctime,blksize:m.blksize,blocks:m.blocks}},setattr:(u,c)=>{var m=C.realPath(u);try{if(c.mode!==void 0&&(J.chmodSync(m,c.mode),u.mode=c.mode),c.timestamp!==void 0){var y=new Date(c.timestamp);J.utimesSync(m,y,y)}c.size!==void 0&&J.truncateSync(m,c.size)}catch(b){throw b.code?new v.ErrnoError(C.convertNodeCode(b)):b}},lookup:(u,c)=>{var m=Q.join2(C.realPath(u),c),y=C.getMode(m);return C.createNode(u,c,y)},mknod:(u,c,m,y)=>{var b=C.createNode(u,c,m,y),d=C.realPath(b);try{v.isDir(b.mode)?J.mkdirSync(d,b.mode):J.writeFileSync(d,"",{mode:b.mode})}catch(p){throw p.code?new v.ErrnoError(C.convertNodeCode(p)):p}return b},rename:(u,c,m)=>{var y=C.realPath(u),b=Q.join2(C.realPath(c),m);try{J.renameSync(y,b)}catch(d){throw d.code?new v.ErrnoError(C.convertNodeCode(d)):d}u.name=m},unlink:(u,c)=>{var m=Q.join2(C.realPath(u),c);try{J.unlinkSync(m)}catch(y){throw y.code?new v.ErrnoError(C.convertNodeCode(y)):y}},rmdir:(u,c)=>{var m=Q.join2(C.realPath(u),c);try{J.rmdirSync(m)}catch(y){throw y.code?new v.ErrnoError(C.convertNodeCode(y)):y}},readdir:u=>{var c=C.realPath(u);try{return J.readdirSync(c)}catch(m){throw m.code?new v.ErrnoError(C.convertNodeCode(m)):m}},symlink:(u,c,m)=>{var y=Q.join2(C.realPath(u),c);try{J.symlinkSync(m,y)}catch(b){throw b.code?new v.ErrnoError(C.convertNodeCode(b)):b}},readlink:u=>{var c=C.realPath(u);try{return c=J.readlinkSync(c),c=Me.relative(Me.resolve(u.mount.opts.root),c),c}catch(m){throw m.code?m.code==="UNKNOWN"?new v.ErrnoError(28):new v.ErrnoError(C.convertNodeCode(m)):m}}},stream_ops:{open:u=>{var c=C.realPath(u.node);try{v.isFile(u.node.mode)&&(u.nfd=J.openSync(c,C.flagsForNode(u.flags)))}catch(m){throw m.code?new v.ErrnoError(C.convertNodeCode(m)):m}},close:u=>{try{v.isFile(u.node.mode)&&u.nfd&&J.closeSync(u.nfd)}catch(c){throw c.code?new v.ErrnoError(C.convertNodeCode(c)):c}},read:(u,c,m,y,b)=>{if(y===0)return 0;try{return J.readSync(u.nfd,Buffer.from(c.buffer),m,y,b)}catch(d){throw new v.ErrnoError(C.convertNodeCode(d))}},write:(u,c,m,y,b)=>{try{return J.writeSync(u.nfd,Buffer.from(c.buffer),m,y,b)}catch(d){throw new v.ErrnoError(C.convertNodeCode(d))}},llseek:(u,c,m)=>{var y=c;if(m===1)y+=u.position;else if(m===2&&v.isFile(u.node.mode))try{var b=J.fstatSync(u.nfd);y+=b.size}catch(d){throw new v.ErrnoError(C.convertNodeCode(d))}if(y<0)throw new v.ErrnoError(28);return y},mmap:(u,c,m,y,b)=>{if(!v.isFile(u.node.mode))throw new v.ErrnoError(43);var d=Ct(c);return C.stream_ops.read(u,ee,d,c,m),{ptr:d,allocated:!0}},msync:(u,c,m,y,b)=>(C.stream_ops.write(u,c,0,y,m,!1),0)}},v={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(u,c={})=>{if(u=ge.resolve(v.cwd(),u),!u)return{path:"",node:null};var m={follow_mount:!0,recurse_count:0};if(c=Object.assign(m,c),c.recurse_count>8)throw new v.ErrnoError(32);for(var y=Q.normalizeArray(u.split("/").filter(t=>!!t),!1),b=v.root,d="/",p=0;p<y.length;p++){var n=p===y.length-1;if(n&&c.parent)break;if(b=v.lookupNode(b,y[p]),d=Q.join2(d,y[p]),v.isMountpoint(b)&&(!n||n&&c.follow_mount)&&(b=b.mounted.root),!n||c.follow)for(var r=0;v.isLink(b.mode);){var e=v.readlink(d);d=ge.resolve(Q.dirname(d),e);var o=v.lookupPath(d,{recurse_count:c.recurse_count+1});if(b=o.node,r++>40)throw new v.ErrnoError(32)}}return{path:d,node:b}},getPath:u=>{for(var c;;){if(v.isRoot(u)){var m=u.mount.mountpoint;return c?m[m.length-1]!=="/"?m+"/"+c:m+c:m}c=c?u.name+"/"+c:u.name,u=u.parent}},hashName:(u,c)=>{for(var m=0,y=0;y<c.length;y++)m=(m<<5)-m+c.charCodeAt(y)|0;return(u+m>>>0)%v.nameTable.length},hashAddNode:u=>{var c=v.hashName(u.parent.id,u.name);u.name_next=v.nameTable[c],v.nameTable[c]=u},hashRemoveNode:u=>{var c=v.hashName(u.parent.id,u.name);if(v.nameTable[c]===u)v.nameTable[c]=u.name_next;else for(var m=v.nameTable[c];m;){if(m.name_next===u){m.name_next=u.name_next;break}m=m.name_next}},lookupNode:(u,c)=>{var m=v.mayLookup(u);if(m)throw new v.ErrnoError(m,u);for(var y=v.hashName(u.id,c),b=v.nameTable[y];b;b=b.name_next){var d=b.name;if(b.parent.id===u.id&&d===c)return b}return v.lookup(u,c)},createNode:(u,c,m,y)=>{var b=new v.FSNode(u,c,m,y);return v.hashAddNode(b),b},destroyNode:u=>{v.hashRemoveNode(u)},isRoot:u=>u===u.parent,isMountpoint:u=>!!u.mounted,isFile:u=>(u&61440)===32768,isDir:u=>(u&61440)===16384,isLink:u=>(u&61440)===40960,isChrdev:u=>(u&61440)===8192,isBlkdev:u=>(u&61440)===24576,isFIFO:u=>(u&61440)===4096,isSocket:u=>(u&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:u=>{var c=v.flagModes[u];if(typeof c>"u")throw new Error("Unknown file open mode: "+u);return c},flagsToPermissionString:u=>{var c=["r","w","rw"][u&3];return u&512&&(c+="w"),c},nodePermissions:(u,c)=>v.ignorePermissions?0:c.includes("r")&&!(u.mode&292)||c.includes("w")&&!(u.mode&146)||c.includes("x")&&!(u.mode&73)?2:0,mayLookup:u=>{var c=v.nodePermissions(u,"x");return c||(u.node_ops.lookup?0:2)},mayCreate:(u,c)=>{try{var m=v.lookupNode(u,c);return 20}catch{}return v.nodePermissions(u,"wx")},mayDelete:(u,c,m)=>{var y;try{y=v.lookupNode(u,c)}catch(d){return d.errno}var b=v.nodePermissions(u,"wx");if(b)return b;if(m){if(!v.isDir(y.mode))return 54;if(v.isRoot(y)||v.getPath(y)===v.cwd())return 10}else if(v.isDir(y.mode))return 31;return 0},mayOpen:(u,c)=>u?v.isLink(u.mode)?32:v.isDir(u.mode)&&(v.flagsToPermissionString(c)!=="r"||c&512)?31:v.nodePermissions(u,v.flagsToPermissionString(c)):44,MAX_OPEN_FDS:4096,nextfd:(u=0,c=v.MAX_OPEN_FDS)=>{for(var m=u;m<=c;m++)if(!v.streams[m])return m;throw new v.ErrnoError(33)},getStream:u=>v.streams[u],createStream:(u,c,m)=>{v.FSStream||(v.FSStream=function(){this.shared={}},v.FSStream.prototype={},Object.defineProperties(v.FSStream.prototype,{object:{get:function(){return this.node},set:function(b){this.node=b}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(b){this.shared.flags=b}},position:{get:function(){return this.shared.position},set:function(b){this.shared.position=b}}})),u=Object.assign(new v.FSStream,u);var y=v.nextfd(c,m);return u.fd=y,v.streams[y]=u,u},closeStream:u=>{v.streams[u]=null},chrdev_stream_ops:{open:u=>{var c=v.getDevice(u.node.rdev);u.stream_ops=c.stream_ops,u.stream_ops.open&&u.stream_ops.open(u)},llseek:()=>{throw new v.ErrnoError(70)}},major:u=>u>>8,minor:u=>u&255,makedev:(u,c)=>u<<8|c,registerDevice:(u,c)=>{v.devices[u]={stream_ops:c}},getDevice:u=>v.devices[u],getMounts:u=>{for(var c=[],m=[u];m.length;){var y=m.pop();c.push(y),m.push.apply(m,y.mounts)}return c},syncfs:(u,c)=>{typeof u=="function"&&(c=u,u=!1),v.syncFSRequests++,v.syncFSRequests>1&&fe("warning: "+v.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var m=v.getMounts(v.root.mount),y=0;function b(p){return v.syncFSRequests--,c(p)}function d(p){if(p)return d.errored?void 0:(d.errored=!0,b(p));++y>=m.length&&b(null)}m.forEach(p=>{if(!p.type.syncfs)return d(null);p.type.syncfs(p,u,d)})},mount:(u,c,m)=>{var y=m==="/",b=!m,d;if(y&&v.root)throw new v.ErrnoError(10);if(!y&&!b){var p=v.lookupPath(m,{follow_mount:!1});if(m=p.path,d=p.node,v.isMountpoint(d))throw new v.ErrnoError(10);if(!v.isDir(d.mode))throw new v.ErrnoError(54)}var n={type:u,opts:c,mountpoint:m,mounts:[]},r=u.mount(n);return r.mount=n,n.root=r,y?v.root=r:d&&(d.mounted=n,d.mount&&d.mount.mounts.push(n)),r},unmount:u=>{var c=v.lookupPath(u,{follow_mount:!1});if(!v.isMountpoint(c.node))throw new v.ErrnoError(28);var m=c.node,y=m.mounted,b=v.getMounts(y);Object.keys(v.nameTable).forEach(p=>{for(var n=v.nameTable[p];n;){var r=n.name_next;b.includes(n.mount)&&v.destroyNode(n),n=r}}),m.mounted=null;var d=m.mount.mounts.indexOf(y);m.mount.mounts.splice(d,1)},lookup:(u,c)=>u.node_ops.lookup(u,c),mknod:(u,c,m)=>{var y=v.lookupPath(u,{parent:!0}),b=y.node,d=Q.basename(u);if(!d||d==="."||d==="..")throw new v.ErrnoError(28);var p=v.mayCreate(b,d);if(p)throw new v.ErrnoError(p);if(!b.node_ops.mknod)throw new v.ErrnoError(63);return b.node_ops.mknod(b,d,c,m)},create:(u,c)=>(c=c!==void 0?c:438,c&=4095,c|=32768,v.mknod(u,c,0)),mkdir:(u,c)=>(c=c!==void 0?c:511,c&=1023,c|=16384,v.mknod(u,c,0)),mkdirTree:(u,c)=>{for(var m=u.split("/"),y="",b=0;b<m.length;++b)if(m[b]){y+="/"+m[b];try{v.mkdir(y,c)}catch(d){if(d.errno!=20)throw d}}},mkdev:(u,c,m)=>(typeof m>"u"&&(m=c,c=438),c|=8192,v.mknod(u,c,m)),symlink:(u,c)=>{if(!ge.resolve(u))throw new v.ErrnoError(44);var m=v.lookupPath(c,{parent:!0}),y=m.node;if(!y)throw new v.ErrnoError(44);var b=Q.basename(c),d=v.mayCreate(y,b);if(d)throw new v.ErrnoError(d);if(!y.node_ops.symlink)throw new v.ErrnoError(63);return y.node_ops.symlink(y,b,u)},rename:(u,c)=>{var m=Q.dirname(u),y=Q.dirname(c),b=Q.basename(u),d=Q.basename(c),p,n,r;if(p=v.lookupPath(u,{parent:!0}),n=p.node,p=v.lookupPath(c,{parent:!0}),r=p.node,!n||!r)throw new v.ErrnoError(44);if(n.mount!==r.mount)throw new v.ErrnoError(75);var e=v.lookupNode(n,b),o=ge.relative(u,y);if(o.charAt(0)!==".")throw new v.ErrnoError(28);if(o=ge.relative(c,m),o.charAt(0)!==".")throw new v.ErrnoError(55);var t;try{t=v.lookupNode(r,d)}catch{}if(e!==t){var a=v.isDir(e.mode),s=v.mayDelete(n,b,a);if(s)throw new v.ErrnoError(s);if(s=t?v.mayDelete(r,d,a):v.mayCreate(r,d),s)throw new v.ErrnoError(s);if(!n.node_ops.rename)throw new v.ErrnoError(63);if(v.isMountpoint(e)||t&&v.isMountpoint(t))throw new v.ErrnoError(10);if(r!==n&&(s=v.nodePermissions(n,"w"),s))throw new v.ErrnoError(s);v.hashRemoveNode(e);try{n.node_ops.rename(e,r,d)}catch(l){throw l}finally{v.hashAddNode(e)}}},rmdir:u=>{var c=v.lookupPath(u,{parent:!0}),m=c.node,y=Q.basename(u),b=v.lookupNode(m,y),d=v.mayDelete(m,y,!0);if(d)throw new v.ErrnoError(d);if(!m.node_ops.rmdir)throw new v.ErrnoError(63);if(v.isMountpoint(b))throw new v.ErrnoError(10);m.node_ops.rmdir(m,y),v.destroyNode(b)},readdir:u=>{var c=v.lookupPath(u,{follow:!0}),m=c.node;if(!m.node_ops.readdir)throw new v.ErrnoError(54);return m.node_ops.readdir(m)},unlink:u=>{var c=v.lookupPath(u,{parent:!0}),m=c.node;if(!m)throw new v.ErrnoError(44);var y=Q.basename(u),b=v.lookupNode(m,y),d=v.mayDelete(m,y,!1);if(d)throw new v.ErrnoError(d);if(!m.node_ops.unlink)throw new v.ErrnoError(63);if(v.isMountpoint(b))throw new v.ErrnoError(10);m.node_ops.unlink(m,y),v.destroyNode(b)},readlink:u=>{var c=v.lookupPath(u),m=c.node;if(!m)throw new v.ErrnoError(44);if(!m.node_ops.readlink)throw new v.ErrnoError(28);return ge.resolve(v.getPath(m.parent),m.node_ops.readlink(m))},stat:(u,c)=>{var m=v.lookupPath(u,{follow:!c}),y=m.node;if(!y)throw new v.ErrnoError(44);if(!y.node_ops.getattr)throw new v.ErrnoError(63);return y.node_ops.getattr(y)},lstat:u=>v.stat(u,!0),chmod:(u,c,m)=>{var y;if(typeof u=="string"){var b=v.lookupPath(u,{follow:!m});y=b.node}else y=u;if(!y.node_ops.setattr)throw new v.ErrnoError(63);y.node_ops.setattr(y,{mode:c&4095|y.mode&-4096,timestamp:Date.now()})},lchmod:(u,c)=>{v.chmod(u,c,!0)},fchmod:(u,c)=>{var m=v.getStream(u);if(!m)throw new v.ErrnoError(8);v.chmod(m.node,c)},chown:(u,c,m,y)=>{var b;if(typeof u=="string"){var d=v.lookupPath(u,{follow:!y});b=d.node}else b=u;if(!b.node_ops.setattr)throw new v.ErrnoError(63);b.node_ops.setattr(b,{timestamp:Date.now()})},lchown:(u,c,m)=>{v.chown(u,c,m,!0)},fchown:(u,c,m)=>{var y=v.getStream(u);if(!y)throw new v.ErrnoError(8);v.chown(y.node,c,m)},truncate:(u,c)=>{if(c<0)throw new v.ErrnoError(28);var m;if(typeof u=="string"){var y=v.lookupPath(u,{follow:!0});m=y.node}else m=u;if(!m.node_ops.setattr)throw new v.ErrnoError(63);if(v.isDir(m.mode))throw new v.ErrnoError(31);if(!v.isFile(m.mode))throw new v.ErrnoError(28);var b=v.nodePermissions(m,"w");if(b)throw new v.ErrnoError(b);m.node_ops.setattr(m,{size:c,timestamp:Date.now()})},ftruncate:(u,c)=>{var m=v.getStream(u);if(!m)throw new v.ErrnoError(8);if(!(m.flags&2097155))throw new v.ErrnoError(28);v.truncate(m.node,c)},utime:(u,c,m)=>{var y=v.lookupPath(u,{follow:!0}),b=y.node;b.node_ops.setattr(b,{timestamp:Math.max(c,m)})},open:(u,c,m)=>{if(u==="")throw new v.ErrnoError(44);c=typeof c=="string"?v.modeStringToFlags(c):c,m=typeof m>"u"?438:m,c&64?m=m&4095|32768:m=0;var y;if(typeof u=="object")y=u;else{u=Q.normalize(u);try{var b=v.lookupPath(u,{follow:!(c&131072)});y=b.node}catch{}}var d=!1;if(c&64)if(y){if(c&128)throw new v.ErrnoError(20)}else y=v.mknod(u,m,0),d=!0;if(!y)throw new v.ErrnoError(44);if(v.isChrdev(y.mode)&&(c&=-513),c&65536&&!v.isDir(y.mode))throw new v.ErrnoError(54);if(!d){var p=v.mayOpen(y,c);if(p)throw new v.ErrnoError(p)}c&512&&!d&&v.truncate(y,0),c&=-131713;var n=v.createStream({node:y,path:v.getPath(y),flags:c,seekable:!0,position:0,stream_ops:y.stream_ops,ungotten:[],error:!1});return n.stream_ops.open&&n.stream_ops.open(n),f.logReadFiles&&!(c&1)&&(v.readFiles||(v.readFiles={}),u in v.readFiles||(v.readFiles[u]=1)),n},close:u=>{if(v.isClosed(u))throw new v.ErrnoError(8);u.getdents&&(u.getdents=null);try{u.stream_ops.close&&u.stream_ops.close(u)}catch(c){throw c}finally{v.closeStream(u.fd)}u.fd=null},isClosed:u=>u.fd===null,llseek:(u,c,m)=>{if(v.isClosed(u))throw new v.ErrnoError(8);if(!u.seekable||!u.stream_ops.llseek)throw new v.ErrnoError(70);if(m!=0&&m!=1&&m!=2)throw new v.ErrnoError(28);return u.position=u.stream_ops.llseek(u,c,m),u.ungotten=[],u.position},read:(u,c,m,y,b)=>{if(y<0||b<0)throw new v.ErrnoError(28);if(v.isClosed(u))throw new v.ErrnoError(8);if((u.flags&2097155)===1)throw new v.ErrnoError(8);if(v.isDir(u.node.mode))throw new v.ErrnoError(31);if(!u.stream_ops.read)throw new v.ErrnoError(28);var d=typeof b<"u";if(!d)b=u.position;else if(!u.seekable)throw new v.ErrnoError(70);var p=u.stream_ops.read(u,c,m,y,b);return d||(u.position+=p),p},write:(u,c,m,y,b,d)=>{if(y<0||b<0)throw new v.ErrnoError(28);if(v.isClosed(u))throw new v.ErrnoError(8);if(!(u.flags&2097155))throw new v.ErrnoError(8);if(v.isDir(u.node.mode))throw new v.ErrnoError(31);if(!u.stream_ops.write)throw new v.ErrnoError(28);u.seekable&&u.flags&1024&&v.llseek(u,0,2);var p=typeof b<"u";if(!p)b=u.position;else if(!u.seekable)throw new v.ErrnoError(70);var n=u.stream_ops.write(u,c,m,y,b,d);return p||(u.position+=n),n},allocate:(u,c,m)=>{if(v.isClosed(u))throw new v.ErrnoError(8);if(c<0||m<=0)throw new v.ErrnoError(28);if(!(u.flags&2097155))throw new v.ErrnoError(8);if(!v.isFile(u.node.mode)&&!v.isDir(u.node.mode))throw new v.ErrnoError(43);if(!u.stream_ops.allocate)throw new v.ErrnoError(138);u.stream_ops.allocate(u,c,m)},mmap:(u,c,m,y,b)=>{if(y&2&&!(b&2)&&(u.flags&2097155)!==2)throw new v.ErrnoError(2);if((u.flags&2097155)===1)throw new v.ErrnoError(2);if(!u.stream_ops.mmap)throw new v.ErrnoError(43);return u.stream_ops.mmap(u,c,m,y,b)},msync:(u,c,m,y,b)=>u.stream_ops.msync?u.stream_ops.msync(u,c,m,y,b):0,munmap:u=>0,ioctl:(u,c,m)=>{if(!u.stream_ops.ioctl)throw new v.ErrnoError(59);return u.stream_ops.ioctl(u,c,m)},readFile:(u,c={})=>{if(c.flags=c.flags||0,c.encoding=c.encoding||"binary",c.encoding!=="utf8"&&c.encoding!=="binary")throw new Error('Invalid encoding type "'+c.encoding+'"');var m,y=v.open(u,c.flags),b=v.stat(u),d=b.size,p=new Uint8Array(d);return v.read(y,p,0,d,0),c.encoding==="utf8"?m=ze(p,0):c.encoding==="binary"&&(m=p),v.close(y),m},writeFile:(u,c,m={})=>{m.flags=m.flags||577;var y=v.open(u,m.flags,m.mode);if(typeof c=="string"){var b=new Uint8Array(Ce(c)+1),d=Ze(c,b,0,b.length);v.write(y,b,0,d,void 0,m.canOwn)}else if(ArrayBuffer.isView(c))v.write(y,c,0,c.byteLength,void 0,m.canOwn);else throw new Error("Unsupported data type");v.close(y)},cwd:()=>v.currentPath,chdir:u=>{var c=v.lookupPath(u,{follow:!0});if(c.node===null)throw new v.ErrnoError(44);if(!v.isDir(c.node.mode))throw new v.ErrnoError(54);var m=v.nodePermissions(c.node,"x");if(m)throw new v.ErrnoError(m);v.currentPath=c.path},createDefaultDirectories:()=>{v.mkdir("/tmp"),v.mkdir("/home"),v.mkdir("/home/web_user")},createDefaultDevices:()=>{v.mkdir("/dev"),v.registerDevice(v.makedev(1,3),{read:()=>0,write:(c,m,y,b,d)=>b}),v.mkdev("/dev/null",v.makedev(1,3)),gr.register(v.makedev(5,0),gr.default_tty_ops),gr.register(v.makedev(6,0),gr.default_tty1_ops),v.mkdev("/dev/tty",v.makedev(5,0)),v.mkdev("/dev/tty1",v.makedev(6,0));var u=Er();v.createDevice("/dev","random",u),v.createDevice("/dev","urandom",u),v.mkdir("/dev/shm"),v.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{v.mkdir("/proc");var u=v.mkdir("/proc/self");v.mkdir("/proc/self/fd"),v.mount({mount:()=>{var c=v.createNode(u,"fd",16895,73);return c.node_ops={lookup:(m,y)=>{var b=+y,d=v.getStream(b);if(!d)throw new v.ErrnoError(8);var p={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>d.path}};return p.parent=p,p}},c}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?v.createDevice("/dev","stdin",f.stdin):v.symlink("/dev/tty","/dev/stdin"),f.stdout?v.createDevice("/dev","stdout",null,f.stdout):v.symlink("/dev/tty","/dev/stdout"),f.stderr?v.createDevice("/dev","stderr",null,f.stderr):v.symlink("/dev/tty1","/dev/stderr");var u=v.open("/dev/stdin",0),c=v.open("/dev/stdout",1),m=v.open("/dev/stderr",1)},ensureErrnoError:()=>{v.ErrnoError||(v.ErrnoError=function(c,m){this.node=m,this.setErrno=function(y){this.errno=y},this.setErrno(c),this.message="FS error"},v.ErrnoError.prototype=new Error,v.ErrnoError.prototype.constructor=v.ErrnoError,[44].forEach(u=>{v.genericErrors[u]=new v.ErrnoError(u),v.genericErrors[u].stack="<generic error, no stack>"}))},staticInit:()=>{v.ensureErrnoError(),v.nameTable=new Array(4096),v.mount(re,{},"/"),v.createDefaultDirectories(),v.createDefaultDevices(),v.createSpecialDirectories(),v.filesystems={MEMFS:re,NODEFS:C}},init:(u,c,m)=>{v.init.initialized=!0,v.ensureErrnoError(),f.stdin=u||f.stdin,f.stdout=c||f.stdout,f.stderr=m||f.stderr,v.createStandardStreams()},quit:()=>{v.init.initialized=!1,un(0);for(var u=0;u<v.streams.length;u++){var c=v.streams[u];c&&v.close(c)}},getMode:(u,c)=>{var m=0;return u&&(m|=365),c&&(m|=146),m},findObject:(u,c)=>{var m=v.analyzePath(u,c);return m.exists?m.object:null},analyzePath:(u,c)=>{try{var m=v.lookupPath(u,{follow:!c});u=m.path}catch{}var y={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var m=v.lookupPath(u,{parent:!0});y.parentExists=!0,y.parentPath=m.path,y.parentObject=m.node,y.name=Q.basename(u),m=v.lookupPath(u,{follow:!c}),y.exists=!0,y.path=m.path,y.object=m.node,y.name=m.node.name,y.isRoot=m.path==="/"}catch(b){y.error=b.errno}return y},createPath:(u,c,m,y)=>{u=typeof u=="string"?u:v.getPath(u);for(var b=c.split("/").reverse();b.length;){var d=b.pop();if(d){var p=Q.join2(u,d);try{v.mkdir(p)}catch{}u=p}}return p},createFile:(u,c,m,y,b)=>{var d=Q.join2(typeof u=="string"?u:v.getPath(u),c),p=v.getMode(y,b);return v.create(d,p)},createDataFile:(u,c,m,y,b,d)=>{var p=c;u&&(u=typeof u=="string"?u:v.getPath(u),p=c?Q.join2(u,c):u);var n=v.getMode(y,b),r=v.create(p,n);if(m){if(typeof m=="string"){for(var e=new Array(m.length),o=0,t=m.length;o<t;++o)e[o]=m.charCodeAt(o);m=e}v.chmod(r,n|146);var a=v.open(r,577);v.write(a,m,0,m.length,0,d),v.close(a),v.chmod(r,n)}return r},createDevice:(u,c,m,y)=>{var b=Q.join2(typeof u=="string"?u:v.getPath(u),c),d=v.getMode(!!m,!!y);v.createDevice.major||(v.createDevice.major=64);var p=v.makedev(v.createDevice.major++,0);return v.registerDevice(p,{open:n=>{n.seekable=!1},close:n=>{y&&y.buffer&&y.buffer.length&&y(10)},read:(n,r,e,o,t)=>{for(var a=0,s=0;s<o;s++){var l;try{l=m()}catch{throw new v.ErrnoError(29)}if(l===void 0&&a===0)throw new v.ErrnoError(6);if(l==null)break;a++,r[e+s]=l}return a&&(n.node.timestamp=Date.now()),a},write:(n,r,e,o,t)=>{for(var a=0;a<o;a++)try{y(r[e+a])}catch{throw new v.ErrnoError(29)}return o&&(n.node.timestamp=Date.now()),a}}),v.mkdev(b,d,p)},forceLoadFile:u=>{if(u.isDevice||u.isFolder||u.link||u.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{u.contents=wr(We(u.url),!0),u.usedBytes=u.contents.length}catch{throw new v.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(u,c,m,y,b)=>{function d(){this.lengthKnown=!1,this.chunks=[]}if(d.prototype.get=function(s){if(!(s>this.length-1||s<0)){var l=s%this.chunkSize,h=s/this.chunkSize|0;return this.getter(h)[l]}},d.prototype.setDataGetter=function(s){this.getter=s},d.prototype.cacheLength=function(){var s=new XMLHttpRequest;if(s.open("HEAD",m,!1),s.send(null),!(s.status>=200&&s.status<300||s.status===304))throw new Error("Couldn't load "+m+". Status: "+s.status);var l=Number(s.getResponseHeader("Content-length")),h,w=(h=s.getResponseHeader("Accept-Ranges"))&&h==="bytes",S=(h=s.getResponseHeader("Content-Encoding"))&&h==="gzip",O=1024*1024;w||(O=l);var N=(F,L)=>{if(F>L)throw new Error("invalid range ("+F+", "+L+") or no bytes requested!");if(L>l-1)throw new Error("only "+l+" bytes available! programmer error!");var R=new XMLHttpRequest;if(R.open("GET",m,!1),l!==O&&R.setRequestHeader("Range","bytes="+F+"-"+L),R.responseType="arraybuffer",R.overrideMimeType&&R.overrideMimeType("text/plain; charset=x-user-defined"),R.send(null),!(R.status>=200&&R.status<300||R.status===304))throw new Error("Couldn't load "+m+". Status: "+R.status);return R.response!==void 0?new Uint8Array(R.response||[]):wr(R.responseText||"",!0)},T=this;T.setDataGetter(F=>{var L=F*O,R=(F+1)*O-1;if(R=Math.min(R,l-1),typeof T.chunks[F]>"u"&&(T.chunks[F]=N(L,R)),typeof T.chunks[F]>"u")throw new Error("doXHR failed!");return T.chunks[F]}),(S||!l)&&(O=l=1,l=this.getter(0).length,O=l,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=l,this._chunkSize=O,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var p=new d;Object.defineProperties(p,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var n={isDevice:!1,contents:p}}else var n={isDevice:!1,url:m};var r=v.createFile(u,c,n,y,b);n.contents?r.contents=n.contents:n.url&&(r.contents=null,r.url=n.url),Object.defineProperties(r,{usedBytes:{get:function(){return this.contents.length}}});var e={},o=Object.keys(r.stream_ops);o.forEach(a=>{var s=r.stream_ops[a];e[a]=function(){return v.forceLoadFile(r),s.apply(null,arguments)}});function t(a,s,l,h,w){var S=a.node.contents;if(w>=S.length)return 0;var O=Math.min(S.length-w,h);if(S.slice)for(var N=0;N<O;N++)s[l+N]=S[w+N];else for(var N=0;N<O;N++)s[l+N]=S.get(w+N);return O}return e.read=(a,s,l,h,w)=>(v.forceLoadFile(r),t(a,s,l,h,w)),e.mmap=(a,s,l,h,w)=>{v.forceLoadFile(r);var S=Ct(s);if(!S)throw new v.ErrnoError(48);return t(a,ee,S,s,l),{ptr:S,allocated:!0}},r.stream_ops=e,r},createPreloadedFile:(u,c,m,y,b,d,p,n,r,e)=>{var o=c?ge.resolve(Q.join2(u,c)):u,t="cp "+o;function a(s){function l(h){e&&e(),n||v.createDataFile(u,c,h,y,b,r),d&&d(),Je(t)}Browser.handledByPreloadPlugin(s,o,l,()=>{p&&p(),Je(t)})||l(s)}dr(t),typeof m=="string"?V(m,s=>a(s),p):a(m)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(u,c,m)=>{c=c||(()=>{}),m=m||(()=>{});var y=v.indexedDB();try{var b=y.open(v.DB_NAME(),v.DB_VERSION)}catch(d){return m(d)}b.onupgradeneeded=()=>{er("creating db");var d=b.result;d.createObjectStore(v.DB_STORE_NAME)},b.onsuccess=()=>{var d=b.result,p=d.transaction([v.DB_STORE_NAME],"readwrite"),n=p.objectStore(v.DB_STORE_NAME),r=0,e=0,o=u.length;function t(){e==0?c():m()}u.forEach(a=>{var s=n.put(v.analyzePath(a).object.contents,a);s.onsuccess=()=>{r++,r+e==o&&t()},s.onerror=()=>{e++,r+e==o&&t()}}),p.onerror=m},b.onerror=m},loadFilesFromDB:(u,c,m)=>{c=c||(()=>{}),m=m||(()=>{});var y=v.indexedDB();try{var b=y.open(v.DB_NAME(),v.DB_VERSION)}catch(d){return m(d)}b.onupgradeneeded=m,b.onsuccess=()=>{var d=b.result;try{var p=d.transaction([v.DB_STORE_NAME],"readonly")}catch(a){m(a);return}var n=p.objectStore(v.DB_STORE_NAME),r=0,e=0,o=u.length;function t(){e==0?c():m()}u.forEach(a=>{var s=n.get(a);s.onsuccess=()=>{v.analyzePath(a).exists&&v.unlink(a),v.createDataFile(Q.dirname(a),Q.basename(a),s.result,!0,!0,!0),r++,r+e==o&&t()},s.onerror=()=>{e++,r+e==o&&t()}}),p.onerror=m},b.onerror=m}},H={DEFAULT_POLLMASK:5,calculateAt:function(u,c,m){if(Q.isAbs(c))return c;var y;if(u===-100)y=v.cwd();else{var b=H.getStreamFromFD(u);y=b.path}if(c.length==0){if(!m)throw new v.ErrnoError(44);return y}return Q.join2(y,c)},doStat:function(u,c,m){try{var y=u(c)}catch(b){if(b&&b.node&&Q.normalize(c)!==Q.normalize(v.getPath(b.node)))return-54;throw b}return E[m>>2]=y.dev,E[m+8>>2]=y.ino,E[m+12>>2]=y.mode,j[m+16>>2]=y.nlink,E[m+20>>2]=y.uid,E[m+24>>2]=y.gid,E[m+28>>2]=y.rdev,Z=[y.size>>>0,(U=y.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[m+40>>2]=Z[0],E[m+44>>2]=Z[1],E[m+48>>2]=4096,E[m+52>>2]=y.blocks,Z=[Math.floor(y.atime.getTime()/1e3)>>>0,(U=Math.floor(y.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[m+56>>2]=Z[0],E[m+60>>2]=Z[1],j[m+64>>2]=0,Z=[Math.floor(y.mtime.getTime()/1e3)>>>0,(U=Math.floor(y.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[m+72>>2]=Z[0],E[m+76>>2]=Z[1],j[m+80>>2]=0,Z=[Math.floor(y.ctime.getTime()/1e3)>>>0,(U=Math.floor(y.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[m+88>>2]=Z[0],E[m+92>>2]=Z[1],j[m+96>>2]=0,Z=[y.ino>>>0,(U=y.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[m+104>>2]=Z[0],E[m+108>>2]=Z[1],0},doMsync:function(u,c,m,y,b){if(!v.isFile(c.node.mode))throw new v.ErrnoError(43);if(y&2)return 0;var d=le.slice(u,u+m);v.msync(c,d,b,m,y)},varargs:void 0,get:function(){H.varargs+=4;var u=E[H.varargs-4>>2];return u},getStr:function(u){var c=ne(u);return c},getStreamFromFD:function(u){var c=v.getStream(u);if(!c)throw new v.ErrnoError(8);return c}};function ke(u,c,m,y,b){try{for(var d=0,p=c?E[c>>2]:0,n=c?E[c+4>>2]:0,r=m?E[m>>2]:0,e=m?E[m+4>>2]:0,o=y?E[y>>2]:0,t=y?E[y+4>>2]:0,a=0,s=0,l=0,h=0,w=0,S=0,O=(c?E[c>>2]:0)|(m?E[m>>2]:0)|(y?E[y>>2]:0),N=(c?E[c+4>>2]:0)|(m?E[m+4>>2]:0)|(y?E[y+4>>2]:0),T=function(P,M,z,q){return P<32?M&q:z&q},F=0;F<u;F++){var L=1<<F%32;if(T(F,O,N,L)){var R=H.getStreamFromFD(F),B=H.DEFAULT_POLLMASK;R.stream_ops?.poll&&(B=R.stream_ops.poll(R)),B&1&&T(F,p,n,L)&&(F<32?a=a|L:s=s|L,d++),B&4&&T(F,r,e,L)&&(F<32?l=l|L:h=h|L,d++),B&2&&T(F,o,t,L)&&(F<32?w=w|L:S=S|L,d++)}}return c&&(E[c>>2]=a,E[c+4>>2]=s),m&&(E[m>>2]=l,E[m+4>>2]=h),y&&(E[y>>2]=w,E[y+4>>2]=S),d}catch(P){if(typeof v>"u"||!(P instanceof v.ErrnoError))throw P;return-P.errno}}var he={mount:function(u){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(c,m){return typeof m=="function"&&(this._callbacks[c]=m),this},f.websocket.emit=function(c,m){typeof this._callbacks[c]=="function"&&this._callbacks[c].call(this,m)},v.createNode(null,"/",16895,0)},createSocket:function(u,c,m){c&=-526337;var y=c==1;if(y&&m&&m!=6)throw new v.ErrnoError(66);var b={family:u,type:c,protocol:m,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:he.websocket_sock_ops},d=he.nextname(),p=v.createNode(he.root,d,49152,0);p.sock=b;var n=v.createStream({path:d,node:p,flags:2,seekable:!1,stream_ops:he.stream_ops});return b.stream=n,b},getSocket:function(u){var c=v.getStream(u);return!c||!v.isSocket(c.node.mode)?null:c.node.sock},stream_ops:{poll:function(u){var c=u.node.sock;return c.sock_ops.poll(c)},ioctl:function(u,c,m){var y=u.node.sock;return y.sock_ops.ioctl(y,c,m)},read:function(u,c,m,y,b){var d=u.node.sock,p=d.sock_ops.recvmsg(d,y);return p?(c.set(p.buffer,m),p.buffer.length):0},write:function(u,c,m,y,b){var d=u.node.sock;return d.sock_ops.sendmsg(d,c,m,y)},close:function(u){var c=u.node.sock;c.sock_ops.close(c)}},nextname:function(){return he.nextname.current||(he.nextname.current=0),"socket["+he.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(u,c,m){var y;if(typeof c=="object"&&(y=c,c=null,m=null),y)if(y._socket)c=y._socket.remoteAddress,m=y._socket.remotePort;else{var b=/ws[s]?:\/\/([^:]+):(\d+)/.exec(y.url);if(!b)throw new Error("WebSocket URL must be in the format ws(s)://address:port");c=b[1],m=parseInt(b[2],10)}else try{var d=f.websocket&&typeof f.websocket=="object",p="ws:#".replace("#","//");if(d&&(typeof f.websocket.url=="function"?p=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(p=f.websocket.url)),p==="ws://"||p==="wss://"){var n=c.split("/");p=p+n[0]+":"+m+"/"+n.slice(1).join("/")}var r="binary";d&&typeof f.websocket.subprotocol=="string"&&(r=f.websocket.subprotocol);var e=void 0;r!=="null"&&(r=r.replace(/^ +| +$/g,"").split(/ *, */),e=r),d&&f.websocket.subprotocol===null&&(r="null",e=void 0);var o;te?o=An():o=WebSocket,f.websocket.decorator&&(o=f.websocket.decorator(o)),y=new o(p,e),y.binaryType="arraybuffer"}catch{throw new v.ErrnoError(23)}var t={addr:c,port:m,socket:y,dgram_send_queue:[]};return he.websocket_sock_ops.addPeer(u,t),he.websocket_sock_ops.handlePeerEvents(u,t),u.type===2&&typeof u.sport<"u"&&t.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(u.sport&65280)>>8,u.sport&255])),t},getPeer:function(u,c,m){return u.peers[c+":"+m]},addPeer:function(u,c){u.peers[c.addr+":"+c.port]=c},removePeer:function(u,c){delete u.peers[c.addr+":"+c.port]},handlePeerEvents:function(u,c){var m=!0,y=function(){f.websocket.emit("open",u.stream.fd);try{for(var d=c.dgram_send_queue.shift();d;)c.socket.send(d),d=c.dgram_send_queue.shift()}catch{c.socket.close()}};function b(d){if(typeof d=="string"){var p=new TextEncoder;d=p.encode(d)}else{if(Le(d.byteLength!==void 0),d.byteLength==0)return;d=new Uint8Array(d)}var n=m;if(m=!1,n&&d.length===10&&d[0]===255&&d[1]===255&&d[2]===255&&d[3]===255&&d[4]==="p".charCodeAt(0)&&d[5]==="o".charCodeAt(0)&&d[6]==="r".charCodeAt(0)&&d[7]==="t".charCodeAt(0)){var r=d[8]<<8|d[9];he.websocket_sock_ops.removePeer(u,c),c.port=r,he.websocket_sock_ops.addPeer(u,c);return}u.recv_queue.push({addr:c.addr,port:c.port,data:d}),f.websocket.emit("message",u.stream.fd)}te?(c.socket.on("open",y),c.socket.on("message",function(d,p){p&&b(new Uint8Array(d).buffer)}),c.socket.on("close",function(){f.websocket.emit("close",u.stream.fd)}),c.socket.on("error",function(d){u.error=14,f.websocket.emit("error",[u.stream.fd,u.error,"ECONNREFUSED: Connection refused"])})):(c.socket.onopen=y,c.socket.onclose=function(){f.websocket.emit("close",u.stream.fd)},c.socket.onmessage=function(p){b(p.data)},c.socket.onerror=function(d){u.error=14,f.websocket.emit("error",[u.stream.fd,u.error,"ECONNREFUSED: Connection refused"])})},poll:function(u){if(u.type===1&&u.server)return u.pending.length?65:0;var c=0,m=u.type===1?he.websocket_sock_ops.getPeer(u,u.daddr,u.dport):null;return(u.recv_queue.length||!m||m&&m.socket.readyState===m.socket.CLOSING||m&&m.socket.readyState===m.socket.CLOSED)&&(c|=65),(!m||m&&m.socket.readyState===m.socket.OPEN)&&(c|=4),(m&&m.socket.readyState===m.socket.CLOSING||m&&m.socket.readyState===m.socket.CLOSED)&&(c|=16),c},ioctl:function(u,c,m){switch(c){case 21531:var y=0;return u.recv_queue.length&&(y=u.recv_queue[0].data.length),E[m>>2]=y,0;default:return 28}},close:function(u){if(u.server){try{u.server.close()}catch{}u.server=null}for(var c=Object.keys(u.peers),m=0;m<c.length;m++){var y=u.peers[c[m]];try{y.socket.close()}catch{}he.websocket_sock_ops.removePeer(u,y)}return 0},bind:function(u,c,m){if(typeof u.saddr<"u"||typeof u.sport<"u")throw new v.ErrnoError(28);if(u.saddr=c,u.sport=m,u.type===2){u.server&&(u.server.close(),u.server=null);try{u.sock_ops.listen(u,0)}catch(y){if(!(y instanceof v.ErrnoError)||y.errno!==138)throw y}}},connect:function(u,c,m){if(u.server)throw new v.ErrnoError(138);if(typeof u.daddr<"u"&&typeof u.dport<"u"){var y=he.websocket_sock_ops.getPeer(u,u.daddr,u.dport);if(y)throw y.socket.readyState===y.socket.CONNECTING?new v.ErrnoError(7):new v.ErrnoError(30)}var b=he.websocket_sock_ops.createPeer(u,c,m);throw u.daddr=b.addr,u.dport=b.port,new v.ErrnoError(26)},listen:function(u,c){if(!te)throw new v.ErrnoError(138);if(u.server)throw new v.ErrnoError(28);var m=An().Server,y=u.saddr;u.server=new m({host:y,port:u.sport}),f.websocket.emit("listen",u.stream.fd),u.server.on("connection",function(b){if(u.type===1){var d=he.createSocket(u.family,u.type,u.protocol),p=he.websocket_sock_ops.createPeer(d,b);d.daddr=p.addr,d.dport=p.port,u.pending.push(d),f.websocket.emit("connection",d.stream.fd)}else he.websocket_sock_ops.createPeer(u,b),f.websocket.emit("connection",u.stream.fd)}),u.server.on("close",function(){f.websocket.emit("close",u.stream.fd),u.server=null}),u.server.on("error",function(b){u.error=23,f.websocket.emit("error",[u.stream.fd,u.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(u){if(!u.server||!u.pending.length)throw new v.ErrnoError(28);var c=u.pending.shift();return c.stream.flags=u.stream.flags,c},getname:function(u,c){var m,y;if(c){if(u.daddr===void 0||u.dport===void 0)throw new v.ErrnoError(53);m=u.daddr,y=u.dport}else m=u.saddr||0,y=u.sport||0;return{addr:m,port:y}},sendmsg:function(u,c,m,y,b,d){if(u.type===2){if((b===void 0||d===void 0)&&(b=u.daddr,d=u.dport),b===void 0||d===void 0)throw new v.ErrnoError(17)}else b=u.daddr,d=u.dport;var p=he.websocket_sock_ops.getPeer(u,b,d);if(u.type===1){if(!p||p.socket.readyState===p.socket.CLOSING||p.socket.readyState===p.socket.CLOSED)throw new v.ErrnoError(53);if(p.socket.readyState===p.socket.CONNECTING)throw new v.ErrnoError(6)}ArrayBuffer.isView(c)&&(m+=c.byteOffset,c=c.buffer);var n;if(n=c.slice(m,m+y),u.type===2&&(!p||p.socket.readyState!==p.socket.OPEN))return(!p||p.socket.readyState===p.socket.CLOSING||p.socket.readyState===p.socket.CLOSED)&&(p=he.websocket_sock_ops.createPeer(u,b,d)),p.dgram_send_queue.push(n),y;try{return p.socket.send(n),y}catch{throw new v.ErrnoError(28)}},recvmsg:function(u,c){if(u.type===1&&u.server)throw new v.ErrnoError(53);var m=u.recv_queue.shift();if(!m){if(u.type===1){var y=he.websocket_sock_ops.getPeer(u,u.daddr,u.dport);if(!y)throw new v.ErrnoError(53);if(y.socket.readyState===y.socket.CLOSING||y.socket.readyState===y.socket.CLOSED)return null;throw new v.ErrnoError(6)}throw new v.ErrnoError(6)}var b=m.data.byteLength||m.data.length,d=m.data.byteOffset||0,p=m.data.buffer||m.data,n=Math.min(c,b),r={buffer:new Uint8Array(p,d,n),addr:m.addr,port:m.port};if(u.type===1&&n<b){var e=b-n;m.data=new Uint8Array(p,d+n,e),u.recv_queue.unshift(m)}return r}}};function Ie(u){var c=he.getSocket(u);if(!c)throw new v.ErrnoError(8);return c}function ce(u){return E[Nt()>>2]=u,u}function Ar(u){for(var c=u.split("."),m=0;m<4;m++){var y=Number(c[m]);if(isNaN(y))return null;c[m]=y}return(c[0]|c[1]<<8|c[2]<<16|c[3]<<24)>>>0}function be(u){return parseInt(u)}function ue(u){var c,m,y,b,d=/^((?=.*::)(?!.*::.+::)(::)?([\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,p=[];if(!d.test(u))return null;if(u==="::")return[0,0,0,0,0,0,0,0];for(u.startsWith("::")?u=u.replace("::","Z:"):u=u.replace("::",":Z:"),u.indexOf(".")>0?(u=u.replace(new RegExp("[.]","g"),":"),c=u.split(":"),c[c.length-4]=be(c[c.length-4])+be(c[c.length-3])*256,c[c.length-3]=be(c[c.length-2])+be(c[c.length-1])*256,c=c.slice(0,c.length-2)):c=u.split(":"),y=0,b=0,m=0;m<c.length;m++)if(typeof c[m]=="string")if(c[m]==="Z"){for(b=0;b<8-c.length+1;b++)p[m+b]=0;y=b-1}else p[m+y]=rn(parseInt(c[m],16));else p[m+y]=c[m];return[p[1]<<16|p[0],p[3]<<16|p[2],p[5]<<16|p[4],p[7]<<16|p[6]]}function Zr(u,c,m,y,b){switch(c){case 2:m=Ar(m),Ir(u,16),b&&(E[b>>2]=16),we[u>>1]=c,E[u+4>>2]=m,we[u+2>>1]=rn(y);break;case 10:m=ue(m),Ir(u,28),b&&(E[b>>2]=28),E[u>>2]=c,E[u+8>>2]=m[0],E[u+12>>2]=m[1],E[u+16>>2]=m[2],E[u+20>>2]=m[3],we[u+2>>1]=rn(y);break;default:return 5}return 0}var Ne={address_map:{id:1,addrs:{},names:{}},lookup_name:function(u){var c=Ar(u);if(c!==null||(c=ue(u),c!==null))return u;var m;if(Ne.address_map.addrs[u])m=Ne.address_map.addrs[u];else{var y=Ne.address_map.id++;Le(y<65535,"exceeded max address mappings of 65535"),m="172.29."+(y&255)+"."+(y&65280),Ne.address_map.names[m]=u,Ne.address_map.addrs[u]=m}return m},lookup_addr:function(u){return Ne.address_map.names[u]?Ne.address_map.names[u]:null}};function kn(u,c,m,y){try{var b=Ie(u),d=b.sock_ops.accept(b);if(c)var p=Zr(c,d.family,Ne.lookup_name(d.daddr),d.dport,m);return d.stream.fd}catch(n){if(typeof v>"u"||!(n instanceof v.ErrnoError))throw n;return-n.errno}}function Gr(u){return(u&255)+"."+(u>>8&255)+"."+(u>>16&255)+"."+(u>>24&255)}function Yr(u){var c="",m=0,y=0,b=0,d=0,p=0,n=0,r=[u[0]&65535,u[0]>>16,u[1]&65535,u[1]>>16,u[2]&65535,u[2]>>16,u[3]&65535,u[3]>>16],e=!0,o="";for(n=0;n<5;n++)if(r[n]!==0){e=!1;break}if(e){if(o=Gr(r[6]|r[7]<<16),r[5]===-1)return c="::ffff:",c+=o,c;if(r[5]===0)return c="::",o==="0.0.0.0"&&(o=""),o==="0.0.0.1"&&(o="1"),c+=o,c}for(m=0;m<8;m++)r[m]===0&&(m-b>1&&(p=0),b=m,p++),p>y&&(y=p,d=m-y+1);for(m=0;m<8;m++){if(y>1&&r[m]===0&&m>=d&&m<d+y){m===d&&(c+=":",d===0&&(c+=":"));continue}c+=Number(tn(r[m]&65535)).toString(16),c+=m<7?":":""}return c}function dn(u,c){var m=we[u>>1],y=tn(lt[u+2>>1]),b;switch(m){case 2:if(c!==16)return{errno:28};b=E[u+4>>2],b=Gr(b);break;case 10:if(c!==28)return{errno:28};b=[E[u+8>>2],E[u+12>>2],E[u+16>>2],E[u+20>>2]],b=Yr(b);break;default:return{errno:5}}return{family:m,addr:b,port:y}}function Pt(u,c,m){if(m&&u===0)return null;var y=dn(u,c);if(y.errno)throw new v.ErrnoError(y.errno);return y.addr=Ne.lookup_addr(y.addr)||y.addr,y}function oo(u,c,m){try{var y=Ie(u),b=Pt(c,m);return y.sock_ops.bind(y,b.addr,b.port),0}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function io(u){try{return u=H.getStr(u),v.chdir(u),0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function ao(u,c){try{return u=H.getStr(u),v.chmod(u,c),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function so(u,c,m){try{var y=Ie(u),b=Pt(c,m);return y.sock_ops.connect(y,b.addr,b.port),0}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function uo(u){try{var c=H.getStreamFromFD(u);return v.createStream(c,0).fd}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function _n(u,c,m){try{var y=H.getStreamFromFD(u);if(y.fd===c)return-28;var b=v.getStream(c);return b&&v.close(b),v.createStream(y,c,c+1).fd}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function fo(u,c,m,y){try{if(c=H.getStr(c),c=H.calculateAt(u,c),m&-8)return-28;var b=v.lookupPath(c,{follow:!0}),d=b.node;if(!d)return-44;var p="";return m&4&&(p+="r"),m&2&&(p+="w"),m&1&&(p+="x"),p&&v.nodePermissions(d,p)?-2:0}catch(n){if(typeof v>"u"||!(n instanceof v.ErrnoError))throw n;return-n.errno}}function gt(u,c){return c+2097152>>>0<4194305-!!u?(u>>>0)+c*4294967296:NaN}function co(u,c,m,y,b,d){try{var p=gt(m,y);if(isNaN(p))return-61;var n=gt(b,d);if(isNaN(n))return-61;var r=H.getStreamFromFD(u);return v.allocate(r,p,n),0}catch(e){if(typeof v>"u"||!(e instanceof v.ErrnoError))throw e;return-e.errno}}function lo(u,c){try{return v.fchmod(u,c),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function qt(u,c,m){try{return v.fchown(u,c,m),0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function _o(u,c,m,y,b){try{c=H.getStr(c);var d=b&256;return b=b&-257,c=H.calculateAt(u,c),(d?v.lchown:v.chown)(c,m,y),0}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function mo(u,c,m){H.varargs=m;try{var y=H.getStreamFromFD(u);switch(c){case 0:{var b=H.get();if(b<0)return-28;var d;return d=v.createStream(y,b),d.fd}case 1:case 2:return 0;case 3:return y.flags;case 4:{var b=H.get();return y.flags|=b,0}case 5:{var b=H.get(),p=0;return we[b+p>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return ce(28),-1;default:return-28}}catch(n){if(typeof v>"u"||!(n instanceof v.ErrnoError))throw n;return-n.errno}}function vo(u){try{var c=H.getStreamFromFD(u);return 0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function po(u,c){try{var m=H.getStreamFromFD(u);return H.doStat(v.stat,m.path,c)}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function ho(u,c,m){try{var y=gt(c,m);return isNaN(y)?-61:(v.ftruncate(u,y),0)}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function yo(u,c){try{if(c===0)return-28;var m=v.cwd(),y=Ce(m)+1;return c<y?-68:(Fe(m,u,c),y)}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function Eo(u,c,m){try{var y=H.getStreamFromFD(u);y.getdents||(y.getdents=v.readdir(y.path));for(var b=280,d=0,p=v.llseek(y,0,1),n=Math.floor(p/b);n<y.getdents.length&&d+b<=m;){var r,e,o=y.getdents[n];if(o===".")r=y.node.id,e=4;else if(o===".."){var t=v.lookupPath(y.path,{parent:!0});r=t.node.id,e=4}else{var a=v.lookupNode(y.node,o);r=a.id,e=v.isChrdev(a.mode)?2:v.isDir(a.mode)?4:v.isLink(a.mode)?10:8}Z=[r>>>0,(U=r,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[c+d>>2]=Z[0],E[c+d+4>>2]=Z[1],Z=[(n+1)*b>>>0,(U=(n+1)*b,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[c+d+8>>2]=Z[0],E[c+d+12>>2]=Z[1],we[c+d+16>>1]=280,ee[c+d+18>>0]=e,Fe(o,c+d+19,256),d+=b,n+=1}return v.llseek(y,n*b,0),d}catch(s){if(typeof v>"u"||!(s instanceof v.ErrnoError))throw s;return-s.errno}}function wo(u,c,m){try{var y=Ie(u);if(!y.daddr)return-53;var b=Zr(c,y.family,Ne.lookup_name(y.daddr),y.dport,m);return 0}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function go(u,c,m){try{fe("__syscall_getsockname "+u);var y=Ie(u),b=Zr(c,y.family,Ne.lookup_name(y.saddr||"0.0.0.0"),y.sport,m);return 0}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function So(u,c,m,y,b){try{var d=Ie(u);return c===1&&m===4?(E[y>>2]=d.error,E[b>>2]=4,d.error=null,0):-50}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function bo(u,c,m){H.varargs=m;try{var y=H.getStreamFromFD(u);switch(c){case 21509:case 21505:return y.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return y.tty?0:-59;case 21519:{if(!y.tty)return-59;var b=H.get();return E[b>>2]=0,0}case 21520:return y.tty?-28:-59;case 21531:{var b=H.get();return v.ioctl(y,c,b)}case 21523:return y.tty?0:-59;case 21524:return y.tty?0:-59;default:return-28}}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function ko(u,c){try{var m=Ie(u);return m.sock_ops.listen(m,c),0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function ae(u,c){try{return u=H.getStr(u),H.doStat(v.lstat,u,c)}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function Oo(u,c,m){try{return c=H.getStr(c),c=H.calculateAt(u,c),c=Q.normalize(c),c[c.length-1]==="/"&&(c=c.substr(0,c.length-1)),v.mkdir(c,m,0),0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function kr(u,c,m,y){try{c=H.getStr(c);var b=y&256,d=y&4096;return y=y&-4353,c=H.calculateAt(u,c,d),H.doStat(b?v.lstat:v.stat,c,m)}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function Do(u,c,m,y){H.varargs=y;try{c=H.getStr(c),c=H.calculateAt(u,c);var b=y?H.get():0;return v.open(c,m,b).fd}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}var Se={BUCKET_BUFFER_SIZE:8192,mount:function(u){return v.createNode(null,"/",16895,0)},createPipe:function(){var u={buckets:[],refcnt:2};u.buckets.push({buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var c=Se.nextname(),m=Se.nextname(),y=v.createNode(Se.root,c,4096,0),b=v.createNode(Se.root,m,4096,0);y.pipe=u,b.pipe=u;var d=v.createStream({path:c,node:y,flags:0,seekable:!1,stream_ops:Se.stream_ops});y.stream=d;var p=v.createStream({path:m,node:b,flags:1,seekable:!1,stream_ops:Se.stream_ops});return b.stream=p,{readable_fd:d.fd,writable_fd:p.fd}},stream_ops:{poll:function(u){var c=u.node.pipe;if((u.flags&2097155)===1)return 260;if(c.buckets.length>0)for(var m=0;m<c.buckets.length;m++){var y=c.buckets[m];if(y.offset-y.roffset>0)return 65}return 0},ioctl:function(u,c,m){return 28},fsync:function(u){return 28},read:function(u,c,m,y,b){for(var d=u.node.pipe,p=0,n=0;n<d.buckets.length;n++){var r=d.buckets[n];p+=r.offset-r.roffset}Le(c instanceof ArrayBuffer||ArrayBuffer.isView(c));var e=c.subarray(m,m+y);if(y<=0)return 0;if(p==0)throw new v.ErrnoError(6);for(var o=Math.min(p,y),t=o,a=0,n=0;n<d.buckets.length;n++){var s=d.buckets[n],l=s.offset-s.roffset;if(o<=l){var h=s.buffer.subarray(s.roffset,s.offset);o<l?(h=h.subarray(0,o),s.roffset+=o):a++,e.set(h);break}else{var h=s.buffer.subarray(s.roffset,s.offset);e.set(h),e=e.subarray(h.byteLength),o-=h.byteLength,a++}}return a&&a==d.buckets.length&&(a--,d.buckets[a].offset=0,d.buckets[a].roffset=0),d.buckets.splice(0,a),t},write:function(u,c,m,y,b){var d=u.node.pipe;Le(c instanceof ArrayBuffer||ArrayBuffer.isView(c));var p=c.subarray(m,m+y),n=p.byteLength;if(n<=0)return 0;var r=null;d.buckets.length==0?(r={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:0,roffset:0},d.buckets.push(r)):r=d.buckets[d.buckets.length-1],Le(r.offset<=Se.BUCKET_BUFFER_SIZE);var e=Se.BUCKET_BUFFER_SIZE-r.offset;if(e>=n)return r.buffer.set(p,r.offset),r.offset+=n,n;e>0&&(r.buffer.set(p.subarray(0,e),r.offset),r.offset+=e,p=p.subarray(e,p.byteLength));for(var o=p.byteLength/Se.BUCKET_BUFFER_SIZE|0,t=p.byteLength%Se.BUCKET_BUFFER_SIZE,a=0;a<o;a++){var s={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:Se.BUCKET_BUFFER_SIZE,roffset:0};d.buckets.push(s),s.buffer.set(p.subarray(0,Se.BUCKET_BUFFER_SIZE)),p=p.subarray(Se.BUCKET_BUFFER_SIZE,p.byteLength)}if(t>0){var s={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:p.byteLength,roffset:0};d.buckets.push(s),s.buffer.set(p)}return n},close:function(u){var c=u.node.pipe;c.refcnt--,c.refcnt===0&&(c.buckets=null)}},nextname:function(){return Se.nextname.current||(Se.nextname.current=0),"pipe["+Se.nextname.current+++"]"}};function No(u){try{if(u==0)throw new v.ErrnoError(21);var c=Se.createPipe();return E[u>>2]=c.readable_fd,E[u+4>>2]=c.writable_fd,0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function To(u,c,m){try{for(var y=0,b=0;b<c;b++){var d=u+8*b,p=E[d>>2],n=we[d+4>>1],r=32,e=v.getStream(p);e&&(r=H.DEFAULT_POLLMASK,e.stream_ops?.poll&&(r=e.stream_ops.poll(e))),r&=n|8|16,r&&y++,we[d+6>>1]=r}return y}catch(o){if(typeof v>"u"||!(o instanceof v.ErrnoError))throw o;return-o.errno}}function Ao(u,c,m,y){try{if(c=H.getStr(c),c=H.calculateAt(u,c),y<=0)return-28;var b=v.readlink(c),d=Math.min(y,Ce(b)),p=ee[m+d];return Fe(b,m,y+1),ee[m+d]=p,d}catch(n){if(typeof v>"u"||!(n instanceof v.ErrnoError))throw n;return-n.errno}}function Fo(u,c,m,y,b,d){try{var p=Ie(u),n=p.sock_ops.recvmsg(p,m);if(!n)return 0;if(b)var r=Zr(b,p.family,Ne.lookup_name(n.addr),n.port,d);return le.set(n.buffer,c),n.buffer.byteLength}catch(e){if(typeof v>"u"||!(e instanceof v.ErrnoError))throw e;return-e.errno}}function Co(u,c,m,y){try{return c=H.getStr(c),y=H.getStr(y),c=H.calculateAt(u,c),y=H.calculateAt(m,y),v.rename(c,y),0}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function Po(u){try{return u=H.getStr(u),v.rmdir(u),0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function Ro(u,c,m,y,b,d){try{var p=Ie(u),n=Pt(b,d,!0);return n?p.sock_ops.sendmsg(p,ee,c,m,n.addr,n.port):v.write(p.stream,ee,c,m)}catch(r){if(typeof v>"u"||!(r instanceof v.ErrnoError))throw r;return-r.errno}}function Mo(u,c,m){try{var y=he.createSocket(u,c,m);return y.stream.fd}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function jr(u,c){try{return u=H.getStr(u),H.doStat(v.stat,u,c)}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function Lo(u,c,m){try{return u=H.getStr(u),E[m+4>>2]=4096,E[m+40>>2]=4096,E[m+8>>2]=1e6,E[m+12>>2]=5e5,E[m+16>>2]=5e5,E[m+20>>2]=v.nextInode,E[m+24>>2]=1e6,E[m+28>>2]=42,E[m+44>>2]=2,E[m+36>>2]=255,0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function mn(u,c){try{return u=H.getStr(u),c=H.getStr(c),v.symlink(u,c),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function Vt(u,c,m){try{return c=H.getStr(c),c=H.calculateAt(u,c),m===0?v.unlink(c):m===512?v.rmdir(c):me("Invalid flags passed to unlinkat"),0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function St(u){return j[u>>2]+E[u+4>>2]*4294967296}function Fn(u,c,m,y){try{if(c=H.getStr(c),c=H.calculateAt(u,c,!0),m){var p=St(m),n=E[m+8>>2];b=p*1e3+n/(1e3*1e3),m+=16,p=St(m),n=E[m+8>>2],d=p*1e3+n/(1e3*1e3)}else var b=Date.now(),d=b;return v.utime(c,b,d),0}catch(r){if(typeof v>"u"||!(r instanceof v.ErrnoError))throw r;return-r.errno}}function Uo(u){}var vn="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Io(u,c){me(vn)}function Bo(u,c){me(vn)}var xo=!0;function zo(){return xo}function Ho(){throw 1/0}function Wo(u,c){var m=new Date(St(u)*1e3);E[c>>2]=m.getUTCSeconds(),E[c+4>>2]=m.getUTCMinutes(),E[c+8>>2]=m.getUTCHours(),E[c+12>>2]=m.getUTCDate(),E[c+16>>2]=m.getUTCMonth(),E[c+20>>2]=m.getUTCFullYear()-1900,E[c+24>>2]=m.getUTCDay();var y=Date.UTC(m.getUTCFullYear(),0,1,0,0,0,0),b=(m.getTime()-y)/(1e3*60*60*24)|0;E[c+28>>2]=b}function Gt(u,c){var m=new Date(St(u)*1e3);E[c>>2]=m.getSeconds(),E[c+4>>2]=m.getMinutes(),E[c+8>>2]=m.getHours(),E[c+12>>2]=m.getDate(),E[c+16>>2]=m.getMonth(),E[c+20>>2]=m.getFullYear()-1900,E[c+24>>2]=m.getDay();var y=new Date(m.getFullYear(),0,1),b=(m.getTime()-y.getTime())/(1e3*60*60*24)|0;E[c+28>>2]=b,E[c+36>>2]=-(m.getTimezoneOffset()*60);var d=new Date(m.getFullYear(),6,1).getTimezoneOffset(),p=y.getTimezoneOffset(),n=(d!=p&&m.getTimezoneOffset()==Math.min(p,d))|0;E[c+32>>2]=n}function Yo(u){var c=new Date(E[u+20>>2]+1900,E[u+16>>2],E[u+12>>2],E[u+8>>2],E[u+4>>2],E[u>>2],0),m=E[u+32>>2],y=c.getTimezoneOffset(),b=new Date(c.getFullYear(),0,1),d=new Date(c.getFullYear(),6,1).getTimezoneOffset(),p=b.getTimezoneOffset(),n=Math.min(p,d);if(m<0)E[u+32>>2]=+(d!=p&&n==y);else if(m>0!=(n==y)){var r=Math.max(p,d),e=m>0?n:r;c.setTime(c.getTime()+(e-y)*6e4)}E[u+24>>2]=c.getDay();var o=(c.getTime()-b.getTime())/(1e3*60*60*24)|0;return E[u+28>>2]=o,E[u>>2]=c.getSeconds(),E[u+4>>2]=c.getMinutes(),E[u+8>>2]=c.getHours(),E[u+12>>2]=c.getDate(),E[u+16>>2]=c.getMonth(),E[u+20>>2]=c.getYear(),c.getTime()/1e3|0}function rt(u,c,m,y,b,d){try{var p=H.getStreamFromFD(y),n=v.mmap(p,u,b,c,m),r=n.ptr;return E[d>>2]=n.allocated,r}catch(e){if(typeof v>"u"||!(e instanceof v.ErrnoError))throw e;return-e.errno}}function jo(u,c,m,y,b,d){try{var p=H.getStreamFromFD(b);m&2&&H.doMsync(u,p,c,y,d),v.munmap(p)}catch(n){if(typeof v>"u"||!(n instanceof v.ErrnoError))throw n;return-n.errno}}function Kt(u){var c=Ce(u)+1,m=Vr(c);return m&&Ze(u,ee,m,c),m}function Xt(u,c,m){var y=new Date().getFullYear(),b=new Date(y,0,1),d=new Date(y,6,1),p=b.getTimezoneOffset(),n=d.getTimezoneOffset(),r=Math.max(p,n);E[u>>2]=r*60,E[c>>2]=+(p!=n);function e(l){var h=l.toTimeString().match(/\(([A-Za-z ]+)\)$/);return h?h[1]:"GMT"}var o=e(b),t=e(d),a=Kt(o),s=Kt(t);n<p?(j[m>>2]=a,j[m+4>>2]=s):(j[m>>2]=s,j[m+4>>2]=a)}function Rt(u,c,m){Rt.called||(Rt.called=!0,Xt(u,c,m))}function tt(){me("")}function qo(){return Date.now()}function Zt(){return 2147483648}function Vo(){return Zt()}var Mt;te?Mt=()=>{var u=process.hrtime();return u[0]*1e3+u[1]/1e6}:Mt=()=>performance.now();function it(u,c,m){le.copyWithin(u,c,c+m)}function Go(u){try{return ir.grow(u-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function Or(u){var c=le.length;u=u>>>0;var m=Zt();if(u>m)return!1;let y=(r,e)=>r+(e-r%e)%e;for(var b=1;b<=4;b*=2){var d=c*(1+.2/b);d=Math.min(d,u+100663296);var p=Math.min(m,y(Math.max(u,d),65536)),n=Go(p);if(n)return!0}return!1}function at(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var st=A.ENV||{};function On(){return ie||"./this.program"}function qr(){if(!qr.strings){var u=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",c={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:u,_:On()};for(var m in st)st[m]===void 0?delete c[m]:c[m]=st[m];var y=[];for(var m in c)y.push(m+"="+c[m]);qr.strings=y}return qr.strings}function Lt(u,c,m){for(var y=0;y<u.length;++y)ee[c++>>0]=u.charCodeAt(y);m||(ee[c>>0]=0)}function Cn(u,c){var m=0;return qr().forEach(function(y,b){var d=c+m;j[u+b*4>>2]=d,Lt(y,d),m+=y.length+1}),0}function Ko(u,c){var m=qr();j[u>>2]=m.length;var y=0;return m.forEach(function(b){y+=b.length+1}),j[c>>2]=y,0}function pn(u){Pr=u,Mr()||(f.onExit&&f.onExit(u),Tr=!0),_e(u,new Ur(u))}function Xo(u,c){Pr=u,Mr()||Kn(),pn(u)}var Zo=Xo;function $o(u){try{var c=H.getStreamFromFD(u);return v.close(c),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return m.errno}}function Jo(u,c){try{var m=H.getStreamFromFD(u),y=m.tty?2:v.isDir(m.mode)?3:v.isLink(m.mode)?7:4;return ee[c>>0]=y,0}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return b.errno}}function Qo(u,c,m,y){for(var b=0,d=0;d<m;d++){var p=j[c>>2],n=j[c+4>>2];c+=8;var r=v.read(u,ee,p,n,y);if(r<0)return-1;if(b+=r,r<n)break}return b}function ei(u,c,m,y){try{var b=H.getStreamFromFD(u),d=Qo(b,c,m);return j[y>>2]=d,0}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return p.errno}}function nn(u,c,m,y,b){try{var d=gt(c,m);if(isNaN(d))return 61;var p=H.getStreamFromFD(u);return v.llseek(p,d,y),Z=[p.position>>>0,(U=p.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[b>>2]=Z[0],E[b+4>>2]=Z[1],p.getdents&&d===0&&y===0&&(p.getdents=null),0}catch(n){if(typeof v>"u"||!(n instanceof v.ErrnoError))throw n;return n.errno}}function Pn(u){try{var c=H.getStreamFromFD(u);return c.stream_ops&&c.stream_ops.fsync?c.stream_ops.fsync(c):0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return m.errno}}function Rn(u,c,m,y){for(var b=0,d=0;d<m;d++){var p=j[c>>2],n=j[c+4>>2];c+=8;var r=v.write(u,ee,p,n,y);if(r<0)return-1;b+=r}return b}function ri(u,c,m,y){try{var b=H.getStreamFromFD(u),d=Rn(b,c,m);return j[y>>2]=d,0}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return p.errno}}function Mn(u,c,m,y){var b=0,d=0,p=0,n=0,r=0,e=0,o;function t(a,s,l,h,w,S){var O,N,T,F;return N=a===10?28:16,w=a===10?Yr(w):Gr(w),O=Vr(N),F=Zr(O,a,w,S),Le(!F),T=Vr(32),E[T+4>>2]=a,E[T+8>>2]=s,E[T+12>>2]=l,E[T+24>>2]=h,j[T+20>>2]=O,a===10?E[T+16>>2]=28:E[T+16>>2]=16,E[T+28>>2]=0,T}if(m&&(p=E[m>>2],n=E[m+4>>2],r=E[m+8>>2],e=E[m+12>>2]),r&&!e&&(e=r===2?17:6),!r&&e&&(r=e===17?2:1),e===0&&(e=6),r===0&&(r=1),!u&&!c)return-2;if(p&-1088||m!==0&&E[m>>2]&2&&!u)return-1;if(p&32)return-2;if(r!==0&&r!==1&&r!==2)return-7;if(n!==0&&n!==2&&n!==10)return-6;if(c&&(c=ne(c),d=parseInt(c,10),isNaN(d)))return p&1024?-2:-8;if(!u)return n===0&&(n=2),p&1||(n===2?b=Sn(2130706433):b=[0,0,0,1]),o=t(n,r,e,null,b,d),j[y>>2]=o,0;if(u=ne(u),b=Ar(u),b!==null)if(n===0||n===2)n=2;else if(n===10&&p&8)b=[0,0,Sn(65535),b],n=10;else return-2;else if(b=ue(u),b!==null)if(n===0||n===10)n=10;else return-2;return b!=null?(o=t(n,r,e,u,b,d),j[y>>2]=o,0):p&4?-2:(u=Ne.lookup_name(u),b=Ar(u),n===0?n=2:n===10&&(b=[0,0,Sn(65535),b]),o=t(n,r,e,null,b,d),j[y>>2]=o,0)}function hn(){fe("missing function: getcontext"),me(-1)}function nt(){fe("missing function: getdtablesize"),me(-1)}function bt(u){var c=Vr(20),m=Vr(u.length+1);Fe(u,m,u.length+1),j[c>>2]=m;var y=Vr(4);j[y>>2]=0,j[c+4>>2]=y;var b=2;E[c+8>>2]=b,E[c+12>>2]=4;var d=Vr(12);return j[d>>2]=d+8,j[d+4>>2]=0,E[d+8>>2]=Ar(Ne.lookup_name(u)),j[c+16>>2]=d,c}function $t(u){return bt(ne(u))}function yn(u,c,m,y,b,d){var p=$t(u);return sn(c,p,20),en(p),E[d>>2]=0,j[b>>2]=c,0}function Fr(u,c){for(var m=Math.min(c,3),y=8,b=0;b<m;b++)dt[u+b*y>>3]=.1;return m}function Ue(u,c,m,y,b,d,p){var n=dn(u,c);if(n.errno)return-6;var r=n.port,e=n.addr,o=!1;if(m&&y){var t;if(p&1||!(t=Ne.lookup_addr(e))){if(p&8)return-2}else e=t;var a=Fe(e,m,y);a+1>=y&&(o=!0)}if(b&&d){r=""+r;var a=Fe(r,b,d);a+1>=d&&(o=!0)}return o?-12:0}var hr={list:[],map:{}};function tr(u){function c(d,p,n){var r=Vr(d.length+1);Lt(d,r);for(var e=0,o=n.length,t=Vr((o+1)*4),a=0;a<o;a++,e+=4){var s=n[a],l=Vr(s.length+1);Lt(s,l),j[t+e>>2]=l}j[t+e>>2]=0;var h=Vr(12);return j[h>>2]=r,j[h+4>>2]=t,E[h+8>>2]=p,h}var m=hr.list,y=hr.map;if(m.length===0){var b=c("tcp",6,["TCP"]);m.push(b),y.tcp=y[6]=b,b=c("udp",17,["UDP"]),m.push(b),y.udp=y[17]=b}tr.index=0}function Hr(u){u=ne(u),tr(!0);var c=hr.map[u];return c}function Ge(u){tr(!0);var c=hr.map[u];return c}function Xe(u){var c=Ce(u)+1,m=kt(c);return Ze(u,ee,m,c),m}var Ve={getAllWebSockets:function(u){let c=new Set;u.server&&u.server.clients.forEach(m=>{c.add(m)});for(let m of Ve.getAllPeers(u))c.add(m.socket);return Array.from(c)},getAllPeers:function(u){let c=new Set;if(u.server&&u.pending.filter(m=>m.peers).forEach(m=>{for(let y of Object.values(m.peers))c.add(y)}),u.peers)for(let m of Object.values(u.peers))c.add(m);return Array.from(c)},awaitData:function(u){return Ve.awaitWsEvent(u,"message")},awaitConnection:function(u){return u.OPEN===u.readyState?[Promise.resolve(),Ve.noop]:Ve.awaitWsEvent(u,"open")},awaitClose:function(u){return[u.CLOSING,u.CLOSED].includes(u.readyState)?[Promise.resolve(),Ve.noop]:Ve.awaitWsEvent(u,"close")},awaitError:function(u){return[u.CLOSING,u.CLOSED].includes(u.readyState)?[Promise.resolve(),Ve.noop]:Ve.awaitWsEvent(u,"error")},awaitWsEvent:function(u,c){let m,y=()=>{m()};return[new Promise(function(p){m=p,u.once(c,y)}),()=>{u.removeListener(c,y),setTimeout(m)}]},noop:function(){},shutdownSocket:function(u,c){let m=Ie(u),y=Object.values(m.peers)[0];if(!y)return-1;try{return y.socket.close(),he.websocket_sock_ops.removePeer(m,y),0}catch(b){return console.log("Socket shutdown error",b),-1}}};function ut(u,c,m){if(!u)return 1;let y=ne(u);if(!y.length)return 0;let b=ne(c);if(!b.length)return 0;if(f.popen_to_file){let{path:d,exitCode:p}=f.popen_to_file(y,b);return le[m]=p,Xe(d)}if(te){let d=require("os").tmpdir(),p="php-process-stream",n=d+"/"+p,r=require("child_process"),e;if(b==="r")e=r.spawnSync(y,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[m]=e.status,require("fs").writeFileSync(n,e.stdout,{encoding:"utf8",flag:"w+"});else return b==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+b+" (should be r or w)"),_W_EXITCODE(0,2));return Xe(n)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function Kr(){fe("missing function: makecontext"),me(-1)}function ot(u){return u%4===0&&(u%100!==0||u%400===0)}function ft(u,c){for(var m=0,y=0;y<=c;m+=u[y++]);return m}var Ot=[31,29,31,30,31,30,31,31,30,31,30,31],Dt=[31,28,31,30,31,30,31,31,30,31,30,31];function Jt(u,c){for(var m=new Date(u.getTime());c>0;){var y=ot(m.getFullYear()),b=m.getMonth(),d=(y?Ot:Dt)[b];if(c>d-m.getDate())c-=d-m.getDate()+1,m.setDate(1),b<11?m.setMonth(b+1):(m.setMonth(0),m.setFullYear(m.getFullYear()+1));else return m.setDate(m.getDate()+c),m}return m}function Ut(u,c,m,y){var b=E[y+40>>2],d={tm_sec:E[y>>2],tm_min:E[y+4>>2],tm_hour:E[y+8>>2],tm_mday:E[y+12>>2],tm_mon:E[y+16>>2],tm_year:E[y+20>>2],tm_wday:E[y+24>>2],tm_yday:E[y+28>>2],tm_isdst:E[y+32>>2],tm_gmtoff:E[y+36>>2],tm_zone:b?ne(b):""},p=ne(m),n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var r in n)p=p.replace(new RegExp(r,"g"),n[r]);var e=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["January","February","March","April","May","June","July","August","September","October","November","December"];function t(O,N,T){for(var F=typeof O=="number"?O.toString():O||"";F.length<N;)F=T[0]+F;return F}function a(O,N){return t(O,N,"0")}function s(O,N){function T(L){return L<0?-1:L>0?1:0}var F;return(F=T(O.getFullYear()-N.getFullYear()))===0&&(F=T(O.getMonth()-N.getMonth()))===0&&(F=T(O.getDate()-N.getDate())),F}function l(O){switch(O.getDay()){case 0:return new Date(O.getFullYear()-1,11,29);case 1:return O;case 2:return new Date(O.getFullYear(),0,3);case 3:return new Date(O.getFullYear(),0,2);case 4:return new Date(O.getFullYear(),0,1);case 5:return new Date(O.getFullYear()-1,11,31);case 6:return new Date(O.getFullYear()-1,11,30)}}function h(O){var N=Jt(new Date(O.tm_year+1900,0,1),O.tm_yday),T=new Date(N.getFullYear(),0,4),F=new Date(N.getFullYear()+1,0,4),L=l(T),R=l(F);return s(L,N)<=0?s(R,N)<=0?N.getFullYear()+1:N.getFullYear():N.getFullYear()-1}var w={"%a":function(O){return e[O.tm_wday].substring(0,3)},"%A":function(O){return e[O.tm_wday]},"%b":function(O){return o[O.tm_mon].substring(0,3)},"%B":function(O){return o[O.tm_mon]},"%C":function(O){var N=O.tm_year+1900;return a(N/100|0,2)},"%d":function(O){return a(O.tm_mday,2)},"%e":function(O){return t(O.tm_mday,2," ")},"%g":function(O){return h(O).toString().substring(2)},"%G":function(O){return h(O)},"%H":function(O){return a(O.tm_hour,2)},"%I":function(O){var N=O.tm_hour;return N==0?N=12:N>12&&(N-=12),a(N,2)},"%j":function(O){return a(O.tm_mday+ft(ot(O.tm_year+1900)?Ot:Dt,O.tm_mon-1),3)},"%m":function(O){return a(O.tm_mon+1,2)},"%M":function(O){return a(O.tm_min,2)},"%n":function(){return`
10
+ `},"%p":function(O){return O.tm_hour>=0&&O.tm_hour<12?"AM":"PM"},"%S":function(O){return a(O.tm_sec,2)},"%t":function(){return" "},"%u":function(O){return O.tm_wday||7},"%U":function(O){var N=O.tm_yday+7-O.tm_wday;return a(Math.floor(N/7),2)},"%V":function(O){var N=Math.floor((O.tm_yday+7-(O.tm_wday+6)%7)/7);if((O.tm_wday+371-O.tm_yday-2)%7<=2&&N++,N){if(N==53){var F=(O.tm_wday+371-O.tm_yday)%7;F!=4&&(F!=3||!ot(O.tm_year))&&(N=1)}}else{N=52;var T=(O.tm_wday+7-O.tm_yday-1)%7;(T==4||T==5&&ot(O.tm_year%400-1))&&N++}return a(N,2)},"%w":function(O){return O.tm_wday},"%W":function(O){var N=O.tm_yday+7-(O.tm_wday+6)%7;return a(Math.floor(N/7),2)},"%y":function(O){return(O.tm_year+1900).toString().substring(2)},"%Y":function(O){return O.tm_year+1900},"%z":function(O){var N=O.tm_gmtoff,T=N>=0;return N=Math.abs(N)/60,N=N/60*100+N%60,(T?"+":"-")+("0000"+N).slice(-4)},"%Z":function(O){return O.tm_zone},"%%":function(){return"%"}};p=p.replace(/%%/g,"\0\0");for(var r in w)p.includes(r)&&(p=p.replace(new RegExp(r,"g"),w[r](d)));p=p.replace(/\0\0/g,"%");var S=wr(p,!1);return S.length>c?0:(Et(S,u),S.length-1)}function Xr(u,c,m){for(var y=ne(c),b="\\!@#$^&*()+=-[]/{}|:<>?,.",d=0,p=b.length;d<p;++d)y=y.replace(new RegExp("\\"+b[d],"g"),"\\"+b[d]);var n={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var r in n)y=y.replace(r,n[r]);var e={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},o={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},t={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},a={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var s in e)y=y.replace(s,"("+s+e[s]+")");for(var l=[],d=y.indexOf("%");d>=0;d=y.indexOf("%"))l.push(y[d+1]),y=y.replace(new RegExp("\\%"+y[d+1],"g"),"");var h=new RegExp("^"+y,"i").exec(ne(u));function w(){function se(Oe,Ae,Qe){return typeof Oe!="number"||isNaN(Oe)?Ae:Oe>=Ae?Oe<=Qe?Oe:Qe:Ae}return{year:se(E[m+20>>2]+1900,1970,9999),month:se(E[m+16>>2],0,11),day:se(E[m+12>>2],1,31),hour:se(E[m+8>>2],0,23),min:se(E[m+4>>2],0,59),sec:se(E[m>>2],0,59)}}if(h){var S=w(),O,N=se=>{var Oe=l.indexOf(se);if(Oe>=0)return h[Oe+1]};if((O=N("S"))&&(S.sec=be(O)),(O=N("M"))&&(S.min=be(O)),O=N("H"))S.hour=be(O);else if(O=N("I")){var T=be(O);(O=N("p"))&&(T+=O.toUpperCase()[0]==="P"?12:0),S.hour=T}if(O=N("Y"))S.year=be(O);else if(O=N("y")){var F=be(O);(O=N("C"))?F+=be(O)*100:F+=F<69?2e3:1900,S.year=F}if((O=N("m"))?S.month=be(O)-1:(O=N("b"))&&(S.month=o[O.substring(0,3).toUpperCase()]||0),O=N("d"))S.day=be(O);else if(O=N("j"))for(var L=be(O),R=ot(S.year),B=0;B<12;++B){var P=ft(R?Ot:Dt,B-1);L<=P+(R?Ot:Dt)[B]&&(S.day=L-P)}else if(O=N("a")){var M=O.substring(0,3).toUpperCase();if(O=N("U")){var z=t[M],q=be(O),W=new Date(S.year,0,1),X;W.getDay()===0?X=Jt(W,z+7*(q-1)):X=Jt(W,7-W.getDay()+z+7*(q-1)),S.day=X.getDate(),S.month=X.getMonth()}else if(O=N("W")){var z=a[M],q=be(O),W=new Date(S.year,0,1),X;W.getDay()===1?X=Jt(W,z+7*(q-1)):X=Jt(W,7-W.getDay()+1+z+7*(q-1)),S.day=X.getDate(),S.month=X.getMonth()}}var oe=new Date(S.year,S.month,S.day,S.hour,S.min,S.sec,0);return E[m>>2]=oe.getSeconds(),E[m+4>>2]=oe.getMinutes(),E[m+8>>2]=oe.getHours(),E[m+12>>2]=oe.getDate(),E[m+16>>2]=oe.getMonth(),E[m+20>>2]=oe.getFullYear()-1900,E[m+24>>2]=oe.getDay(),E[m+28>>2]=ft(ot(oe.getFullYear())?Ot:Dt,oe.getMonth()-1)+oe.getDate()-1,E[m+32>>2]=0,u+wr(h[0]).length-1}return 0}function $r(){fe("missing function: swapcontext"),me(-1)}function En(u){return Ve.shutdownSocket(u,2)}function ti(u,c,m){if(typeof Asyncify>"u")return 0;let y=1,b=2,d=4,p=8,n=16,r=32;return Asyncify.handleSleep(e=>{let o=Ie(u);if(!o){e(0);return}let t=[],a=new Set;if(c&y||c&b){if(o.server){for(let O of o.pending)if((O.recv_queue||[]).length>0){e(1);return}}else if((o.recv_queue||[]).length>0){e(1);return}}let s=Ve.getAllWebSockets(o);if(!s.length){e(0);return}for(let O of s)(c&y||c&b)&&(t.push(Ve.awaitData(O)),a.add("POLLIN")),c&d&&(t.push(Ve.awaitConnection(O)),a.add("POLLOUT")),c&n&&(t.push(Ve.awaitClose(O)),a.add("POLLHUP")),(c&p||c&r)&&(t.push(Ve.awaitError(O)),a.add("POLLERR"));if(t.length===0){console.warn("Unsupported poll event "+c+", defaulting to setTimeout()."),setTimeout(function(){e(0)},m);return}let l=t.map(([O])=>O),h=()=>t.forEach(([,O])=>O()),w=!1;Promise.race(l).then(function(O){w||(w=!0,e(1),clearTimeout(S),h())});let S=setTimeout(function(){w||(w=!0,e(0),h())},m)})}function wn(u,c,m,y,b){let d=le[y];if(!(c===1&&m===9||c===6&&m===1))return console.warn(`Unsupported socket option: ${c}, ${m}, ${d}`),-1;let t=Ve.getAllWebSockets(u)[0];return t?(t.setSocketOpt(c,m,y),0):-1}function on(u,c){return Ve.shutdownSocket(u,c)}function Qt(u){var c=f["_"+u];return c}function Dn(u,c,m,y,b){var d={string:l=>{var h=0;if(l!=null&&l!==0){var w=(l.length<<2)+1;h=kt(w),Fe(l,h,w)}return h},array:l=>{var h=kt(l.length);return Et(l,h),h}};function p(l){return c==="string"?ne(l):c==="boolean"?!!l:l}var n=Qt(u),r=[],e=0;if(y)for(var o=0;o<y.length;o++){var t=d[m[o]];t?(e===0&&(e=xe()),r[o]=t(y[o])):r[o]=y[o]}var a=n.apply(null,r);function s(l){return e!==0&&lr(e),p(l)}return a=s(a),a}var gn=function(u,c,m,y){u||(u=this),this.parent=u,this.mount=u.mount,this.mounted=null,this.id=v.nextInode++,this.name=c,this.mode=m,this.node_ops={},this.stream_ops={},this.rdev=y},Tt=365,Jr=146;Object.defineProperties(gn.prototype,{read:{get:function(){return(this.mode&Tt)===Tt},set:function(u){u?this.mode|=Tt:this.mode&=~Tt}},write:{get:function(){return(this.mode&Jr)===Jr},set:function(u){u?this.mode|=Jr:this.mode&=~Jr}},isFolder:{get:function(){return v.isDir(this.mode)}},isDevice:{get:function(){return v.isChrdev(this.mode)}}}),v.FSNode=gn,v.staticInit(),f.FS_createPath=v.createPath,f.FS_createDataFile=v.createDataFile,f.FS_createPreloadedFile=v.createPreloadedFile,f.FS_unlink=v.unlink,f.FS_createLazyFile=v.createLazyFile,f.FS_createDevice=v.createDevice,te&&(yr(),C.staticInit()),i={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};var mr={m:to,_a:no,Za:ke,Ya:kn,Xa:oo,Wa:io,O:ao,Va:so,Ua:uo,Ta:_n,Sa:fo,V:co,Ra:lo,Qa:qt,N:_o,o:mo,Pa:vo,Oa:po,U:ho,Na:yo,Ma:Eo,La:wo,Ka:go,Ja:So,M:bo,Ia:ko,Ha:ae,Ga:Oo,Fa:kr,x:Do,Ea:No,Da:To,Ca:Ao,Ba:Fo,Aa:Co,L:Po,za:Ro,K:Mo,ya:jr,xa:Lo,wa:mn,E:Vt,va:Fn,qa:Uo,pa:Io,oa:Bo,na:zo,ma:Ho,la:Wo,ka:Gt,ja:Yo,ia:rt,ha:jo,ga:Rt,l:tt,C:qo,fa:Vo,B:Mt,ea:it,da:Or,ca:at,ua:Cn,ta:Ko,r:Zo,t:$o,J:Jo,I:ei,T:nn,sa:Pn,D:ri,ba:Mn,aa:hn,$:nt,H:yn,_:Fr,w:Ue,Z:Hr,Y:Ge,i:Nn,c:Yt,b:Ht,f:zt,h:li,q:Bn,s:Bt,v:g,G:di,e:fn,a:xt,d:Wt,A:bn,g:jt,k:Tn,n:In,j:_i,X:k,z:xn,W:ut,S:Kr,ra:pn,F:Ut,R:Xr,Q:$r,u:En,y:ti,p:wn,P:on},Qr=ro(),It=f.___wasm_call_ctors=function(){return(It=f.___wasm_call_ctors=f.asm.ab).apply(null,arguments)},zr=f._wasm_popen=function(){return(zr=f._wasm_popen=f.asm.bb).apply(null,arguments)},Nt=f.___errno_location=function(){return(Nt=f.___errno_location=f.asm.cb).apply(null,arguments)},Dr=f._wasm_pclose=function(){return(Dr=f._wasm_pclose=f.asm.db).apply(null,arguments)},At=f._php_pollfd_for=function(){return(At=f._php_pollfd_for=f.asm.eb).apply(null,arguments)},an=f._wasm_select=function(){return(an=f._wasm_select=f.asm.fb).apply(null,arguments)},Br=f._wasm_add_cli_arg=function(){return(Br=f._wasm_add_cli_arg=f.asm.gb).apply(null,arguments)},Vr=f._malloc=function(){return(Vr=f._malloc=f.asm.hb).apply(null,arguments)},Ft=f._run_cli=function(){return(Ft=f._run_cli=f.asm.ib).apply(null,arguments)},sn=f._memcpy=function(){return(sn=f._memcpy=f.asm.jb).apply(null,arguments)},en=f._free=function(){return(en=f._free=f.asm.kb).apply(null,arguments)},un=f._fflush=function(){return(un=f._fflush=f.asm.mb).apply(null,arguments)},rn=f._htons=function(){return(rn=f._htons=f.asm.nb).apply(null,arguments)},tn=f._ntohs=function(){return(tn=f._ntohs=f.asm.ob).apply(null,arguments)},Sn=f._htonl=function(){return(Sn=f._htonl=f.asm.pb).apply(null,arguments)},ni=f._wasm_set_phpini_path=function(){return(ni=f._wasm_set_phpini_path=f.asm.qb).apply(null,arguments)},oi=f._wasm_set_phpini_entries=function(){return(oi=f._wasm_set_phpini_entries=f.asm.rb).apply(null,arguments)},ii=f._wasm_add_SERVER_entry=function(){return(ii=f._wasm_add_SERVER_entry=f.asm.sb).apply(null,arguments)},ai=f._wasm_add_uploaded_file=function(){return(ai=f._wasm_add_uploaded_file=f.asm.tb).apply(null,arguments)},si=f._wasm_set_query_string=function(){return(si=f._wasm_set_query_string=f.asm.ub).apply(null,arguments)},ui=f._wasm_set_path_translated=function(){return(ui=f._wasm_set_path_translated=f.asm.vb).apply(null,arguments)},fi=f._wasm_set_skip_shebang=function(){return(fi=f._wasm_set_skip_shebang=f.asm.wb).apply(null,arguments)},ci=f._wasm_set_request_uri=function(){return(ci=f._wasm_set_request_uri=f.asm.xb).apply(null,arguments)},Ln=f._wasm_set_request_method=function(){return(Ln=f._wasm_set_request_method=f.asm.yb).apply(null,arguments)},Un=f._wasm_set_request_host=function(){return(Un=f._wasm_set_request_host=f.asm.zb).apply(null,arguments)},Cr=f._wasm_set_content_type=function(){return(Cr=f._wasm_set_content_type=f.asm.Ab).apply(null,arguments)},Sr=f._wasm_set_request_body=function(){return(Sr=f._wasm_set_request_body=f.asm.Bb).apply(null,arguments)},br=f._wasm_set_content_length=function(){return(br=f._wasm_set_content_length=f.asm.Cb).apply(null,arguments)},Te=f._wasm_set_cookies=function(){return(Te=f._wasm_set_cookies=f.asm.Db).apply(null,arguments)},De=f._wasm_set_php_code=function(){return(De=f._wasm_set_php_code=f.asm.Eb).apply(null,arguments)},ye=f._wasm_set_request_port=function(){return(ye=f._wasm_set_request_port=f.asm.Fb).apply(null,arguments)},sr=f._phpwasm_init_uploaded_files_hash=function(){return(sr=f._phpwasm_init_uploaded_files_hash=f.asm.Gb).apply(null,arguments)},Ye=f._phpwasm_register_uploaded_file=function(){return(Ye=f._phpwasm_register_uploaded_file=f.asm.Hb).apply(null,arguments)},vr=f._phpwasm_destroy_uploaded_files_hash=function(){return(vr=f._phpwasm_destroy_uploaded_files_hash=f.asm.Ib).apply(null,arguments)},Be=f._wasm_sapi_handle_request=function(){return(Be=f._wasm_sapi_handle_request=f.asm.Jb).apply(null,arguments)},ur=f._php_wasm_init=function(){return(ur=f._php_wasm_init=f.asm.Kb).apply(null,arguments)},fr=f.___funcs_on_exit=function(){return(fr=f.___funcs_on_exit=f.asm.Lb).apply(null,arguments)},cr=f._emscripten_builtin_memalign=function(){return(cr=f._emscripten_builtin_memalign=f.asm.Mb).apply(null,arguments)},He=f._setThrew=function(){return(He=f._setThrew=f.asm.Nb).apply(null,arguments)},xe=f.stackSave=function(){return(xe=f.stackSave=f.asm.Ob).apply(null,arguments)},lr=f.stackRestore=function(){return(lr=f.stackRestore=f.asm.Pb).apply(null,arguments)},kt=f.stackAlloc=function(){return(kt=f.stackAlloc=f.asm.Qb).apply(null,arguments)};function Bt(u,c,m,y,b,d,p){var n=xe();try{return Y(u)(c,m,y,b,d,p)}catch(r){if(lr(n),r!==r+0)throw r;He(1,0)}}function xt(u,c){var m=xe();try{Y(u)(c)}catch(y){if(lr(m),y!==y+0)throw y;He(1,0)}}function zt(u,c,m,y){var b=xe();try{return Y(u)(c,m,y)}catch(d){if(lr(b),d!==d+0)throw d;He(1,0)}}function Ht(u,c,m){var y=xe();try{return Y(u)(c,m)}catch(b){if(lr(y),b!==b+0)throw b;He(1,0)}}function Wt(u,c,m){var y=xe();try{Y(u)(c,m)}catch(b){if(lr(y),b!==b+0)throw b;He(1,0)}}function Yt(u,c){var m=xe();try{return Y(u)(c)}catch(y){if(lr(m),y!==y+0)throw y;He(1,0)}}function jt(u,c,m,y){var b=xe();try{Y(u)(c,m,y)}catch(d){if(lr(b),d!==d+0)throw d;He(1,0)}}function fn(u){var c=xe();try{Y(u)()}catch(m){if(lr(c),m!==m+0)throw m;He(1,0)}}function Nn(u){var c=xe();try{return Y(u)()}catch(m){if(lr(c),m!==m+0)throw m;He(1,0)}}function Tn(u,c,m,y,b){var d=xe();try{Y(u)(c,m,y,b)}catch(p){if(lr(d),p!==p+0)throw p;He(1,0)}}function In(u,c,m,y,b,d){var p=xe();try{Y(u)(c,m,y,b,d)}catch(n){if(lr(p),n!==n+0)throw n;He(1,0)}}function Bn(u,c,m,y,b,d){var p=xe();try{return Y(u)(c,m,y,b,d)}catch(n){if(lr(p),n!==n+0)throw n;He(1,0)}}function li(u,c,m,y,b){var d=xe();try{return Y(u)(c,m,y,b)}catch(p){if(lr(d),p!==p+0)throw p;He(1,0)}}function di(u,c,m,y,b,d,p,n,r,e){var o=xe();try{return Y(u)(c,m,y,b,d,p,n,r,e)}catch(t){if(lr(o),t!==t+0)throw t;He(1,0)}}function _i(u,c,m,y,b,d,p){var n=xe();try{Y(u)(c,m,y,b,d,p)}catch(r){if(lr(n),r!==r+0)throw r;He(1,0)}}function bn(u,c,m,y,b,d){var p=xe();try{Y(u)(c,m,y,b,d)}catch(n){if(lr(p),n!==n+0)throw n;He(1,0)}}function xn(u,c,m,y,b,d,p,n,r,e){var o=xe();try{Y(u)(c,m,y,b,d,p,n,r,e)}catch(t){if(lr(o),t!==t+0)throw t;He(1,0)}}function g(u,c,m,y,b,d,p,n){var r=xe();try{return Y(u)(c,m,y,b,d,p,n)}catch(e){if(lr(r),e!==e+0)throw e;He(1,0)}}function k(u,c,m,y,b,d,p,n){var r=xe();try{Y(u)(c,m,y,b,d,p,n)}catch(e){if(lr(r),e!==e+0)throw e;He(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=v.createPath,f.FS_createDataFile=v.createDataFile,f.FS_createPreloadedFile=v.createPreloadedFile,f.FS_createLazyFile=v.createLazyFile,f.FS_createDevice=v.createDevice,f.FS_unlink=v.unlink,f.ccall=Dn,f.FS=v;var D;$e=function u(){D||_(),D||($e=u)};function _(u){if(u=u||$,Pe>0||(Vn(),Pe>0))return;function c(){D||(D=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),c()},1)):c()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return _(),A}var Pf,js,Vs=Oi(()=>{"use strict";Pf=10142469,js=__dirname+"/php_8_2.wasm"});var Ks={};gi(Ks,{default:()=>Lf,dependenciesTotalSize:()=>Mf,dependencyFilename:()=>Gs});function Lf(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(_,u)=>{throw u},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(_){return f.locateFile?f.locateFile(_,ve):ve+_}var We,ar,Re;function Wr(_){if(_ instanceof Ur)return;fe("exiting due to exception: "+_)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(_,u)=>(yr(),_=Me.normalize(_),J.readFileSync(_,u?void 0:"utf8")),Re=_=>{var u=We(_,!0);return u.buffer||(u=new Uint8Array(u)),u},ar=(_,u,c)=>{yr(),_=Me.normalize(_),J.readFile(_,function(m,y){m?c(m):u(y.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(_){if(!(_ instanceof Ur))throw _}),process.on("unhandledRejection",function(_){throw _}),_e=(_,u)=>{if(Mr())throw process.exitCode=_,u;Wr(u),process.exit(_)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(_,u){_||me(u)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(_,u,c){for(var m=u+c,y=u;_[y]&&!(y>=m);)++y;if(y-u>16&&_.buffer&&ct)return ct.decode(_.subarray(u,y));for(var b="";u<y;){var d=_[u++];if(!(d&128)){b+=String.fromCharCode(d);continue}var p=_[u++]&63;if((d&224)==192){b+=String.fromCharCode((d&31)<<6|p);continue}var n=_[u++]&63;if((d&240)==224?d=(d&15)<<12|p<<6|n:d=(d&7)<<18|p<<12|n<<6|_[u++]&63,d<65536)b+=String.fromCharCode(d);else{var r=d-65536;b+=String.fromCharCode(55296|r>>10,56320|r&1023)}}return b}function ne(_,u){return _?ze(le,_,u):""}function Ze(_,u,c,m){if(!(m>0))return 0;for(var y=c,b=c+m-1,d=0;d<_.length;++d){var p=_.charCodeAt(d);if(p>=55296&&p<=57343){var n=_.charCodeAt(++d);p=65536+((p&1023)<<10)|n&1023}if(p<=127){if(c>=b)break;u[c++]=p}else if(p<=2047){if(c+1>=b)break;u[c++]=192|p>>6,u[c++]=128|p&63}else if(p<=65535){if(c+2>=b)break;u[c++]=224|p>>12,u[c++]=128|p>>6&63,u[c++]=128|p&63}else{if(c+3>=b)break;u[c++]=240|p>>18,u[c++]=128|p>>12&63,u[c++]=128|p>>6&63,u[c++]=128|p&63}}return u[c]=0,c-y}function Fe(_,u,c){return Ze(_,le,u,c)}function Ce(_){for(var u=0,c=0;c<_.length;++c){var m=_.charCodeAt(c);m<=127?u++:m<=2047?u+=2:m>=55296&&m<=57343?(u+=4,++c):u+=3}return u}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(_){Rr=_,f.HEAP8=ee=new Int8Array(_),f.HEAP16=we=new Int16Array(_),f.HEAP32=E=new Int32Array(_),f.HEAPU8=le=new Uint8Array(_),f.HEAPU16=lt=new Uint16Array(_),f.HEAPU32=j=new Uint32Array(_),f.HEAPF32=Hn=new Float32Array(_),f.HEAPF64=dt=new Float64Array(_)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!v.init.initialized&&v.init(),v.ignorePermissions=!1,gr.init(),he.root=v.mount(he,{},null),Se.root=v.mount(Se,{},null),_r(vt)}function Kn(){ur(),_r(Wn),v.quit(),gr.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(_){mt.unshift(_)}function $n(_){vt.unshift(_)}function Jn(_){pt.unshift(_)}var Pe=0,Lr=null,$e=null;function Ci(_){return _}function dr(_){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(_){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var u=$e;$e=null,u()}}function me(_){f.onAbort&&f.onAbort(_),_="Aborted("+_+")",fe(_),Tr=!0,Pr=1,_+=". Build with -sASSERTIONS for more info.";var u=new WebAssembly.RuntimeError(_);throw u}var Qn="data:application/octet-stream;base64,";function ht(_){return _.startsWith(Qn)}var de;de=Gs,ht(de)||(de=Nr(de));function yt(_){try{if(_==de&&qe)return new Uint8Array(qe);if(Re)return Re(_);throw"both async and sync fetching of the wasm failed"}catch(u){me(u)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(_){if(!_.ok)throw"failed to load wasm binary file at '"+de+"'";return _.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var _={a:Jr};function u(d,p){var n=d.exports;f.asm=n,ir=f.asm._a,_t(ir.buffer),ln=f.asm.kb,$n(f.asm.$a),Je("wasm-instantiate")}dr("wasm-instantiate");function c(d){u(d.instance)}function m(d){return eo().then(function(p){return WebAssembly.instantiate(p,_)}).then(function(p){return p}).then(d,function(p){fe("failed to asynchronously prepare wasm: "+p),me(p)})}function y(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(d){var p=WebAssembly.instantiateStreaming(d,_);return p.then(c,function(n){return fe("wasm streaming compile failed: "+n),fe("falling back to ArrayBuffer instantiation"),m(c)})}):m(c)}if(f.instantiateWasm)try{var b=f.instantiateWasm(_,u);return b}catch(d){return fe("Module.instantiateWasm callback failed with error: "+d),!1}return y(),{}}var U,Z;function Ur(_){this.name="ExitStatus",this.message="Program terminated with exit("+_+")",this.status=_}function _r(_){for(;_.length>0;)_.shift()(f)}function Et(_,u){ee.set(_,u)}function to(_,u,c,m){me("Assertion failed: "+ne(_)+", at: "+[u?ne(u):"unknown filename",c,m?ne(m):"unknown function"])}var wt=[];function Y(_){var u=wt[_];return u||(_>=wt.length&&(wt.length=_+1),wt[_]=u=ln.get(_)),u}function no(_,u){Y(_)(u)}var Q={isAbs:_=>_.charAt(0)==="/",splitPath:_=>{var u=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return u.exec(_).slice(1)},normalizeArray:(_,u)=>{for(var c=0,m=_.length-1;m>=0;m--){var y=_[m];y==="."?_.splice(m,1):y===".."?(_.splice(m,1),c++):c&&(_.splice(m,1),c--)}if(u)for(;c;c--)_.unshift("..");return _},normalize:_=>{var u=Q.isAbs(_),c=_.substr(-1)==="/";return _=Q.normalizeArray(_.split("/").filter(m=>!!m),!u).join("/"),!_&&!u&&(_="."),_&&c&&(_+="/"),(u?"/":"")+_},dirname:_=>{var u=Q.splitPath(_),c=u[0],m=u[1];return!c&&!m?".":(m&&(m=m.substr(0,m.length-1)),c+m)},basename:_=>{if(_==="/")return"/";_=Q.normalize(_),_=_.replace(/\/$/,"");var u=_.lastIndexOf("/");return u===-1?_:_.substr(u+1)},join:function(){var _=Array.prototype.slice.call(arguments);return Q.normalize(_.join("/"))},join2:(_,u)=>Q.normalize(_+"/"+u)};function Er(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var _=new Uint8Array(1);return()=>(crypto.getRandomValues(_),_[0])}else if(te)try{var u=require("crypto");return()=>u.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var ge={resolve:function(){for(var _="",u=!1,c=arguments.length-1;c>=-1&&!u;c--){var m=c>=0?arguments[c]:v.cwd();if(typeof m!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!m)return"";_=m+"/"+_,u=Q.isAbs(m)}return _=Q.normalizeArray(_.split("/").filter(y=>!!y),!u).join("/"),(u?"/":"")+_||"."},relative:(_,u)=>{_=ge.resolve(_).substr(1),u=ge.resolve(u).substr(1);function c(r){for(var e=0;e<r.length&&r[e]==="";e++);for(var o=r.length-1;o>=0&&r[o]==="";o--);return e>o?[]:r.slice(e,o-e+1)}for(var m=c(_.split("/")),y=c(u.split("/")),b=Math.min(m.length,y.length),d=b,p=0;p<b;p++)if(m[p]!==y[p]){d=p;break}for(var n=[],p=d;p<m.length;p++)n.push("..");return n=n.concat(y.slice(d)),n.join("/")}};function wr(_,u,c){var m=c>0?c:Ce(_)+1,y=new Array(m),b=Ze(_,y,0,y.length);return u&&(y.length=b),y}var gr={ttys:[],init:function(){},shutdown:function(){},register:function(_,u){gr.ttys[_]={input:[],output:[],ops:u},v.registerDevice(_,gr.stream_ops)},stream_ops:{open:function(_){var u=gr.ttys[_.node.rdev];if(!u)throw new v.ErrnoError(43);_.tty=u,_.seekable=!1},close:function(_){_.tty.ops.fsync(_.tty)},fsync:function(_){_.tty.ops.fsync(_.tty)},read:function(_,u,c,m,y){if(!_.tty||!_.tty.ops.get_char)throw new v.ErrnoError(60);for(var b=0,d=0;d<m;d++){var p;try{p=_.tty.ops.get_char(_.tty)}catch{throw new v.ErrnoError(29)}if(p===void 0&&b===0)throw new v.ErrnoError(6);if(p==null)break;b++,u[c+d]=p}return b&&(_.node.timestamp=Date.now()),b},write:function(_,u,c,m,y){if(!_.tty||!_.tty.ops.put_char)throw new v.ErrnoError(60);try{for(var b=0;b<m;b++)_.tty.ops.put_char(_.tty,u[c+b])}catch{throw new v.ErrnoError(29)}return m&&(_.node.timestamp=Date.now()),b}},default_tty_ops:{get_char:function(_){if(!_.input.length){var u=null;if(te){var c=256,m=Buffer.alloc(c),y=0;try{y=J.readSync(process.stdin.fd,m,0,c,-1)}catch(b){if(b.toString().includes("EOF"))y=0;else throw b}y>0?u=m.slice(0,y).toString("utf-8"):u=null}else typeof window<"u"&&typeof window.prompt=="function"?(u=window.prompt("Input: "),u!==null&&(u+=`
11
+ `)):typeof readline=="function"&&(u=readline(),u!==null&&(u+=`
12
+ `));if(!u)return null;_.input=wr(u,!0)}return _.input.shift()},put_char:function(_,u){u===null||u===10?(er(ze(_.output,0)),_.output=[]):u!=0&&_.output.push(u)},fsync:function(_){_.output&&_.output.length>0&&(er(ze(_.output,0)),_.output=[])}},default_tty1_ops:{put_char:function(_,u){u===null||u===10?(fe(ze(_.output,0)),_.output=[]):u!=0&&_.output.push(u)},fsync:function(_){_.output&&_.output.length>0&&(fe(ze(_.output,0)),_.output=[])}}};function Ir(_,u){return le.fill(0,_,_+u),_}function G(_,u){return Math.ceil(_/u)*u}function Ct(_){_=G(_,65536);var u=fr(65536,_);return u?Ir(u,_):0}var re={ops_table:null,mount:function(_){return re.createNode(null,"/",16895,0)},createNode:function(_,u,c,m){if(v.isBlkdev(c)||v.isFIFO(c))throw new v.ErrnoError(63);re.ops_table||(re.ops_table={dir:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,lookup:re.node_ops.lookup,mknod:re.node_ops.mknod,rename:re.node_ops.rename,unlink:re.node_ops.unlink,rmdir:re.node_ops.rmdir,readdir:re.node_ops.readdir,symlink:re.node_ops.symlink},stream:{llseek:re.stream_ops.llseek}},file:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:{llseek:re.stream_ops.llseek,read:re.stream_ops.read,write:re.stream_ops.write,allocate:re.stream_ops.allocate,mmap:re.stream_ops.mmap,msync:re.stream_ops.msync}},link:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,readlink:re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:v.chrdev_stream_ops}});var y=v.createNode(_,u,c,m);return v.isDir(y.mode)?(y.node_ops=re.ops_table.dir.node,y.stream_ops=re.ops_table.dir.stream,y.contents={}):v.isFile(y.mode)?(y.node_ops=re.ops_table.file.node,y.stream_ops=re.ops_table.file.stream,y.usedBytes=0,y.contents=null):v.isLink(y.mode)?(y.node_ops=re.ops_table.link.node,y.stream_ops=re.ops_table.link.stream):v.isChrdev(y.mode)&&(y.node_ops=re.ops_table.chrdev.node,y.stream_ops=re.ops_table.chrdev.stream),y.timestamp=Date.now(),_&&(_.contents[u]=y,_.timestamp=y.timestamp),y},getFileDataAsTypedArray:function(_){return _.contents?_.contents.subarray?_.contents.subarray(0,_.usedBytes):new Uint8Array(_.contents):new Uint8Array(0)},expandFileStorage:function(_,u){var c=_.contents?_.contents.length:0;if(!(c>=u)){var m=1024*1024;u=Math.max(u,c*(c<m?2:1.125)>>>0),c!=0&&(u=Math.max(u,256));var y=_.contents;_.contents=new Uint8Array(u),_.usedBytes>0&&_.contents.set(y.subarray(0,_.usedBytes),0)}},resizeFileStorage:function(_,u){if(_.usedBytes!=u)if(u==0)_.contents=null,_.usedBytes=0;else{var c=_.contents;_.contents=new Uint8Array(u),c&&_.contents.set(c.subarray(0,Math.min(u,_.usedBytes))),_.usedBytes=u}},node_ops:{getattr:function(_){var u={};return u.dev=v.isChrdev(_.mode)?_.id:1,u.ino=_.id,u.mode=_.mode,u.nlink=1,u.uid=0,u.gid=0,u.rdev=_.rdev,v.isDir(_.mode)?u.size=4096:v.isFile(_.mode)?u.size=_.usedBytes:v.isLink(_.mode)?u.size=_.link.length:u.size=0,u.atime=new Date(_.timestamp),u.mtime=new Date(_.timestamp),u.ctime=new Date(_.timestamp),u.blksize=4096,u.blocks=Math.ceil(u.size/u.blksize),u},setattr:function(_,u){u.mode!==void 0&&(_.mode=u.mode),u.timestamp!==void 0&&(_.timestamp=u.timestamp),u.size!==void 0&&re.resizeFileStorage(_,u.size)},lookup:function(_,u){throw v.genericErrors[44]},mknod:function(_,u,c,m){return re.createNode(_,u,c,m)},rename:function(_,u,c){if(v.isDir(_.mode)){var m;try{m=v.lookupNode(u,c)}catch{}if(m)for(var y in m.contents)throw new v.ErrnoError(55)}delete _.parent.contents[_.name],_.parent.timestamp=Date.now(),_.name=c,u.contents[c]=_,u.timestamp=_.parent.timestamp,_.parent=u},unlink:function(_,u){delete _.contents[u],_.timestamp=Date.now()},rmdir:function(_,u){var c=v.lookupNode(_,u);for(var m in c.contents)throw new v.ErrnoError(55);delete _.contents[u],_.timestamp=Date.now()},readdir:function(_){var u=[".",".."];for(var c in _.contents)_.contents.hasOwnProperty(c)&&u.push(c);return u},symlink:function(_,u,c){var m=re.createNode(_,u,41471,0);return m.link=c,m},readlink:function(_){if(!v.isLink(_.mode))throw new v.ErrnoError(28);return _.link}},stream_ops:{read:function(_,u,c,m,y){var b=_.node.contents;if(y>=_.node.usedBytes)return 0;var d=Math.min(_.node.usedBytes-y,m);if(d>8&&b.subarray)u.set(b.subarray(y,y+d),c);else for(var p=0;p<d;p++)u[c+p]=b[y+p];return d},write:function(_,u,c,m,y,b){if(u.buffer===ee.buffer&&(b=!1),!m)return 0;var d=_.node;if(d.timestamp=Date.now(),u.subarray&&(!d.contents||d.contents.subarray)){if(b)return d.contents=u.subarray(c,c+m),d.usedBytes=m,m;if(d.usedBytes===0&&y===0)return d.contents=u.slice(c,c+m),d.usedBytes=m,m;if(y+m<=d.usedBytes)return d.contents.set(u.subarray(c,c+m),y),m}if(re.expandFileStorage(d,y+m),d.contents.subarray&&u.subarray)d.contents.set(u.subarray(c,c+m),y);else for(var p=0;p<m;p++)d.contents[y+p]=u[c+p];return d.usedBytes=Math.max(d.usedBytes,y+m),m},llseek:function(_,u,c){var m=u;if(c===1?m+=_.position:c===2&&v.isFile(_.node.mode)&&(m+=_.node.usedBytes),m<0)throw new v.ErrnoError(28);return m},allocate:function(_,u,c){re.expandFileStorage(_.node,u+c),_.node.usedBytes=Math.max(_.node.usedBytes,u+c)},mmap:function(_,u,c,m,y){if(!v.isFile(_.node.mode))throw new v.ErrnoError(43);var b,d,p=_.node.contents;if(!(y&2)&&p.buffer===Rr)d=!1,b=p.byteOffset;else{if((c>0||c+u<p.length)&&(p.subarray?p=p.subarray(c,c+u):p=Array.prototype.slice.call(p,c,c+u)),d=!0,b=Ct(u),!b)throw new v.ErrnoError(48);ee.set(p,b)}return{ptr:b,allocated:d}},msync:function(_,u,c,m,y){return re.stream_ops.write(_,u,0,m,c,!1),0}}};function V(_,u,c,m){var y=m?"":"al "+_;ar(_,b=>{Le(b,'Loading data file "'+_+'" failed (no arrayBuffer).'),u(new Uint8Array(b)),y&&Je(y)},b=>{if(c)c();else throw'Loading data file "'+_+'" failed.'}),y&&dr(y)}var i={},C={isWindows:!1,staticInit:()=>{C.isWindows=!!process.platform.match(/^win/);var _=process.binding("constants");_.fs&&(_=_.fs),C.flagsForNodeMap={1024:_.O_APPEND,64:_.O_CREAT,128:_.O_EXCL,256:_.O_NOCTTY,0:_.O_RDONLY,2:_.O_RDWR,4096:_.O_SYNC,512:_.O_TRUNC,1:_.O_WRONLY,131072:_.O_NOFOLLOW}},convertNodeCode:_=>{var u=_.code;return i[u]},mount:_=>C.createNode(null,"/",C.getMode(_.opts.root),0),createNode:(_,u,c,m)=>{if(!v.isDir(c)&&!v.isFile(c)&&!v.isLink(c))throw new v.ErrnoError(28);var y=v.createNode(_,u,c);return y.node_ops=C.node_ops,y.stream_ops=C.stream_ops,y},getMode:_=>{var u;try{u=J.lstatSync(_),C.isWindows&&(u.mode=u.mode|(u.mode&292)>>2)}catch(c){throw c.code?new v.ErrnoError(C.convertNodeCode(c)):c}return u.mode},realPath:_=>{for(var u=[];_.parent!==_;)u.push(_.name),_=_.parent;return u.push(_.mount.opts.root),u.reverse(),Q.join.apply(null,u)},flagsForNode:_=>{_&=-2097153,_&=-2049,_&=-32769,_&=-524289,_&=-65537;var u=0;for(var c in C.flagsForNodeMap)_&c&&(u|=C.flagsForNodeMap[c],_^=c);if(_)throw new v.ErrnoError(28);return u},node_ops:{getattr:_=>{var u=C.realPath(_),c;try{c=J.lstatSync(u)}catch(m){throw m.code?new v.ErrnoError(C.convertNodeCode(m)):m}return C.isWindows&&!c.blksize&&(c.blksize=4096),C.isWindows&&!c.blocks&&(c.blocks=(c.size+c.blksize-1)/c.blksize|0),{dev:c.dev,ino:c.ino,mode:c.mode,nlink:c.nlink,uid:c.uid,gid:c.gid,rdev:c.rdev,size:c.size,atime:c.atime,mtime:c.mtime,ctime:c.ctime,blksize:c.blksize,blocks:c.blocks}},setattr:(_,u)=>{var c=C.realPath(_);try{if(u.mode!==void 0&&(J.chmodSync(c,u.mode),_.mode=u.mode),u.timestamp!==void 0){var m=new Date(u.timestamp);J.utimesSync(c,m,m)}u.size!==void 0&&J.truncateSync(c,u.size)}catch(y){throw y.code?new v.ErrnoError(C.convertNodeCode(y)):y}},lookup:(_,u)=>{var c=Q.join2(C.realPath(_),u),m=C.getMode(c);return C.createNode(_,u,m)},mknod:(_,u,c,m)=>{var y=C.createNode(_,u,c,m),b=C.realPath(y);try{v.isDir(y.mode)?J.mkdirSync(b,y.mode):J.writeFileSync(b,"",{mode:y.mode})}catch(d){throw d.code?new v.ErrnoError(C.convertNodeCode(d)):d}return y},rename:(_,u,c)=>{var m=C.realPath(_),y=Q.join2(C.realPath(u),c);try{J.renameSync(m,y)}catch(b){throw b.code?new v.ErrnoError(C.convertNodeCode(b)):b}_.name=c},unlink:(_,u)=>{var c=Q.join2(C.realPath(_),u);try{J.unlinkSync(c)}catch(m){throw m.code?new v.ErrnoError(C.convertNodeCode(m)):m}},rmdir:(_,u)=>{var c=Q.join2(C.realPath(_),u);try{J.rmdirSync(c)}catch(m){throw m.code?new v.ErrnoError(C.convertNodeCode(m)):m}},readdir:_=>{var u=C.realPath(_);try{return J.readdirSync(u)}catch(c){throw c.code?new v.ErrnoError(C.convertNodeCode(c)):c}},symlink:(_,u,c)=>{var m=Q.join2(C.realPath(_),u);try{J.symlinkSync(c,m)}catch(y){throw y.code?new v.ErrnoError(C.convertNodeCode(y)):y}},readlink:_=>{var u=C.realPath(_);try{return u=J.readlinkSync(u),u=Me.relative(Me.resolve(_.mount.opts.root),u),u}catch(c){throw c.code?c.code==="UNKNOWN"?new v.ErrnoError(28):new v.ErrnoError(C.convertNodeCode(c)):c}}},stream_ops:{open:_=>{var u=C.realPath(_.node);try{v.isFile(_.node.mode)&&(_.nfd=J.openSync(u,C.flagsForNode(_.flags)))}catch(c){throw c.code?new v.ErrnoError(C.convertNodeCode(c)):c}},close:_=>{try{v.isFile(_.node.mode)&&_.nfd&&J.closeSync(_.nfd)}catch(u){throw u.code?new v.ErrnoError(C.convertNodeCode(u)):u}},read:(_,u,c,m,y)=>{if(m===0)return 0;try{return J.readSync(_.nfd,Buffer.from(u.buffer),c,m,y)}catch(b){throw new v.ErrnoError(C.convertNodeCode(b))}},write:(_,u,c,m,y)=>{try{return J.writeSync(_.nfd,Buffer.from(u.buffer),c,m,y)}catch(b){throw new v.ErrnoError(C.convertNodeCode(b))}},llseek:(_,u,c)=>{var m=u;if(c===1)m+=_.position;else if(c===2&&v.isFile(_.node.mode))try{var y=J.fstatSync(_.nfd);m+=y.size}catch(b){throw new v.ErrnoError(C.convertNodeCode(b))}if(m<0)throw new v.ErrnoError(28);return m},mmap:(_,u,c,m,y)=>{if(!v.isFile(_.node.mode))throw new v.ErrnoError(43);var b=Ct(u);return C.stream_ops.read(_,ee,b,u,c),{ptr:b,allocated:!0}},msync:(_,u,c,m,y)=>(C.stream_ops.write(_,u,0,m,c,!1),0)}},v={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(_,u={})=>{if(_=ge.resolve(v.cwd(),_),!_)return{path:"",node:null};var c={follow_mount:!0,recurse_count:0};if(u=Object.assign(c,u),u.recurse_count>8)throw new v.ErrnoError(32);for(var m=Q.normalizeArray(_.split("/").filter(o=>!!o),!1),y=v.root,b="/",d=0;d<m.length;d++){var p=d===m.length-1;if(p&&u.parent)break;if(y=v.lookupNode(y,m[d]),b=Q.join2(b,m[d]),v.isMountpoint(y)&&(!p||p&&u.follow_mount)&&(y=y.mounted.root),!p||u.follow)for(var n=0;v.isLink(y.mode);){var r=v.readlink(b);b=ge.resolve(Q.dirname(b),r);var e=v.lookupPath(b,{recurse_count:u.recurse_count+1});if(y=e.node,n++>40)throw new v.ErrnoError(32)}}return{path:b,node:y}},getPath:_=>{for(var u;;){if(v.isRoot(_)){var c=_.mount.mountpoint;return u?c[c.length-1]!=="/"?c+"/"+u:c+u:c}u=u?_.name+"/"+u:_.name,_=_.parent}},hashName:(_,u)=>{for(var c=0,m=0;m<u.length;m++)c=(c<<5)-c+u.charCodeAt(m)|0;return(_+c>>>0)%v.nameTable.length},hashAddNode:_=>{var u=v.hashName(_.parent.id,_.name);_.name_next=v.nameTable[u],v.nameTable[u]=_},hashRemoveNode:_=>{var u=v.hashName(_.parent.id,_.name);if(v.nameTable[u]===_)v.nameTable[u]=_.name_next;else for(var c=v.nameTable[u];c;){if(c.name_next===_){c.name_next=_.name_next;break}c=c.name_next}},lookupNode:(_,u)=>{var c=v.mayLookup(_);if(c)throw new v.ErrnoError(c,_);for(var m=v.hashName(_.id,u),y=v.nameTable[m];y;y=y.name_next){var b=y.name;if(y.parent.id===_.id&&b===u)return y}return v.lookup(_,u)},createNode:(_,u,c,m)=>{var y=new v.FSNode(_,u,c,m);return v.hashAddNode(y),y},destroyNode:_=>{v.hashRemoveNode(_)},isRoot:_=>_===_.parent,isMountpoint:_=>!!_.mounted,isFile:_=>(_&61440)===32768,isDir:_=>(_&61440)===16384,isLink:_=>(_&61440)===40960,isChrdev:_=>(_&61440)===8192,isBlkdev:_=>(_&61440)===24576,isFIFO:_=>(_&61440)===4096,isSocket:_=>(_&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:_=>{var u=v.flagModes[_];if(typeof u>"u")throw new Error("Unknown file open mode: "+_);return u},flagsToPermissionString:_=>{var u=["r","w","rw"][_&3];return _&512&&(u+="w"),u},nodePermissions:(_,u)=>v.ignorePermissions?0:u.includes("r")&&!(_.mode&292)||u.includes("w")&&!(_.mode&146)||u.includes("x")&&!(_.mode&73)?2:0,mayLookup:_=>{var u=v.nodePermissions(_,"x");return u||(_.node_ops.lookup?0:2)},mayCreate:(_,u)=>{try{var c=v.lookupNode(_,u);return 20}catch{}return v.nodePermissions(_,"wx")},mayDelete:(_,u,c)=>{var m;try{m=v.lookupNode(_,u)}catch(b){return b.errno}var y=v.nodePermissions(_,"wx");if(y)return y;if(c){if(!v.isDir(m.mode))return 54;if(v.isRoot(m)||v.getPath(m)===v.cwd())return 10}else if(v.isDir(m.mode))return 31;return 0},mayOpen:(_,u)=>_?v.isLink(_.mode)?32:v.isDir(_.mode)&&(v.flagsToPermissionString(u)!=="r"||u&512)?31:v.nodePermissions(_,v.flagsToPermissionString(u)):44,MAX_OPEN_FDS:4096,nextfd:(_=0,u=v.MAX_OPEN_FDS)=>{for(var c=_;c<=u;c++)if(!v.streams[c])return c;throw new v.ErrnoError(33)},getStream:_=>v.streams[_],createStream:(_,u,c)=>{v.FSStream||(v.FSStream=function(){this.shared={}},v.FSStream.prototype={},Object.defineProperties(v.FSStream.prototype,{object:{get:function(){return this.node},set:function(y){this.node=y}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(y){this.shared.flags=y}},position:{get:function(){return this.shared.position},set:function(y){this.shared.position=y}}})),_=Object.assign(new v.FSStream,_);var m=v.nextfd(u,c);return _.fd=m,v.streams[m]=_,_},closeStream:_=>{v.streams[_]=null},chrdev_stream_ops:{open:_=>{var u=v.getDevice(_.node.rdev);_.stream_ops=u.stream_ops,_.stream_ops.open&&_.stream_ops.open(_)},llseek:()=>{throw new v.ErrnoError(70)}},major:_=>_>>8,minor:_=>_&255,makedev:(_,u)=>_<<8|u,registerDevice:(_,u)=>{v.devices[_]={stream_ops:u}},getDevice:_=>v.devices[_],getMounts:_=>{for(var u=[],c=[_];c.length;){var m=c.pop();u.push(m),c.push.apply(c,m.mounts)}return u},syncfs:(_,u)=>{typeof _=="function"&&(u=_,_=!1),v.syncFSRequests++,v.syncFSRequests>1&&fe("warning: "+v.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var c=v.getMounts(v.root.mount),m=0;function y(d){return v.syncFSRequests--,u(d)}function b(d){if(d)return b.errored?void 0:(b.errored=!0,y(d));++m>=c.length&&y(null)}c.forEach(d=>{if(!d.type.syncfs)return b(null);d.type.syncfs(d,_,b)})},mount:(_,u,c)=>{var m=c==="/",y=!c,b;if(m&&v.root)throw new v.ErrnoError(10);if(!m&&!y){var d=v.lookupPath(c,{follow_mount:!1});if(c=d.path,b=d.node,v.isMountpoint(b))throw new v.ErrnoError(10);if(!v.isDir(b.mode))throw new v.ErrnoError(54)}var p={type:_,opts:u,mountpoint:c,mounts:[]},n=_.mount(p);return n.mount=p,p.root=n,m?v.root=n:b&&(b.mounted=p,b.mount&&b.mount.mounts.push(p)),n},unmount:_=>{var u=v.lookupPath(_,{follow_mount:!1});if(!v.isMountpoint(u.node))throw new v.ErrnoError(28);var c=u.node,m=c.mounted,y=v.getMounts(m);Object.keys(v.nameTable).forEach(d=>{for(var p=v.nameTable[d];p;){var n=p.name_next;y.includes(p.mount)&&v.destroyNode(p),p=n}}),c.mounted=null;var b=c.mount.mounts.indexOf(m);c.mount.mounts.splice(b,1)},lookup:(_,u)=>_.node_ops.lookup(_,u),mknod:(_,u,c)=>{var m=v.lookupPath(_,{parent:!0}),y=m.node,b=Q.basename(_);if(!b||b==="."||b==="..")throw new v.ErrnoError(28);var d=v.mayCreate(y,b);if(d)throw new v.ErrnoError(d);if(!y.node_ops.mknod)throw new v.ErrnoError(63);return y.node_ops.mknod(y,b,u,c)},create:(_,u)=>(u=u!==void 0?u:438,u&=4095,u|=32768,v.mknod(_,u,0)),mkdir:(_,u)=>(u=u!==void 0?u:511,u&=1023,u|=16384,v.mknod(_,u,0)),mkdirTree:(_,u)=>{for(var c=_.split("/"),m="",y=0;y<c.length;++y)if(c[y]){m+="/"+c[y];try{v.mkdir(m,u)}catch(b){if(b.errno!=20)throw b}}},mkdev:(_,u,c)=>(typeof c>"u"&&(c=u,u=438),u|=8192,v.mknod(_,u,c)),symlink:(_,u)=>{if(!ge.resolve(_))throw new v.ErrnoError(44);var c=v.lookupPath(u,{parent:!0}),m=c.node;if(!m)throw new v.ErrnoError(44);var y=Q.basename(u),b=v.mayCreate(m,y);if(b)throw new v.ErrnoError(b);if(!m.node_ops.symlink)throw new v.ErrnoError(63);return m.node_ops.symlink(m,y,_)},rename:(_,u)=>{var c=Q.dirname(_),m=Q.dirname(u),y=Q.basename(_),b=Q.basename(u),d,p,n;if(d=v.lookupPath(_,{parent:!0}),p=d.node,d=v.lookupPath(u,{parent:!0}),n=d.node,!p||!n)throw new v.ErrnoError(44);if(p.mount!==n.mount)throw new v.ErrnoError(75);var r=v.lookupNode(p,y),e=ge.relative(_,m);if(e.charAt(0)!==".")throw new v.ErrnoError(28);if(e=ge.relative(u,c),e.charAt(0)!==".")throw new v.ErrnoError(55);var o;try{o=v.lookupNode(n,b)}catch{}if(r!==o){var t=v.isDir(r.mode),a=v.mayDelete(p,y,t);if(a)throw new v.ErrnoError(a);if(a=o?v.mayDelete(n,b,t):v.mayCreate(n,b),a)throw new v.ErrnoError(a);if(!p.node_ops.rename)throw new v.ErrnoError(63);if(v.isMountpoint(r)||o&&v.isMountpoint(o))throw new v.ErrnoError(10);if(n!==p&&(a=v.nodePermissions(p,"w"),a))throw new v.ErrnoError(a);v.hashRemoveNode(r);try{p.node_ops.rename(r,n,b)}catch(s){throw s}finally{v.hashAddNode(r)}}},rmdir:_=>{var u=v.lookupPath(_,{parent:!0}),c=u.node,m=Q.basename(_),y=v.lookupNode(c,m),b=v.mayDelete(c,m,!0);if(b)throw new v.ErrnoError(b);if(!c.node_ops.rmdir)throw new v.ErrnoError(63);if(v.isMountpoint(y))throw new v.ErrnoError(10);c.node_ops.rmdir(c,m),v.destroyNode(y)},readdir:_=>{var u=v.lookupPath(_,{follow:!0}),c=u.node;if(!c.node_ops.readdir)throw new v.ErrnoError(54);return c.node_ops.readdir(c)},unlink:_=>{var u=v.lookupPath(_,{parent:!0}),c=u.node;if(!c)throw new v.ErrnoError(44);var m=Q.basename(_),y=v.lookupNode(c,m),b=v.mayDelete(c,m,!1);if(b)throw new v.ErrnoError(b);if(!c.node_ops.unlink)throw new v.ErrnoError(63);if(v.isMountpoint(y))throw new v.ErrnoError(10);c.node_ops.unlink(c,m),v.destroyNode(y)},readlink:_=>{var u=v.lookupPath(_),c=u.node;if(!c)throw new v.ErrnoError(44);if(!c.node_ops.readlink)throw new v.ErrnoError(28);return ge.resolve(v.getPath(c.parent),c.node_ops.readlink(c))},stat:(_,u)=>{var c=v.lookupPath(_,{follow:!u}),m=c.node;if(!m)throw new v.ErrnoError(44);if(!m.node_ops.getattr)throw new v.ErrnoError(63);return m.node_ops.getattr(m)},lstat:_=>v.stat(_,!0),chmod:(_,u,c)=>{var m;if(typeof _=="string"){var y=v.lookupPath(_,{follow:!c});m=y.node}else m=_;if(!m.node_ops.setattr)throw new v.ErrnoError(63);m.node_ops.setattr(m,{mode:u&4095|m.mode&-4096,timestamp:Date.now()})},lchmod:(_,u)=>{v.chmod(_,u,!0)},fchmod:(_,u)=>{var c=v.getStream(_);if(!c)throw new v.ErrnoError(8);v.chmod(c.node,u)},chown:(_,u,c,m)=>{var y;if(typeof _=="string"){var b=v.lookupPath(_,{follow:!m});y=b.node}else y=_;if(!y.node_ops.setattr)throw new v.ErrnoError(63);y.node_ops.setattr(y,{timestamp:Date.now()})},lchown:(_,u,c)=>{v.chown(_,u,c,!0)},fchown:(_,u,c)=>{var m=v.getStream(_);if(!m)throw new v.ErrnoError(8);v.chown(m.node,u,c)},truncate:(_,u)=>{if(u<0)throw new v.ErrnoError(28);var c;if(typeof _=="string"){var m=v.lookupPath(_,{follow:!0});c=m.node}else c=_;if(!c.node_ops.setattr)throw new v.ErrnoError(63);if(v.isDir(c.mode))throw new v.ErrnoError(31);if(!v.isFile(c.mode))throw new v.ErrnoError(28);var y=v.nodePermissions(c,"w");if(y)throw new v.ErrnoError(y);c.node_ops.setattr(c,{size:u,timestamp:Date.now()})},ftruncate:(_,u)=>{var c=v.getStream(_);if(!c)throw new v.ErrnoError(8);if(!(c.flags&2097155))throw new v.ErrnoError(28);v.truncate(c.node,u)},utime:(_,u,c)=>{var m=v.lookupPath(_,{follow:!0}),y=m.node;y.node_ops.setattr(y,{timestamp:Math.max(u,c)})},open:(_,u,c)=>{if(_==="")throw new v.ErrnoError(44);u=typeof u=="string"?v.modeStringToFlags(u):u,c=typeof c>"u"?438:c,u&64?c=c&4095|32768:c=0;var m;if(typeof _=="object")m=_;else{_=Q.normalize(_);try{var y=v.lookupPath(_,{follow:!(u&131072)});m=y.node}catch{}}var b=!1;if(u&64)if(m){if(u&128)throw new v.ErrnoError(20)}else m=v.mknod(_,c,0),b=!0;if(!m)throw new v.ErrnoError(44);if(v.isChrdev(m.mode)&&(u&=-513),u&65536&&!v.isDir(m.mode))throw new v.ErrnoError(54);if(!b){var d=v.mayOpen(m,u);if(d)throw new v.ErrnoError(d)}u&512&&!b&&v.truncate(m,0),u&=-131713;var p=v.createStream({node:m,path:v.getPath(m),flags:u,seekable:!0,position:0,stream_ops:m.stream_ops,ungotten:[],error:!1});return p.stream_ops.open&&p.stream_ops.open(p),f.logReadFiles&&!(u&1)&&(v.readFiles||(v.readFiles={}),_ in v.readFiles||(v.readFiles[_]=1)),p},close:_=>{if(v.isClosed(_))throw new v.ErrnoError(8);_.getdents&&(_.getdents=null);try{_.stream_ops.close&&_.stream_ops.close(_)}catch(u){throw u}finally{v.closeStream(_.fd)}_.fd=null},isClosed:_=>_.fd===null,llseek:(_,u,c)=>{if(v.isClosed(_))throw new v.ErrnoError(8);if(!_.seekable||!_.stream_ops.llseek)throw new v.ErrnoError(70);if(c!=0&&c!=1&&c!=2)throw new v.ErrnoError(28);return _.position=_.stream_ops.llseek(_,u,c),_.ungotten=[],_.position},read:(_,u,c,m,y)=>{if(m<0||y<0)throw new v.ErrnoError(28);if(v.isClosed(_))throw new v.ErrnoError(8);if((_.flags&2097155)===1)throw new v.ErrnoError(8);if(v.isDir(_.node.mode))throw new v.ErrnoError(31);if(!_.stream_ops.read)throw new v.ErrnoError(28);var b=typeof y<"u";if(!b)y=_.position;else if(!_.seekable)throw new v.ErrnoError(70);var d=_.stream_ops.read(_,u,c,m,y);return b||(_.position+=d),d},write:(_,u,c,m,y,b)=>{if(m<0||y<0)throw new v.ErrnoError(28);if(v.isClosed(_))throw new v.ErrnoError(8);if(!(_.flags&2097155))throw new v.ErrnoError(8);if(v.isDir(_.node.mode))throw new v.ErrnoError(31);if(!_.stream_ops.write)throw new v.ErrnoError(28);_.seekable&&_.flags&1024&&v.llseek(_,0,2);var d=typeof y<"u";if(!d)y=_.position;else if(!_.seekable)throw new v.ErrnoError(70);var p=_.stream_ops.write(_,u,c,m,y,b);return d||(_.position+=p),p},allocate:(_,u,c)=>{if(v.isClosed(_))throw new v.ErrnoError(8);if(u<0||c<=0)throw new v.ErrnoError(28);if(!(_.flags&2097155))throw new v.ErrnoError(8);if(!v.isFile(_.node.mode)&&!v.isDir(_.node.mode))throw new v.ErrnoError(43);if(!_.stream_ops.allocate)throw new v.ErrnoError(138);_.stream_ops.allocate(_,u,c)},mmap:(_,u,c,m,y)=>{if(m&2&&!(y&2)&&(_.flags&2097155)!==2)throw new v.ErrnoError(2);if((_.flags&2097155)===1)throw new v.ErrnoError(2);if(!_.stream_ops.mmap)throw new v.ErrnoError(43);return _.stream_ops.mmap(_,u,c,m,y)},msync:(_,u,c,m,y)=>_.stream_ops.msync?_.stream_ops.msync(_,u,c,m,y):0,munmap:_=>0,ioctl:(_,u,c)=>{if(!_.stream_ops.ioctl)throw new v.ErrnoError(59);return _.stream_ops.ioctl(_,u,c)},readFile:(_,u={})=>{if(u.flags=u.flags||0,u.encoding=u.encoding||"binary",u.encoding!=="utf8"&&u.encoding!=="binary")throw new Error('Invalid encoding type "'+u.encoding+'"');var c,m=v.open(_,u.flags),y=v.stat(_),b=y.size,d=new Uint8Array(b);return v.read(m,d,0,b,0),u.encoding==="utf8"?c=ze(d,0):u.encoding==="binary"&&(c=d),v.close(m),c},writeFile:(_,u,c={})=>{c.flags=c.flags||577;var m=v.open(_,c.flags,c.mode);if(typeof u=="string"){var y=new Uint8Array(Ce(u)+1),b=Ze(u,y,0,y.length);v.write(m,y,0,b,void 0,c.canOwn)}else if(ArrayBuffer.isView(u))v.write(m,u,0,u.byteLength,void 0,c.canOwn);else throw new Error("Unsupported data type");v.close(m)},cwd:()=>v.currentPath,chdir:_=>{var u=v.lookupPath(_,{follow:!0});if(u.node===null)throw new v.ErrnoError(44);if(!v.isDir(u.node.mode))throw new v.ErrnoError(54);var c=v.nodePermissions(u.node,"x");if(c)throw new v.ErrnoError(c);v.currentPath=u.path},createDefaultDirectories:()=>{v.mkdir("/tmp"),v.mkdir("/home"),v.mkdir("/home/web_user")},createDefaultDevices:()=>{v.mkdir("/dev"),v.registerDevice(v.makedev(1,3),{read:()=>0,write:(u,c,m,y,b)=>y}),v.mkdev("/dev/null",v.makedev(1,3)),gr.register(v.makedev(5,0),gr.default_tty_ops),gr.register(v.makedev(6,0),gr.default_tty1_ops),v.mkdev("/dev/tty",v.makedev(5,0)),v.mkdev("/dev/tty1",v.makedev(6,0));var _=Er();v.createDevice("/dev","random",_),v.createDevice("/dev","urandom",_),v.mkdir("/dev/shm"),v.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{v.mkdir("/proc");var _=v.mkdir("/proc/self");v.mkdir("/proc/self/fd"),v.mount({mount:()=>{var u=v.createNode(_,"fd",16895,73);return u.node_ops={lookup:(c,m)=>{var y=+m,b=v.getStream(y);if(!b)throw new v.ErrnoError(8);var d={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>b.path}};return d.parent=d,d}},u}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?v.createDevice("/dev","stdin",f.stdin):v.symlink("/dev/tty","/dev/stdin"),f.stdout?v.createDevice("/dev","stdout",null,f.stdout):v.symlink("/dev/tty","/dev/stdout"),f.stderr?v.createDevice("/dev","stderr",null,f.stderr):v.symlink("/dev/tty1","/dev/stderr");var _=v.open("/dev/stdin",0),u=v.open("/dev/stdout",1),c=v.open("/dev/stderr",1)},ensureErrnoError:()=>{v.ErrnoError||(v.ErrnoError=function(u,c){this.node=c,this.setErrno=function(m){this.errno=m},this.setErrno(u),this.message="FS error"},v.ErrnoError.prototype=new Error,v.ErrnoError.prototype.constructor=v.ErrnoError,[44].forEach(_=>{v.genericErrors[_]=new v.ErrnoError(_),v.genericErrors[_].stack="<generic error, no stack>"}))},staticInit:()=>{v.ensureErrnoError(),v.nameTable=new Array(4096),v.mount(re,{},"/"),v.createDefaultDirectories(),v.createDefaultDevices(),v.createSpecialDirectories(),v.filesystems={MEMFS:re,NODEFS:C}},init:(_,u,c)=>{v.init.initialized=!0,v.ensureErrnoError(),f.stdin=_||f.stdin,f.stdout=u||f.stdout,f.stderr=c||f.stderr,v.createStandardStreams()},quit:()=>{v.init.initialized=!1,en(0);for(var _=0;_<v.streams.length;_++){var u=v.streams[_];u&&v.close(u)}},getMode:(_,u)=>{var c=0;return _&&(c|=365),u&&(c|=146),c},findObject:(_,u)=>{var c=v.analyzePath(_,u);return c.exists?c.object:null},analyzePath:(_,u)=>{try{var c=v.lookupPath(_,{follow:!u});_=c.path}catch{}var m={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var c=v.lookupPath(_,{parent:!0});m.parentExists=!0,m.parentPath=c.path,m.parentObject=c.node,m.name=Q.basename(_),c=v.lookupPath(_,{follow:!u}),m.exists=!0,m.path=c.path,m.object=c.node,m.name=c.node.name,m.isRoot=c.path==="/"}catch(y){m.error=y.errno}return m},createPath:(_,u,c,m)=>{_=typeof _=="string"?_:v.getPath(_);for(var y=u.split("/").reverse();y.length;){var b=y.pop();if(b){var d=Q.join2(_,b);try{v.mkdir(d)}catch{}_=d}}return d},createFile:(_,u,c,m,y)=>{var b=Q.join2(typeof _=="string"?_:v.getPath(_),u),d=v.getMode(m,y);return v.create(b,d)},createDataFile:(_,u,c,m,y,b)=>{var d=u;_&&(_=typeof _=="string"?_:v.getPath(_),d=u?Q.join2(_,u):_);var p=v.getMode(m,y),n=v.create(d,p);if(c){if(typeof c=="string"){for(var r=new Array(c.length),e=0,o=c.length;e<o;++e)r[e]=c.charCodeAt(e);c=r}v.chmod(n,p|146);var t=v.open(n,577);v.write(t,c,0,c.length,0,b),v.close(t),v.chmod(n,p)}return n},createDevice:(_,u,c,m)=>{var y=Q.join2(typeof _=="string"?_:v.getPath(_),u),b=v.getMode(!!c,!!m);v.createDevice.major||(v.createDevice.major=64);var d=v.makedev(v.createDevice.major++,0);return v.registerDevice(d,{open:p=>{p.seekable=!1},close:p=>{m&&m.buffer&&m.buffer.length&&m(10)},read:(p,n,r,e,o)=>{for(var t=0,a=0;a<e;a++){var s;try{s=c()}catch{throw new v.ErrnoError(29)}if(s===void 0&&t===0)throw new v.ErrnoError(6);if(s==null)break;t++,n[r+a]=s}return t&&(p.node.timestamp=Date.now()),t},write:(p,n,r,e,o)=>{for(var t=0;t<e;t++)try{m(n[r+t])}catch{throw new v.ErrnoError(29)}return e&&(p.node.timestamp=Date.now()),t}}),v.mkdev(y,b,d)},forceLoadFile:_=>{if(_.isDevice||_.isFolder||_.link||_.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{_.contents=wr(We(_.url),!0),_.usedBytes=_.contents.length}catch{throw new v.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(_,u,c,m,y)=>{function b(){this.lengthKnown=!1,this.chunks=[]}if(b.prototype.get=function(a){if(!(a>this.length-1||a<0)){var s=a%this.chunkSize,l=a/this.chunkSize|0;return this.getter(l)[s]}},b.prototype.setDataGetter=function(a){this.getter=a},b.prototype.cacheLength=function(){var a=new XMLHttpRequest;if(a.open("HEAD",c,!1),a.send(null),!(a.status>=200&&a.status<300||a.status===304))throw new Error("Couldn't load "+c+". Status: "+a.status);var s=Number(a.getResponseHeader("Content-length")),l,h=(l=a.getResponseHeader("Accept-Ranges"))&&l==="bytes",w=(l=a.getResponseHeader("Content-Encoding"))&&l==="gzip",S=1024*1024;h||(S=s);var O=(T,F)=>{if(T>F)throw new Error("invalid range ("+T+", "+F+") or no bytes requested!");if(F>s-1)throw new Error("only "+s+" bytes available! programmer error!");var L=new XMLHttpRequest;if(L.open("GET",c,!1),s!==S&&L.setRequestHeader("Range","bytes="+T+"-"+F),L.responseType="arraybuffer",L.overrideMimeType&&L.overrideMimeType("text/plain; charset=x-user-defined"),L.send(null),!(L.status>=200&&L.status<300||L.status===304))throw new Error("Couldn't load "+c+". Status: "+L.status);return L.response!==void 0?new Uint8Array(L.response||[]):wr(L.responseText||"",!0)},N=this;N.setDataGetter(T=>{var F=T*S,L=(T+1)*S-1;if(L=Math.min(L,s-1),typeof N.chunks[T]>"u"&&(N.chunks[T]=O(F,L)),typeof N.chunks[T]>"u")throw new Error("doXHR failed!");return N.chunks[T]}),(w||!s)&&(S=s=1,s=this.getter(0).length,S=s,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=s,this._chunkSize=S,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var d=new b;Object.defineProperties(d,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var p={isDevice:!1,contents:d}}else var p={isDevice:!1,url:c};var n=v.createFile(_,u,p,m,y);p.contents?n.contents=p.contents:p.url&&(n.contents=null,n.url=p.url),Object.defineProperties(n,{usedBytes:{get:function(){return this.contents.length}}});var r={},e=Object.keys(n.stream_ops);e.forEach(t=>{var a=n.stream_ops[t];r[t]=function(){return v.forceLoadFile(n),a.apply(null,arguments)}});function o(t,a,s,l,h){var w=t.node.contents;if(h>=w.length)return 0;var S=Math.min(w.length-h,l);if(w.slice)for(var O=0;O<S;O++)a[s+O]=w[h+O];else for(var O=0;O<S;O++)a[s+O]=w.get(h+O);return S}return r.read=(t,a,s,l,h)=>(v.forceLoadFile(n),o(t,a,s,l,h)),r.mmap=(t,a,s,l,h)=>{v.forceLoadFile(n);var w=Ct(a);if(!w)throw new v.ErrnoError(48);return o(t,ee,w,a,s),{ptr:w,allocated:!0}},n.stream_ops=r,n},createPreloadedFile:(_,u,c,m,y,b,d,p,n,r)=>{var e=u?ge.resolve(Q.join2(_,u)):_,o="cp "+e;function t(a){function s(l){r&&r(),p||v.createDataFile(_,u,l,m,y,n),b&&b(),Je(o)}Browser.handledByPreloadPlugin(a,e,s,()=>{d&&d(),Je(o)})||s(a)}dr(o),typeof c=="string"?V(c,a=>t(a),d):t(c)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(_,u,c)=>{u=u||(()=>{}),c=c||(()=>{});var m=v.indexedDB();try{var y=m.open(v.DB_NAME(),v.DB_VERSION)}catch(b){return c(b)}y.onupgradeneeded=()=>{er("creating db");var b=y.result;b.createObjectStore(v.DB_STORE_NAME)},y.onsuccess=()=>{var b=y.result,d=b.transaction([v.DB_STORE_NAME],"readwrite"),p=d.objectStore(v.DB_STORE_NAME),n=0,r=0,e=_.length;function o(){r==0?u():c()}_.forEach(t=>{var a=p.put(v.analyzePath(t).object.contents,t);a.onsuccess=()=>{n++,n+r==e&&o()},a.onerror=()=>{r++,n+r==e&&o()}}),d.onerror=c},y.onerror=c},loadFilesFromDB:(_,u,c)=>{u=u||(()=>{}),c=c||(()=>{});var m=v.indexedDB();try{var y=m.open(v.DB_NAME(),v.DB_VERSION)}catch(b){return c(b)}y.onupgradeneeded=c,y.onsuccess=()=>{var b=y.result;try{var d=b.transaction([v.DB_STORE_NAME],"readonly")}catch(t){c(t);return}var p=d.objectStore(v.DB_STORE_NAME),n=0,r=0,e=_.length;function o(){r==0?u():c()}_.forEach(t=>{var a=p.get(t);a.onsuccess=()=>{v.analyzePath(t).exists&&v.unlink(t),v.createDataFile(Q.dirname(t),Q.basename(t),a.result,!0,!0,!0),n++,n+r==e&&o()},a.onerror=()=>{r++,n+r==e&&o()}}),d.onerror=c},y.onerror=c}},H={DEFAULT_POLLMASK:5,calculateAt:function(_,u,c){if(Q.isAbs(u))return u;var m;if(_===-100)m=v.cwd();else{var y=H.getStreamFromFD(_);m=y.path}if(u.length==0){if(!c)throw new v.ErrnoError(44);return m}return Q.join2(m,u)},doStat:function(_,u,c){try{var m=_(u)}catch(y){if(y&&y.node&&Q.normalize(u)!==Q.normalize(v.getPath(y.node)))return-54;throw y}return E[c>>2]=m.dev,E[c+8>>2]=m.ino,E[c+12>>2]=m.mode,j[c+16>>2]=m.nlink,E[c+20>>2]=m.uid,E[c+24>>2]=m.gid,E[c+28>>2]=m.rdev,Z=[m.size>>>0,(U=m.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[c+40>>2]=Z[0],E[c+44>>2]=Z[1],E[c+48>>2]=4096,E[c+52>>2]=m.blocks,Z=[Math.floor(m.atime.getTime()/1e3)>>>0,(U=Math.floor(m.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[c+56>>2]=Z[0],E[c+60>>2]=Z[1],j[c+64>>2]=0,Z=[Math.floor(m.mtime.getTime()/1e3)>>>0,(U=Math.floor(m.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[c+72>>2]=Z[0],E[c+76>>2]=Z[1],j[c+80>>2]=0,Z=[Math.floor(m.ctime.getTime()/1e3)>>>0,(U=Math.floor(m.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[c+88>>2]=Z[0],E[c+92>>2]=Z[1],j[c+96>>2]=0,Z=[m.ino>>>0,(U=m.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[c+104>>2]=Z[0],E[c+108>>2]=Z[1],0},doMsync:function(_,u,c,m,y){if(!v.isFile(u.node.mode))throw new v.ErrnoError(43);if(m&2)return 0;var b=le.slice(_,_+c);v.msync(u,b,y,c,m)},varargs:void 0,get:function(){H.varargs+=4;var _=E[H.varargs-4>>2];return _},getStr:function(_){var u=ne(_);return u},getStreamFromFD:function(_){var u=v.getStream(_);if(!u)throw new v.ErrnoError(8);return u}};function ke(_,u,c,m,y){try{for(var b=0,d=u?E[u>>2]:0,p=u?E[u+4>>2]:0,n=c?E[c>>2]:0,r=c?E[c+4>>2]:0,e=m?E[m>>2]:0,o=m?E[m+4>>2]:0,t=0,a=0,s=0,l=0,h=0,w=0,S=(u?E[u>>2]:0)|(c?E[c>>2]:0)|(m?E[m>>2]:0),O=(u?E[u+4>>2]:0)|(c?E[c+4>>2]:0)|(m?E[m+4>>2]:0),N=function(B,P,M,z){return B<32?P&z:M&z},T=0;T<_;T++){var F=1<<T%32;if(N(T,S,O,F)){var L=H.getStreamFromFD(T),R=H.DEFAULT_POLLMASK;L.stream_ops?.poll&&(R=L.stream_ops.poll(L)),R&1&&N(T,d,p,F)&&(T<32?t=t|F:a=a|F,b++),R&4&&N(T,n,r,F)&&(T<32?s=s|F:l=l|F,b++),R&2&&N(T,e,o,F)&&(T<32?h=h|F:w=w|F,b++)}}return u&&(E[u>>2]=t,E[u+4>>2]=a),c&&(E[c>>2]=s,E[c+4>>2]=l),m&&(E[m>>2]=h,E[m+4>>2]=w),b}catch(B){if(typeof v>"u"||!(B instanceof v.ErrnoError))throw B;return-B.errno}}var he={mount:function(_){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(u,c){return typeof c=="function"&&(this._callbacks[u]=c),this},f.websocket.emit=function(u,c){typeof this._callbacks[u]=="function"&&this._callbacks[u].call(this,c)},v.createNode(null,"/",16895,0)},createSocket:function(_,u,c){u&=-526337;var m=u==1;if(m&&c&&c!=6)throw new v.ErrnoError(66);var y={family:_,type:u,protocol:c,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:he.websocket_sock_ops},b=he.nextname(),d=v.createNode(he.root,b,49152,0);d.sock=y;var p=v.createStream({path:b,node:d,flags:2,seekable:!1,stream_ops:he.stream_ops});return y.stream=p,y},getSocket:function(_){var u=v.getStream(_);return!u||!v.isSocket(u.node.mode)?null:u.node.sock},stream_ops:{poll:function(_){var u=_.node.sock;return u.sock_ops.poll(u)},ioctl:function(_,u,c){var m=_.node.sock;return m.sock_ops.ioctl(m,u,c)},read:function(_,u,c,m,y){var b=_.node.sock,d=b.sock_ops.recvmsg(b,m);return d?(u.set(d.buffer,c),d.buffer.length):0},write:function(_,u,c,m,y){var b=_.node.sock;return b.sock_ops.sendmsg(b,u,c,m)},close:function(_){var u=_.node.sock;u.sock_ops.close(u)}},nextname:function(){return he.nextname.current||(he.nextname.current=0),"socket["+he.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(_,u,c){var m;if(typeof u=="object"&&(m=u,u=null,c=null),m)if(m._socket)u=m._socket.remoteAddress,c=m._socket.remotePort;else{var y=/ws[s]?:\/\/([^:]+):(\d+)/.exec(m.url);if(!y)throw new Error("WebSocket URL must be in the format ws(s)://address:port");u=y[1],c=parseInt(y[2],10)}else try{var b=f.websocket&&typeof f.websocket=="object",d="ws:#".replace("#","//");if(b&&(typeof f.websocket.url=="function"?d=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(d=f.websocket.url)),d==="ws://"||d==="wss://"){var p=u.split("/");d=d+p[0]+":"+c+"/"+p.slice(1).join("/")}var n="binary";b&&typeof f.websocket.subprotocol=="string"&&(n=f.websocket.subprotocol);var r=void 0;n!=="null"&&(n=n.replace(/^ +| +$/g,"").split(/ *, */),r=n),b&&f.websocket.subprotocol===null&&(n="null",r=void 0);var e;te?e=An():e=WebSocket,f.websocket.decorator&&(e=f.websocket.decorator(e)),m=new e(d,r),m.binaryType="arraybuffer"}catch{throw new v.ErrnoError(23)}var o={addr:u,port:c,socket:m,dgram_send_queue:[]};return he.websocket_sock_ops.addPeer(_,o),he.websocket_sock_ops.handlePeerEvents(_,o),_.type===2&&typeof _.sport<"u"&&o.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(_.sport&65280)>>8,_.sport&255])),o},getPeer:function(_,u,c){return _.peers[u+":"+c]},addPeer:function(_,u){_.peers[u.addr+":"+u.port]=u},removePeer:function(_,u){delete _.peers[u.addr+":"+u.port]},handlePeerEvents:function(_,u){var c=!0,m=function(){f.websocket.emit("open",_.stream.fd);try{for(var b=u.dgram_send_queue.shift();b;)u.socket.send(b),b=u.dgram_send_queue.shift()}catch{u.socket.close()}};function y(b){if(typeof b=="string"){var d=new TextEncoder;b=d.encode(b)}else{if(Le(b.byteLength!==void 0),b.byteLength==0)return;b=new Uint8Array(b)}var p=c;if(c=!1,p&&b.length===10&&b[0]===255&&b[1]===255&&b[2]===255&&b[3]===255&&b[4]==="p".charCodeAt(0)&&b[5]==="o".charCodeAt(0)&&b[6]==="r".charCodeAt(0)&&b[7]==="t".charCodeAt(0)){var n=b[8]<<8|b[9];he.websocket_sock_ops.removePeer(_,u),u.port=n,he.websocket_sock_ops.addPeer(_,u);return}_.recv_queue.push({addr:u.addr,port:u.port,data:b}),f.websocket.emit("message",_.stream.fd)}te?(u.socket.on("open",m),u.socket.on("message",function(b,d){d&&y(new Uint8Array(b).buffer)}),u.socket.on("close",function(){f.websocket.emit("close",_.stream.fd)}),u.socket.on("error",function(b){_.error=14,f.websocket.emit("error",[_.stream.fd,_.error,"ECONNREFUSED: Connection refused"])})):(u.socket.onopen=m,u.socket.onclose=function(){f.websocket.emit("close",_.stream.fd)},u.socket.onmessage=function(d){y(d.data)},u.socket.onerror=function(b){_.error=14,f.websocket.emit("error",[_.stream.fd,_.error,"ECONNREFUSED: Connection refused"])})},poll:function(_){if(_.type===1&&_.server)return _.pending.length?65:0;var u=0,c=_.type===1?he.websocket_sock_ops.getPeer(_,_.daddr,_.dport):null;return(_.recv_queue.length||!c||c&&c.socket.readyState===c.socket.CLOSING||c&&c.socket.readyState===c.socket.CLOSED)&&(u|=65),(!c||c&&c.socket.readyState===c.socket.OPEN)&&(u|=4),(c&&c.socket.readyState===c.socket.CLOSING||c&&c.socket.readyState===c.socket.CLOSED)&&(u|=16),u},ioctl:function(_,u,c){switch(u){case 21531:var m=0;return _.recv_queue.length&&(m=_.recv_queue[0].data.length),E[c>>2]=m,0;default:return 28}},close:function(_){if(_.server){try{_.server.close()}catch{}_.server=null}for(var u=Object.keys(_.peers),c=0;c<u.length;c++){var m=_.peers[u[c]];try{m.socket.close()}catch{}he.websocket_sock_ops.removePeer(_,m)}return 0},bind:function(_,u,c){if(typeof _.saddr<"u"||typeof _.sport<"u")throw new v.ErrnoError(28);if(_.saddr=u,_.sport=c,_.type===2){_.server&&(_.server.close(),_.server=null);try{_.sock_ops.listen(_,0)}catch(m){if(!(m instanceof v.ErrnoError)||m.errno!==138)throw m}}},connect:function(_,u,c){if(_.server)throw new v.ErrnoError(138);if(typeof _.daddr<"u"&&typeof _.dport<"u"){var m=he.websocket_sock_ops.getPeer(_,_.daddr,_.dport);if(m)throw m.socket.readyState===m.socket.CONNECTING?new v.ErrnoError(7):new v.ErrnoError(30)}var y=he.websocket_sock_ops.createPeer(_,u,c);throw _.daddr=y.addr,_.dport=y.port,new v.ErrnoError(26)},listen:function(_,u){if(!te)throw new v.ErrnoError(138);if(_.server)throw new v.ErrnoError(28);var c=An().Server,m=_.saddr;_.server=new c({host:m,port:_.sport}),f.websocket.emit("listen",_.stream.fd),_.server.on("connection",function(y){if(_.type===1){var b=he.createSocket(_.family,_.type,_.protocol),d=he.websocket_sock_ops.createPeer(b,y);b.daddr=d.addr,b.dport=d.port,_.pending.push(b),f.websocket.emit("connection",b.stream.fd)}else he.websocket_sock_ops.createPeer(_,y),f.websocket.emit("connection",_.stream.fd)}),_.server.on("close",function(){f.websocket.emit("close",_.stream.fd),_.server=null}),_.server.on("error",function(y){_.error=23,f.websocket.emit("error",[_.stream.fd,_.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(_){if(!_.server||!_.pending.length)throw new v.ErrnoError(28);var u=_.pending.shift();return u.stream.flags=_.stream.flags,u},getname:function(_,u){var c,m;if(u){if(_.daddr===void 0||_.dport===void 0)throw new v.ErrnoError(53);c=_.daddr,m=_.dport}else c=_.saddr||0,m=_.sport||0;return{addr:c,port:m}},sendmsg:function(_,u,c,m,y,b){if(_.type===2){if((y===void 0||b===void 0)&&(y=_.daddr,b=_.dport),y===void 0||b===void 0)throw new v.ErrnoError(17)}else y=_.daddr,b=_.dport;var d=he.websocket_sock_ops.getPeer(_,y,b);if(_.type===1){if(!d||d.socket.readyState===d.socket.CLOSING||d.socket.readyState===d.socket.CLOSED)throw new v.ErrnoError(53);if(d.socket.readyState===d.socket.CONNECTING)throw new v.ErrnoError(6)}ArrayBuffer.isView(u)&&(c+=u.byteOffset,u=u.buffer);var p;if(p=u.slice(c,c+m),_.type===2&&(!d||d.socket.readyState!==d.socket.OPEN))return(!d||d.socket.readyState===d.socket.CLOSING||d.socket.readyState===d.socket.CLOSED)&&(d=he.websocket_sock_ops.createPeer(_,y,b)),d.dgram_send_queue.push(p),m;try{return d.socket.send(p),m}catch{throw new v.ErrnoError(28)}},recvmsg:function(_,u){if(_.type===1&&_.server)throw new v.ErrnoError(53);var c=_.recv_queue.shift();if(!c){if(_.type===1){var m=he.websocket_sock_ops.getPeer(_,_.daddr,_.dport);if(!m)throw new v.ErrnoError(53);if(m.socket.readyState===m.socket.CLOSING||m.socket.readyState===m.socket.CLOSED)return null;throw new v.ErrnoError(6)}throw new v.ErrnoError(6)}var y=c.data.byteLength||c.data.length,b=c.data.byteOffset||0,d=c.data.buffer||c.data,p=Math.min(u,y),n={buffer:new Uint8Array(d,b,p),addr:c.addr,port:c.port};if(_.type===1&&p<y){var r=y-p;c.data=new Uint8Array(d,b+p,r),_.recv_queue.unshift(c)}return n}}};function Ie(_){var u=he.getSocket(_);if(!u)throw new v.ErrnoError(8);return u}function ce(_){return E[zr()>>2]=_,_}function Ar(_){for(var u=_.split("."),c=0;c<4;c++){var m=Number(u[c]);if(isNaN(m))return null;u[c]=m}return(u[0]|u[1]<<8|u[2]<<16|u[3]<<24)>>>0}function be(_){return parseInt(_)}function ue(_){var u,c,m,y,b=/^((?=.*::)(?!.*::.+::)(::)?([\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,d=[];if(!b.test(_))return null;if(_==="::")return[0,0,0,0,0,0,0,0];for(_.startsWith("::")?_=_.replace("::","Z:"):_=_.replace("::",":Z:"),_.indexOf(".")>0?(_=_.replace(new RegExp("[.]","g"),":"),u=_.split(":"),u[u.length-4]=be(u[u.length-4])+be(u[u.length-3])*256,u[u.length-3]=be(u[u.length-2])+be(u[u.length-1])*256,u=u.slice(0,u.length-2)):u=_.split(":"),m=0,y=0,c=0;c<u.length;c++)if(typeof u[c]=="string")if(u[c]==="Z"){for(y=0;y<8-u.length+1;y++)d[c+y]=0;m=y-1}else d[c+m]=un(parseInt(u[c],16));else d[c+m]=u[c];return[d[1]<<16|d[0],d[3]<<16|d[2],d[5]<<16|d[4],d[7]<<16|d[6]]}function Zr(_,u,c,m,y){switch(u){case 2:c=Ar(c),Ir(_,16),y&&(E[y>>2]=16),we[_>>1]=u,E[_+4>>2]=c,we[_+2>>1]=un(m);break;case 10:c=ue(c),Ir(_,28),y&&(E[y>>2]=28),E[_>>2]=u,E[_+8>>2]=c[0],E[_+12>>2]=c[1],E[_+16>>2]=c[2],E[_+20>>2]=c[3],we[_+2>>1]=un(m);break;default:return 5}return 0}var Ne={address_map:{id:1,addrs:{},names:{}},lookup_name:function(_){var u=Ar(_);if(u!==null||(u=ue(_),u!==null))return _;var c;if(Ne.address_map.addrs[_])c=Ne.address_map.addrs[_];else{var m=Ne.address_map.id++;Le(m<65535,"exceeded max address mappings of 65535"),c="172.29."+(m&255)+"."+(m&65280),Ne.address_map.names[c]=_,Ne.address_map.addrs[_]=c}return c},lookup_addr:function(_){return Ne.address_map.names[_]?Ne.address_map.names[_]:null}};function kn(_,u,c,m){try{var y=Ie(_),b=y.sock_ops.accept(y);if(u)var d=Zr(u,b.family,Ne.lookup_name(b.daddr),b.dport,c);return b.stream.fd}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function Gr(_){return(_&255)+"."+(_>>8&255)+"."+(_>>16&255)+"."+(_>>24&255)}function Yr(_){var u="",c=0,m=0,y=0,b=0,d=0,p=0,n=[_[0]&65535,_[0]>>16,_[1]&65535,_[1]>>16,_[2]&65535,_[2]>>16,_[3]&65535,_[3]>>16],r=!0,e="";for(p=0;p<5;p++)if(n[p]!==0){r=!1;break}if(r){if(e=Gr(n[6]|n[7]<<16),n[5]===-1)return u="::ffff:",u+=e,u;if(n[5]===0)return u="::",e==="0.0.0.0"&&(e=""),e==="0.0.0.1"&&(e="1"),u+=e,u}for(c=0;c<8;c++)n[c]===0&&(c-y>1&&(d=0),y=c,d++),d>m&&(m=d,b=c-m+1);for(c=0;c<8;c++){if(m>1&&n[c]===0&&c>=b&&c<b+m){c===b&&(u+=":",b===0&&(u+=":"));continue}u+=Number(rn(n[c]&65535)).toString(16),u+=c<7?":":""}return u}function dn(_,u){var c=we[_>>1],m=rn(lt[_+2>>1]),y;switch(c){case 2:if(u!==16)return{errno:28};y=E[_+4>>2],y=Gr(y);break;case 10:if(u!==28)return{errno:28};y=[E[_+8>>2],E[_+12>>2],E[_+16>>2],E[_+20>>2]],y=Yr(y);break;default:return{errno:5}}return{family:c,addr:y,port:m}}function Pt(_,u,c){if(c&&_===0)return null;var m=dn(_,u);if(m.errno)throw new v.ErrnoError(m.errno);return m.addr=Ne.lookup_addr(m.addr)||m.addr,m}function oo(_,u,c){try{var m=Ie(_),y=Pt(u,c);return m.sock_ops.bind(m,y.addr,y.port),0}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function io(_){try{return _=H.getStr(_),v.chdir(_),0}catch(u){if(typeof v>"u"||!(u instanceof v.ErrnoError))throw u;return-u.errno}}function ao(_,u){try{return _=H.getStr(_),v.chmod(_,u),0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function so(_,u,c){try{var m=Ie(_),y=Pt(u,c);return m.sock_ops.connect(m,y.addr,y.port),0}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function uo(_){try{var u=H.getStreamFromFD(_);return v.createStream(u,0).fd}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function _n(_,u,c){try{var m=H.getStreamFromFD(_);if(m.fd===u)return-28;var y=v.getStream(u);return y&&v.close(y),v.createStream(m,u,u+1).fd}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function fo(_,u,c,m){try{if(u=H.getStr(u),u=H.calculateAt(_,u),c&-8)return-28;var y=v.lookupPath(u,{follow:!0}),b=y.node;if(!b)return-44;var d="";return c&4&&(d+="r"),c&2&&(d+="w"),c&1&&(d+="x"),d&&v.nodePermissions(b,d)?-2:0}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function gt(_,u){return u+2097152>>>0<4194305-!!_?(_>>>0)+u*4294967296:NaN}function co(_,u,c,m,y,b){try{var d=gt(c,m);if(isNaN(d))return-61;var p=gt(y,b);if(isNaN(p))return-61;var n=H.getStreamFromFD(_);return v.allocate(n,d,p),0}catch(r){if(typeof v>"u"||!(r instanceof v.ErrnoError))throw r;return-r.errno}}function lo(_,u){try{return v.fchmod(_,u),0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function qt(_,u,c){try{return v.fchown(_,u,c),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function _o(_,u,c,m,y){try{u=H.getStr(u);var b=y&256;return y=y&-257,u=H.calculateAt(_,u),(b?v.lchown:v.chown)(u,c,m),0}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function mo(_,u,c){H.varargs=c;try{var m=H.getStreamFromFD(_);switch(u){case 0:{var y=H.get();if(y<0)return-28;var b;return b=v.createStream(m,y),b.fd}case 1:case 2:return 0;case 3:return m.flags;case 4:{var y=H.get();return m.flags|=y,0}case 5:{var y=H.get(),d=0;return we[y+d>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return ce(28),-1;default:return-28}}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function vo(_){try{var u=H.getStreamFromFD(_);return 0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function po(_,u){try{var c=H.getStreamFromFD(_);return H.doStat(v.stat,c.path,u)}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function ho(_,u,c){try{var m=gt(u,c);return isNaN(m)?-61:(v.ftruncate(_,m),0)}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function yo(_,u){try{if(u===0)return-28;var c=v.cwd(),m=Ce(c)+1;return u<m?-68:(Fe(c,_,u),m)}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function Eo(_,u,c){try{var m=H.getStreamFromFD(_);m.getdents||(m.getdents=v.readdir(m.path));for(var y=280,b=0,d=v.llseek(m,0,1),p=Math.floor(d/y);p<m.getdents.length&&b+y<=c;){var n,r,e=m.getdents[p];if(e===".")n=m.node.id,r=4;else if(e===".."){var o=v.lookupPath(m.path,{parent:!0});n=o.node.id,r=4}else{var t=v.lookupNode(m.node,e);n=t.id,r=v.isChrdev(t.mode)?2:v.isDir(t.mode)?4:v.isLink(t.mode)?10:8}Z=[n>>>0,(U=n,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[u+b>>2]=Z[0],E[u+b+4>>2]=Z[1],Z=[(p+1)*y>>>0,(U=(p+1)*y,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[u+b+8>>2]=Z[0],E[u+b+12>>2]=Z[1],we[u+b+16>>1]=280,ee[u+b+18>>0]=r,Fe(e,u+b+19,256),b+=y,p+=1}return v.llseek(m,p*y,0),b}catch(a){if(typeof v>"u"||!(a instanceof v.ErrnoError))throw a;return-a.errno}}function wo(_,u,c){try{var m=Ie(_);if(!m.daddr)return-53;var y=Zr(u,m.family,Ne.lookup_name(m.daddr),m.dport,c);return 0}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function go(_,u,c){try{fe("__syscall_getsockname "+_);var m=Ie(_),y=Zr(u,m.family,Ne.lookup_name(m.saddr||"0.0.0.0"),m.sport,c);return 0}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function So(_,u,c,m,y){try{var b=Ie(_);return u===1&&c===4?(E[m>>2]=b.error,E[y>>2]=4,b.error=null,0):-50}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function bo(_,u,c){H.varargs=c;try{var m=H.getStreamFromFD(_);switch(u){case 21509:case 21505:return m.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return m.tty?0:-59;case 21519:{if(!m.tty)return-59;var y=H.get();return E[y>>2]=0,0}case 21520:return m.tty?-28:-59;case 21531:{var y=H.get();return v.ioctl(m,u,y)}case 21523:return m.tty?0:-59;case 21524:return m.tty?0:-59;default:return-28}}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function ko(_,u){try{var c=Ie(_);return c.sock_ops.listen(c,u),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function ae(_,u){try{return _=H.getStr(_),H.doStat(v.lstat,_,u)}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function Oo(_,u,c){try{return u=H.getStr(u),u=H.calculateAt(_,u),u=Q.normalize(u),u[u.length-1]==="/"&&(u=u.substr(0,u.length-1)),v.mkdir(u,c,0),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function kr(_,u,c,m){try{u=H.getStr(u);var y=m&256,b=m&4096;return m=m&-4353,u=H.calculateAt(_,u,b),H.doStat(y?v.lstat:v.stat,u,c)}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function Do(_,u,c,m){H.varargs=m;try{u=H.getStr(u),u=H.calculateAt(_,u);var y=m?H.get():0;return v.open(u,c,y).fd}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}var Se={BUCKET_BUFFER_SIZE:8192,mount:function(_){return v.createNode(null,"/",16895,0)},createPipe:function(){var _={buckets:[],refcnt:2};_.buckets.push({buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var u=Se.nextname(),c=Se.nextname(),m=v.createNode(Se.root,u,4096,0),y=v.createNode(Se.root,c,4096,0);m.pipe=_,y.pipe=_;var b=v.createStream({path:u,node:m,flags:0,seekable:!1,stream_ops:Se.stream_ops});m.stream=b;var d=v.createStream({path:c,node:y,flags:1,seekable:!1,stream_ops:Se.stream_ops});return y.stream=d,{readable_fd:b.fd,writable_fd:d.fd}},stream_ops:{poll:function(_){var u=_.node.pipe;if((_.flags&2097155)===1)return 260;if(u.buckets.length>0)for(var c=0;c<u.buckets.length;c++){var m=u.buckets[c];if(m.offset-m.roffset>0)return 65}return 0},ioctl:function(_,u,c){return 28},fsync:function(_){return 28},read:function(_,u,c,m,y){for(var b=_.node.pipe,d=0,p=0;p<b.buckets.length;p++){var n=b.buckets[p];d+=n.offset-n.roffset}Le(u instanceof ArrayBuffer||ArrayBuffer.isView(u));var r=u.subarray(c,c+m);if(m<=0)return 0;if(d==0)throw new v.ErrnoError(6);for(var e=Math.min(d,m),o=e,t=0,p=0;p<b.buckets.length;p++){var a=b.buckets[p],s=a.offset-a.roffset;if(e<=s){var l=a.buffer.subarray(a.roffset,a.offset);e<s?(l=l.subarray(0,e),a.roffset+=e):t++,r.set(l);break}else{var l=a.buffer.subarray(a.roffset,a.offset);r.set(l),r=r.subarray(l.byteLength),e-=l.byteLength,t++}}return t&&t==b.buckets.length&&(t--,b.buckets[t].offset=0,b.buckets[t].roffset=0),b.buckets.splice(0,t),o},write:function(_,u,c,m,y){var b=_.node.pipe;Le(u instanceof ArrayBuffer||ArrayBuffer.isView(u));var d=u.subarray(c,c+m),p=d.byteLength;if(p<=0)return 0;var n=null;b.buckets.length==0?(n={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:0,roffset:0},b.buckets.push(n)):n=b.buckets[b.buckets.length-1],Le(n.offset<=Se.BUCKET_BUFFER_SIZE);var r=Se.BUCKET_BUFFER_SIZE-n.offset;if(r>=p)return n.buffer.set(d,n.offset),n.offset+=p,p;r>0&&(n.buffer.set(d.subarray(0,r),n.offset),n.offset+=r,d=d.subarray(r,d.byteLength));for(var e=d.byteLength/Se.BUCKET_BUFFER_SIZE|0,o=d.byteLength%Se.BUCKET_BUFFER_SIZE,t=0;t<e;t++){var a={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:Se.BUCKET_BUFFER_SIZE,roffset:0};b.buckets.push(a),a.buffer.set(d.subarray(0,Se.BUCKET_BUFFER_SIZE)),d=d.subarray(Se.BUCKET_BUFFER_SIZE,d.byteLength)}if(o>0){var a={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:d.byteLength,roffset:0};b.buckets.push(a),a.buffer.set(d)}return p},close:function(_){var u=_.node.pipe;u.refcnt--,u.refcnt===0&&(u.buckets=null)}},nextname:function(){return Se.nextname.current||(Se.nextname.current=0),"pipe["+Se.nextname.current+++"]"}};function No(_){try{if(_==0)throw new v.ErrnoError(21);var u=Se.createPipe();return E[_>>2]=u.readable_fd,E[_+4>>2]=u.writable_fd,0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function To(_,u,c){try{for(var m=0,y=0;y<u;y++){var b=_+8*y,d=E[b>>2],p=we[b+4>>1],n=32,r=v.getStream(d);r&&(n=H.DEFAULT_POLLMASK,r.stream_ops?.poll&&(n=r.stream_ops.poll(r))),n&=p|8|16,n&&m++,we[b+6>>1]=n}return m}catch(e){if(typeof v>"u"||!(e instanceof v.ErrnoError))throw e;return-e.errno}}function Ao(_,u,c,m){try{if(u=H.getStr(u),u=H.calculateAt(_,u),m<=0)return-28;var y=v.readlink(u),b=Math.min(m,Ce(y)),d=ee[c+b];return Fe(y,c,m+1),ee[c+b]=d,b}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function Fo(_,u,c,m,y,b){try{var d=Ie(_),p=d.sock_ops.recvmsg(d,c);if(!p)return 0;if(y)var n=Zr(y,d.family,Ne.lookup_name(p.addr),p.port,b);return le.set(p.buffer,u),p.buffer.byteLength}catch(r){if(typeof v>"u"||!(r instanceof v.ErrnoError))throw r;return-r.errno}}function Co(_,u,c,m){try{return u=H.getStr(u),m=H.getStr(m),u=H.calculateAt(_,u),m=H.calculateAt(c,m),v.rename(u,m),0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function Po(_){try{return _=H.getStr(_),v.rmdir(_),0}catch(u){if(typeof v>"u"||!(u instanceof v.ErrnoError))throw u;return-u.errno}}function Ro(_,u,c,m,y,b){try{var d=Ie(_),p=Pt(y,b,!0);return p?d.sock_ops.sendmsg(d,ee,u,c,p.addr,p.port):v.write(d.stream,ee,u,c)}catch(n){if(typeof v>"u"||!(n instanceof v.ErrnoError))throw n;return-n.errno}}function Mo(_,u,c){try{var m=he.createSocket(_,u,c);return m.stream.fd}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function jr(_,u){try{return _=H.getStr(_),H.doStat(v.stat,_,u)}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function Lo(_,u,c){try{return _=H.getStr(_),E[c+4>>2]=4096,E[c+40>>2]=4096,E[c+8>>2]=1e6,E[c+12>>2]=5e5,E[c+16>>2]=5e5,E[c+20>>2]=v.nextInode,E[c+24>>2]=1e6,E[c+28>>2]=42,E[c+44>>2]=2,E[c+36>>2]=255,0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function mn(_,u){try{return _=H.getStr(_),u=H.getStr(u),v.symlink(_,u),0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function Vt(_,u,c){try{return u=H.getStr(u),u=H.calculateAt(_,u),c===0?v.unlink(u):c===512?v.rmdir(u):me("Invalid flags passed to unlinkat"),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function St(_){return j[_>>2]+E[_+4>>2]*4294967296}function Fn(_,u,c,m){try{if(u=H.getStr(u),u=H.calculateAt(_,u,!0),c){var d=St(c),p=E[c+8>>2];y=d*1e3+p/(1e3*1e3),c+=16,d=St(c),p=E[c+8>>2],b=d*1e3+p/(1e3*1e3)}else var y=Date.now(),b=y;return v.utime(u,y,b),0}catch(n){if(typeof v>"u"||!(n instanceof v.ErrnoError))throw n;return-n.errno}}function Uo(_){}var vn="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Io(_,u){me(vn)}function Bo(_,u){me(vn)}var xo=!0;function zo(){return xo}function Ho(){throw 1/0}function Wo(_,u){var c=new Date(St(_)*1e3);E[u>>2]=c.getUTCSeconds(),E[u+4>>2]=c.getUTCMinutes(),E[u+8>>2]=c.getUTCHours(),E[u+12>>2]=c.getUTCDate(),E[u+16>>2]=c.getUTCMonth(),E[u+20>>2]=c.getUTCFullYear()-1900,E[u+24>>2]=c.getUTCDay();var m=Date.UTC(c.getUTCFullYear(),0,1,0,0,0,0),y=(c.getTime()-m)/(1e3*60*60*24)|0;E[u+28>>2]=y}function Gt(_,u){var c=new Date(St(_)*1e3);E[u>>2]=c.getSeconds(),E[u+4>>2]=c.getMinutes(),E[u+8>>2]=c.getHours(),E[u+12>>2]=c.getDate(),E[u+16>>2]=c.getMonth(),E[u+20>>2]=c.getFullYear()-1900,E[u+24>>2]=c.getDay();var m=new Date(c.getFullYear(),0,1),y=(c.getTime()-m.getTime())/(1e3*60*60*24)|0;E[u+28>>2]=y,E[u+36>>2]=-(c.getTimezoneOffset()*60);var b=new Date(c.getFullYear(),6,1).getTimezoneOffset(),d=m.getTimezoneOffset(),p=(b!=d&&c.getTimezoneOffset()==Math.min(d,b))|0;E[u+32>>2]=p}function Yo(_){var u=new Date(E[_+20>>2]+1900,E[_+16>>2],E[_+12>>2],E[_+8>>2],E[_+4>>2],E[_>>2],0),c=E[_+32>>2],m=u.getTimezoneOffset(),y=new Date(u.getFullYear(),0,1),b=new Date(u.getFullYear(),6,1).getTimezoneOffset(),d=y.getTimezoneOffset(),p=Math.min(d,b);if(c<0)E[_+32>>2]=+(b!=d&&p==m);else if(c>0!=(p==m)){var n=Math.max(d,b),r=c>0?p:n;u.setTime(u.getTime()+(r-m)*6e4)}E[_+24>>2]=u.getDay();var e=(u.getTime()-y.getTime())/(1e3*60*60*24)|0;return E[_+28>>2]=e,E[_>>2]=u.getSeconds(),E[_+4>>2]=u.getMinutes(),E[_+8>>2]=u.getHours(),E[_+12>>2]=u.getDate(),E[_+16>>2]=u.getMonth(),E[_+20>>2]=u.getYear(),u.getTime()/1e3|0}function rt(_,u,c,m,y,b){try{var d=H.getStreamFromFD(m),p=v.mmap(d,_,y,u,c),n=p.ptr;return E[b>>2]=p.allocated,n}catch(r){if(typeof v>"u"||!(r instanceof v.ErrnoError))throw r;return-r.errno}}function jo(_,u,c,m,y,b){try{var d=H.getStreamFromFD(y);c&2&&H.doMsync(_,d,u,m,b),v.munmap(d)}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function Kt(_){var u=Ce(_)+1,c=Br(u);return c&&Ze(_,ee,c,u),c}function Xt(_,u,c){var m=new Date().getFullYear(),y=new Date(m,0,1),b=new Date(m,6,1),d=y.getTimezoneOffset(),p=b.getTimezoneOffset(),n=Math.max(d,p);E[_>>2]=n*60,E[u>>2]=+(d!=p);function r(s){var l=s.toTimeString().match(/\(([A-Za-z ]+)\)$/);return l?l[1]:"GMT"}var e=r(y),o=r(b),t=Kt(e),a=Kt(o);p<d?(j[c>>2]=t,j[c+4>>2]=a):(j[c>>2]=a,j[c+4>>2]=t)}function Rt(_,u,c){Rt.called||(Rt.called=!0,Xt(_,u,c))}function tt(){me("")}function qo(){return Date.now()}function Zt(){return 2147483648}function Vo(){return Zt()}var Mt;te?Mt=()=>{var _=process.hrtime();return _[0]*1e3+_[1]/1e6}:Mt=()=>performance.now();function it(_,u,c){le.copyWithin(_,u,u+c)}function Go(_){try{return ir.grow(_-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function Or(_){var u=le.length;_=_>>>0;var c=Zt();if(_>c)return!1;let m=(n,r)=>n+(r-n%r)%r;for(var y=1;y<=4;y*=2){var b=u*(1+.2/y);b=Math.min(b,_+100663296);var d=Math.min(c,m(Math.max(_,b),65536)),p=Go(d);if(p)return!0}return!1}function at(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var st=A.ENV||{};function On(){return ie||"./this.program"}function qr(){if(!qr.strings){var _=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",u={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:_,_:On()};for(var c in st)st[c]===void 0?delete u[c]:u[c]=st[c];var m=[];for(var c in u)m.push(c+"="+u[c]);qr.strings=m}return qr.strings}function Lt(_,u,c){for(var m=0;m<_.length;++m)ee[u++>>0]=_.charCodeAt(m);c||(ee[u>>0]=0)}function Cn(_,u){var c=0;return qr().forEach(function(m,y){var b=u+c;j[_+y*4>>2]=b,Lt(m,b),c+=m.length+1}),0}function Ko(_,u){var c=qr();j[_>>2]=c.length;var m=0;return c.forEach(function(y){m+=y.length+1}),j[u>>2]=m,0}function pn(_){Pr=_,Mr()||(f.onExit&&f.onExit(_),Tr=!0),_e(_,new Ur(_))}function Xo(_,u){Pr=_,Mr()||Kn(),pn(_)}var Zo=Xo;function $o(_){try{var u=H.getStreamFromFD(_);return v.close(u),0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return c.errno}}function Jo(_,u){try{var c=H.getStreamFromFD(_),m=c.tty?2:v.isDir(c.mode)?3:v.isLink(c.mode)?7:4;return ee[u>>0]=m,0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return y.errno}}function Qo(_,u,c,m){for(var y=0,b=0;b<c;b++){var d=j[u>>2],p=j[u+4>>2];u+=8;var n=v.read(_,ee,d,p,m);if(n<0)return-1;if(y+=n,n<p)break}return y}function ei(_,u,c,m){try{var y=H.getStreamFromFD(_),b=Qo(y,u,c);return j[m>>2]=b,0}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return d.errno}}function nn(_,u,c,m,y){try{var b=gt(u,c);if(isNaN(b))return 61;var d=H.getStreamFromFD(_);return v.llseek(d,b,m),Z=[d.position>>>0,(U=d.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[y>>2]=Z[0],E[y+4>>2]=Z[1],d.getdents&&b===0&&m===0&&(d.getdents=null),0}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return p.errno}}function Pn(_){try{var u=H.getStreamFromFD(_);return u.stream_ops&&u.stream_ops.fsync?u.stream_ops.fsync(u):0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return c.errno}}function Rn(_,u,c,m){for(var y=0,b=0;b<c;b++){var d=j[u>>2],p=j[u+4>>2];u+=8;var n=v.write(_,ee,d,p,m);if(n<0)return-1;y+=n}return y}function ri(_,u,c,m){try{var y=H.getStreamFromFD(_),b=Rn(y,u,c);return j[m>>2]=b,0}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return d.errno}}function Mn(_,u,c,m){var y=0,b=0,d=0,p=0,n=0,r=0,e;function o(t,a,s,l,h,w){var S,O,N,T;return O=t===10?28:16,h=t===10?Yr(h):Gr(h),S=Br(O),T=Zr(S,t,h,w),Le(!T),N=Br(32),E[N+4>>2]=t,E[N+8>>2]=a,E[N+12>>2]=s,E[N+24>>2]=l,j[N+20>>2]=S,t===10?E[N+16>>2]=28:E[N+16>>2]=16,E[N+28>>2]=0,N}if(c&&(d=E[c>>2],p=E[c+4>>2],n=E[c+8>>2],r=E[c+12>>2]),n&&!r&&(r=n===2?17:6),!n&&r&&(n=r===17?2:1),r===0&&(r=6),n===0&&(n=1),!_&&!u)return-2;if(d&-1088||c!==0&&E[c>>2]&2&&!_)return-1;if(d&32)return-2;if(n!==0&&n!==1&&n!==2)return-7;if(p!==0&&p!==2&&p!==10)return-6;if(u&&(u=ne(u),b=parseInt(u,10),isNaN(b)))return d&1024?-2:-8;if(!_)return p===0&&(p=2),d&1||(p===2?y=tn(2130706433):y=[0,0,0,1]),e=o(p,n,r,null,y,b),j[m>>2]=e,0;if(_=ne(_),y=Ar(_),y!==null)if(p===0||p===2)p=2;else if(p===10&&d&8)y=[0,0,tn(65535),y],p=10;else return-2;else if(y=ue(_),y!==null)if(p===0||p===10)p=10;else return-2;return y!=null?(e=o(p,n,r,_,y,b),j[m>>2]=e,0):d&4?-2:(_=Ne.lookup_name(_),y=Ar(_),p===0?p=2:p===10&&(y=[0,0,tn(65535),y]),e=o(p,n,r,null,y,b),j[m>>2]=e,0)}function hn(){fe("missing function: getcontext"),me(-1)}function nt(_){var u=Br(20),c=Br(_.length+1);Fe(_,c,_.length+1),j[u>>2]=c;var m=Br(4);j[m>>2]=0,j[u+4>>2]=m;var y=2;E[u+8>>2]=y,E[u+12>>2]=4;var b=Br(12);return j[b>>2]=b+8,j[b+4>>2]=0,E[b+8>>2]=Ar(Ne.lookup_name(_)),j[u+16>>2]=b,u}function bt(_){return nt(ne(_))}function $t(_,u,c,m,y,b){var d=bt(_);return Ft(u,d,20),sn(d),E[b>>2]=0,j[y>>2]=u,0}function yn(_,u){for(var c=Math.min(u,3),m=8,y=0;y<c;y++)dt[_+y*m>>3]=.1;return c}function Fr(_,u,c,m,y,b,d){var p=dn(_,u);if(p.errno)return-6;var n=p.port,r=p.addr,e=!1;if(c&&m){var o;if(d&1||!(o=Ne.lookup_addr(r))){if(d&8)return-2}else r=o;var t=Fe(r,c,m);t+1>=m&&(e=!0)}if(y&&b){n=""+n;var t=Fe(n,y,b);t+1>=b&&(e=!0)}return e?-12:0}var Ue={list:[],map:{}};function hr(_){function u(b,d,p){var n=Br(b.length+1);Lt(b,n);for(var r=0,e=p.length,o=Br((e+1)*4),t=0;t<e;t++,r+=4){var a=p[t],s=Br(a.length+1);Lt(a,s),j[o+r>>2]=s}j[o+r>>2]=0;var l=Br(12);return j[l>>2]=n,j[l+4>>2]=o,E[l+8>>2]=d,l}var c=Ue.list,m=Ue.map;if(c.length===0){var y=u("tcp",6,["TCP"]);c.push(y),m.tcp=m[6]=y,y=u("udp",17,["UDP"]),c.push(y),m.udp=m[17]=y}hr.index=0}function tr(_){_=ne(_),hr(!0);var u=Ue.map[_];return u}function Hr(_){hr(!0);var u=Ue.map[_];return u}function Ge(_){var u=Ce(_)+1,c=lr(u);return Ze(_,ee,c,u),c}var Xe={getAllWebSockets:function(_){let u=new Set;_.server&&_.server.clients.forEach(c=>{u.add(c)});for(let c of Xe.getAllPeers(_))u.add(c.socket);return Array.from(u)},getAllPeers:function(_){let u=new Set;if(_.server&&_.pending.filter(c=>c.peers).forEach(c=>{for(let m of Object.values(c.peers))u.add(m)}),_.peers)for(let c of Object.values(_.peers))u.add(c);return Array.from(u)},awaitData:function(_){return Xe.awaitWsEvent(_,"message")},awaitConnection:function(_){return _.OPEN===_.readyState?[Promise.resolve(),Xe.noop]:Xe.awaitWsEvent(_,"open")},awaitClose:function(_){return[_.CLOSING,_.CLOSED].includes(_.readyState)?[Promise.resolve(),Xe.noop]:Xe.awaitWsEvent(_,"close")},awaitError:function(_){return[_.CLOSING,_.CLOSED].includes(_.readyState)?[Promise.resolve(),Xe.noop]:Xe.awaitWsEvent(_,"error")},awaitWsEvent:function(_,u){let c,m=()=>{c()};return[new Promise(function(d){c=d,_.once(u,m)}),()=>{_.removeListener(u,m),setTimeout(c)}]},noop:function(){},shutdownSocket:function(_,u){let c=Ie(_),m=Object.values(c.peers)[0];if(!m)return-1;try{return m.socket.close(),he.websocket_sock_ops.removePeer(c,m),0}catch(y){return console.log("Socket shutdown error",y),-1}}};function Ve(_,u,c){if(!_)return 1;let m=ne(_);if(!m.length)return 0;let y=ne(u);if(!y.length)return 0;if(f.popen_to_file){let{path:b,exitCode:d}=f.popen_to_file(m,y);return le[c]=d,Ge(b)}if(te){let b=require("os").tmpdir(),d="php-process-stream",p=b+"/"+d,n=require("child_process"),r;if(y==="r")r=n.spawnSync(m,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[c]=r.status,require("fs").writeFileSync(p,r.stdout,{encoding:"utf8",flag:"w+"});else return y==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+y+" (should be r or w)"),_W_EXITCODE(0,2));return Ge(p)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function ut(){fe("missing function: makecontext"),me(-1)}function Kr(_){return _%4===0&&(_%100!==0||_%400===0)}function ot(_,u){for(var c=0,m=0;m<=u;c+=_[m++]);return c}var ft=[31,29,31,30,31,30,31,31,30,31,30,31],Ot=[31,28,31,30,31,30,31,31,30,31,30,31];function Dt(_,u){for(var c=new Date(_.getTime());u>0;){var m=Kr(c.getFullYear()),y=c.getMonth(),b=(m?ft:Ot)[y];if(u>b-c.getDate())u-=b-c.getDate()+1,c.setDate(1),y<11?c.setMonth(y+1):(c.setMonth(0),c.setFullYear(c.getFullYear()+1));else return c.setDate(c.getDate()+u),c}return c}function Jt(_,u,c,m){var y=E[m+40>>2],b={tm_sec:E[m>>2],tm_min:E[m+4>>2],tm_hour:E[m+8>>2],tm_mday:E[m+12>>2],tm_mon:E[m+16>>2],tm_year:E[m+20>>2],tm_wday:E[m+24>>2],tm_yday:E[m+28>>2],tm_isdst:E[m+32>>2],tm_gmtoff:E[m+36>>2],tm_zone:y?ne(y):""},d=ne(c),p={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var n in p)d=d.replace(new RegExp(n,"g"),p[n]);var r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],e=["January","February","March","April","May","June","July","August","September","October","November","December"];function o(S,O,N){for(var T=typeof S=="number"?S.toString():S||"";T.length<O;)T=N[0]+T;return T}function t(S,O){return o(S,O,"0")}function a(S,O){function N(F){return F<0?-1:F>0?1:0}var T;return(T=N(S.getFullYear()-O.getFullYear()))===0&&(T=N(S.getMonth()-O.getMonth()))===0&&(T=N(S.getDate()-O.getDate())),T}function s(S){switch(S.getDay()){case 0:return new Date(S.getFullYear()-1,11,29);case 1:return S;case 2:return new Date(S.getFullYear(),0,3);case 3:return new Date(S.getFullYear(),0,2);case 4:return new Date(S.getFullYear(),0,1);case 5:return new Date(S.getFullYear()-1,11,31);case 6:return new Date(S.getFullYear()-1,11,30)}}function l(S){var O=Dt(new Date(S.tm_year+1900,0,1),S.tm_yday),N=new Date(O.getFullYear(),0,4),T=new Date(O.getFullYear()+1,0,4),F=s(N),L=s(T);return a(F,O)<=0?a(L,O)<=0?O.getFullYear()+1:O.getFullYear():O.getFullYear()-1}var h={"%a":function(S){return r[S.tm_wday].substring(0,3)},"%A":function(S){return r[S.tm_wday]},"%b":function(S){return e[S.tm_mon].substring(0,3)},"%B":function(S){return e[S.tm_mon]},"%C":function(S){var O=S.tm_year+1900;return t(O/100|0,2)},"%d":function(S){return t(S.tm_mday,2)},"%e":function(S){return o(S.tm_mday,2," ")},"%g":function(S){return l(S).toString().substring(2)},"%G":function(S){return l(S)},"%H":function(S){return t(S.tm_hour,2)},"%I":function(S){var O=S.tm_hour;return O==0?O=12:O>12&&(O-=12),t(O,2)},"%j":function(S){return t(S.tm_mday+ot(Kr(S.tm_year+1900)?ft:Ot,S.tm_mon-1),3)},"%m":function(S){return t(S.tm_mon+1,2)},"%M":function(S){return t(S.tm_min,2)},"%n":function(){return`
13
+ `},"%p":function(S){return S.tm_hour>=0&&S.tm_hour<12?"AM":"PM"},"%S":function(S){return t(S.tm_sec,2)},"%t":function(){return" "},"%u":function(S){return S.tm_wday||7},"%U":function(S){var O=S.tm_yday+7-S.tm_wday;return t(Math.floor(O/7),2)},"%V":function(S){var O=Math.floor((S.tm_yday+7-(S.tm_wday+6)%7)/7);if((S.tm_wday+371-S.tm_yday-2)%7<=2&&O++,O){if(O==53){var T=(S.tm_wday+371-S.tm_yday)%7;T!=4&&(T!=3||!Kr(S.tm_year))&&(O=1)}}else{O=52;var N=(S.tm_wday+7-S.tm_yday-1)%7;(N==4||N==5&&Kr(S.tm_year%400-1))&&O++}return t(O,2)},"%w":function(S){return S.tm_wday},"%W":function(S){var O=S.tm_yday+7-(S.tm_wday+6)%7;return t(Math.floor(O/7),2)},"%y":function(S){return(S.tm_year+1900).toString().substring(2)},"%Y":function(S){return S.tm_year+1900},"%z":function(S){var O=S.tm_gmtoff,N=O>=0;return O=Math.abs(O)/60,O=O/60*100+O%60,(N?"+":"-")+("0000"+O).slice(-4)},"%Z":function(S){return S.tm_zone},"%%":function(){return"%"}};d=d.replace(/%%/g,"\0\0");for(var n in h)d.includes(n)&&(d=d.replace(new RegExp(n,"g"),h[n](b)));d=d.replace(/\0\0/g,"%");var w=wr(d,!1);return w.length>u?0:(Et(w,_),w.length-1)}function Ut(_,u,c){for(var m=ne(u),y="\\!@#$^&*()+=-[]/{}|:<>?,.",b=0,d=y.length;b<d;++b)m=m.replace(new RegExp("\\"+y[b],"g"),"\\"+y[b]);var p={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var n in p)m=m.replace(n,p[n]);var r={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},e={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},o={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},t={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var a in r)m=m.replace(a,"("+a+r[a]+")");for(var s=[],b=m.indexOf("%");b>=0;b=m.indexOf("%"))s.push(m[b+1]),m=m.replace(new RegExp("\\%"+m[b+1],"g"),"");var l=new RegExp("^"+m,"i").exec(ne(_));function h(){function oe(se,Oe,Ae){return typeof se!="number"||isNaN(se)?Oe:se>=Oe?se<=Ae?se:Ae:Oe}return{year:oe(E[c+20>>2]+1900,1970,9999),month:oe(E[c+16>>2],0,11),day:oe(E[c+12>>2],1,31),hour:oe(E[c+8>>2],0,23),min:oe(E[c+4>>2],0,59),sec:oe(E[c>>2],0,59)}}if(l){var w=h(),S,O=oe=>{var se=s.indexOf(oe);if(se>=0)return l[se+1]};if((S=O("S"))&&(w.sec=be(S)),(S=O("M"))&&(w.min=be(S)),S=O("H"))w.hour=be(S);else if(S=O("I")){var N=be(S);(S=O("p"))&&(N+=S.toUpperCase()[0]==="P"?12:0),w.hour=N}if(S=O("Y"))w.year=be(S);else if(S=O("y")){var T=be(S);(S=O("C"))?T+=be(S)*100:T+=T<69?2e3:1900,w.year=T}if((S=O("m"))?w.month=be(S)-1:(S=O("b"))&&(w.month=e[S.substring(0,3).toUpperCase()]||0),S=O("d"))w.day=be(S);else if(S=O("j"))for(var F=be(S),L=Kr(w.year),R=0;R<12;++R){var B=ot(L?ft:Ot,R-1);F<=B+(L?ft:Ot)[R]&&(w.day=F-B)}else if(S=O("a")){var P=S.substring(0,3).toUpperCase();if(S=O("U")){var M=o[P],z=be(S),q=new Date(w.year,0,1),W;q.getDay()===0?W=Dt(q,M+7*(z-1)):W=Dt(q,7-q.getDay()+M+7*(z-1)),w.day=W.getDate(),w.month=W.getMonth()}else if(S=O("W")){var M=t[P],z=be(S),q=new Date(w.year,0,1),W;q.getDay()===1?W=Dt(q,M+7*(z-1)):W=Dt(q,7-q.getDay()+1+M+7*(z-1)),w.day=W.getDate(),w.month=W.getMonth()}}var X=new Date(w.year,w.month,w.day,w.hour,w.min,w.sec,0);return E[c>>2]=X.getSeconds(),E[c+4>>2]=X.getMinutes(),E[c+8>>2]=X.getHours(),E[c+12>>2]=X.getDate(),E[c+16>>2]=X.getMonth(),E[c+20>>2]=X.getFullYear()-1900,E[c+24>>2]=X.getDay(),E[c+28>>2]=ot(Kr(X.getFullYear())?ft:Ot,X.getMonth()-1)+X.getDate()-1,E[c+32>>2]=0,_+wr(l[0]).length-1}return 0}function Xr(){fe("missing function: swapcontext"),me(-1)}function $r(_){return Xe.shutdownSocket(_,2)}function En(_,u,c){if(typeof Asyncify>"u")return 0;let m=1,y=2,b=4,d=8,p=16,n=32;return Asyncify.handleSleep(r=>{let e=Ie(_);if(!e){r(0);return}let o=[],t=new Set;if(u&m||u&y){if(e.server){for(let S of e.pending)if((S.recv_queue||[]).length>0){r(1);return}}else if((e.recv_queue||[]).length>0){r(1);return}}let a=Xe.getAllWebSockets(e);if(!a.length){r(0);return}for(let S of a)(u&m||u&y)&&(o.push(Xe.awaitData(S)),t.add("POLLIN")),u&b&&(o.push(Xe.awaitConnection(S)),t.add("POLLOUT")),u&p&&(o.push(Xe.awaitClose(S)),t.add("POLLHUP")),(u&d||u&n)&&(o.push(Xe.awaitError(S)),t.add("POLLERR"));if(o.length===0){console.warn("Unsupported poll event "+u+", defaulting to setTimeout()."),setTimeout(function(){r(0)},c);return}let s=o.map(([S])=>S),l=()=>o.forEach(([,S])=>S()),h=!1;Promise.race(s).then(function(S){h||(h=!0,r(1),clearTimeout(w),l())});let w=setTimeout(function(){h||(h=!0,r(0),l())},c)})}function ti(_,u,c,m,y){let b=le[m];if(!(u===1&&c===9||u===6&&c===1))return console.warn(`Unsupported socket option: ${u}, ${c}, ${b}`),-1;let o=Xe.getAllWebSockets(_)[0];return o?(o.setSocketOpt(u,c,m),0):-1}function wn(_,u){return Xe.shutdownSocket(_,u)}function on(_){var u=f["_"+_];return u}function Qt(_,u,c,m,y){var b={string:s=>{var l=0;if(s!=null&&s!==0){var h=(s.length<<2)+1;l=lr(h),Fe(s,l,h)}return l},array:s=>{var l=lr(s.length);return Et(s,l),l}};function d(s){return u==="string"?ne(s):u==="boolean"?!!s:s}var p=on(_),n=[],r=0;if(m)for(var e=0;e<m.length;e++){var o=b[c[e]];o?(r===0&&(r=He()),n[e]=o(m[e])):n[e]=m[e]}var t=p.apply(null,n);function a(s){return r!==0&&xe(r),d(s)}return t=a(t),t}var Dn=function(_,u,c,m){_||(_=this),this.parent=_,this.mount=_.mount,this.mounted=null,this.id=v.nextInode++,this.name=u,this.mode=c,this.node_ops={},this.stream_ops={},this.rdev=m},gn=365,Tt=146;Object.defineProperties(Dn.prototype,{read:{get:function(){return(this.mode&gn)===gn},set:function(_){_?this.mode|=gn:this.mode&=~gn}},write:{get:function(){return(this.mode&Tt)===Tt},set:function(_){_?this.mode|=Tt:this.mode&=~Tt}},isFolder:{get:function(){return v.isDir(this.mode)}},isDevice:{get:function(){return v.isChrdev(this.mode)}}}),v.FSNode=Dn,v.staticInit(),f.FS_createPath=v.createPath,f.FS_createDataFile=v.createDataFile,f.FS_createPreloadedFile=v.createPreloadedFile,f.FS_unlink=v.unlink,f.FS_createLazyFile=v.createLazyFile,f.FS_createDevice=v.createDevice,te&&(yr(),C.staticInit()),i={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};var Jr={l:to,Za:no,Ya:ke,Xa:kn,Wa:oo,Va:io,O:ao,Ua:so,Ta:uo,Sa:_n,Ra:fo,V:co,Qa:lo,Pa:qt,N:_o,o:mo,Oa:vo,Na:po,U:ho,Ma:yo,La:Eo,Ka:wo,Ja:go,Ia:So,M:bo,Ha:ko,Ga:ae,Fa:Oo,Ea:kr,x:Do,Da:No,Ca:To,Ba:Ao,Aa:Fo,za:Co,L:Po,ya:Ro,K:Mo,xa:jr,wa:Lo,va:mn,E:Vt,ua:Fn,pa:Uo,oa:Io,na:Bo,ma:zo,la:Ho,ka:Wo,ja:Gt,ia:Yo,ha:rt,ga:jo,fa:Rt,n:tt,C:qo,ea:Vo,B:Mt,da:it,ca:Or,ba:at,ta:Cn,sa:Ko,q:Zo,t:$o,J:Jo,I:ei,T:nn,ra:Pn,D:ri,aa:Mn,$:hn,H:$t,_:yn,w:Fr,Z:tr,Y:Hr,i:fn,c:Wt,b:zt,f:xt,h:In,s:Bn,r:kt,v:xn,G:li,e:jt,a:Bt,d:Ht,A:_i,g:Yt,k:Nn,m:Tn,j:di,X:g,z:bn,W:Ve,S:ut,qa:pn,F:Jt,R:Ut,Q:Xr,u:$r,y:En,p:ti,P:wn},mr=ro(),Qr=f.___wasm_call_ctors=function(){return(Qr=f.___wasm_call_ctors=f.asm.$a).apply(null,arguments)},It=f._wasm_popen=function(){return(It=f._wasm_popen=f.asm.ab).apply(null,arguments)},zr=f.___errno_location=function(){return(zr=f.___errno_location=f.asm.bb).apply(null,arguments)},Nt=f._wasm_pclose=function(){return(Nt=f._wasm_pclose=f.asm.cb).apply(null,arguments)},Dr=f._php_pollfd_for=function(){return(Dr=f._php_pollfd_for=f.asm.db).apply(null,arguments)},At=f._wasm_select=function(){return(At=f._wasm_select=f.asm.eb).apply(null,arguments)},an=f._wasm_add_cli_arg=function(){return(an=f._wasm_add_cli_arg=f.asm.fb).apply(null,arguments)},Br=f._malloc=function(){return(Br=f._malloc=f.asm.gb).apply(null,arguments)},Vr=f._run_cli=function(){return(Vr=f._run_cli=f.asm.hb).apply(null,arguments)},Ft=f._memcpy=function(){return(Ft=f._memcpy=f.asm.ib).apply(null,arguments)},sn=f._free=function(){return(sn=f._free=f.asm.jb).apply(null,arguments)},en=f._fflush=function(){return(en=f._fflush=f.asm.lb).apply(null,arguments)},un=f._htons=function(){return(un=f._htons=f.asm.mb).apply(null,arguments)},rn=f._ntohs=function(){return(rn=f._ntohs=f.asm.nb).apply(null,arguments)},tn=f._htonl=function(){return(tn=f._htonl=f.asm.ob).apply(null,arguments)},Sn=f._wasm_set_phpini_path=function(){return(Sn=f._wasm_set_phpini_path=f.asm.pb).apply(null,arguments)},ni=f._wasm_set_phpini_entries=function(){return(ni=f._wasm_set_phpini_entries=f.asm.qb).apply(null,arguments)},oi=f._wasm_add_SERVER_entry=function(){return(oi=f._wasm_add_SERVER_entry=f.asm.rb).apply(null,arguments)},ii=f._wasm_add_uploaded_file=function(){return(ii=f._wasm_add_uploaded_file=f.asm.sb).apply(null,arguments)},ai=f._wasm_set_query_string=function(){return(ai=f._wasm_set_query_string=f.asm.tb).apply(null,arguments)},si=f._wasm_set_path_translated=function(){return(si=f._wasm_set_path_translated=f.asm.ub).apply(null,arguments)},ui=f._wasm_set_skip_shebang=function(){return(ui=f._wasm_set_skip_shebang=f.asm.vb).apply(null,arguments)},fi=f._wasm_set_request_uri=function(){return(fi=f._wasm_set_request_uri=f.asm.wb).apply(null,arguments)},ci=f._wasm_set_request_method=function(){return(ci=f._wasm_set_request_method=f.asm.xb).apply(null,arguments)},Ln=f._wasm_set_request_host=function(){return(Ln=f._wasm_set_request_host=f.asm.yb).apply(null,arguments)},Un=f._wasm_set_content_type=function(){return(Un=f._wasm_set_content_type=f.asm.zb).apply(null,arguments)},Cr=f._wasm_set_request_body=function(){return(Cr=f._wasm_set_request_body=f.asm.Ab).apply(null,arguments)},Sr=f._wasm_set_content_length=function(){return(Sr=f._wasm_set_content_length=f.asm.Bb).apply(null,arguments)},br=f._wasm_set_cookies=function(){return(br=f._wasm_set_cookies=f.asm.Cb).apply(null,arguments)},Te=f._wasm_set_php_code=function(){return(Te=f._wasm_set_php_code=f.asm.Db).apply(null,arguments)},De=f._wasm_set_request_port=function(){return(De=f._wasm_set_request_port=f.asm.Eb).apply(null,arguments)},ye=f._phpwasm_init_uploaded_files_hash=function(){return(ye=f._phpwasm_init_uploaded_files_hash=f.asm.Fb).apply(null,arguments)},sr=f._phpwasm_register_uploaded_file=function(){return(sr=f._phpwasm_register_uploaded_file=f.asm.Gb).apply(null,arguments)},Ye=f._phpwasm_destroy_uploaded_files_hash=function(){return(Ye=f._phpwasm_destroy_uploaded_files_hash=f.asm.Hb).apply(null,arguments)},vr=f._wasm_sapi_handle_request=function(){return(vr=f._wasm_sapi_handle_request=f.asm.Ib).apply(null,arguments)},Be=f._php_wasm_init=function(){return(Be=f._php_wasm_init=f.asm.Jb).apply(null,arguments)},ur=f.___funcs_on_exit=function(){return(ur=f.___funcs_on_exit=f.asm.Kb).apply(null,arguments)},fr=f._emscripten_builtin_memalign=function(){return(fr=f._emscripten_builtin_memalign=f.asm.Lb).apply(null,arguments)},cr=f._setThrew=function(){return(cr=f._setThrew=f.asm.Mb).apply(null,arguments)},He=f.stackSave=function(){return(He=f.stackSave=f.asm.Nb).apply(null,arguments)},xe=f.stackRestore=function(){return(xe=f.stackRestore=f.asm.Ob).apply(null,arguments)},lr=f.stackAlloc=function(){return(lr=f.stackAlloc=f.asm.Pb).apply(null,arguments)};function kt(_,u,c,m,y,b,d){var p=He();try{return Y(_)(u,c,m,y,b,d)}catch(n){if(xe(p),n!==n+0)throw n;cr(1,0)}}function Bt(_,u){var c=He();try{Y(_)(u)}catch(m){if(xe(c),m!==m+0)throw m;cr(1,0)}}function xt(_,u,c,m){var y=He();try{return Y(_)(u,c,m)}catch(b){if(xe(y),b!==b+0)throw b;cr(1,0)}}function zt(_,u,c){var m=He();try{return Y(_)(u,c)}catch(y){if(xe(m),y!==y+0)throw y;cr(1,0)}}function Ht(_,u,c){var m=He();try{Y(_)(u,c)}catch(y){if(xe(m),y!==y+0)throw y;cr(1,0)}}function Wt(_,u){var c=He();try{return Y(_)(u)}catch(m){if(xe(c),m!==m+0)throw m;cr(1,0)}}function Yt(_,u,c,m){var y=He();try{Y(_)(u,c,m)}catch(b){if(xe(y),b!==b+0)throw b;cr(1,0)}}function jt(_){var u=He();try{Y(_)()}catch(c){if(xe(u),c!==c+0)throw c;cr(1,0)}}function fn(_){var u=He();try{return Y(_)()}catch(c){if(xe(u),c!==c+0)throw c;cr(1,0)}}function Nn(_,u,c,m,y){var b=He();try{Y(_)(u,c,m,y)}catch(d){if(xe(b),d!==d+0)throw d;cr(1,0)}}function Tn(_,u,c,m,y,b){var d=He();try{Y(_)(u,c,m,y,b)}catch(p){if(xe(d),p!==p+0)throw p;cr(1,0)}}function In(_,u,c,m,y){var b=He();try{return Y(_)(u,c,m,y)}catch(d){if(xe(b),d!==d+0)throw d;cr(1,0)}}function Bn(_,u,c,m,y,b){var d=He();try{return Y(_)(u,c,m,y,b)}catch(p){if(xe(d),p!==p+0)throw p;cr(1,0)}}function li(_,u,c,m,y,b,d,p,n,r){var e=He();try{return Y(_)(u,c,m,y,b,d,p,n,r)}catch(o){if(xe(e),o!==o+0)throw o;cr(1,0)}}function di(_,u,c,m,y,b,d){var p=He();try{Y(_)(u,c,m,y,b,d)}catch(n){if(xe(p),n!==n+0)throw n;cr(1,0)}}function _i(_,u,c,m,y,b){var d=He();try{Y(_)(u,c,m,y,b)}catch(p){if(xe(d),p!==p+0)throw p;cr(1,0)}}function bn(_,u,c,m,y,b,d,p,n,r){var e=He();try{Y(_)(u,c,m,y,b,d,p,n,r)}catch(o){if(xe(e),o!==o+0)throw o;cr(1,0)}}function xn(_,u,c,m,y,b,d,p){var n=He();try{return Y(_)(u,c,m,y,b,d,p)}catch(r){if(xe(n),r!==r+0)throw r;cr(1,0)}}function g(_,u,c,m,y,b,d,p){var n=He();try{Y(_)(u,c,m,y,b,d,p)}catch(r){if(xe(n),r!==r+0)throw r;cr(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=v.createPath,f.FS_createDataFile=v.createDataFile,f.FS_createPreloadedFile=v.createPreloadedFile,f.FS_createLazyFile=v.createLazyFile,f.FS_createDevice=v.createDevice,f.FS_unlink=v.unlink,f.ccall=Qt,f.FS=v;var k;$e=function _(){k||D(),k||($e=_)};function D(_){if(_=_||$,Pe>0||(Vn(),Pe>0))return;function u(){k||(k=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),u()},1)):u()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return D(),A}var Mf,Gs,Xs=Oi(()=>{"use strict";Mf=9887266,Gs=__dirname+"/php_8_1.wasm"});var $s={};gi($s,{default:()=>If,dependenciesTotalSize:()=>Uf,dependencyFilename:()=>Zs});function If(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(g,k)=>{throw k},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(g){return f.locateFile?f.locateFile(g,ve):ve+g}var We,ar,Re;function Wr(g){if(g instanceof Ur)return;fe("exiting due to exception: "+g)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(g,k)=>(yr(),g=Me.normalize(g),J.readFileSync(g,k?void 0:"utf8")),Re=g=>{var k=We(g,!0);return k.buffer||(k=new Uint8Array(k)),k},ar=(g,k,D)=>{yr(),g=Me.normalize(g),J.readFile(g,function(_,u){_?D(_):k(u.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(g){if(!(g instanceof Ur))throw g}),process.on("unhandledRejection",function(g){throw g}),_e=(g,k)=>{if(Mr())throw process.exitCode=g,k;Wr(k),process.exit(g)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(g,k){g||me(k)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(g,k,D){for(var _=k+D,u=k;g[u]&&!(u>=_);)++u;if(u-k>16&&g.buffer&&ct)return ct.decode(g.subarray(k,u));for(var c="";k<u;){var m=g[k++];if(!(m&128)){c+=String.fromCharCode(m);continue}var y=g[k++]&63;if((m&224)==192){c+=String.fromCharCode((m&31)<<6|y);continue}var b=g[k++]&63;if((m&240)==224?m=(m&15)<<12|y<<6|b:m=(m&7)<<18|y<<12|b<<6|g[k++]&63,m<65536)c+=String.fromCharCode(m);else{var d=m-65536;c+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return c}function ne(g,k){return g?ze(le,g,k):""}function Ze(g,k,D,_){if(!(_>0))return 0;for(var u=D,c=D+_-1,m=0;m<g.length;++m){var y=g.charCodeAt(m);if(y>=55296&&y<=57343){var b=g.charCodeAt(++m);y=65536+((y&1023)<<10)|b&1023}if(y<=127){if(D>=c)break;k[D++]=y}else if(y<=2047){if(D+1>=c)break;k[D++]=192|y>>6,k[D++]=128|y&63}else if(y<=65535){if(D+2>=c)break;k[D++]=224|y>>12,k[D++]=128|y>>6&63,k[D++]=128|y&63}else{if(D+3>=c)break;k[D++]=240|y>>18,k[D++]=128|y>>12&63,k[D++]=128|y>>6&63,k[D++]=128|y&63}}return k[D]=0,D-u}function Fe(g,k,D){return Ze(g,le,k,D)}function Ce(g){for(var k=0,D=0;D<g.length;++D){var _=g.charCodeAt(D);_<=127?k++:_<=2047?k+=2:_>=55296&&_<=57343?(k+=4,++D):k+=3}return k}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(g){Rr=g,f.HEAP8=ee=new Int8Array(g),f.HEAP16=we=new Int16Array(g),f.HEAP32=E=new Int32Array(g),f.HEAPU8=le=new Uint8Array(g),f.HEAPU16=lt=new Uint16Array(g),f.HEAPU32=j=new Uint32Array(g),f.HEAPF32=Hn=new Float32Array(g),f.HEAPF64=dt=new Float64Array(g)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!v.init.initialized&&v.init(),v.ignorePermissions=!1,gr.init(),he.root=v.mount(he,{},null),Se.root=v.mount(Se,{},null),_r(vt)}function Kn(){Ye(),_r(Wn),v.quit(),gr.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(g){mt.unshift(g)}function $n(g){vt.unshift(g)}function Jn(g){pt.unshift(g)}var Pe=0,Lr=null,$e=null;function Ci(g){return g}function dr(g){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(g){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var k=$e;$e=null,k()}}function me(g){f.onAbort&&f.onAbort(g),g="Aborted("+g+")",fe(g),Tr=!0,Pr=1,g+=". Build with -sASSERTIONS for more info.";var k=new WebAssembly.RuntimeError(g);throw k}var Qn="data:application/octet-stream;base64,";function ht(g){return g.startsWith(Qn)}var de;de=Zs,ht(de)||(de=Nr(de));function yt(g){try{if(g==de&&qe)return new Uint8Array(qe);if(Re)return Re(g);throw"both async and sync fetching of the wasm failed"}catch(k){me(k)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(g){if(!g.ok)throw"failed to load wasm binary file at '"+de+"'";return g.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var g={a:Dn};function k(m,y){var b=m.exports;f.asm=b,ir=f.asm.Xa,_t(ir.buffer),ln=f.asm.hb,$n(f.asm.Ya),Je("wasm-instantiate")}dr("wasm-instantiate");function D(m){k(m.instance)}function _(m){return eo().then(function(y){return WebAssembly.instantiate(y,g)}).then(function(y){return y}).then(m,function(y){fe("failed to asynchronously prepare wasm: "+y),me(y)})}function u(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(m){var y=WebAssembly.instantiateStreaming(m,g);return y.then(D,function(b){return fe("wasm streaming compile failed: "+b),fe("falling back to ArrayBuffer instantiation"),_(D)})}):_(D)}if(f.instantiateWasm)try{var c=f.instantiateWasm(g,k);return c}catch(m){return fe("Module.instantiateWasm callback failed with error: "+m),!1}return u(),{}}var U,Z;function Ur(g){this.name="ExitStatus",this.message="Program terminated with exit("+g+")",this.status=g}function _r(g){for(;g.length>0;)g.shift()(f)}function Et(g,k){ee.set(g,k)}function to(g,k,D,_){me("Assertion failed: "+ne(g)+", at: "+[k?ne(k):"unknown filename",D,_?ne(_):"unknown function"])}var wt=[];function Y(g){var k=wt[g];return k||(g>=wt.length&&(wt.length=g+1),wt[g]=k=ln.get(g)),k}function no(g,k){Y(g)(k)}var Q={isAbs:g=>g.charAt(0)==="/",splitPath:g=>{var k=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return k.exec(g).slice(1)},normalizeArray:(g,k)=>{for(var D=0,_=g.length-1;_>=0;_--){var u=g[_];u==="."?g.splice(_,1):u===".."?(g.splice(_,1),D++):D&&(g.splice(_,1),D--)}if(k)for(;D;D--)g.unshift("..");return g},normalize:g=>{var k=Q.isAbs(g),D=g.substr(-1)==="/";return g=Q.normalizeArray(g.split("/").filter(_=>!!_),!k).join("/"),!g&&!k&&(g="."),g&&D&&(g+="/"),(k?"/":"")+g},dirname:g=>{var k=Q.splitPath(g),D=k[0],_=k[1];return!D&&!_?".":(_&&(_=_.substr(0,_.length-1)),D+_)},basename:g=>{if(g==="/")return"/";g=Q.normalize(g),g=g.replace(/\/$/,"");var k=g.lastIndexOf("/");return k===-1?g:g.substr(k+1)},join:function(){var g=Array.prototype.slice.call(arguments);return Q.normalize(g.join("/"))},join2:(g,k)=>Q.normalize(g+"/"+k)};function Er(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var g=new Uint8Array(1);return()=>(crypto.getRandomValues(g),g[0])}else if(te)try{var k=require("crypto");return()=>k.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var ge={resolve:function(){for(var g="",k=!1,D=arguments.length-1;D>=-1&&!k;D--){var _=D>=0?arguments[D]:v.cwd();if(typeof _!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!_)return"";g=_+"/"+g,k=Q.isAbs(_)}return g=Q.normalizeArray(g.split("/").filter(u=>!!u),!k).join("/"),(k?"/":"")+g||"."},relative:(g,k)=>{g=ge.resolve(g).substr(1),k=ge.resolve(k).substr(1);function D(d){for(var p=0;p<d.length&&d[p]==="";p++);for(var n=d.length-1;n>=0&&d[n]==="";n--);return p>n?[]:d.slice(p,n-p+1)}for(var _=D(g.split("/")),u=D(k.split("/")),c=Math.min(_.length,u.length),m=c,y=0;y<c;y++)if(_[y]!==u[y]){m=y;break}for(var b=[],y=m;y<_.length;y++)b.push("..");return b=b.concat(u.slice(m)),b.join("/")}};function wr(g,k,D){var _=D>0?D:Ce(g)+1,u=new Array(_),c=Ze(g,u,0,u.length);return k&&(u.length=c),u}var gr={ttys:[],init:function(){},shutdown:function(){},register:function(g,k){gr.ttys[g]={input:[],output:[],ops:k},v.registerDevice(g,gr.stream_ops)},stream_ops:{open:function(g){var k=gr.ttys[g.node.rdev];if(!k)throw new v.ErrnoError(43);g.tty=k,g.seekable=!1},close:function(g){g.tty.ops.fsync(g.tty)},fsync:function(g){g.tty.ops.fsync(g.tty)},read:function(g,k,D,_,u){if(!g.tty||!g.tty.ops.get_char)throw new v.ErrnoError(60);for(var c=0,m=0;m<_;m++){var y;try{y=g.tty.ops.get_char(g.tty)}catch{throw new v.ErrnoError(29)}if(y===void 0&&c===0)throw new v.ErrnoError(6);if(y==null)break;c++,k[D+m]=y}return c&&(g.node.timestamp=Date.now()),c},write:function(g,k,D,_,u){if(!g.tty||!g.tty.ops.put_char)throw new v.ErrnoError(60);try{for(var c=0;c<_;c++)g.tty.ops.put_char(g.tty,k[D+c])}catch{throw new v.ErrnoError(29)}return _&&(g.node.timestamp=Date.now()),c}},default_tty_ops:{get_char:function(g){if(!g.input.length){var k=null;if(te){var D=256,_=Buffer.alloc(D),u=0;try{u=J.readSync(process.stdin.fd,_,0,D,-1)}catch(c){if(c.toString().includes("EOF"))u=0;else throw c}u>0?k=_.slice(0,u).toString("utf-8"):k=null}else typeof window<"u"&&typeof window.prompt=="function"?(k=window.prompt("Input: "),k!==null&&(k+=`
14
+ `)):typeof readline=="function"&&(k=readline(),k!==null&&(k+=`
15
+ `));if(!k)return null;g.input=wr(k,!0)}return g.input.shift()},put_char:function(g,k){k===null||k===10?(er(ze(g.output,0)),g.output=[]):k!=0&&g.output.push(k)},fsync:function(g){g.output&&g.output.length>0&&(er(ze(g.output,0)),g.output=[])}},default_tty1_ops:{put_char:function(g,k){k===null||k===10?(fe(ze(g.output,0)),g.output=[]):k!=0&&g.output.push(k)},fsync:function(g){g.output&&g.output.length>0&&(fe(ze(g.output,0)),g.output=[])}}};function Ir(g,k){return le.fill(0,g,g+k),g}function G(g,k){return Math.ceil(g/k)*k}function Ct(g){g=G(g,65536);var k=vr(65536,g);return k?Ir(k,g):0}var re={ops_table:null,mount:function(g){return re.createNode(null,"/",16895,0)},createNode:function(g,k,D,_){if(v.isBlkdev(D)||v.isFIFO(D))throw new v.ErrnoError(63);re.ops_table||(re.ops_table={dir:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,lookup:re.node_ops.lookup,mknod:re.node_ops.mknod,rename:re.node_ops.rename,unlink:re.node_ops.unlink,rmdir:re.node_ops.rmdir,readdir:re.node_ops.readdir,symlink:re.node_ops.symlink},stream:{llseek:re.stream_ops.llseek}},file:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:{llseek:re.stream_ops.llseek,read:re.stream_ops.read,write:re.stream_ops.write,allocate:re.stream_ops.allocate,mmap:re.stream_ops.mmap,msync:re.stream_ops.msync}},link:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,readlink:re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:v.chrdev_stream_ops}});var u=v.createNode(g,k,D,_);return v.isDir(u.mode)?(u.node_ops=re.ops_table.dir.node,u.stream_ops=re.ops_table.dir.stream,u.contents={}):v.isFile(u.mode)?(u.node_ops=re.ops_table.file.node,u.stream_ops=re.ops_table.file.stream,u.usedBytes=0,u.contents=null):v.isLink(u.mode)?(u.node_ops=re.ops_table.link.node,u.stream_ops=re.ops_table.link.stream):v.isChrdev(u.mode)&&(u.node_ops=re.ops_table.chrdev.node,u.stream_ops=re.ops_table.chrdev.stream),u.timestamp=Date.now(),g&&(g.contents[k]=u,g.timestamp=u.timestamp),u},getFileDataAsTypedArray:function(g){return g.contents?g.contents.subarray?g.contents.subarray(0,g.usedBytes):new Uint8Array(g.contents):new Uint8Array(0)},expandFileStorage:function(g,k){var D=g.contents?g.contents.length:0;if(!(D>=k)){var _=1024*1024;k=Math.max(k,D*(D<_?2:1.125)>>>0),D!=0&&(k=Math.max(k,256));var u=g.contents;g.contents=new Uint8Array(k),g.usedBytes>0&&g.contents.set(u.subarray(0,g.usedBytes),0)}},resizeFileStorage:function(g,k){if(g.usedBytes!=k)if(k==0)g.contents=null,g.usedBytes=0;else{var D=g.contents;g.contents=new Uint8Array(k),D&&g.contents.set(D.subarray(0,Math.min(k,g.usedBytes))),g.usedBytes=k}},node_ops:{getattr:function(g){var k={};return k.dev=v.isChrdev(g.mode)?g.id:1,k.ino=g.id,k.mode=g.mode,k.nlink=1,k.uid=0,k.gid=0,k.rdev=g.rdev,v.isDir(g.mode)?k.size=4096:v.isFile(g.mode)?k.size=g.usedBytes:v.isLink(g.mode)?k.size=g.link.length:k.size=0,k.atime=new Date(g.timestamp),k.mtime=new Date(g.timestamp),k.ctime=new Date(g.timestamp),k.blksize=4096,k.blocks=Math.ceil(k.size/k.blksize),k},setattr:function(g,k){k.mode!==void 0&&(g.mode=k.mode),k.timestamp!==void 0&&(g.timestamp=k.timestamp),k.size!==void 0&&re.resizeFileStorage(g,k.size)},lookup:function(g,k){throw v.genericErrors[44]},mknod:function(g,k,D,_){return re.createNode(g,k,D,_)},rename:function(g,k,D){if(v.isDir(g.mode)){var _;try{_=v.lookupNode(k,D)}catch{}if(_)for(var u in _.contents)throw new v.ErrnoError(55)}delete g.parent.contents[g.name],g.parent.timestamp=Date.now(),g.name=D,k.contents[D]=g,k.timestamp=g.parent.timestamp,g.parent=k},unlink:function(g,k){delete g.contents[k],g.timestamp=Date.now()},rmdir:function(g,k){var D=v.lookupNode(g,k);for(var _ in D.contents)throw new v.ErrnoError(55);delete g.contents[k],g.timestamp=Date.now()},readdir:function(g){var k=[".",".."];for(var D in g.contents)g.contents.hasOwnProperty(D)&&k.push(D);return k},symlink:function(g,k,D){var _=re.createNode(g,k,41471,0);return _.link=D,_},readlink:function(g){if(!v.isLink(g.mode))throw new v.ErrnoError(28);return g.link}},stream_ops:{read:function(g,k,D,_,u){var c=g.node.contents;if(u>=g.node.usedBytes)return 0;var m=Math.min(g.node.usedBytes-u,_);if(m>8&&c.subarray)k.set(c.subarray(u,u+m),D);else for(var y=0;y<m;y++)k[D+y]=c[u+y];return m},write:function(g,k,D,_,u,c){if(k.buffer===ee.buffer&&(c=!1),!_)return 0;var m=g.node;if(m.timestamp=Date.now(),k.subarray&&(!m.contents||m.contents.subarray)){if(c)return m.contents=k.subarray(D,D+_),m.usedBytes=_,_;if(m.usedBytes===0&&u===0)return m.contents=k.slice(D,D+_),m.usedBytes=_,_;if(u+_<=m.usedBytes)return m.contents.set(k.subarray(D,D+_),u),_}if(re.expandFileStorage(m,u+_),m.contents.subarray&&k.subarray)m.contents.set(k.subarray(D,D+_),u);else for(var y=0;y<_;y++)m.contents[u+y]=k[D+y];return m.usedBytes=Math.max(m.usedBytes,u+_),_},llseek:function(g,k,D){var _=k;if(D===1?_+=g.position:D===2&&v.isFile(g.node.mode)&&(_+=g.node.usedBytes),_<0)throw new v.ErrnoError(28);return _},allocate:function(g,k,D){re.expandFileStorage(g.node,k+D),g.node.usedBytes=Math.max(g.node.usedBytes,k+D)},mmap:function(g,k,D,_,u){if(!v.isFile(g.node.mode))throw new v.ErrnoError(43);var c,m,y=g.node.contents;if(!(u&2)&&y.buffer===Rr)m=!1,c=y.byteOffset;else{if((D>0||D+k<y.length)&&(y.subarray?y=y.subarray(D,D+k):y=Array.prototype.slice.call(y,D,D+k)),m=!0,c=Ct(k),!c)throw new v.ErrnoError(48);ee.set(y,c)}return{ptr:c,allocated:m}},msync:function(g,k,D,_,u){return re.stream_ops.write(g,k,0,_,D,!1),0}}};function V(g,k,D,_){var u=_?"":"al "+g;ar(g,c=>{Le(c,'Loading data file "'+g+'" failed (no arrayBuffer).'),k(new Uint8Array(c)),u&&Je(u)},c=>{if(D)D();else throw'Loading data file "'+g+'" failed.'}),u&&dr(u)}var i={},C={isWindows:!1,staticInit:()=>{C.isWindows=!!process.platform.match(/^win/);var g=process.binding("constants");g.fs&&(g=g.fs),C.flagsForNodeMap={1024:g.O_APPEND,64:g.O_CREAT,128:g.O_EXCL,256:g.O_NOCTTY,0:g.O_RDONLY,2:g.O_RDWR,4096:g.O_SYNC,512:g.O_TRUNC,1:g.O_WRONLY,131072:g.O_NOFOLLOW}},convertNodeCode:g=>{var k=g.code;return i[k]},mount:g=>C.createNode(null,"/",C.getMode(g.opts.root),0),createNode:(g,k,D,_)=>{if(!v.isDir(D)&&!v.isFile(D)&&!v.isLink(D))throw new v.ErrnoError(28);var u=v.createNode(g,k,D);return u.node_ops=C.node_ops,u.stream_ops=C.stream_ops,u},getMode:g=>{var k;try{k=J.lstatSync(g),C.isWindows&&(k.mode=k.mode|(k.mode&292)>>2)}catch(D){throw D.code?new v.ErrnoError(C.convertNodeCode(D)):D}return k.mode},realPath:g=>{for(var k=[];g.parent!==g;)k.push(g.name),g=g.parent;return k.push(g.mount.opts.root),k.reverse(),Q.join.apply(null,k)},flagsForNode:g=>{g&=-2097153,g&=-2049,g&=-32769,g&=-524289,g&=-65537;var k=0;for(var D in C.flagsForNodeMap)g&D&&(k|=C.flagsForNodeMap[D],g^=D);if(g)throw new v.ErrnoError(28);return k},node_ops:{getattr:g=>{var k=C.realPath(g),D;try{D=J.lstatSync(k)}catch(_){throw _.code?new v.ErrnoError(C.convertNodeCode(_)):_}return C.isWindows&&!D.blksize&&(D.blksize=4096),C.isWindows&&!D.blocks&&(D.blocks=(D.size+D.blksize-1)/D.blksize|0),{dev:D.dev,ino:D.ino,mode:D.mode,nlink:D.nlink,uid:D.uid,gid:D.gid,rdev:D.rdev,size:D.size,atime:D.atime,mtime:D.mtime,ctime:D.ctime,blksize:D.blksize,blocks:D.blocks}},setattr:(g,k)=>{var D=C.realPath(g);try{if(k.mode!==void 0&&(J.chmodSync(D,k.mode),g.mode=k.mode),k.timestamp!==void 0){var _=new Date(k.timestamp);J.utimesSync(D,_,_)}k.size!==void 0&&J.truncateSync(D,k.size)}catch(u){throw u.code?new v.ErrnoError(C.convertNodeCode(u)):u}},lookup:(g,k)=>{var D=Q.join2(C.realPath(g),k),_=C.getMode(D);return C.createNode(g,k,_)},mknod:(g,k,D,_)=>{var u=C.createNode(g,k,D,_),c=C.realPath(u);try{v.isDir(u.mode)?J.mkdirSync(c,u.mode):J.writeFileSync(c,"",{mode:u.mode})}catch(m){throw m.code?new v.ErrnoError(C.convertNodeCode(m)):m}return u},rename:(g,k,D)=>{var _=C.realPath(g),u=Q.join2(C.realPath(k),D);try{J.renameSync(_,u)}catch(c){throw c.code?new v.ErrnoError(C.convertNodeCode(c)):c}g.name=D},unlink:(g,k)=>{var D=Q.join2(C.realPath(g),k);try{J.unlinkSync(D)}catch(_){throw _.code?new v.ErrnoError(C.convertNodeCode(_)):_}},rmdir:(g,k)=>{var D=Q.join2(C.realPath(g),k);try{J.rmdirSync(D)}catch(_){throw _.code?new v.ErrnoError(C.convertNodeCode(_)):_}},readdir:g=>{var k=C.realPath(g);try{return J.readdirSync(k)}catch(D){throw D.code?new v.ErrnoError(C.convertNodeCode(D)):D}},symlink:(g,k,D)=>{var _=Q.join2(C.realPath(g),k);try{J.symlinkSync(D,_)}catch(u){throw u.code?new v.ErrnoError(C.convertNodeCode(u)):u}},readlink:g=>{var k=C.realPath(g);try{return k=J.readlinkSync(k),k=Me.relative(Me.resolve(g.mount.opts.root),k),k}catch(D){throw D.code?D.code==="UNKNOWN"?new v.ErrnoError(28):new v.ErrnoError(C.convertNodeCode(D)):D}}},stream_ops:{open:g=>{var k=C.realPath(g.node);try{v.isFile(g.node.mode)&&(g.nfd=J.openSync(k,C.flagsForNode(g.flags)))}catch(D){throw D.code?new v.ErrnoError(C.convertNodeCode(D)):D}},close:g=>{try{v.isFile(g.node.mode)&&g.nfd&&J.closeSync(g.nfd)}catch(k){throw k.code?new v.ErrnoError(C.convertNodeCode(k)):k}},read:(g,k,D,_,u)=>{if(_===0)return 0;try{return J.readSync(g.nfd,Buffer.from(k.buffer),D,_,u)}catch(c){throw new v.ErrnoError(C.convertNodeCode(c))}},write:(g,k,D,_,u)=>{try{return J.writeSync(g.nfd,Buffer.from(k.buffer),D,_,u)}catch(c){throw new v.ErrnoError(C.convertNodeCode(c))}},llseek:(g,k,D)=>{var _=k;if(D===1)_+=g.position;else if(D===2&&v.isFile(g.node.mode))try{var u=J.fstatSync(g.nfd);_+=u.size}catch(c){throw new v.ErrnoError(C.convertNodeCode(c))}if(_<0)throw new v.ErrnoError(28);return _},mmap:(g,k,D,_,u)=>{if(!v.isFile(g.node.mode))throw new v.ErrnoError(43);var c=Ct(k);return C.stream_ops.read(g,ee,c,k,D),{ptr:c,allocated:!0}},msync:(g,k,D,_,u)=>(C.stream_ops.write(g,k,0,_,D,!1),0)}},v={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(g,k={})=>{if(g=ge.resolve(v.cwd(),g),!g)return{path:"",node:null};var D={follow_mount:!0,recurse_count:0};if(k=Object.assign(D,k),k.recurse_count>8)throw new v.ErrnoError(32);for(var _=Q.normalizeArray(g.split("/").filter(n=>!!n),!1),u=v.root,c="/",m=0;m<_.length;m++){var y=m===_.length-1;if(y&&k.parent)break;if(u=v.lookupNode(u,_[m]),c=Q.join2(c,_[m]),v.isMountpoint(u)&&(!y||y&&k.follow_mount)&&(u=u.mounted.root),!y||k.follow)for(var b=0;v.isLink(u.mode);){var d=v.readlink(c);c=ge.resolve(Q.dirname(c),d);var p=v.lookupPath(c,{recurse_count:k.recurse_count+1});if(u=p.node,b++>40)throw new v.ErrnoError(32)}}return{path:c,node:u}},getPath:g=>{for(var k;;){if(v.isRoot(g)){var D=g.mount.mountpoint;return k?D[D.length-1]!=="/"?D+"/"+k:D+k:D}k=k?g.name+"/"+k:g.name,g=g.parent}},hashName:(g,k)=>{for(var D=0,_=0;_<k.length;_++)D=(D<<5)-D+k.charCodeAt(_)|0;return(g+D>>>0)%v.nameTable.length},hashAddNode:g=>{var k=v.hashName(g.parent.id,g.name);g.name_next=v.nameTable[k],v.nameTable[k]=g},hashRemoveNode:g=>{var k=v.hashName(g.parent.id,g.name);if(v.nameTable[k]===g)v.nameTable[k]=g.name_next;else for(var D=v.nameTable[k];D;){if(D.name_next===g){D.name_next=g.name_next;break}D=D.name_next}},lookupNode:(g,k)=>{var D=v.mayLookup(g);if(D)throw new v.ErrnoError(D,g);for(var _=v.hashName(g.id,k),u=v.nameTable[_];u;u=u.name_next){var c=u.name;if(u.parent.id===g.id&&c===k)return u}return v.lookup(g,k)},createNode:(g,k,D,_)=>{var u=new v.FSNode(g,k,D,_);return v.hashAddNode(u),u},destroyNode:g=>{v.hashRemoveNode(g)},isRoot:g=>g===g.parent,isMountpoint:g=>!!g.mounted,isFile:g=>(g&61440)===32768,isDir:g=>(g&61440)===16384,isLink:g=>(g&61440)===40960,isChrdev:g=>(g&61440)===8192,isBlkdev:g=>(g&61440)===24576,isFIFO:g=>(g&61440)===4096,isSocket:g=>(g&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:g=>{var k=v.flagModes[g];if(typeof k>"u")throw new Error("Unknown file open mode: "+g);return k},flagsToPermissionString:g=>{var k=["r","w","rw"][g&3];return g&512&&(k+="w"),k},nodePermissions:(g,k)=>v.ignorePermissions?0:k.includes("r")&&!(g.mode&292)||k.includes("w")&&!(g.mode&146)||k.includes("x")&&!(g.mode&73)?2:0,mayLookup:g=>{var k=v.nodePermissions(g,"x");return k||(g.node_ops.lookup?0:2)},mayCreate:(g,k)=>{try{var D=v.lookupNode(g,k);return 20}catch{}return v.nodePermissions(g,"wx")},mayDelete:(g,k,D)=>{var _;try{_=v.lookupNode(g,k)}catch(c){return c.errno}var u=v.nodePermissions(g,"wx");if(u)return u;if(D){if(!v.isDir(_.mode))return 54;if(v.isRoot(_)||v.getPath(_)===v.cwd())return 10}else if(v.isDir(_.mode))return 31;return 0},mayOpen:(g,k)=>g?v.isLink(g.mode)?32:v.isDir(g.mode)&&(v.flagsToPermissionString(k)!=="r"||k&512)?31:v.nodePermissions(g,v.flagsToPermissionString(k)):44,MAX_OPEN_FDS:4096,nextfd:(g=0,k=v.MAX_OPEN_FDS)=>{for(var D=g;D<=k;D++)if(!v.streams[D])return D;throw new v.ErrnoError(33)},getStream:g=>v.streams[g],createStream:(g,k,D)=>{v.FSStream||(v.FSStream=function(){this.shared={}},v.FSStream.prototype={},Object.defineProperties(v.FSStream.prototype,{object:{get:function(){return this.node},set:function(u){this.node=u}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(u){this.shared.flags=u}},position:{get:function(){return this.shared.position},set:function(u){this.shared.position=u}}})),g=Object.assign(new v.FSStream,g);var _=v.nextfd(k,D);return g.fd=_,v.streams[_]=g,g},closeStream:g=>{v.streams[g]=null},chrdev_stream_ops:{open:g=>{var k=v.getDevice(g.node.rdev);g.stream_ops=k.stream_ops,g.stream_ops.open&&g.stream_ops.open(g)},llseek:()=>{throw new v.ErrnoError(70)}},major:g=>g>>8,minor:g=>g&255,makedev:(g,k)=>g<<8|k,registerDevice:(g,k)=>{v.devices[g]={stream_ops:k}},getDevice:g=>v.devices[g],getMounts:g=>{for(var k=[],D=[g];D.length;){var _=D.pop();k.push(_),D.push.apply(D,_.mounts)}return k},syncfs:(g,k)=>{typeof g=="function"&&(k=g,g=!1),v.syncFSRequests++,v.syncFSRequests>1&&fe("warning: "+v.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var D=v.getMounts(v.root.mount),_=0;function u(m){return v.syncFSRequests--,k(m)}function c(m){if(m)return c.errored?void 0:(c.errored=!0,u(m));++_>=D.length&&u(null)}D.forEach(m=>{if(!m.type.syncfs)return c(null);m.type.syncfs(m,g,c)})},mount:(g,k,D)=>{var _=D==="/",u=!D,c;if(_&&v.root)throw new v.ErrnoError(10);if(!_&&!u){var m=v.lookupPath(D,{follow_mount:!1});if(D=m.path,c=m.node,v.isMountpoint(c))throw new v.ErrnoError(10);if(!v.isDir(c.mode))throw new v.ErrnoError(54)}var y={type:g,opts:k,mountpoint:D,mounts:[]},b=g.mount(y);return b.mount=y,y.root=b,_?v.root=b:c&&(c.mounted=y,c.mount&&c.mount.mounts.push(y)),b},unmount:g=>{var k=v.lookupPath(g,{follow_mount:!1});if(!v.isMountpoint(k.node))throw new v.ErrnoError(28);var D=k.node,_=D.mounted,u=v.getMounts(_);Object.keys(v.nameTable).forEach(m=>{for(var y=v.nameTable[m];y;){var b=y.name_next;u.includes(y.mount)&&v.destroyNode(y),y=b}}),D.mounted=null;var c=D.mount.mounts.indexOf(_);D.mount.mounts.splice(c,1)},lookup:(g,k)=>g.node_ops.lookup(g,k),mknod:(g,k,D)=>{var _=v.lookupPath(g,{parent:!0}),u=_.node,c=Q.basename(g);if(!c||c==="."||c==="..")throw new v.ErrnoError(28);var m=v.mayCreate(u,c);if(m)throw new v.ErrnoError(m);if(!u.node_ops.mknod)throw new v.ErrnoError(63);return u.node_ops.mknod(u,c,k,D)},create:(g,k)=>(k=k!==void 0?k:438,k&=4095,k|=32768,v.mknod(g,k,0)),mkdir:(g,k)=>(k=k!==void 0?k:511,k&=1023,k|=16384,v.mknod(g,k,0)),mkdirTree:(g,k)=>{for(var D=g.split("/"),_="",u=0;u<D.length;++u)if(D[u]){_+="/"+D[u];try{v.mkdir(_,k)}catch(c){if(c.errno!=20)throw c}}},mkdev:(g,k,D)=>(typeof D>"u"&&(D=k,k=438),k|=8192,v.mknod(g,k,D)),symlink:(g,k)=>{if(!ge.resolve(g))throw new v.ErrnoError(44);var D=v.lookupPath(k,{parent:!0}),_=D.node;if(!_)throw new v.ErrnoError(44);var u=Q.basename(k),c=v.mayCreate(_,u);if(c)throw new v.ErrnoError(c);if(!_.node_ops.symlink)throw new v.ErrnoError(63);return _.node_ops.symlink(_,u,g)},rename:(g,k)=>{var D=Q.dirname(g),_=Q.dirname(k),u=Q.basename(g),c=Q.basename(k),m,y,b;if(m=v.lookupPath(g,{parent:!0}),y=m.node,m=v.lookupPath(k,{parent:!0}),b=m.node,!y||!b)throw new v.ErrnoError(44);if(y.mount!==b.mount)throw new v.ErrnoError(75);var d=v.lookupNode(y,u),p=ge.relative(g,_);if(p.charAt(0)!==".")throw new v.ErrnoError(28);if(p=ge.relative(k,D),p.charAt(0)!==".")throw new v.ErrnoError(55);var n;try{n=v.lookupNode(b,c)}catch{}if(d!==n){var r=v.isDir(d.mode),e=v.mayDelete(y,u,r);if(e)throw new v.ErrnoError(e);if(e=n?v.mayDelete(b,c,r):v.mayCreate(b,c),e)throw new v.ErrnoError(e);if(!y.node_ops.rename)throw new v.ErrnoError(63);if(v.isMountpoint(d)||n&&v.isMountpoint(n))throw new v.ErrnoError(10);if(b!==y&&(e=v.nodePermissions(y,"w"),e))throw new v.ErrnoError(e);v.hashRemoveNode(d);try{y.node_ops.rename(d,b,c)}catch(o){throw o}finally{v.hashAddNode(d)}}},rmdir:g=>{var k=v.lookupPath(g,{parent:!0}),D=k.node,_=Q.basename(g),u=v.lookupNode(D,_),c=v.mayDelete(D,_,!0);if(c)throw new v.ErrnoError(c);if(!D.node_ops.rmdir)throw new v.ErrnoError(63);if(v.isMountpoint(u))throw new v.ErrnoError(10);D.node_ops.rmdir(D,_),v.destroyNode(u)},readdir:g=>{var k=v.lookupPath(g,{follow:!0}),D=k.node;if(!D.node_ops.readdir)throw new v.ErrnoError(54);return D.node_ops.readdir(D)},unlink:g=>{var k=v.lookupPath(g,{parent:!0}),D=k.node;if(!D)throw new v.ErrnoError(44);var _=Q.basename(g),u=v.lookupNode(D,_),c=v.mayDelete(D,_,!1);if(c)throw new v.ErrnoError(c);if(!D.node_ops.unlink)throw new v.ErrnoError(63);if(v.isMountpoint(u))throw new v.ErrnoError(10);D.node_ops.unlink(D,_),v.destroyNode(u)},readlink:g=>{var k=v.lookupPath(g),D=k.node;if(!D)throw new v.ErrnoError(44);if(!D.node_ops.readlink)throw new v.ErrnoError(28);return ge.resolve(v.getPath(D.parent),D.node_ops.readlink(D))},stat:(g,k)=>{var D=v.lookupPath(g,{follow:!k}),_=D.node;if(!_)throw new v.ErrnoError(44);if(!_.node_ops.getattr)throw new v.ErrnoError(63);return _.node_ops.getattr(_)},lstat:g=>v.stat(g,!0),chmod:(g,k,D)=>{var _;if(typeof g=="string"){var u=v.lookupPath(g,{follow:!D});_=u.node}else _=g;if(!_.node_ops.setattr)throw new v.ErrnoError(63);_.node_ops.setattr(_,{mode:k&4095|_.mode&-4096,timestamp:Date.now()})},lchmod:(g,k)=>{v.chmod(g,k,!0)},fchmod:(g,k)=>{var D=v.getStream(g);if(!D)throw new v.ErrnoError(8);v.chmod(D.node,k)},chown:(g,k,D,_)=>{var u;if(typeof g=="string"){var c=v.lookupPath(g,{follow:!_});u=c.node}else u=g;if(!u.node_ops.setattr)throw new v.ErrnoError(63);u.node_ops.setattr(u,{timestamp:Date.now()})},lchown:(g,k,D)=>{v.chown(g,k,D,!0)},fchown:(g,k,D)=>{var _=v.getStream(g);if(!_)throw new v.ErrnoError(8);v.chown(_.node,k,D)},truncate:(g,k)=>{if(k<0)throw new v.ErrnoError(28);var D;if(typeof g=="string"){var _=v.lookupPath(g,{follow:!0});D=_.node}else D=g;if(!D.node_ops.setattr)throw new v.ErrnoError(63);if(v.isDir(D.mode))throw new v.ErrnoError(31);if(!v.isFile(D.mode))throw new v.ErrnoError(28);var u=v.nodePermissions(D,"w");if(u)throw new v.ErrnoError(u);D.node_ops.setattr(D,{size:k,timestamp:Date.now()})},ftruncate:(g,k)=>{var D=v.getStream(g);if(!D)throw new v.ErrnoError(8);if(!(D.flags&2097155))throw new v.ErrnoError(28);v.truncate(D.node,k)},utime:(g,k,D)=>{var _=v.lookupPath(g,{follow:!0}),u=_.node;u.node_ops.setattr(u,{timestamp:Math.max(k,D)})},open:(g,k,D)=>{if(g==="")throw new v.ErrnoError(44);k=typeof k=="string"?v.modeStringToFlags(k):k,D=typeof D>"u"?438:D,k&64?D=D&4095|32768:D=0;var _;if(typeof g=="object")_=g;else{g=Q.normalize(g);try{var u=v.lookupPath(g,{follow:!(k&131072)});_=u.node}catch{}}var c=!1;if(k&64)if(_){if(k&128)throw new v.ErrnoError(20)}else _=v.mknod(g,D,0),c=!0;if(!_)throw new v.ErrnoError(44);if(v.isChrdev(_.mode)&&(k&=-513),k&65536&&!v.isDir(_.mode))throw new v.ErrnoError(54);if(!c){var m=v.mayOpen(_,k);if(m)throw new v.ErrnoError(m)}k&512&&!c&&v.truncate(_,0),k&=-131713;var y=v.createStream({node:_,path:v.getPath(_),flags:k,seekable:!0,position:0,stream_ops:_.stream_ops,ungotten:[],error:!1});return y.stream_ops.open&&y.stream_ops.open(y),f.logReadFiles&&!(k&1)&&(v.readFiles||(v.readFiles={}),g in v.readFiles||(v.readFiles[g]=1)),y},close:g=>{if(v.isClosed(g))throw new v.ErrnoError(8);g.getdents&&(g.getdents=null);try{g.stream_ops.close&&g.stream_ops.close(g)}catch(k){throw k}finally{v.closeStream(g.fd)}g.fd=null},isClosed:g=>g.fd===null,llseek:(g,k,D)=>{if(v.isClosed(g))throw new v.ErrnoError(8);if(!g.seekable||!g.stream_ops.llseek)throw new v.ErrnoError(70);if(D!=0&&D!=1&&D!=2)throw new v.ErrnoError(28);return g.position=g.stream_ops.llseek(g,k,D),g.ungotten=[],g.position},read:(g,k,D,_,u)=>{if(_<0||u<0)throw new v.ErrnoError(28);if(v.isClosed(g))throw new v.ErrnoError(8);if((g.flags&2097155)===1)throw new v.ErrnoError(8);if(v.isDir(g.node.mode))throw new v.ErrnoError(31);if(!g.stream_ops.read)throw new v.ErrnoError(28);var c=typeof u<"u";if(!c)u=g.position;else if(!g.seekable)throw new v.ErrnoError(70);var m=g.stream_ops.read(g,k,D,_,u);return c||(g.position+=m),m},write:(g,k,D,_,u,c)=>{if(_<0||u<0)throw new v.ErrnoError(28);if(v.isClosed(g))throw new v.ErrnoError(8);if(!(g.flags&2097155))throw new v.ErrnoError(8);if(v.isDir(g.node.mode))throw new v.ErrnoError(31);if(!g.stream_ops.write)throw new v.ErrnoError(28);g.seekable&&g.flags&1024&&v.llseek(g,0,2);var m=typeof u<"u";if(!m)u=g.position;else if(!g.seekable)throw new v.ErrnoError(70);var y=g.stream_ops.write(g,k,D,_,u,c);return m||(g.position+=y),y},allocate:(g,k,D)=>{if(v.isClosed(g))throw new v.ErrnoError(8);if(k<0||D<=0)throw new v.ErrnoError(28);if(!(g.flags&2097155))throw new v.ErrnoError(8);if(!v.isFile(g.node.mode)&&!v.isDir(g.node.mode))throw new v.ErrnoError(43);if(!g.stream_ops.allocate)throw new v.ErrnoError(138);g.stream_ops.allocate(g,k,D)},mmap:(g,k,D,_,u)=>{if(_&2&&!(u&2)&&(g.flags&2097155)!==2)throw new v.ErrnoError(2);if((g.flags&2097155)===1)throw new v.ErrnoError(2);if(!g.stream_ops.mmap)throw new v.ErrnoError(43);return g.stream_ops.mmap(g,k,D,_,u)},msync:(g,k,D,_,u)=>g.stream_ops.msync?g.stream_ops.msync(g,k,D,_,u):0,munmap:g=>0,ioctl:(g,k,D)=>{if(!g.stream_ops.ioctl)throw new v.ErrnoError(59);return g.stream_ops.ioctl(g,k,D)},readFile:(g,k={})=>{if(k.flags=k.flags||0,k.encoding=k.encoding||"binary",k.encoding!=="utf8"&&k.encoding!=="binary")throw new Error('Invalid encoding type "'+k.encoding+'"');var D,_=v.open(g,k.flags),u=v.stat(g),c=u.size,m=new Uint8Array(c);return v.read(_,m,0,c,0),k.encoding==="utf8"?D=ze(m,0):k.encoding==="binary"&&(D=m),v.close(_),D},writeFile:(g,k,D={})=>{D.flags=D.flags||577;var _=v.open(g,D.flags,D.mode);if(typeof k=="string"){var u=new Uint8Array(Ce(k)+1),c=Ze(k,u,0,u.length);v.write(_,u,0,c,void 0,D.canOwn)}else if(ArrayBuffer.isView(k))v.write(_,k,0,k.byteLength,void 0,D.canOwn);else throw new Error("Unsupported data type");v.close(_)},cwd:()=>v.currentPath,chdir:g=>{var k=v.lookupPath(g,{follow:!0});if(k.node===null)throw new v.ErrnoError(44);if(!v.isDir(k.node.mode))throw new v.ErrnoError(54);var D=v.nodePermissions(k.node,"x");if(D)throw new v.ErrnoError(D);v.currentPath=k.path},createDefaultDirectories:()=>{v.mkdir("/tmp"),v.mkdir("/home"),v.mkdir("/home/web_user")},createDefaultDevices:()=>{v.mkdir("/dev"),v.registerDevice(v.makedev(1,3),{read:()=>0,write:(k,D,_,u,c)=>u}),v.mkdev("/dev/null",v.makedev(1,3)),gr.register(v.makedev(5,0),gr.default_tty_ops),gr.register(v.makedev(6,0),gr.default_tty1_ops),v.mkdev("/dev/tty",v.makedev(5,0)),v.mkdev("/dev/tty1",v.makedev(6,0));var g=Er();v.createDevice("/dev","random",g),v.createDevice("/dev","urandom",g),v.mkdir("/dev/shm"),v.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{v.mkdir("/proc");var g=v.mkdir("/proc/self");v.mkdir("/proc/self/fd"),v.mount({mount:()=>{var k=v.createNode(g,"fd",16895,73);return k.node_ops={lookup:(D,_)=>{var u=+_,c=v.getStream(u);if(!c)throw new v.ErrnoError(8);var m={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>c.path}};return m.parent=m,m}},k}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?v.createDevice("/dev","stdin",f.stdin):v.symlink("/dev/tty","/dev/stdin"),f.stdout?v.createDevice("/dev","stdout",null,f.stdout):v.symlink("/dev/tty","/dev/stdout"),f.stderr?v.createDevice("/dev","stderr",null,f.stderr):v.symlink("/dev/tty1","/dev/stderr");var g=v.open("/dev/stdin",0),k=v.open("/dev/stdout",1),D=v.open("/dev/stderr",1)},ensureErrnoError:()=>{v.ErrnoError||(v.ErrnoError=function(k,D){this.node=D,this.setErrno=function(_){this.errno=_},this.setErrno(k),this.message="FS error"},v.ErrnoError.prototype=new Error,v.ErrnoError.prototype.constructor=v.ErrnoError,[44].forEach(g=>{v.genericErrors[g]=new v.ErrnoError(g),v.genericErrors[g].stack="<generic error, no stack>"}))},staticInit:()=>{v.ensureErrnoError(),v.nameTable=new Array(4096),v.mount(re,{},"/"),v.createDefaultDirectories(),v.createDefaultDevices(),v.createSpecialDirectories(),v.filesystems={MEMFS:re,NODEFS:C}},init:(g,k,D)=>{v.init.initialized=!0,v.ensureErrnoError(),f.stdin=g||f.stdin,f.stdout=k||f.stdout,f.stderr=D||f.stderr,v.createStandardStreams()},quit:()=>{v.init.initialized=!1,Vr(0);for(var g=0;g<v.streams.length;g++){var k=v.streams[g];k&&v.close(k)}},getMode:(g,k)=>{var D=0;return g&&(D|=365),k&&(D|=146),D},findObject:(g,k)=>{var D=v.analyzePath(g,k);return D.exists?D.object:null},analyzePath:(g,k)=>{try{var D=v.lookupPath(g,{follow:!k});g=D.path}catch{}var _={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var D=v.lookupPath(g,{parent:!0});_.parentExists=!0,_.parentPath=D.path,_.parentObject=D.node,_.name=Q.basename(g),D=v.lookupPath(g,{follow:!k}),_.exists=!0,_.path=D.path,_.object=D.node,_.name=D.node.name,_.isRoot=D.path==="/"}catch(u){_.error=u.errno}return _},createPath:(g,k,D,_)=>{g=typeof g=="string"?g:v.getPath(g);for(var u=k.split("/").reverse();u.length;){var c=u.pop();if(c){var m=Q.join2(g,c);try{v.mkdir(m)}catch{}g=m}}return m},createFile:(g,k,D,_,u)=>{var c=Q.join2(typeof g=="string"?g:v.getPath(g),k),m=v.getMode(_,u);return v.create(c,m)},createDataFile:(g,k,D,_,u,c)=>{var m=k;g&&(g=typeof g=="string"?g:v.getPath(g),m=k?Q.join2(g,k):g);var y=v.getMode(_,u),b=v.create(m,y);if(D){if(typeof D=="string"){for(var d=new Array(D.length),p=0,n=D.length;p<n;++p)d[p]=D.charCodeAt(p);D=d}v.chmod(b,y|146);var r=v.open(b,577);v.write(r,D,0,D.length,0,c),v.close(r),v.chmod(b,y)}return b},createDevice:(g,k,D,_)=>{var u=Q.join2(typeof g=="string"?g:v.getPath(g),k),c=v.getMode(!!D,!!_);v.createDevice.major||(v.createDevice.major=64);var m=v.makedev(v.createDevice.major++,0);return v.registerDevice(m,{open:y=>{y.seekable=!1},close:y=>{_&&_.buffer&&_.buffer.length&&_(10)},read:(y,b,d,p,n)=>{for(var r=0,e=0;e<p;e++){var o;try{o=D()}catch{throw new v.ErrnoError(29)}if(o===void 0&&r===0)throw new v.ErrnoError(6);if(o==null)break;r++,b[d+e]=o}return r&&(y.node.timestamp=Date.now()),r},write:(y,b,d,p,n)=>{for(var r=0;r<p;r++)try{_(b[d+r])}catch{throw new v.ErrnoError(29)}return p&&(y.node.timestamp=Date.now()),r}}),v.mkdev(u,c,m)},forceLoadFile:g=>{if(g.isDevice||g.isFolder||g.link||g.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{g.contents=wr(We(g.url),!0),g.usedBytes=g.contents.length}catch{throw new v.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(g,k,D,_,u)=>{function c(){this.lengthKnown=!1,this.chunks=[]}if(c.prototype.get=function(e){if(!(e>this.length-1||e<0)){var o=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[o]}},c.prototype.setDataGetter=function(e){this.getter=e},c.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",D,!1),e.send(null),!(e.status>=200&&e.status<300||e.status===304))throw new Error("Couldn't load "+D+". Status: "+e.status);var o=Number(e.getResponseHeader("Content-length")),t,a=(t=e.getResponseHeader("Accept-Ranges"))&&t==="bytes",s=(t=e.getResponseHeader("Content-Encoding"))&&t==="gzip",l=1024*1024;a||(l=o);var h=(S,O)=>{if(S>O)throw new Error("invalid range ("+S+", "+O+") or no bytes requested!");if(O>o-1)throw new Error("only "+o+" bytes available! programmer error!");var N=new XMLHttpRequest;if(N.open("GET",D,!1),o!==l&&N.setRequestHeader("Range","bytes="+S+"-"+O),N.responseType="arraybuffer",N.overrideMimeType&&N.overrideMimeType("text/plain; charset=x-user-defined"),N.send(null),!(N.status>=200&&N.status<300||N.status===304))throw new Error("Couldn't load "+D+". Status: "+N.status);return N.response!==void 0?new Uint8Array(N.response||[]):wr(N.responseText||"",!0)},w=this;w.setDataGetter(S=>{var O=S*l,N=(S+1)*l-1;if(N=Math.min(N,o-1),typeof w.chunks[S]>"u"&&(w.chunks[S]=h(O,N)),typeof w.chunks[S]>"u")throw new Error("doXHR failed!");return w.chunks[S]}),(s||!o)&&(l=o=1,o=this.getter(0).length,l=o,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=o,this._chunkSize=l,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var m=new c;Object.defineProperties(m,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var y={isDevice:!1,contents:m}}else var y={isDevice:!1,url:D};var b=v.createFile(g,k,y,_,u);y.contents?b.contents=y.contents:y.url&&(b.contents=null,b.url=y.url),Object.defineProperties(b,{usedBytes:{get:function(){return this.contents.length}}});var d={},p=Object.keys(b.stream_ops);p.forEach(r=>{var e=b.stream_ops[r];d[r]=function(){return v.forceLoadFile(b),e.apply(null,arguments)}});function n(r,e,o,t,a){var s=r.node.contents;if(a>=s.length)return 0;var l=Math.min(s.length-a,t);if(s.slice)for(var h=0;h<l;h++)e[o+h]=s[a+h];else for(var h=0;h<l;h++)e[o+h]=s.get(a+h);return l}return d.read=(r,e,o,t,a)=>(v.forceLoadFile(b),n(r,e,o,t,a)),d.mmap=(r,e,o,t,a)=>{v.forceLoadFile(b);var s=Ct(e);if(!s)throw new v.ErrnoError(48);return n(r,ee,s,e,o),{ptr:s,allocated:!0}},b.stream_ops=d,b},createPreloadedFile:(g,k,D,_,u,c,m,y,b,d)=>{var p=k?ge.resolve(Q.join2(g,k)):g,n="cp "+p;function r(e){function o(t){d&&d(),y||v.createDataFile(g,k,t,_,u,b),c&&c(),Je(n)}Browser.handledByPreloadPlugin(e,p,o,()=>{m&&m(),Je(n)})||o(e)}dr(n),typeof D=="string"?V(D,e=>r(e),m):r(D)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(g,k,D)=>{k=k||(()=>{}),D=D||(()=>{});var _=v.indexedDB();try{var u=_.open(v.DB_NAME(),v.DB_VERSION)}catch(c){return D(c)}u.onupgradeneeded=()=>{er("creating db");var c=u.result;c.createObjectStore(v.DB_STORE_NAME)},u.onsuccess=()=>{var c=u.result,m=c.transaction([v.DB_STORE_NAME],"readwrite"),y=m.objectStore(v.DB_STORE_NAME),b=0,d=0,p=g.length;function n(){d==0?k():D()}g.forEach(r=>{var e=y.put(v.analyzePath(r).object.contents,r);e.onsuccess=()=>{b++,b+d==p&&n()},e.onerror=()=>{d++,b+d==p&&n()}}),m.onerror=D},u.onerror=D},loadFilesFromDB:(g,k,D)=>{k=k||(()=>{}),D=D||(()=>{});var _=v.indexedDB();try{var u=_.open(v.DB_NAME(),v.DB_VERSION)}catch(c){return D(c)}u.onupgradeneeded=D,u.onsuccess=()=>{var c=u.result;try{var m=c.transaction([v.DB_STORE_NAME],"readonly")}catch(r){D(r);return}var y=m.objectStore(v.DB_STORE_NAME),b=0,d=0,p=g.length;function n(){d==0?k():D()}g.forEach(r=>{var e=y.get(r);e.onsuccess=()=>{v.analyzePath(r).exists&&v.unlink(r),v.createDataFile(Q.dirname(r),Q.basename(r),e.result,!0,!0,!0),b++,b+d==p&&n()},e.onerror=()=>{d++,b+d==p&&n()}}),m.onerror=D},u.onerror=D}},H={DEFAULT_POLLMASK:5,calculateAt:function(g,k,D){if(Q.isAbs(k))return k;var _;if(g===-100)_=v.cwd();else{var u=H.getStreamFromFD(g);_=u.path}if(k.length==0){if(!D)throw new v.ErrnoError(44);return _}return Q.join2(_,k)},doStat:function(g,k,D){try{var _=g(k)}catch(u){if(u&&u.node&&Q.normalize(k)!==Q.normalize(v.getPath(u.node)))return-54;throw u}return E[D>>2]=_.dev,E[D+8>>2]=_.ino,E[D+12>>2]=_.mode,j[D+16>>2]=_.nlink,E[D+20>>2]=_.uid,E[D+24>>2]=_.gid,E[D+28>>2]=_.rdev,Z=[_.size>>>0,(U=_.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[D+40>>2]=Z[0],E[D+44>>2]=Z[1],E[D+48>>2]=4096,E[D+52>>2]=_.blocks,Z=[Math.floor(_.atime.getTime()/1e3)>>>0,(U=Math.floor(_.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[D+56>>2]=Z[0],E[D+60>>2]=Z[1],j[D+64>>2]=0,Z=[Math.floor(_.mtime.getTime()/1e3)>>>0,(U=Math.floor(_.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[D+72>>2]=Z[0],E[D+76>>2]=Z[1],j[D+80>>2]=0,Z=[Math.floor(_.ctime.getTime()/1e3)>>>0,(U=Math.floor(_.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[D+88>>2]=Z[0],E[D+92>>2]=Z[1],j[D+96>>2]=0,Z=[_.ino>>>0,(U=_.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[D+104>>2]=Z[0],E[D+108>>2]=Z[1],0},doMsync:function(g,k,D,_,u){if(!v.isFile(k.node.mode))throw new v.ErrnoError(43);if(_&2)return 0;var c=le.slice(g,g+D);v.msync(k,c,u,D,_)},varargs:void 0,get:function(){H.varargs+=4;var g=E[H.varargs-4>>2];return g},getStr:function(g){var k=ne(g);return k},getStreamFromFD:function(g){var k=v.getStream(g);if(!k)throw new v.ErrnoError(8);return k}};function ke(g,k,D,_,u){try{for(var c=0,m=k?E[k>>2]:0,y=k?E[k+4>>2]:0,b=D?E[D>>2]:0,d=D?E[D+4>>2]:0,p=_?E[_>>2]:0,n=_?E[_+4>>2]:0,r=0,e=0,o=0,t=0,a=0,s=0,l=(k?E[k>>2]:0)|(D?E[D>>2]:0)|(_?E[_>>2]:0),h=(k?E[k+4>>2]:0)|(D?E[D+4>>2]:0)|(_?E[_+4>>2]:0),w=function(F,L,R,B){return F<32?L&B:R&B},S=0;S<g;S++){var O=1<<S%32;if(w(S,l,h,O)){var N=H.getStreamFromFD(S),T=H.DEFAULT_POLLMASK;N.stream_ops?.poll&&(T=N.stream_ops.poll(N)),T&1&&w(S,m,y,O)&&(S<32?r=r|O:e=e|O,c++),T&4&&w(S,b,d,O)&&(S<32?o=o|O:t=t|O,c++),T&2&&w(S,p,n,O)&&(S<32?a=a|O:s=s|O,c++)}}return k&&(E[k>>2]=r,E[k+4>>2]=e),D&&(E[D>>2]=o,E[D+4>>2]=t),_&&(E[_>>2]=a,E[_+4>>2]=s),c}catch(F){if(typeof v>"u"||!(F instanceof v.ErrnoError))throw F;return-F.errno}}var he={mount:function(g){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(k,D){return typeof D=="function"&&(this._callbacks[k]=D),this},f.websocket.emit=function(k,D){typeof this._callbacks[k]=="function"&&this._callbacks[k].call(this,D)},v.createNode(null,"/",16895,0)},createSocket:function(g,k,D){k&=-526337;var _=k==1;if(_&&D&&D!=6)throw new v.ErrnoError(66);var u={family:g,type:k,protocol:D,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:he.websocket_sock_ops},c=he.nextname(),m=v.createNode(he.root,c,49152,0);m.sock=u;var y=v.createStream({path:c,node:m,flags:2,seekable:!1,stream_ops:he.stream_ops});return u.stream=y,u},getSocket:function(g){var k=v.getStream(g);return!k||!v.isSocket(k.node.mode)?null:k.node.sock},stream_ops:{poll:function(g){var k=g.node.sock;return k.sock_ops.poll(k)},ioctl:function(g,k,D){var _=g.node.sock;return _.sock_ops.ioctl(_,k,D)},read:function(g,k,D,_,u){var c=g.node.sock,m=c.sock_ops.recvmsg(c,_);return m?(k.set(m.buffer,D),m.buffer.length):0},write:function(g,k,D,_,u){var c=g.node.sock;return c.sock_ops.sendmsg(c,k,D,_)},close:function(g){var k=g.node.sock;k.sock_ops.close(k)}},nextname:function(){return he.nextname.current||(he.nextname.current=0),"socket["+he.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(g,k,D){var _;if(typeof k=="object"&&(_=k,k=null,D=null),_)if(_._socket)k=_._socket.remoteAddress,D=_._socket.remotePort;else{var u=/ws[s]?:\/\/([^:]+):(\d+)/.exec(_.url);if(!u)throw new Error("WebSocket URL must be in the format ws(s)://address:port");k=u[1],D=parseInt(u[2],10)}else try{var c=f.websocket&&typeof f.websocket=="object",m="ws:#".replace("#","//");if(c&&(typeof f.websocket.url=="function"?m=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(m=f.websocket.url)),m==="ws://"||m==="wss://"){var y=k.split("/");m=m+y[0]+":"+D+"/"+y.slice(1).join("/")}var b="binary";c&&typeof f.websocket.subprotocol=="string"&&(b=f.websocket.subprotocol);var d=void 0;b!=="null"&&(b=b.replace(/^ +| +$/g,"").split(/ *, */),d=b),c&&f.websocket.subprotocol===null&&(b="null",d=void 0);var p;te?p=An():p=WebSocket,f.websocket.decorator&&(p=f.websocket.decorator(p)),_=new p(m,d),_.binaryType="arraybuffer"}catch{throw new v.ErrnoError(23)}var n={addr:k,port:D,socket:_,dgram_send_queue:[]};return he.websocket_sock_ops.addPeer(g,n),he.websocket_sock_ops.handlePeerEvents(g,n),g.type===2&&typeof g.sport<"u"&&n.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(g.sport&65280)>>8,g.sport&255])),n},getPeer:function(g,k,D){return g.peers[k+":"+D]},addPeer:function(g,k){g.peers[k.addr+":"+k.port]=k},removePeer:function(g,k){delete g.peers[k.addr+":"+k.port]},handlePeerEvents:function(g,k){var D=!0,_=function(){f.websocket.emit("open",g.stream.fd);try{for(var c=k.dgram_send_queue.shift();c;)k.socket.send(c),c=k.dgram_send_queue.shift()}catch{k.socket.close()}};function u(c){if(typeof c=="string"){var m=new TextEncoder;c=m.encode(c)}else{if(Le(c.byteLength!==void 0),c.byteLength==0)return;c=new Uint8Array(c)}var y=D;if(D=!1,y&&c.length===10&&c[0]===255&&c[1]===255&&c[2]===255&&c[3]===255&&c[4]==="p".charCodeAt(0)&&c[5]==="o".charCodeAt(0)&&c[6]==="r".charCodeAt(0)&&c[7]==="t".charCodeAt(0)){var b=c[8]<<8|c[9];he.websocket_sock_ops.removePeer(g,k),k.port=b,he.websocket_sock_ops.addPeer(g,k);return}g.recv_queue.push({addr:k.addr,port:k.port,data:c}),f.websocket.emit("message",g.stream.fd)}te?(k.socket.on("open",_),k.socket.on("message",function(c,m){m&&u(new Uint8Array(c).buffer)}),k.socket.on("close",function(){f.websocket.emit("close",g.stream.fd)}),k.socket.on("error",function(c){g.error=14,f.websocket.emit("error",[g.stream.fd,g.error,"ECONNREFUSED: Connection refused"])})):(k.socket.onopen=_,k.socket.onclose=function(){f.websocket.emit("close",g.stream.fd)},k.socket.onmessage=function(m){u(m.data)},k.socket.onerror=function(c){g.error=14,f.websocket.emit("error",[g.stream.fd,g.error,"ECONNREFUSED: Connection refused"])})},poll:function(g){if(g.type===1&&g.server)return g.pending.length?65:0;var k=0,D=g.type===1?he.websocket_sock_ops.getPeer(g,g.daddr,g.dport):null;return(g.recv_queue.length||!D||D&&D.socket.readyState===D.socket.CLOSING||D&&D.socket.readyState===D.socket.CLOSED)&&(k|=65),(!D||D&&D.socket.readyState===D.socket.OPEN)&&(k|=4),(D&&D.socket.readyState===D.socket.CLOSING||D&&D.socket.readyState===D.socket.CLOSED)&&(k|=16),k},ioctl:function(g,k,D){switch(k){case 21531:var _=0;return g.recv_queue.length&&(_=g.recv_queue[0].data.length),E[D>>2]=_,0;default:return 28}},close:function(g){if(g.server){try{g.server.close()}catch{}g.server=null}for(var k=Object.keys(g.peers),D=0;D<k.length;D++){var _=g.peers[k[D]];try{_.socket.close()}catch{}he.websocket_sock_ops.removePeer(g,_)}return 0},bind:function(g,k,D){if(typeof g.saddr<"u"||typeof g.sport<"u")throw new v.ErrnoError(28);if(g.saddr=k,g.sport=D,g.type===2){g.server&&(g.server.close(),g.server=null);try{g.sock_ops.listen(g,0)}catch(_){if(!(_ instanceof v.ErrnoError)||_.errno!==138)throw _}}},connect:function(g,k,D){if(g.server)throw new v.ErrnoError(138);if(typeof g.daddr<"u"&&typeof g.dport<"u"){var _=he.websocket_sock_ops.getPeer(g,g.daddr,g.dport);if(_)throw _.socket.readyState===_.socket.CONNECTING?new v.ErrnoError(7):new v.ErrnoError(30)}var u=he.websocket_sock_ops.createPeer(g,k,D);throw g.daddr=u.addr,g.dport=u.port,new v.ErrnoError(26)},listen:function(g,k){if(!te)throw new v.ErrnoError(138);if(g.server)throw new v.ErrnoError(28);var D=An().Server,_=g.saddr;g.server=new D({host:_,port:g.sport}),f.websocket.emit("listen",g.stream.fd),g.server.on("connection",function(u){if(g.type===1){var c=he.createSocket(g.family,g.type,g.protocol),m=he.websocket_sock_ops.createPeer(c,u);c.daddr=m.addr,c.dport=m.port,g.pending.push(c),f.websocket.emit("connection",c.stream.fd)}else he.websocket_sock_ops.createPeer(g,u),f.websocket.emit("connection",g.stream.fd)}),g.server.on("close",function(){f.websocket.emit("close",g.stream.fd),g.server=null}),g.server.on("error",function(u){g.error=23,f.websocket.emit("error",[g.stream.fd,g.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(g){if(!g.server||!g.pending.length)throw new v.ErrnoError(28);var k=g.pending.shift();return k.stream.flags=g.stream.flags,k},getname:function(g,k){var D,_;if(k){if(g.daddr===void 0||g.dport===void 0)throw new v.ErrnoError(53);D=g.daddr,_=g.dport}else D=g.saddr||0,_=g.sport||0;return{addr:D,port:_}},sendmsg:function(g,k,D,_,u,c){if(g.type===2){if((u===void 0||c===void 0)&&(u=g.daddr,c=g.dport),u===void 0||c===void 0)throw new v.ErrnoError(17)}else u=g.daddr,c=g.dport;var m=he.websocket_sock_ops.getPeer(g,u,c);if(g.type===1){if(!m||m.socket.readyState===m.socket.CLOSING||m.socket.readyState===m.socket.CLOSED)throw new v.ErrnoError(53);if(m.socket.readyState===m.socket.CONNECTING)throw new v.ErrnoError(6)}ArrayBuffer.isView(k)&&(D+=k.byteOffset,k=k.buffer);var y;if(y=k.slice(D,D+_),g.type===2&&(!m||m.socket.readyState!==m.socket.OPEN))return(!m||m.socket.readyState===m.socket.CLOSING||m.socket.readyState===m.socket.CLOSED)&&(m=he.websocket_sock_ops.createPeer(g,u,c)),m.dgram_send_queue.push(y),_;try{return m.socket.send(y),_}catch{throw new v.ErrnoError(28)}},recvmsg:function(g,k){if(g.type===1&&g.server)throw new v.ErrnoError(53);var D=g.recv_queue.shift();if(!D){if(g.type===1){var _=he.websocket_sock_ops.getPeer(g,g.daddr,g.dport);if(!_)throw new v.ErrnoError(53);if(_.socket.readyState===_.socket.CLOSING||_.socket.readyState===_.socket.CLOSED)return null;throw new v.ErrnoError(6)}throw new v.ErrnoError(6)}var u=D.data.byteLength||D.data.length,c=D.data.byteOffset||0,m=D.data.buffer||D.data,y=Math.min(k,u),b={buffer:new Uint8Array(m,c,y),addr:D.addr,port:D.port};if(g.type===1&&y<u){var d=u-y;D.data=new Uint8Array(m,c+y,d),g.recv_queue.unshift(D)}return b}}};function Ie(g){var k=he.getSocket(g);if(!k)throw new v.ErrnoError(8);return k}function ce(g){return E[mr()>>2]=g,g}function Ar(g){for(var k=g.split("."),D=0;D<4;D++){var _=Number(k[D]);if(isNaN(_))return null;k[D]=_}return(k[0]|k[1]<<8|k[2]<<16|k[3]<<24)>>>0}function be(g){return parseInt(g)}function ue(g){var k,D,_,u,c=/^((?=.*::)(?!.*::.+::)(::)?([\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,m=[];if(!c.test(g))return null;if(g==="::")return[0,0,0,0,0,0,0,0];for(g.startsWith("::")?g=g.replace("::","Z:"):g=g.replace("::",":Z:"),g.indexOf(".")>0?(g=g.replace(new RegExp("[.]","g"),":"),k=g.split(":"),k[k.length-4]=be(k[k.length-4])+be(k[k.length-3])*256,k[k.length-3]=be(k[k.length-2])+be(k[k.length-1])*256,k=k.slice(0,k.length-2)):k=g.split(":"),_=0,u=0,D=0;D<k.length;D++)if(typeof k[D]=="string")if(k[D]==="Z"){for(u=0;u<8-k.length+1;u++)m[D+u]=0;_=u-1}else m[D+_]=Ft(parseInt(k[D],16));else m[D+_]=k[D];return[m[1]<<16|m[0],m[3]<<16|m[2],m[5]<<16|m[4],m[7]<<16|m[6]]}function Zr(g,k,D,_,u){switch(k){case 2:D=Ar(D),Ir(g,16),u&&(E[u>>2]=16),we[g>>1]=k,E[g+4>>2]=D,we[g+2>>1]=Ft(_);break;case 10:D=ue(D),Ir(g,28),u&&(E[u>>2]=28),E[g>>2]=k,E[g+8>>2]=D[0],E[g+12>>2]=D[1],E[g+16>>2]=D[2],E[g+20>>2]=D[3],we[g+2>>1]=Ft(_);break;default:return 5}return 0}var Ne={address_map:{id:1,addrs:{},names:{}},lookup_name:function(g){var k=Ar(g);if(k!==null||(k=ue(g),k!==null))return g;var D;if(Ne.address_map.addrs[g])D=Ne.address_map.addrs[g];else{var _=Ne.address_map.id++;Le(_<65535,"exceeded max address mappings of 65535"),D="172.29."+(_&255)+"."+(_&65280),Ne.address_map.names[D]=g,Ne.address_map.addrs[g]=D}return D},lookup_addr:function(g){return Ne.address_map.names[g]?Ne.address_map.names[g]:null}};function kn(g,k,D,_){try{var u=Ie(g),c=u.sock_ops.accept(u);if(k)var m=Zr(k,c.family,Ne.lookup_name(c.daddr),c.dport,D);return c.stream.fd}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function Gr(g){return(g&255)+"."+(g>>8&255)+"."+(g>>16&255)+"."+(g>>24&255)}function Yr(g){var k="",D=0,_=0,u=0,c=0,m=0,y=0,b=[g[0]&65535,g[0]>>16,g[1]&65535,g[1]>>16,g[2]&65535,g[2]>>16,g[3]&65535,g[3]>>16],d=!0,p="";for(y=0;y<5;y++)if(b[y]!==0){d=!1;break}if(d){if(p=Gr(b[6]|b[7]<<16),b[5]===-1)return k="::ffff:",k+=p,k;if(b[5]===0)return k="::",p==="0.0.0.0"&&(p=""),p==="0.0.0.1"&&(p="1"),k+=p,k}for(D=0;D<8;D++)b[D]===0&&(D-u>1&&(m=0),u=D,m++),m>_&&(_=m,c=D-_+1);for(D=0;D<8;D++){if(_>1&&b[D]===0&&D>=c&&D<c+_){D===c&&(k+=":",c===0&&(k+=":"));continue}k+=Number(sn(b[D]&65535)).toString(16),k+=D<7?":":""}return k}function dn(g,k){var D=we[g>>1],_=sn(lt[g+2>>1]),u;switch(D){case 2:if(k!==16)return{errno:28};u=E[g+4>>2],u=Gr(u);break;case 10:if(k!==28)return{errno:28};u=[E[g+8>>2],E[g+12>>2],E[g+16>>2],E[g+20>>2]],u=Yr(u);break;default:return{errno:5}}return{family:D,addr:u,port:_}}function Pt(g,k,D){if(D&&g===0)return null;var _=dn(g,k);if(_.errno)throw new v.ErrnoError(_.errno);return _.addr=Ne.lookup_addr(_.addr)||_.addr,_}function oo(g,k,D){try{var _=Ie(g),u=Pt(k,D);return _.sock_ops.bind(_,u.addr,u.port),0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function io(g){try{return g=H.getStr(g),v.chdir(g),0}catch(k){if(typeof v>"u"||!(k instanceof v.ErrnoError))throw k;return-k.errno}}function ao(g,k){try{return g=H.getStr(g),v.chmod(g,k),0}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return-D.errno}}function so(g,k,D){try{var _=Ie(g),u=Pt(k,D);return _.sock_ops.connect(_,u.addr,u.port),0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function uo(g){try{var k=H.getStreamFromFD(g);return v.createStream(k,0).fd}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return-D.errno}}function _n(g,k,D){try{var _=H.getStreamFromFD(g);if(_.fd===k)return-28;var u=v.getStream(k);return u&&v.close(u),v.createStream(_,k,k+1).fd}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function fo(g,k,D,_){try{if(k=H.getStr(k),k=H.calculateAt(g,k),D&-8)return-28;var u=v.lookupPath(k,{follow:!0}),c=u.node;if(!c)return-44;var m="";return D&4&&(m+="r"),D&2&&(m+="w"),D&1&&(m+="x"),m&&v.nodePermissions(c,m)?-2:0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function gt(g,k){return k+2097152>>>0<4194305-!!g?(g>>>0)+k*4294967296:NaN}function co(g,k,D,_,u,c){try{var m=gt(D,_);if(isNaN(m))return-61;var y=gt(u,c);if(isNaN(y))return-61;var b=H.getStreamFromFD(g);return v.allocate(b,m,y),0}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function lo(g,k){try{return v.fchmod(g,k),0}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return-D.errno}}function qt(g,k,D){try{return v.fchown(g,k,D),0}catch(_){if(typeof v>"u"||!(_ instanceof v.ErrnoError))throw _;return-_.errno}}function _o(g,k,D,_,u){try{k=H.getStr(k);var c=u&256;return u=u&-257,k=H.calculateAt(g,k),(c?v.lchown:v.chown)(k,D,_),0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function mo(g,k,D){H.varargs=D;try{var _=H.getStreamFromFD(g);switch(k){case 0:{var u=H.get();if(u<0)return-28;var c;return c=v.createStream(_,u),c.fd}case 1:case 2:return 0;case 3:return _.flags;case 4:{var u=H.get();return _.flags|=u,0}case 5:{var u=H.get(),m=0;return we[u+m>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return ce(28),-1;default:return-28}}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function vo(g){try{var k=H.getStreamFromFD(g);return 0}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return-D.errno}}function po(g,k){try{var D=H.getStreamFromFD(g);return H.doStat(v.stat,D.path,k)}catch(_){if(typeof v>"u"||!(_ instanceof v.ErrnoError))throw _;return-_.errno}}function ho(g,k,D){try{var _=gt(k,D);return isNaN(_)?-61:(v.ftruncate(g,_),0)}catch(u){if(typeof v>"u"||!(u instanceof v.ErrnoError))throw u;return-u.errno}}function yo(g,k){try{if(k===0)return-28;var D=v.cwd(),_=Ce(D)+1;return k<_?-68:(Fe(D,g,k),_)}catch(u){if(typeof v>"u"||!(u instanceof v.ErrnoError))throw u;return-u.errno}}function Eo(g,k,D){try{var _=H.getStreamFromFD(g);_.getdents||(_.getdents=v.readdir(_.path));for(var u=280,c=0,m=v.llseek(_,0,1),y=Math.floor(m/u);y<_.getdents.length&&c+u<=D;){var b,d,p=_.getdents[y];if(p===".")b=_.node.id,d=4;else if(p===".."){var n=v.lookupPath(_.path,{parent:!0});b=n.node.id,d=4}else{var r=v.lookupNode(_.node,p);b=r.id,d=v.isChrdev(r.mode)?2:v.isDir(r.mode)?4:v.isLink(r.mode)?10:8}Z=[b>>>0,(U=b,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[k+c>>2]=Z[0],E[k+c+4>>2]=Z[1],Z=[(y+1)*u>>>0,(U=(y+1)*u,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[k+c+8>>2]=Z[0],E[k+c+12>>2]=Z[1],we[k+c+16>>1]=280,ee[k+c+18>>0]=d,Fe(p,k+c+19,256),c+=u,y+=1}return v.llseek(_,y*u,0),c}catch(e){if(typeof v>"u"||!(e instanceof v.ErrnoError))throw e;return-e.errno}}function wo(g,k,D){try{var _=Ie(g);if(!_.daddr)return-53;var u=Zr(k,_.family,Ne.lookup_name(_.daddr),_.dport,D);return 0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function go(g,k,D){try{fe("__syscall_getsockname "+g);var _=Ie(g),u=Zr(k,_.family,Ne.lookup_name(_.saddr||"0.0.0.0"),_.sport,D);return 0}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function So(g,k,D,_,u){try{var c=Ie(g);return k===1&&D===4?(E[_>>2]=c.error,E[u>>2]=4,c.error=null,0):-50}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function bo(g,k,D){H.varargs=D;try{var _=H.getStreamFromFD(g);switch(k){case 21509:case 21505:return _.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return _.tty?0:-59;case 21519:{if(!_.tty)return-59;var u=H.get();return E[u>>2]=0,0}case 21520:return _.tty?-28:-59;case 21531:{var u=H.get();return v.ioctl(_,k,u)}case 21523:return _.tty?0:-59;case 21524:return _.tty?0:-59;default:return-28}}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}function ko(g,k){try{var D=Ie(g);return D.sock_ops.listen(D,k),0}catch(_){if(typeof v>"u"||!(_ instanceof v.ErrnoError))throw _;return-_.errno}}function ae(g,k){try{return g=H.getStr(g),H.doStat(v.lstat,g,k)}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return-D.errno}}function Oo(g,k,D){try{return k=H.getStr(k),k=H.calculateAt(g,k),k=Q.normalize(k),k[k.length-1]==="/"&&(k=k.substr(0,k.length-1)),v.mkdir(k,D,0),0}catch(_){if(typeof v>"u"||!(_ instanceof v.ErrnoError))throw _;return-_.errno}}function kr(g,k,D,_){try{k=H.getStr(k);var u=_&256,c=_&4096;return _=_&-4353,k=H.calculateAt(g,k,c),H.doStat(u?v.lstat:v.stat,k,D)}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return-m.errno}}function Do(g,k,D,_){H.varargs=_;try{k=H.getStr(k),k=H.calculateAt(g,k);var u=_?H.get():0;return v.open(k,D,u).fd}catch(c){if(typeof v>"u"||!(c instanceof v.ErrnoError))throw c;return-c.errno}}var Se={BUCKET_BUFFER_SIZE:8192,mount:function(g){return v.createNode(null,"/",16895,0)},createPipe:function(){var g={buckets:[],refcnt:2};g.buckets.push({buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var k=Se.nextname(),D=Se.nextname(),_=v.createNode(Se.root,k,4096,0),u=v.createNode(Se.root,D,4096,0);_.pipe=g,u.pipe=g;var c=v.createStream({path:k,node:_,flags:0,seekable:!1,stream_ops:Se.stream_ops});_.stream=c;var m=v.createStream({path:D,node:u,flags:1,seekable:!1,stream_ops:Se.stream_ops});return u.stream=m,{readable_fd:c.fd,writable_fd:m.fd}},stream_ops:{poll:function(g){var k=g.node.pipe;if((g.flags&2097155)===1)return 260;if(k.buckets.length>0)for(var D=0;D<k.buckets.length;D++){var _=k.buckets[D];if(_.offset-_.roffset>0)return 65}return 0},ioctl:function(g,k,D){return 28},fsync:function(g){return 28},read:function(g,k,D,_,u){for(var c=g.node.pipe,m=0,y=0;y<c.buckets.length;y++){var b=c.buckets[y];m+=b.offset-b.roffset}Le(k instanceof ArrayBuffer||ArrayBuffer.isView(k));var d=k.subarray(D,D+_);if(_<=0)return 0;if(m==0)throw new v.ErrnoError(6);for(var p=Math.min(m,_),n=p,r=0,y=0;y<c.buckets.length;y++){var e=c.buckets[y],o=e.offset-e.roffset;if(p<=o){var t=e.buffer.subarray(e.roffset,e.offset);p<o?(t=t.subarray(0,p),e.roffset+=p):r++,d.set(t);break}else{var t=e.buffer.subarray(e.roffset,e.offset);d.set(t),d=d.subarray(t.byteLength),p-=t.byteLength,r++}}return r&&r==c.buckets.length&&(r--,c.buckets[r].offset=0,c.buckets[r].roffset=0),c.buckets.splice(0,r),n},write:function(g,k,D,_,u){var c=g.node.pipe;Le(k instanceof ArrayBuffer||ArrayBuffer.isView(k));var m=k.subarray(D,D+_),y=m.byteLength;if(y<=0)return 0;var b=null;c.buckets.length==0?(b={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:0,roffset:0},c.buckets.push(b)):b=c.buckets[c.buckets.length-1],Le(b.offset<=Se.BUCKET_BUFFER_SIZE);var d=Se.BUCKET_BUFFER_SIZE-b.offset;if(d>=y)return b.buffer.set(m,b.offset),b.offset+=y,y;d>0&&(b.buffer.set(m.subarray(0,d),b.offset),b.offset+=d,m=m.subarray(d,m.byteLength));for(var p=m.byteLength/Se.BUCKET_BUFFER_SIZE|0,n=m.byteLength%Se.BUCKET_BUFFER_SIZE,r=0;r<p;r++){var e={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:Se.BUCKET_BUFFER_SIZE,roffset:0};c.buckets.push(e),e.buffer.set(m.subarray(0,Se.BUCKET_BUFFER_SIZE)),m=m.subarray(Se.BUCKET_BUFFER_SIZE,m.byteLength)}if(n>0){var e={buffer:new Uint8Array(Se.BUCKET_BUFFER_SIZE),offset:m.byteLength,roffset:0};c.buckets.push(e),e.buffer.set(m)}return y},close:function(g){var k=g.node.pipe;k.refcnt--,k.refcnt===0&&(k.buckets=null)}},nextname:function(){return Se.nextname.current||(Se.nextname.current=0),"pipe["+Se.nextname.current+++"]"}};function No(g){try{if(g==0)throw new v.ErrnoError(21);var k=Se.createPipe();return E[g>>2]=k.readable_fd,E[g+4>>2]=k.writable_fd,0}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return-D.errno}}function To(g,k,D){try{for(var _=0,u=0;u<k;u++){var c=g+8*u,m=E[c>>2],y=we[c+4>>1],b=32,d=v.getStream(m);d&&(b=H.DEFAULT_POLLMASK,d.stream_ops?.poll&&(b=d.stream_ops.poll(d))),b&=y|8|16,b&&_++,we[c+6>>1]=b}return _}catch(p){if(typeof v>"u"||!(p instanceof v.ErrnoError))throw p;return-p.errno}}function Ao(g,k,D,_){try{if(k=H.getStr(k),k=H.calculateAt(g,k),_<=0)return-28;var u=v.readlink(k),c=Math.min(_,Ce(u)),m=ee[D+c];return Fe(u,D,_+1),ee[D+c]=m,c}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function Fo(g,k,D,_,u,c){try{var m=Ie(g),y=m.sock_ops.recvmsg(m,D);if(!y)return 0;if(u)var b=Zr(u,m.family,Ne.lookup_name(y.addr),y.port,c);return le.set(y.buffer,k),y.buffer.byteLength}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function Co(g,k,D,_){try{return k=H.getStr(k),_=H.getStr(_),k=H.calculateAt(g,k),_=H.calculateAt(D,_),v.rename(k,_),0}catch(u){if(typeof v>"u"||!(u instanceof v.ErrnoError))throw u;return-u.errno}}function Po(g){try{return g=H.getStr(g),v.rmdir(g),0}catch(k){if(typeof v>"u"||!(k instanceof v.ErrnoError))throw k;return-k.errno}}function Ro(g,k,D,_,u,c){try{var m=Ie(g),y=Pt(u,c,!0);return y?m.sock_ops.sendmsg(m,ee,k,D,y.addr,y.port):v.write(m.stream,ee,k,D)}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function Mo(g,k,D){try{var _=he.createSocket(g,k,D);return _.stream.fd}catch(u){if(typeof v>"u"||!(u instanceof v.ErrnoError))throw u;return-u.errno}}function jr(g,k){try{return g=H.getStr(g),H.doStat(v.stat,g,k)}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return-D.errno}}function Lo(g,k,D){try{return g=H.getStr(g),E[D+4>>2]=4096,E[D+40>>2]=4096,E[D+8>>2]=1e6,E[D+12>>2]=5e5,E[D+16>>2]=5e5,E[D+20>>2]=v.nextInode,E[D+24>>2]=1e6,E[D+28>>2]=42,E[D+44>>2]=2,E[D+36>>2]=255,0}catch(_){if(typeof v>"u"||!(_ instanceof v.ErrnoError))throw _;return-_.errno}}function mn(g,k){try{return g=H.getStr(g),k=H.getStr(k),v.symlink(g,k),0}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return-D.errno}}function Vt(g,k,D){try{return k=H.getStr(k),k=H.calculateAt(g,k),D===0?v.unlink(k):D===512?v.rmdir(k):me("Invalid flags passed to unlinkat"),0}catch(_){if(typeof v>"u"||!(_ instanceof v.ErrnoError))throw _;return-_.errno}}function St(g){return j[g>>2]+E[g+4>>2]*4294967296}function Fn(g,k,D,_){try{if(k=H.getStr(k),k=H.calculateAt(g,k,!0),D){var m=St(D),y=E[D+8>>2];u=m*1e3+y/(1e3*1e3),D+=16,m=St(D),y=E[D+8>>2],c=m*1e3+y/(1e3*1e3)}else var u=Date.now(),c=u;return v.utime(k,u,c),0}catch(b){if(typeof v>"u"||!(b instanceof v.ErrnoError))throw b;return-b.errno}}function Uo(g){}var vn="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Io(g,k){me(vn)}function Bo(g,k){me(vn)}var xo=!0;function zo(){return xo}function Ho(){throw 1/0}function Wo(g,k){var D=new Date(St(g)*1e3);E[k>>2]=D.getUTCSeconds(),E[k+4>>2]=D.getUTCMinutes(),E[k+8>>2]=D.getUTCHours(),E[k+12>>2]=D.getUTCDate(),E[k+16>>2]=D.getUTCMonth(),E[k+20>>2]=D.getUTCFullYear()-1900,E[k+24>>2]=D.getUTCDay();var _=Date.UTC(D.getUTCFullYear(),0,1,0,0,0,0),u=(D.getTime()-_)/(1e3*60*60*24)|0;E[k+28>>2]=u}function Gt(g,k){var D=new Date(St(g)*1e3);E[k>>2]=D.getSeconds(),E[k+4>>2]=D.getMinutes(),E[k+8>>2]=D.getHours(),E[k+12>>2]=D.getDate(),E[k+16>>2]=D.getMonth(),E[k+20>>2]=D.getFullYear()-1900,E[k+24>>2]=D.getDay();var _=new Date(D.getFullYear(),0,1),u=(D.getTime()-_.getTime())/(1e3*60*60*24)|0;E[k+28>>2]=u,E[k+36>>2]=-(D.getTimezoneOffset()*60);var c=new Date(D.getFullYear(),6,1).getTimezoneOffset(),m=_.getTimezoneOffset(),y=(c!=m&&D.getTimezoneOffset()==Math.min(m,c))|0;E[k+32>>2]=y}function Yo(g){var k=new Date(E[g+20>>2]+1900,E[g+16>>2],E[g+12>>2],E[g+8>>2],E[g+4>>2],E[g>>2],0),D=E[g+32>>2],_=k.getTimezoneOffset(),u=new Date(k.getFullYear(),0,1),c=new Date(k.getFullYear(),6,1).getTimezoneOffset(),m=u.getTimezoneOffset(),y=Math.min(m,c);if(D<0)E[g+32>>2]=+(c!=m&&y==_);else if(D>0!=(y==_)){var b=Math.max(m,c),d=D>0?y:b;k.setTime(k.getTime()+(d-_)*6e4)}E[g+24>>2]=k.getDay();var p=(k.getTime()-u.getTime())/(1e3*60*60*24)|0;return E[g+28>>2]=p,E[g>>2]=k.getSeconds(),E[g+4>>2]=k.getMinutes(),E[g+8>>2]=k.getHours(),E[g+12>>2]=k.getDate(),E[g+16>>2]=k.getMonth(),E[g+20>>2]=k.getYear(),k.getTime()/1e3|0}function rt(g,k,D,_,u,c){try{var m=H.getStreamFromFD(_),y=v.mmap(m,g,u,k,D),b=y.ptr;return E[c>>2]=y.allocated,b}catch(d){if(typeof v>"u"||!(d instanceof v.ErrnoError))throw d;return-d.errno}}function jo(g,k,D,_,u,c){try{var m=H.getStreamFromFD(u);D&2&&H.doMsync(g,m,k,_,c),v.munmap(m)}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return-y.errno}}function Kt(g){var k=Ce(g)+1,D=Dr(k);return D&&Ze(g,ee,D,k),D}function Xt(g,k,D){var _=new Date().getFullYear(),u=new Date(_,0,1),c=new Date(_,6,1),m=u.getTimezoneOffset(),y=c.getTimezoneOffset(),b=Math.max(m,y);E[g>>2]=b*60,E[k>>2]=+(m!=y);function d(o){var t=o.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}var p=d(u),n=d(c),r=Kt(p),e=Kt(n);y<m?(j[D>>2]=r,j[D+4>>2]=e):(j[D>>2]=e,j[D+4>>2]=r)}function Rt(g,k,D){Rt.called||(Rt.called=!0,Xt(g,k,D))}function tt(){me("")}function qo(){return Date.now()}function Zt(){return 2147483648}function Vo(){return Zt()}var Mt;te?Mt=()=>{var g=process.hrtime();return g[0]*1e3+g[1]/1e6}:Mt=()=>performance.now();function it(g,k,D){le.copyWithin(g,k,k+D)}function Go(g){try{return ir.grow(g-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function Or(g){var k=le.length;g=g>>>0;var D=Zt();if(g>D)return!1;let _=(b,d)=>b+(d-b%d)%d;for(var u=1;u<=4;u*=2){var c=k*(1+.2/u);c=Math.min(c,g+100663296);var m=Math.min(D,_(Math.max(g,c),65536)),y=Go(m);if(y)return!0}return!1}function at(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var st=A.ENV||{};function On(){return ie||"./this.program"}function qr(){if(!qr.strings){var g=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",k={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:g,_:On()};for(var D in st)st[D]===void 0?delete k[D]:k[D]=st[D];var _=[];for(var D in k)_.push(D+"="+k[D]);qr.strings=_}return qr.strings}function Lt(g,k,D){for(var _=0;_<g.length;++_)ee[k++>>0]=g.charCodeAt(_);D||(ee[k>>0]=0)}function Cn(g,k){var D=0;return qr().forEach(function(_,u){var c=k+D;j[g+u*4>>2]=c,Lt(_,c),D+=_.length+1}),0}function Ko(g,k){var D=qr();j[g>>2]=D.length;var _=0;return D.forEach(function(u){_+=u.length+1}),j[k>>2]=_,0}function pn(g){Pr=g,Mr()||(f.onExit&&f.onExit(g),Tr=!0),_e(g,new Ur(g))}function Xo(g,k){Pr=g,Mr()||Kn(),pn(g)}var Zo=Xo;function $o(g){try{var k=H.getStreamFromFD(g);return v.close(k),0}catch(D){if(typeof v>"u"||!(D instanceof v.ErrnoError))throw D;return D.errno}}function Jo(g,k){try{var D=H.getStreamFromFD(g),_=D.tty?2:v.isDir(D.mode)?3:v.isLink(D.mode)?7:4;return ee[k>>0]=_,0}catch(u){if(typeof v>"u"||!(u instanceof v.ErrnoError))throw u;return u.errno}}function Qo(g,k,D,_){for(var u=0,c=0;c<D;c++){var m=j[k>>2],y=j[k+4>>2];k+=8;var b=v.read(g,ee,m,y,_);if(b<0)return-1;if(u+=b,b<y)break}return u}function ei(g,k,D,_){try{var u=H.getStreamFromFD(g),c=Qo(u,k,D);return j[_>>2]=c,0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return m.errno}}function nn(g,k,D,_,u){try{var c=gt(k,D);if(isNaN(c))return 61;var m=H.getStreamFromFD(g);return v.llseek(m,c,_),Z=[m.position>>>0,(U=m.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[u>>2]=Z[0],E[u+4>>2]=Z[1],m.getdents&&c===0&&_===0&&(m.getdents=null),0}catch(y){if(typeof v>"u"||!(y instanceof v.ErrnoError))throw y;return y.errno}}function Pn(g,k,D,_){for(var u=0,c=0;c<D;c++){var m=j[k>>2],y=j[k+4>>2];k+=8;var b=v.write(g,ee,m,y,_);if(b<0)return-1;u+=b}return u}function Rn(g,k,D,_){try{var u=H.getStreamFromFD(g),c=Pn(u,k,D);return j[_>>2]=c,0}catch(m){if(typeof v>"u"||!(m instanceof v.ErrnoError))throw m;return m.errno}}function ri(g,k,D,_){var u=0,c=0,m=0,y=0,b=0,d=0,p;function n(r,e,o,t,a,s){var l,h,w,S;return h=r===10?28:16,a=r===10?Yr(a):Gr(a),l=Dr(h),S=Zr(l,r,a,s),Le(!S),w=Dr(32),E[w+4>>2]=r,E[w+8>>2]=e,E[w+12>>2]=o,E[w+24>>2]=t,j[w+20>>2]=l,r===10?E[w+16>>2]=28:E[w+16>>2]=16,E[w+28>>2]=0,w}if(D&&(m=E[D>>2],y=E[D+4>>2],b=E[D+8>>2],d=E[D+12>>2]),b&&!d&&(d=b===2?17:6),!b&&d&&(b=d===17?2:1),d===0&&(d=6),b===0&&(b=1),!g&&!k)return-2;if(m&-1088||D!==0&&E[D>>2]&2&&!g)return-1;if(m&32)return-2;if(b!==0&&b!==1&&b!==2)return-7;if(y!==0&&y!==2&&y!==10)return-6;if(k&&(k=ne(k),c=parseInt(k,10),isNaN(c)))return m&1024?-2:-8;if(!g)return y===0&&(y=2),m&1||(y===2?u=en(2130706433):u=[0,0,0,1]),p=n(y,b,d,null,u,c),j[_>>2]=p,0;if(g=ne(g),u=Ar(g),u!==null)if(y===0||y===2)y=2;else if(y===10&&m&8)u=[0,0,en(65535),u],y=10;else return-2;else if(u=ue(g),u!==null)if(y===0||y===10)y=10;else return-2;return u!=null?(p=n(y,b,d,g,u,c),j[_>>2]=p,0):m&4?-2:(g=Ne.lookup_name(g),u=Ar(g),y===0?y=2:y===10&&(u=[0,0,en(65535),u]),p=n(y,b,d,null,u,c),j[_>>2]=p,0)}function Mn(g){var k=Dr(20),D=Dr(g.length+1);Fe(g,D,g.length+1),j[k>>2]=D;var _=Dr(4);j[_>>2]=0,j[k+4>>2]=_;var u=2;E[k+8>>2]=u,E[k+12>>2]=4;var c=Dr(12);return j[c>>2]=c+8,j[c+4>>2]=0,E[c+8>>2]=Ar(Ne.lookup_name(g)),j[k+16>>2]=c,k}function hn(g,k,D){if(D!==2)return ce(5),null;g=E[g>>2];var _=Gr(g),u=Ne.lookup_addr(_);return u&&(_=u),Mn(_)}function nt(g){return Mn(ne(g))}function bt(g,k,D,_,u,c){var m=nt(g);return an(k,m,20),Br(m),E[c>>2]=0,j[u>>2]=k,0}function $t(g,k){for(var D=Math.min(k,3),_=8,u=0;u<D;u++)dt[g+u*_>>3]=.1;return D}function yn(g,k,D,_,u,c,m){var y=dn(g,k);if(y.errno)return-6;var b=y.port,d=y.addr,p=!1;if(D&&_){var n;if(m&1||!(n=Ne.lookup_addr(d))){if(m&8)return-2}else d=n;var r=Fe(d,D,_);r+1>=_&&(p=!0)}if(u&&c){b=""+b;var r=Fe(b,u,c);r+1>=c&&(p=!0)}return p?-12:0}var Fr={list:[],map:{}};function Ue(g){function k(c,m,y){var b=Dr(c.length+1);Lt(c,b);for(var d=0,p=y.length,n=Dr((p+1)*4),r=0;r<p;r++,d+=4){var e=y[r],o=Dr(e.length+1);Lt(e,o),j[n+d>>2]=o}j[n+d>>2]=0;var t=Dr(12);return j[t>>2]=b,j[t+4>>2]=n,E[t+8>>2]=m,t}var D=Fr.list,_=Fr.map;if(D.length===0){var u=k("tcp",6,["TCP"]);D.push(u),_.tcp=_[6]=u,u=k("udp",17,["UDP"]),D.push(u),_.udp=_[17]=u}Ue.index=0}function hr(g){g=ne(g),Ue(!0);var k=Fr.map[g];return k}function tr(g){Ue(!0);var k=Fr.map[g];return k}function Hr(g){var k=Ce(g)+1,D=cr(k);return Ze(g,ee,D,k),D}var Ge={getAllWebSockets:function(g){let k=new Set;g.server&&g.server.clients.forEach(D=>{k.add(D)});for(let D of Ge.getAllPeers(g))k.add(D.socket);return Array.from(k)},getAllPeers:function(g){let k=new Set;if(g.server&&g.pending.filter(D=>D.peers).forEach(D=>{for(let _ of Object.values(D.peers))k.add(_)}),g.peers)for(let D of Object.values(g.peers))k.add(D);return Array.from(k)},awaitData:function(g){return Ge.awaitWsEvent(g,"message")},awaitConnection:function(g){return g.OPEN===g.readyState?[Promise.resolve(),Ge.noop]:Ge.awaitWsEvent(g,"open")},awaitClose:function(g){return[g.CLOSING,g.CLOSED].includes(g.readyState)?[Promise.resolve(),Ge.noop]:Ge.awaitWsEvent(g,"close")},awaitError:function(g){return[g.CLOSING,g.CLOSED].includes(g.readyState)?[Promise.resolve(),Ge.noop]:Ge.awaitWsEvent(g,"error")},awaitWsEvent:function(g,k){let D,_=()=>{D()};return[new Promise(function(m){D=m,g.once(k,_)}),()=>{g.removeListener(k,_),setTimeout(D)}]},noop:function(){},shutdownSocket:function(g,k){let D=Ie(g),_=Object.values(D.peers)[0];if(!_)return-1;try{return _.socket.close(),he.websocket_sock_ops.removePeer(D,_),0}catch(u){return console.log("Socket shutdown error",u),-1}}};function Xe(g,k,D){if(!g)return 1;let _=ne(g);if(!_.length)return 0;let u=ne(k);if(!u.length)return 0;if(f.popen_to_file){let{path:c,exitCode:m}=f.popen_to_file(_,u);return le[D]=m,Hr(c)}if(te){let c=require("os").tmpdir(),m="php-process-stream",y=c+"/"+m,b=require("child_process"),d;if(u==="r")d=b.spawnSync(_,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[D]=d.status,require("fs").writeFileSync(y,d.stdout,{encoding:"utf8",flag:"w+"});else return u==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+u+" (should be r or w)"),_W_EXITCODE(0,2));return Hr(y)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function Ve(g){return g%4===0&&(g%100!==0||g%400===0)}function ut(g,k){for(var D=0,_=0;_<=k;D+=g[_++]);return D}var Kr=[31,29,31,30,31,30,31,31,30,31,30,31],ot=[31,28,31,30,31,30,31,31,30,31,30,31];function ft(g,k){for(var D=new Date(g.getTime());k>0;){var _=Ve(D.getFullYear()),u=D.getMonth(),c=(_?Kr:ot)[u];if(k>c-D.getDate())k-=c-D.getDate()+1,D.setDate(1),u<11?D.setMonth(u+1):(D.setMonth(0),D.setFullYear(D.getFullYear()+1));else return D.setDate(D.getDate()+k),D}return D}function Ot(g,k,D,_){var u=E[_+40>>2],c={tm_sec:E[_>>2],tm_min:E[_+4>>2],tm_hour:E[_+8>>2],tm_mday:E[_+12>>2],tm_mon:E[_+16>>2],tm_year:E[_+20>>2],tm_wday:E[_+24>>2],tm_yday:E[_+28>>2],tm_isdst:E[_+32>>2],tm_gmtoff:E[_+36>>2],tm_zone:u?ne(u):""},m=ne(D),y={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var b in y)m=m.replace(new RegExp(b,"g"),y[b]);var d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function n(l,h,w){for(var S=typeof l=="number"?l.toString():l||"";S.length<h;)S=w[0]+S;return S}function r(l,h){return n(l,h,"0")}function e(l,h){function w(O){return O<0?-1:O>0?1:0}var S;return(S=w(l.getFullYear()-h.getFullYear()))===0&&(S=w(l.getMonth()-h.getMonth()))===0&&(S=w(l.getDate()-h.getDate())),S}function o(l){switch(l.getDay()){case 0:return new Date(l.getFullYear()-1,11,29);case 1:return l;case 2:return new Date(l.getFullYear(),0,3);case 3:return new Date(l.getFullYear(),0,2);case 4:return new Date(l.getFullYear(),0,1);case 5:return new Date(l.getFullYear()-1,11,31);case 6:return new Date(l.getFullYear()-1,11,30)}}function t(l){var h=ft(new Date(l.tm_year+1900,0,1),l.tm_yday),w=new Date(h.getFullYear(),0,4),S=new Date(h.getFullYear()+1,0,4),O=o(w),N=o(S);return e(O,h)<=0?e(N,h)<=0?h.getFullYear()+1:h.getFullYear():h.getFullYear()-1}var a={"%a":function(l){return d[l.tm_wday].substring(0,3)},"%A":function(l){return d[l.tm_wday]},"%b":function(l){return p[l.tm_mon].substring(0,3)},"%B":function(l){return p[l.tm_mon]},"%C":function(l){var h=l.tm_year+1900;return r(h/100|0,2)},"%d":function(l){return r(l.tm_mday,2)},"%e":function(l){return n(l.tm_mday,2," ")},"%g":function(l){return t(l).toString().substring(2)},"%G":function(l){return t(l)},"%H":function(l){return r(l.tm_hour,2)},"%I":function(l){var h=l.tm_hour;return h==0?h=12:h>12&&(h-=12),r(h,2)},"%j":function(l){return r(l.tm_mday+ut(Ve(l.tm_year+1900)?Kr:ot,l.tm_mon-1),3)},"%m":function(l){return r(l.tm_mon+1,2)},"%M":function(l){return r(l.tm_min,2)},"%n":function(){return`
16
+ `},"%p":function(l){return l.tm_hour>=0&&l.tm_hour<12?"AM":"PM"},"%S":function(l){return r(l.tm_sec,2)},"%t":function(){return" "},"%u":function(l){return l.tm_wday||7},"%U":function(l){var h=l.tm_yday+7-l.tm_wday;return r(Math.floor(h/7),2)},"%V":function(l){var h=Math.floor((l.tm_yday+7-(l.tm_wday+6)%7)/7);if((l.tm_wday+371-l.tm_yday-2)%7<=2&&h++,h){if(h==53){var S=(l.tm_wday+371-l.tm_yday)%7;S!=4&&(S!=3||!Ve(l.tm_year))&&(h=1)}}else{h=52;var w=(l.tm_wday+7-l.tm_yday-1)%7;(w==4||w==5&&Ve(l.tm_year%400-1))&&h++}return r(h,2)},"%w":function(l){return l.tm_wday},"%W":function(l){var h=l.tm_yday+7-(l.tm_wday+6)%7;return r(Math.floor(h/7),2)},"%y":function(l){return(l.tm_year+1900).toString().substring(2)},"%Y":function(l){return l.tm_year+1900},"%z":function(l){var h=l.tm_gmtoff,w=h>=0;return h=Math.abs(h)/60,h=h/60*100+h%60,(w?"+":"-")+("0000"+h).slice(-4)},"%Z":function(l){return l.tm_zone},"%%":function(){return"%"}};m=m.replace(/%%/g,"\0\0");for(var b in a)m.includes(b)&&(m=m.replace(new RegExp(b,"g"),a[b](c)));m=m.replace(/\0\0/g,"%");var s=wr(m,!1);return s.length>k?0:(Et(s,g),s.length-1)}function Dt(g,k,D){for(var _=ne(k),u="\\!@#$^&*()+=-[]/{}|:<>?,.",c=0,m=u.length;c<m;++c)_=_.replace(new RegExp("\\"+u[c],"g"),"\\"+u[c]);var y={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var b in y)_=_.replace(b,y[b]);var d={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},p={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},r={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var e in d)_=_.replace(e,"("+e+d[e]+")");for(var o=[],c=_.indexOf("%");c>=0;c=_.indexOf("%"))o.push(_[c+1]),_=_.replace(new RegExp("\\%"+_[c+1],"g"),"");var t=new RegExp("^"+_,"i").exec(ne(g));function a(){function q(W,X,oe){return typeof W!="number"||isNaN(W)?X:W>=X?W<=oe?W:oe:X}return{year:q(E[D+20>>2]+1900,1970,9999),month:q(E[D+16>>2],0,11),day:q(E[D+12>>2],1,31),hour:q(E[D+8>>2],0,23),min:q(E[D+4>>2],0,59),sec:q(E[D>>2],0,59)}}if(t){var s=a(),l,h=q=>{var W=o.indexOf(q);if(W>=0)return t[W+1]};if((l=h("S"))&&(s.sec=be(l)),(l=h("M"))&&(s.min=be(l)),l=h("H"))s.hour=be(l);else if(l=h("I")){var w=be(l);(l=h("p"))&&(w+=l.toUpperCase()[0]==="P"?12:0),s.hour=w}if(l=h("Y"))s.year=be(l);else if(l=h("y")){var S=be(l);(l=h("C"))?S+=be(l)*100:S+=S<69?2e3:1900,s.year=S}if((l=h("m"))?s.month=be(l)-1:(l=h("b"))&&(s.month=p[l.substring(0,3).toUpperCase()]||0),l=h("d"))s.day=be(l);else if(l=h("j"))for(var O=be(l),N=Ve(s.year),T=0;T<12;++T){var F=ut(N?Kr:ot,T-1);O<=F+(N?Kr:ot)[T]&&(s.day=O-F)}else if(l=h("a")){var L=l.substring(0,3).toUpperCase();if(l=h("U")){var R=n[L],B=be(l),P=new Date(s.year,0,1),M;P.getDay()===0?M=ft(P,R+7*(B-1)):M=ft(P,7-P.getDay()+R+7*(B-1)),s.day=M.getDate(),s.month=M.getMonth()}else if(l=h("W")){var R=r[L],B=be(l),P=new Date(s.year,0,1),M;P.getDay()===1?M=ft(P,R+7*(B-1)):M=ft(P,7-P.getDay()+1+R+7*(B-1)),s.day=M.getDate(),s.month=M.getMonth()}}var z=new Date(s.year,s.month,s.day,s.hour,s.min,s.sec,0);return E[D>>2]=z.getSeconds(),E[D+4>>2]=z.getMinutes(),E[D+8>>2]=z.getHours(),E[D+12>>2]=z.getDate(),E[D+16>>2]=z.getMonth(),E[D+20>>2]=z.getFullYear()-1900,E[D+24>>2]=z.getDay(),E[D+28>>2]=ut(Ve(z.getFullYear())?Kr:ot,z.getMonth()-1)+z.getDate()-1,E[D+32>>2]=0,g+wr(t[0]).length-1}return 0}function Jt(g){return Ge.shutdownSocket(g,2)}function Ut(g,k,D){if(typeof Asyncify>"u")return 0;let _=1,u=2,c=4,m=8,y=16,b=32;return Asyncify.handleSleep(d=>{let p=Ie(g);if(!p){d(0);return}let n=[],r=new Set;if(k&_||k&u){if(p.server){for(let l of p.pending)if((l.recv_queue||[]).length>0){d(1);return}}else if((p.recv_queue||[]).length>0){d(1);return}}let e=Ge.getAllWebSockets(p);if(!e.length){d(0);return}for(let l of e)(k&_||k&u)&&(n.push(Ge.awaitData(l)),r.add("POLLIN")),k&c&&(n.push(Ge.awaitConnection(l)),r.add("POLLOUT")),k&y&&(n.push(Ge.awaitClose(l)),r.add("POLLHUP")),(k&m||k&b)&&(n.push(Ge.awaitError(l)),r.add("POLLERR"));if(n.length===0){console.warn("Unsupported poll event "+k+", defaulting to setTimeout()."),setTimeout(function(){d(0)},D);return}let o=n.map(([l])=>l),t=()=>n.forEach(([,l])=>l()),a=!1;Promise.race(o).then(function(l){a||(a=!0,d(1),clearTimeout(s),t())});let s=setTimeout(function(){a||(a=!0,d(0),t())},D)})}function Xr(g,k,D,_,u){let c=le[_];if(!(k===1&&D===9||k===6&&D===1))return console.warn(`Unsupported socket option: ${k}, ${D}, ${c}`),-1;let n=Ge.getAllWebSockets(g)[0];return n?(n.setSocketOpt(k,D,_),0):-1}function $r(g,k){return Ge.shutdownSocket(g,k)}function En(g){var k=f["_"+g];return k}function ti(g,k,D,_,u){var c={string:o=>{var t=0;if(o!=null&&o!==0){var a=(o.length<<2)+1;t=cr(a),Fe(o,t,a)}return t},array:o=>{var t=cr(o.length);return Et(o,t),t}};function m(o){return k==="string"?ne(o):k==="boolean"?!!o:o}var y=En(g),b=[],d=0;if(_)for(var p=0;p<_.length;p++){var n=c[D[p]];n?(d===0&&(d=ur()),b[p]=n(_[p])):b[p]=_[p]}var r=y.apply(null,b);function e(o){return d!==0&&fr(d),m(o)}return r=e(r),r}var wn=function(g,k,D,_){g||(g=this),this.parent=g,this.mount=g.mount,this.mounted=null,this.id=v.nextInode++,this.name=k,this.mode=D,this.node_ops={},this.stream_ops={},this.rdev=_},on=365,Qt=146;Object.defineProperties(wn.prototype,{read:{get:function(){return(this.mode&on)===on},set:function(g){g?this.mode|=on:this.mode&=~on}},write:{get:function(){return(this.mode&Qt)===Qt},set:function(g){g?this.mode|=Qt:this.mode&=~Qt}},isFolder:{get:function(){return v.isDir(this.mode)}},isDevice:{get:function(){return v.isChrdev(this.mode)}}}),v.FSNode=wn,v.staticInit(),f.FS_createPath=v.createPath,f.FS_createDataFile=v.createDataFile,f.FS_createPreloadedFile=v.createPreloadedFile,f.FS_unlink=v.unlink,f.FS_createLazyFile=v.createLazyFile,f.FS_createDevice=v.createDevice,te&&(yr(),C.staticInit()),i={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};var Dn={k:to,Wa:no,Va:ke,Ua:kn,Ta:oo,Sa:io,O:ao,Ra:so,Qa:uo,Pa:_n,Oa:fo,T:co,Na:lo,Ma:qt,N:_o,o:mo,La:vo,Ka:po,S:ho,Ja:yo,Ia:Eo,Ha:wo,Ga:go,Fa:So,M:bo,Ea:ko,Da:ae,Ca:Oo,Ba:kr,w:Do,Aa:No,za:To,ya:Ao,xa:Fo,wa:Co,L:Po,va:Ro,K:Mo,ua:jr,ta:Lo,sa:mn,D:Vt,ra:Fn,na:Uo,ma:Io,la:Bo,ka:zo,ja:Ho,ia:Wo,ha:Gt,ga:Yo,fa:rt,ea:jo,da:Rt,m:tt,B:qo,ca:Vo,A:Mt,ba:it,aa:Or,$:at,qa:Cn,pa:Ko,p:Zo,s:$o,J:Jo,I:ei,R:nn,C:Rn,_:ri,H:hn,G:bt,Z:$t,F:yn,Y:hr,X:tr,h:Bt,d:zt,b:lr,f:jt,g:Ht,u:Bn,r:He,v:di,W:In,e:Yt,a:xe,c:Wt,z:Tn,j:xt,l:kt,n:Nn,i:fn,V:_i,y:li,U:Xe,oa:pn,E:Ot,Q:Dt,t:Jt,x:Ut,q:Xr,P:$r},gn=ro(),Tt=f.___wasm_call_ctors=function(){return(Tt=f.___wasm_call_ctors=f.asm.Ya).apply(null,arguments)},Jr=f._wasm_popen=function(){return(Jr=f._wasm_popen=f.asm.Za).apply(null,arguments)},mr=f.___errno_location=function(){return(mr=f.___errno_location=f.asm._a).apply(null,arguments)},Qr=f._wasm_pclose=function(){return(Qr=f._wasm_pclose=f.asm.$a).apply(null,arguments)},It=f._php_pollfd_for=function(){return(It=f._php_pollfd_for=f.asm.ab).apply(null,arguments)},zr=f._wasm_select=function(){return(zr=f._wasm_select=f.asm.bb).apply(null,arguments)},Nt=f._wasm_add_cli_arg=function(){return(Nt=f._wasm_add_cli_arg=f.asm.cb).apply(null,arguments)},Dr=f._malloc=function(){return(Dr=f._malloc=f.asm.db).apply(null,arguments)},At=f._run_cli=function(){return(At=f._run_cli=f.asm.eb).apply(null,arguments)},an=f._memcpy=function(){return(an=f._memcpy=f.asm.fb).apply(null,arguments)},Br=f._free=function(){return(Br=f._free=f.asm.gb).apply(null,arguments)},Vr=f._fflush=function(){return(Vr=f._fflush=f.asm.ib).apply(null,arguments)},Ft=f._htons=function(){return(Ft=f._htons=f.asm.jb).apply(null,arguments)},sn=f._ntohs=function(){return(sn=f._ntohs=f.asm.kb).apply(null,arguments)},en=f._htonl=function(){return(en=f._htonl=f.asm.lb).apply(null,arguments)},un=f._wasm_set_phpini_path=function(){return(un=f._wasm_set_phpini_path=f.asm.mb).apply(null,arguments)},rn=f._wasm_set_phpini_entries=function(){return(rn=f._wasm_set_phpini_entries=f.asm.nb).apply(null,arguments)},tn=f._wasm_add_SERVER_entry=function(){return(tn=f._wasm_add_SERVER_entry=f.asm.ob).apply(null,arguments)},Sn=f._wasm_add_uploaded_file=function(){return(Sn=f._wasm_add_uploaded_file=f.asm.pb).apply(null,arguments)},ni=f._wasm_set_query_string=function(){return(ni=f._wasm_set_query_string=f.asm.qb).apply(null,arguments)},oi=f._wasm_set_path_translated=function(){return(oi=f._wasm_set_path_translated=f.asm.rb).apply(null,arguments)},ii=f._wasm_set_skip_shebang=function(){return(ii=f._wasm_set_skip_shebang=f.asm.sb).apply(null,arguments)},ai=f._wasm_set_request_uri=function(){return(ai=f._wasm_set_request_uri=f.asm.tb).apply(null,arguments)},si=f._wasm_set_request_method=function(){return(si=f._wasm_set_request_method=f.asm.ub).apply(null,arguments)},ui=f._wasm_set_request_host=function(){return(ui=f._wasm_set_request_host=f.asm.vb).apply(null,arguments)},fi=f._wasm_set_content_type=function(){return(fi=f._wasm_set_content_type=f.asm.wb).apply(null,arguments)},ci=f._wasm_set_request_body=function(){return(ci=f._wasm_set_request_body=f.asm.xb).apply(null,arguments)},Ln=f._wasm_set_content_length=function(){return(Ln=f._wasm_set_content_length=f.asm.yb).apply(null,arguments)},Un=f._wasm_set_cookies=function(){return(Un=f._wasm_set_cookies=f.asm.zb).apply(null,arguments)},Cr=f._wasm_set_php_code=function(){return(Cr=f._wasm_set_php_code=f.asm.Ab).apply(null,arguments)},Sr=f._wasm_set_request_port=function(){return(Sr=f._wasm_set_request_port=f.asm.Bb).apply(null,arguments)},br=f._phpwasm_init_uploaded_files_hash=function(){return(br=f._phpwasm_init_uploaded_files_hash=f.asm.Cb).apply(null,arguments)},Te=f._phpwasm_register_uploaded_file=function(){return(Te=f._phpwasm_register_uploaded_file=f.asm.Db).apply(null,arguments)},De=f._phpwasm_destroy_uploaded_files_hash=function(){return(De=f._phpwasm_destroy_uploaded_files_hash=f.asm.Eb).apply(null,arguments)},ye=f._wasm_sapi_handle_request=function(){return(ye=f._wasm_sapi_handle_request=f.asm.Fb).apply(null,arguments)},sr=f._php_wasm_init=function(){return(sr=f._php_wasm_init=f.asm.Gb).apply(null,arguments)},Ye=f.___funcs_on_exit=function(){return(Ye=f.___funcs_on_exit=f.asm.Hb).apply(null,arguments)},vr=f._emscripten_builtin_memalign=function(){return(vr=f._emscripten_builtin_memalign=f.asm.Ib).apply(null,arguments)},Be=f._setThrew=function(){return(Be=f._setThrew=f.asm.Jb).apply(null,arguments)},ur=f.stackSave=function(){return(ur=f.stackSave=f.asm.Kb).apply(null,arguments)},fr=f.stackRestore=function(){return(fr=f.stackRestore=f.asm.Lb).apply(null,arguments)},cr=f.stackAlloc=function(){return(cr=f.stackAlloc=f.asm.Mb).apply(null,arguments)};function He(g,k,D,_,u,c,m){var y=ur();try{return Y(g)(k,D,_,u,c,m)}catch(b){if(fr(y),b!==b+0)throw b;Be(1,0)}}function xe(g,k){var D=ur();try{Y(g)(k)}catch(_){if(fr(D),_!==_+0)throw _;Be(1,0)}}function lr(g,k,D){var _=ur();try{return Y(g)(k,D)}catch(u){if(fr(_),u!==u+0)throw u;Be(1,0)}}function kt(g,k,D,_,u){var c=ur();try{Y(g)(k,D,_,u)}catch(m){if(fr(c),m!==m+0)throw m;Be(1,0)}}function Bt(g){var k=ur();try{return Y(g)()}catch(D){if(fr(k),D!==D+0)throw D;Be(1,0)}}function xt(g,k,D,_){var u=ur();try{Y(g)(k,D,_)}catch(c){if(fr(u),c!==c+0)throw c;Be(1,0)}}function zt(g,k){var D=ur();try{return Y(g)(k)}catch(_){if(fr(D),_!==_+0)throw _;Be(1,0)}}function Ht(g,k,D,_,u){var c=ur();try{return Y(g)(k,D,_,u)}catch(m){if(fr(c),m!==m+0)throw m;Be(1,0)}}function Wt(g,k,D){var _=ur();try{Y(g)(k,D)}catch(u){if(fr(_),u!==u+0)throw u;Be(1,0)}}function Yt(g){var k=ur();try{Y(g)()}catch(D){if(fr(k),D!==D+0)throw D;Be(1,0)}}function jt(g,k,D,_){var u=ur();try{return Y(g)(k,D,_)}catch(c){if(fr(u),c!==c+0)throw c;Be(1,0)}}function fn(g,k,D,_,u,c,m){var y=ur();try{Y(g)(k,D,_,u,c,m)}catch(b){if(fr(y),b!==b+0)throw b;Be(1,0)}}function Nn(g,k,D,_,u,c){var m=ur();try{Y(g)(k,D,_,u,c)}catch(y){if(fr(m),y!==y+0)throw y;Be(1,0)}}function Tn(g,k,D,_,u,c){var m=ur();try{Y(g)(k,D,_,u,c)}catch(y){if(fr(m),y!==y+0)throw y;Be(1,0)}}function In(g,k,D,_,u,c,m,y,b,d){var p=ur();try{return Y(g)(k,D,_,u,c,m,y,b,d)}catch(n){if(fr(p),n!==n+0)throw n;Be(1,0)}}function Bn(g,k,D,_,u,c){var m=ur();try{return Y(g)(k,D,_,u,c)}catch(y){if(fr(m),y!==y+0)throw y;Be(1,0)}}function li(g,k,D,_,u,c,m,y,b,d){var p=ur();try{Y(g)(k,D,_,u,c,m,y,b,d)}catch(n){if(fr(p),n!==n+0)throw n;Be(1,0)}}function di(g,k,D,_,u,c,m,y){var b=ur();try{return Y(g)(k,D,_,u,c,m,y)}catch(d){if(fr(b),d!==d+0)throw d;Be(1,0)}}function _i(g,k,D,_,u,c,m,y){var b=ur();try{Y(g)(k,D,_,u,c,m,y)}catch(d){if(fr(b),d!==d+0)throw d;Be(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=v.createPath,f.FS_createDataFile=v.createDataFile,f.FS_createPreloadedFile=v.createPreloadedFile,f.FS_createLazyFile=v.createLazyFile,f.FS_createDevice=v.createDevice,f.FS_unlink=v.unlink,f.ccall=ti,f.FS=v;var bn;$e=function g(){bn||xn(),bn||($e=g)};function xn(g){if(g=g||$,Pe>0||(Vn(),Pe>0))return;function k(){bn||(bn=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),k()},1)):k()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return xn(),A}var Uf,Zs,Js=Oi(()=>{"use strict";Uf=10015235,Zs=__dirname+"/php_8_0.wasm"});var eu={};gi(eu,{default:()=>xf,dependenciesTotalSize:()=>Bf,dependencyFilename:()=>Qs});function xf(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(t,a)=>{throw a},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(t){return f.locateFile?f.locateFile(t,ve):ve+t}var We,ar,Re;function Wr(t){if(t instanceof Ur)return;fe("exiting due to exception: "+t)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(t,a)=>(yr(),t=Me.normalize(t),J.readFileSync(t,a?void 0:"utf8")),Re=t=>{var a=We(t,!0);return a.buffer||(a=new Uint8Array(a)),a},ar=(t,a,s)=>{yr(),t=Me.normalize(t),J.readFile(t,function(l,h){l?s(l):a(h.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(t){if(!(t instanceof Ur))throw t}),process.on("unhandledRejection",function(t){throw t}),_e=(t,a)=>{if(Mr())throw process.exitCode=t,a;Wr(a),process.exit(t)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(t,a){t||me(a)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(t,a,s){for(var l=a+s,h=a;t[h]&&!(h>=l);)++h;if(h-a>16&&t.buffer&&ct)return ct.decode(t.subarray(a,h));for(var w="";a<h;){var S=t[a++];if(!(S&128)){w+=String.fromCharCode(S);continue}var O=t[a++]&63;if((S&224)==192){w+=String.fromCharCode((S&31)<<6|O);continue}var N=t[a++]&63;if((S&240)==224?S=(S&15)<<12|O<<6|N:S=(S&7)<<18|O<<12|N<<6|t[a++]&63,S<65536)w+=String.fromCharCode(S);else{var T=S-65536;w+=String.fromCharCode(55296|T>>10,56320|T&1023)}}return w}function ne(t,a){return t?ze(le,t,a):""}function Ze(t,a,s,l){if(!(l>0))return 0;for(var h=s,w=s+l-1,S=0;S<t.length;++S){var O=t.charCodeAt(S);if(O>=55296&&O<=57343){var N=t.charCodeAt(++S);O=65536+((O&1023)<<10)|N&1023}if(O<=127){if(s>=w)break;a[s++]=O}else if(O<=2047){if(s+1>=w)break;a[s++]=192|O>>6,a[s++]=128|O&63}else if(O<=65535){if(s+2>=w)break;a[s++]=224|O>>12,a[s++]=128|O>>6&63,a[s++]=128|O&63}else{if(s+3>=w)break;a[s++]=240|O>>18,a[s++]=128|O>>12&63,a[s++]=128|O>>6&63,a[s++]=128|O&63}}return a[s]=0,s-h}function Fe(t,a,s){return Ze(t,le,a,s)}function Ce(t){for(var a=0,s=0;s<t.length;++s){var l=t.charCodeAt(s);l<=127?a++:l<=2047?a+=2:l>=55296&&l<=57343?(a+=4,++s):a+=3}return a}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(t){Rr=t,f.HEAP8=ee=new Int8Array(t),f.HEAP16=we=new Int16Array(t),f.HEAP32=E=new Int32Array(t),f.HEAPU8=le=new Uint8Array(t),f.HEAPU16=lt=new Uint16Array(t),f.HEAPU32=j=new Uint32Array(t),f.HEAPF32=Hn=new Float32Array(t),f.HEAPF64=dt=new Float64Array(t)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!i.init.initialized&&i.init(),i.ignorePermissions=!1,ge.init(),H.root=i.mount(H,{},null),kr.root=i.mount(kr,{},null),_r(vt)}function Kn(){ye(),_r(Wn),i.quit(),ge.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(t){mt.unshift(t)}function $n(t){vt.unshift(t)}function Jn(t){pt.unshift(t)}var Pe=0,Lr=null,$e=null;function Ci(t){return t}function dr(t){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(t){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var a=$e;$e=null,a()}}function me(t){f.onAbort&&f.onAbort(t),t="Aborted("+t+")",fe(t),Tr=!0,Pr=1,t+=". Build with -sASSERTIONS for more info.";var a=new WebAssembly.RuntimeError(t);throw a}var Qn="data:application/octet-stream;base64,";function ht(t){return t.startsWith(Qn)}var de;de=Qs,ht(de)||(de=Nr(de));function yt(t){try{if(t==de&&qe)return new Uint8Array(qe);if(Re)return Re(t);throw"both async and sync fetching of the wasm failed"}catch(a){me(a)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+de+"'";return t.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var t={a:on};function a(S,O){var N=S.exports;f.asm=N,ir=f.asm.Wa,_t(ir.buffer),ln=f.asm.gb,$n(f.asm.Xa),Je("wasm-instantiate")}dr("wasm-instantiate");function s(S){a(S.instance)}function l(S){return eo().then(function(O){return WebAssembly.instantiate(O,t)}).then(function(O){return O}).then(S,function(O){fe("failed to asynchronously prepare wasm: "+O),me(O)})}function h(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(S){var O=WebAssembly.instantiateStreaming(S,t);return O.then(s,function(N){return fe("wasm streaming compile failed: "+N),fe("falling back to ArrayBuffer instantiation"),l(s)})}):l(s)}if(f.instantiateWasm)try{var w=f.instantiateWasm(t,a);return w}catch(S){return fe("Module.instantiateWasm callback failed with error: "+S),!1}return h(),{}}var U,Z;function Ur(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function _r(t){for(;t.length>0;)t.shift()(f)}function Et(t,a){ee.set(t,a)}function to(t,a,s,l){me("Assertion failed: "+ne(t)+", at: "+[a?ne(a):"unknown filename",s,l?ne(l):"unknown function"])}function wt(t,a){(function(s){fr.apply(null,[t,s])})(a)}var Y={isAbs:t=>t.charAt(0)==="/",splitPath:t=>{var a=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return a.exec(t).slice(1)},normalizeArray:(t,a)=>{for(var s=0,l=t.length-1;l>=0;l--){var h=t[l];h==="."?t.splice(l,1):h===".."?(t.splice(l,1),s++):s&&(t.splice(l,1),s--)}if(a)for(;s;s--)t.unshift("..");return t},normalize:t=>{var a=Y.isAbs(t),s=t.substr(-1)==="/";return t=Y.normalizeArray(t.split("/").filter(l=>!!l),!a).join("/"),!t&&!a&&(t="."),t&&s&&(t+="/"),(a?"/":"")+t},dirname:t=>{var a=Y.splitPath(t),s=a[0],l=a[1];return!s&&!l?".":(l&&(l=l.substr(0,l.length-1)),s+l)},basename:t=>{if(t==="/")return"/";t=Y.normalize(t),t=t.replace(/\/$/,"");var a=t.lastIndexOf("/");return a===-1?t:t.substr(a+1)},join:function(){var t=Array.prototype.slice.call(arguments);return Y.normalize(t.join("/"))},join2:(t,a)=>Y.normalize(t+"/"+a)};function no(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}else if(te)try{var a=require("crypto");return()=>a.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var Q={resolve:function(){for(var t="",a=!1,s=arguments.length-1;s>=-1&&!a;s--){var l=s>=0?arguments[s]:i.cwd();if(typeof l!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!l)return"";t=l+"/"+t,a=Y.isAbs(l)}return t=Y.normalizeArray(t.split("/").filter(h=>!!h),!a).join("/"),(a?"/":"")+t||"."},relative:(t,a)=>{t=Q.resolve(t).substr(1),a=Q.resolve(a).substr(1);function s(T){for(var F=0;F<T.length&&T[F]==="";F++);for(var L=T.length-1;L>=0&&T[L]==="";L--);return F>L?[]:T.slice(F,L-F+1)}for(var l=s(t.split("/")),h=s(a.split("/")),w=Math.min(l.length,h.length),S=w,O=0;O<w;O++)if(l[O]!==h[O]){S=O;break}for(var N=[],O=S;O<l.length;O++)N.push("..");return N=N.concat(h.slice(S)),N.join("/")}};function Er(t,a,s){var l=s>0?s:Ce(t)+1,h=new Array(l),w=Ze(t,h,0,h.length);return a&&(h.length=w),h}var ge={ttys:[],init:function(){},shutdown:function(){},register:function(t,a){ge.ttys[t]={input:[],output:[],ops:a},i.registerDevice(t,ge.stream_ops)},stream_ops:{open:function(t){var a=ge.ttys[t.node.rdev];if(!a)throw new i.ErrnoError(43);t.tty=a,t.seekable=!1},close:function(t){t.tty.ops.fsync(t.tty)},fsync:function(t){t.tty.ops.fsync(t.tty)},read:function(t,a,s,l,h){if(!t.tty||!t.tty.ops.get_char)throw new i.ErrnoError(60);for(var w=0,S=0;S<l;S++){var O;try{O=t.tty.ops.get_char(t.tty)}catch{throw new i.ErrnoError(29)}if(O===void 0&&w===0)throw new i.ErrnoError(6);if(O==null)break;w++,a[s+S]=O}return w&&(t.node.timestamp=Date.now()),w},write:function(t,a,s,l,h){if(!t.tty||!t.tty.ops.put_char)throw new i.ErrnoError(60);try{for(var w=0;w<l;w++)t.tty.ops.put_char(t.tty,a[s+w])}catch{throw new i.ErrnoError(29)}return l&&(t.node.timestamp=Date.now()),w}},default_tty_ops:{get_char:function(t){if(!t.input.length){var a=null;if(te){var s=256,l=Buffer.alloc(s),h=0;try{h=J.readSync(process.stdin.fd,l,0,s,-1)}catch(w){if(w.toString().includes("EOF"))h=0;else throw w}h>0?a=l.slice(0,h).toString("utf-8"):a=null}else typeof window<"u"&&typeof window.prompt=="function"?(a=window.prompt("Input: "),a!==null&&(a+=`
17
+ `)):typeof readline=="function"&&(a=readline(),a!==null&&(a+=`
18
+ `));if(!a)return null;t.input=Er(a,!0)}return t.input.shift()},put_char:function(t,a){a===null||a===10?(er(ze(t.output,0)),t.output=[]):a!=0&&t.output.push(a)},fsync:function(t){t.output&&t.output.length>0&&(er(ze(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,a){a===null||a===10?(fe(ze(t.output,0)),t.output=[]):a!=0&&t.output.push(a)},fsync:function(t){t.output&&t.output.length>0&&(fe(ze(t.output,0)),t.output=[])}}};function wr(t,a){return le.fill(0,t,t+a),t}function gr(t,a){return Math.ceil(t/a)*a}function Ir(t){t=gr(t,65536);var a=sr(65536,t);return a?wr(a,t):0}var G={ops_table:null,mount:function(t){return G.createNode(null,"/",16895,0)},createNode:function(t,a,s,l){if(i.isBlkdev(s)||i.isFIFO(s))throw new i.ErrnoError(63);G.ops_table||(G.ops_table={dir:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,lookup:G.node_ops.lookup,mknod:G.node_ops.mknod,rename:G.node_ops.rename,unlink:G.node_ops.unlink,rmdir:G.node_ops.rmdir,readdir:G.node_ops.readdir,symlink:G.node_ops.symlink},stream:{llseek:G.stream_ops.llseek}},file:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:{llseek:G.stream_ops.llseek,read:G.stream_ops.read,write:G.stream_ops.write,allocate:G.stream_ops.allocate,mmap:G.stream_ops.mmap,msync:G.stream_ops.msync}},link:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,readlink:G.node_ops.readlink},stream:{}},chrdev:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:i.chrdev_stream_ops}});var h=i.createNode(t,a,s,l);return i.isDir(h.mode)?(h.node_ops=G.ops_table.dir.node,h.stream_ops=G.ops_table.dir.stream,h.contents={}):i.isFile(h.mode)?(h.node_ops=G.ops_table.file.node,h.stream_ops=G.ops_table.file.stream,h.usedBytes=0,h.contents=null):i.isLink(h.mode)?(h.node_ops=G.ops_table.link.node,h.stream_ops=G.ops_table.link.stream):i.isChrdev(h.mode)&&(h.node_ops=G.ops_table.chrdev.node,h.stream_ops=G.ops_table.chrdev.stream),h.timestamp=Date.now(),t&&(t.contents[a]=h,t.timestamp=h.timestamp),h},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,a){var s=t.contents?t.contents.length:0;if(!(s>=a)){var l=1024*1024;a=Math.max(a,s*(s<l?2:1.125)>>>0),s!=0&&(a=Math.max(a,256));var h=t.contents;t.contents=new Uint8Array(a),t.usedBytes>0&&t.contents.set(h.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,a){if(t.usedBytes!=a)if(a==0)t.contents=null,t.usedBytes=0;else{var s=t.contents;t.contents=new Uint8Array(a),s&&t.contents.set(s.subarray(0,Math.min(a,t.usedBytes))),t.usedBytes=a}},node_ops:{getattr:function(t){var a={};return a.dev=i.isChrdev(t.mode)?t.id:1,a.ino=t.id,a.mode=t.mode,a.nlink=1,a.uid=0,a.gid=0,a.rdev=t.rdev,i.isDir(t.mode)?a.size=4096:i.isFile(t.mode)?a.size=t.usedBytes:i.isLink(t.mode)?a.size=t.link.length:a.size=0,a.atime=new Date(t.timestamp),a.mtime=new Date(t.timestamp),a.ctime=new Date(t.timestamp),a.blksize=4096,a.blocks=Math.ceil(a.size/a.blksize),a},setattr:function(t,a){a.mode!==void 0&&(t.mode=a.mode),a.timestamp!==void 0&&(t.timestamp=a.timestamp),a.size!==void 0&&G.resizeFileStorage(t,a.size)},lookup:function(t,a){throw i.genericErrors[44]},mknod:function(t,a,s,l){return G.createNode(t,a,s,l)},rename:function(t,a,s){if(i.isDir(t.mode)){var l;try{l=i.lookupNode(a,s)}catch{}if(l)for(var h in l.contents)throw new i.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=s,a.contents[s]=t,a.timestamp=t.parent.timestamp,t.parent=a},unlink:function(t,a){delete t.contents[a],t.timestamp=Date.now()},rmdir:function(t,a){var s=i.lookupNode(t,a);for(var l in s.contents)throw new i.ErrnoError(55);delete t.contents[a],t.timestamp=Date.now()},readdir:function(t){var a=[".",".."];for(var s in t.contents)t.contents.hasOwnProperty(s)&&a.push(s);return a},symlink:function(t,a,s){var l=G.createNode(t,a,41471,0);return l.link=s,l},readlink:function(t){if(!i.isLink(t.mode))throw new i.ErrnoError(28);return t.link}},stream_ops:{read:function(t,a,s,l,h){var w=t.node.contents;if(h>=t.node.usedBytes)return 0;var S=Math.min(t.node.usedBytes-h,l);if(S>8&&w.subarray)a.set(w.subarray(h,h+S),s);else for(var O=0;O<S;O++)a[s+O]=w[h+O];return S},write:function(t,a,s,l,h,w){if(a.buffer===ee.buffer&&(w=!1),!l)return 0;var S=t.node;if(S.timestamp=Date.now(),a.subarray&&(!S.contents||S.contents.subarray)){if(w)return S.contents=a.subarray(s,s+l),S.usedBytes=l,l;if(S.usedBytes===0&&h===0)return S.contents=a.slice(s,s+l),S.usedBytes=l,l;if(h+l<=S.usedBytes)return S.contents.set(a.subarray(s,s+l),h),l}if(G.expandFileStorage(S,h+l),S.contents.subarray&&a.subarray)S.contents.set(a.subarray(s,s+l),h);else for(var O=0;O<l;O++)S.contents[h+O]=a[s+O];return S.usedBytes=Math.max(S.usedBytes,h+l),l},llseek:function(t,a,s){var l=a;if(s===1?l+=t.position:s===2&&i.isFile(t.node.mode)&&(l+=t.node.usedBytes),l<0)throw new i.ErrnoError(28);return l},allocate:function(t,a,s){G.expandFileStorage(t.node,a+s),t.node.usedBytes=Math.max(t.node.usedBytes,a+s)},mmap:function(t,a,s,l,h){if(!i.isFile(t.node.mode))throw new i.ErrnoError(43);var w,S,O=t.node.contents;if(!(h&2)&&O.buffer===Rr)S=!1,w=O.byteOffset;else{if((s>0||s+a<O.length)&&(O.subarray?O=O.subarray(s,s+a):O=Array.prototype.slice.call(O,s,s+a)),S=!0,w=Ir(a),!w)throw new i.ErrnoError(48);ee.set(O,w)}return{ptr:w,allocated:S}},msync:function(t,a,s,l,h){return G.stream_ops.write(t,a,0,l,s,!1),0}}};function Ct(t,a,s,l){var h=l?"":"al "+t;ar(t,w=>{Le(w,'Loading data file "'+t+'" failed (no arrayBuffer).'),a(new Uint8Array(w)),h&&Je(h)},w=>{if(s)s();else throw'Loading data file "'+t+'" failed.'}),h&&dr(h)}var re={},V={isWindows:!1,staticInit:()=>{V.isWindows=!!process.platform.match(/^win/);var t=process.binding("constants");t.fs&&(t=t.fs),V.flagsForNodeMap={1024:t.O_APPEND,64:t.O_CREAT,128:t.O_EXCL,256:t.O_NOCTTY,0:t.O_RDONLY,2:t.O_RDWR,4096:t.O_SYNC,512:t.O_TRUNC,1:t.O_WRONLY,131072:t.O_NOFOLLOW}},convertNodeCode:t=>{var a=t.code;return re[a]},mount:t=>V.createNode(null,"/",V.getMode(t.opts.root),0),createNode:(t,a,s,l)=>{if(!i.isDir(s)&&!i.isFile(s)&&!i.isLink(s))throw new i.ErrnoError(28);var h=i.createNode(t,a,s);return h.node_ops=V.node_ops,h.stream_ops=V.stream_ops,h},getMode:t=>{var a;try{a=J.lstatSync(t),V.isWindows&&(a.mode=a.mode|(a.mode&292)>>2)}catch(s){throw s.code?new i.ErrnoError(V.convertNodeCode(s)):s}return a.mode},realPath:t=>{for(var a=[];t.parent!==t;)a.push(t.name),t=t.parent;return a.push(t.mount.opts.root),a.reverse(),Y.join.apply(null,a)},flagsForNode:t=>{t&=-2097153,t&=-2049,t&=-32769,t&=-524289,t&=-65537;var a=0;for(var s in V.flagsForNodeMap)t&s&&(a|=V.flagsForNodeMap[s],t^=s);if(t)throw new i.ErrnoError(28);return a},node_ops:{getattr:t=>{var a=V.realPath(t),s;try{s=J.lstatSync(a)}catch(l){throw l.code?new i.ErrnoError(V.convertNodeCode(l)):l}return V.isWindows&&!s.blksize&&(s.blksize=4096),V.isWindows&&!s.blocks&&(s.blocks=(s.size+s.blksize-1)/s.blksize|0),{dev:s.dev,ino:s.ino,mode:s.mode,nlink:s.nlink,uid:s.uid,gid:s.gid,rdev:s.rdev,size:s.size,atime:s.atime,mtime:s.mtime,ctime:s.ctime,blksize:s.blksize,blocks:s.blocks}},setattr:(t,a)=>{var s=V.realPath(t);try{if(a.mode!==void 0&&(J.chmodSync(s,a.mode),t.mode=a.mode),a.timestamp!==void 0){var l=new Date(a.timestamp);J.utimesSync(s,l,l)}a.size!==void 0&&J.truncateSync(s,a.size)}catch(h){throw h.code?new i.ErrnoError(V.convertNodeCode(h)):h}},lookup:(t,a)=>{var s=Y.join2(V.realPath(t),a),l=V.getMode(s);return V.createNode(t,a,l)},mknod:(t,a,s,l)=>{var h=V.createNode(t,a,s,l),w=V.realPath(h);try{i.isDir(h.mode)?J.mkdirSync(w,h.mode):J.writeFileSync(w,"",{mode:h.mode})}catch(S){throw S.code?new i.ErrnoError(V.convertNodeCode(S)):S}return h},rename:(t,a,s)=>{var l=V.realPath(t),h=Y.join2(V.realPath(a),s);try{J.renameSync(l,h)}catch(w){throw w.code?new i.ErrnoError(V.convertNodeCode(w)):w}t.name=s},unlink:(t,a)=>{var s=Y.join2(V.realPath(t),a);try{J.unlinkSync(s)}catch(l){throw l.code?new i.ErrnoError(V.convertNodeCode(l)):l}},rmdir:(t,a)=>{var s=Y.join2(V.realPath(t),a);try{J.rmdirSync(s)}catch(l){throw l.code?new i.ErrnoError(V.convertNodeCode(l)):l}},readdir:t=>{var a=V.realPath(t);try{return J.readdirSync(a)}catch(s){throw s.code?new i.ErrnoError(V.convertNodeCode(s)):s}},symlink:(t,a,s)=>{var l=Y.join2(V.realPath(t),a);try{J.symlinkSync(s,l)}catch(h){throw h.code?new i.ErrnoError(V.convertNodeCode(h)):h}},readlink:t=>{var a=V.realPath(t);try{return a=J.readlinkSync(a),a=Me.relative(Me.resolve(t.mount.opts.root),a),a}catch(s){throw s.code?s.code==="UNKNOWN"?new i.ErrnoError(28):new i.ErrnoError(V.convertNodeCode(s)):s}}},stream_ops:{open:t=>{var a=V.realPath(t.node);try{i.isFile(t.node.mode)&&(t.nfd=J.openSync(a,V.flagsForNode(t.flags)))}catch(s){throw s.code?new i.ErrnoError(V.convertNodeCode(s)):s}},close:t=>{try{i.isFile(t.node.mode)&&t.nfd&&J.closeSync(t.nfd)}catch(a){throw a.code?new i.ErrnoError(V.convertNodeCode(a)):a}},read:(t,a,s,l,h)=>{if(l===0)return 0;try{return J.readSync(t.nfd,Buffer.from(a.buffer),s,l,h)}catch(w){throw new i.ErrnoError(V.convertNodeCode(w))}},write:(t,a,s,l,h)=>{try{return J.writeSync(t.nfd,Buffer.from(a.buffer),s,l,h)}catch(w){throw new i.ErrnoError(V.convertNodeCode(w))}},llseek:(t,a,s)=>{var l=a;if(s===1)l+=t.position;else if(s===2&&i.isFile(t.node.mode))try{var h=J.fstatSync(t.nfd);l+=h.size}catch(w){throw new i.ErrnoError(V.convertNodeCode(w))}if(l<0)throw new i.ErrnoError(28);return l},mmap:(t,a,s,l,h)=>{if(!i.isFile(t.node.mode))throw new i.ErrnoError(43);var w=Ir(a);return V.stream_ops.read(t,ee,w,a,s),{ptr:w,allocated:!0}},msync:(t,a,s,l,h)=>(V.stream_ops.write(t,a,0,l,s,!1),0)}},i={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,a={})=>{if(t=Q.resolve(i.cwd(),t),!t)return{path:"",node:null};var s={follow_mount:!0,recurse_count:0};if(a=Object.assign(s,a),a.recurse_count>8)throw new i.ErrnoError(32);for(var l=Y.normalizeArray(t.split("/").filter(L=>!!L),!1),h=i.root,w="/",S=0;S<l.length;S++){var O=S===l.length-1;if(O&&a.parent)break;if(h=i.lookupNode(h,l[S]),w=Y.join2(w,l[S]),i.isMountpoint(h)&&(!O||O&&a.follow_mount)&&(h=h.mounted.root),!O||a.follow)for(var N=0;i.isLink(h.mode);){var T=i.readlink(w);w=Q.resolve(Y.dirname(w),T);var F=i.lookupPath(w,{recurse_count:a.recurse_count+1});if(h=F.node,N++>40)throw new i.ErrnoError(32)}}return{path:w,node:h}},getPath:t=>{for(var a;;){if(i.isRoot(t)){var s=t.mount.mountpoint;return a?s[s.length-1]!=="/"?s+"/"+a:s+a:s}a=a?t.name+"/"+a:t.name,t=t.parent}},hashName:(t,a)=>{for(var s=0,l=0;l<a.length;l++)s=(s<<5)-s+a.charCodeAt(l)|0;return(t+s>>>0)%i.nameTable.length},hashAddNode:t=>{var a=i.hashName(t.parent.id,t.name);t.name_next=i.nameTable[a],i.nameTable[a]=t},hashRemoveNode:t=>{var a=i.hashName(t.parent.id,t.name);if(i.nameTable[a]===t)i.nameTable[a]=t.name_next;else for(var s=i.nameTable[a];s;){if(s.name_next===t){s.name_next=t.name_next;break}s=s.name_next}},lookupNode:(t,a)=>{var s=i.mayLookup(t);if(s)throw new i.ErrnoError(s,t);for(var l=i.hashName(t.id,a),h=i.nameTable[l];h;h=h.name_next){var w=h.name;if(h.parent.id===t.id&&w===a)return h}return i.lookup(t,a)},createNode:(t,a,s,l)=>{var h=new i.FSNode(t,a,s,l);return i.hashAddNode(h),h},destroyNode:t=>{i.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>(t&61440)===32768,isDir:t=>(t&61440)===16384,isLink:t=>(t&61440)===40960,isChrdev:t=>(t&61440)===8192,isBlkdev:t=>(t&61440)===24576,isFIFO:t=>(t&61440)===4096,isSocket:t=>(t&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:t=>{var a=i.flagModes[t];if(typeof a>"u")throw new Error("Unknown file open mode: "+t);return a},flagsToPermissionString:t=>{var a=["r","w","rw"][t&3];return t&512&&(a+="w"),a},nodePermissions:(t,a)=>i.ignorePermissions?0:a.includes("r")&&!(t.mode&292)||a.includes("w")&&!(t.mode&146)||a.includes("x")&&!(t.mode&73)?2:0,mayLookup:t=>{var a=i.nodePermissions(t,"x");return a||(t.node_ops.lookup?0:2)},mayCreate:(t,a)=>{try{var s=i.lookupNode(t,a);return 20}catch{}return i.nodePermissions(t,"wx")},mayDelete:(t,a,s)=>{var l;try{l=i.lookupNode(t,a)}catch(w){return w.errno}var h=i.nodePermissions(t,"wx");if(h)return h;if(s){if(!i.isDir(l.mode))return 54;if(i.isRoot(l)||i.getPath(l)===i.cwd())return 10}else if(i.isDir(l.mode))return 31;return 0},mayOpen:(t,a)=>t?i.isLink(t.mode)?32:i.isDir(t.mode)&&(i.flagsToPermissionString(a)!=="r"||a&512)?31:i.nodePermissions(t,i.flagsToPermissionString(a)):44,MAX_OPEN_FDS:4096,nextfd:(t=0,a=i.MAX_OPEN_FDS)=>{for(var s=t;s<=a;s++)if(!i.streams[s])return s;throw new i.ErrnoError(33)},getStream:t=>i.streams[t],createStream:(t,a,s)=>{i.FSStream||(i.FSStream=function(){this.shared={}},i.FSStream.prototype={},Object.defineProperties(i.FSStream.prototype,{object:{get:function(){return this.node},set:function(h){this.node=h}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(h){this.shared.flags=h}},position:{get:function(){return this.shared.position},set:function(h){this.shared.position=h}}})),t=Object.assign(new i.FSStream,t);var l=i.nextfd(a,s);return t.fd=l,i.streams[l]=t,t},closeStream:t=>{i.streams[t]=null},chrdev_stream_ops:{open:t=>{var a=i.getDevice(t.node.rdev);t.stream_ops=a.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new i.ErrnoError(70)}},major:t=>t>>8,minor:t=>t&255,makedev:(t,a)=>t<<8|a,registerDevice:(t,a)=>{i.devices[t]={stream_ops:a}},getDevice:t=>i.devices[t],getMounts:t=>{for(var a=[],s=[t];s.length;){var l=s.pop();a.push(l),s.push.apply(s,l.mounts)}return a},syncfs:(t,a)=>{typeof t=="function"&&(a=t,t=!1),i.syncFSRequests++,i.syncFSRequests>1&&fe("warning: "+i.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var s=i.getMounts(i.root.mount),l=0;function h(S){return i.syncFSRequests--,a(S)}function w(S){if(S)return w.errored?void 0:(w.errored=!0,h(S));++l>=s.length&&h(null)}s.forEach(S=>{if(!S.type.syncfs)return w(null);S.type.syncfs(S,t,w)})},mount:(t,a,s)=>{var l=s==="/",h=!s,w;if(l&&i.root)throw new i.ErrnoError(10);if(!l&&!h){var S=i.lookupPath(s,{follow_mount:!1});if(s=S.path,w=S.node,i.isMountpoint(w))throw new i.ErrnoError(10);if(!i.isDir(w.mode))throw new i.ErrnoError(54)}var O={type:t,opts:a,mountpoint:s,mounts:[]},N=t.mount(O);return N.mount=O,O.root=N,l?i.root=N:w&&(w.mounted=O,w.mount&&w.mount.mounts.push(O)),N},unmount:t=>{var a=i.lookupPath(t,{follow_mount:!1});if(!i.isMountpoint(a.node))throw new i.ErrnoError(28);var s=a.node,l=s.mounted,h=i.getMounts(l);Object.keys(i.nameTable).forEach(S=>{for(var O=i.nameTable[S];O;){var N=O.name_next;h.includes(O.mount)&&i.destroyNode(O),O=N}}),s.mounted=null;var w=s.mount.mounts.indexOf(l);s.mount.mounts.splice(w,1)},lookup:(t,a)=>t.node_ops.lookup(t,a),mknod:(t,a,s)=>{var l=i.lookupPath(t,{parent:!0}),h=l.node,w=Y.basename(t);if(!w||w==="."||w==="..")throw new i.ErrnoError(28);var S=i.mayCreate(h,w);if(S)throw new i.ErrnoError(S);if(!h.node_ops.mknod)throw new i.ErrnoError(63);return h.node_ops.mknod(h,w,a,s)},create:(t,a)=>(a=a!==void 0?a:438,a&=4095,a|=32768,i.mknod(t,a,0)),mkdir:(t,a)=>(a=a!==void 0?a:511,a&=1023,a|=16384,i.mknod(t,a,0)),mkdirTree:(t,a)=>{for(var s=t.split("/"),l="",h=0;h<s.length;++h)if(s[h]){l+="/"+s[h];try{i.mkdir(l,a)}catch(w){if(w.errno!=20)throw w}}},mkdev:(t,a,s)=>(typeof s>"u"&&(s=a,a=438),a|=8192,i.mknod(t,a,s)),symlink:(t,a)=>{if(!Q.resolve(t))throw new i.ErrnoError(44);var s=i.lookupPath(a,{parent:!0}),l=s.node;if(!l)throw new i.ErrnoError(44);var h=Y.basename(a),w=i.mayCreate(l,h);if(w)throw new i.ErrnoError(w);if(!l.node_ops.symlink)throw new i.ErrnoError(63);return l.node_ops.symlink(l,h,t)},rename:(t,a)=>{var s=Y.dirname(t),l=Y.dirname(a),h=Y.basename(t),w=Y.basename(a),S,O,N;if(S=i.lookupPath(t,{parent:!0}),O=S.node,S=i.lookupPath(a,{parent:!0}),N=S.node,!O||!N)throw new i.ErrnoError(44);if(O.mount!==N.mount)throw new i.ErrnoError(75);var T=i.lookupNode(O,h),F=Q.relative(t,l);if(F.charAt(0)!==".")throw new i.ErrnoError(28);if(F=Q.relative(a,s),F.charAt(0)!==".")throw new i.ErrnoError(55);var L;try{L=i.lookupNode(N,w)}catch{}if(T!==L){var R=i.isDir(T.mode),B=i.mayDelete(O,h,R);if(B)throw new i.ErrnoError(B);if(B=L?i.mayDelete(N,w,R):i.mayCreate(N,w),B)throw new i.ErrnoError(B);if(!O.node_ops.rename)throw new i.ErrnoError(63);if(i.isMountpoint(T)||L&&i.isMountpoint(L))throw new i.ErrnoError(10);if(N!==O&&(B=i.nodePermissions(O,"w"),B))throw new i.ErrnoError(B);i.hashRemoveNode(T);try{O.node_ops.rename(T,N,w)}catch(P){throw P}finally{i.hashAddNode(T)}}},rmdir:t=>{var a=i.lookupPath(t,{parent:!0}),s=a.node,l=Y.basename(t),h=i.lookupNode(s,l),w=i.mayDelete(s,l,!0);if(w)throw new i.ErrnoError(w);if(!s.node_ops.rmdir)throw new i.ErrnoError(63);if(i.isMountpoint(h))throw new i.ErrnoError(10);s.node_ops.rmdir(s,l),i.destroyNode(h)},readdir:t=>{var a=i.lookupPath(t,{follow:!0}),s=a.node;if(!s.node_ops.readdir)throw new i.ErrnoError(54);return s.node_ops.readdir(s)},unlink:t=>{var a=i.lookupPath(t,{parent:!0}),s=a.node;if(!s)throw new i.ErrnoError(44);var l=Y.basename(t),h=i.lookupNode(s,l),w=i.mayDelete(s,l,!1);if(w)throw new i.ErrnoError(w);if(!s.node_ops.unlink)throw new i.ErrnoError(63);if(i.isMountpoint(h))throw new i.ErrnoError(10);s.node_ops.unlink(s,l),i.destroyNode(h)},readlink:t=>{var a=i.lookupPath(t),s=a.node;if(!s)throw new i.ErrnoError(44);if(!s.node_ops.readlink)throw new i.ErrnoError(28);return Q.resolve(i.getPath(s.parent),s.node_ops.readlink(s))},stat:(t,a)=>{var s=i.lookupPath(t,{follow:!a}),l=s.node;if(!l)throw new i.ErrnoError(44);if(!l.node_ops.getattr)throw new i.ErrnoError(63);return l.node_ops.getattr(l)},lstat:t=>i.stat(t,!0),chmod:(t,a,s)=>{var l;if(typeof t=="string"){var h=i.lookupPath(t,{follow:!s});l=h.node}else l=t;if(!l.node_ops.setattr)throw new i.ErrnoError(63);l.node_ops.setattr(l,{mode:a&4095|l.mode&-4096,timestamp:Date.now()})},lchmod:(t,a)=>{i.chmod(t,a,!0)},fchmod:(t,a)=>{var s=i.getStream(t);if(!s)throw new i.ErrnoError(8);i.chmod(s.node,a)},chown:(t,a,s,l)=>{var h;if(typeof t=="string"){var w=i.lookupPath(t,{follow:!l});h=w.node}else h=t;if(!h.node_ops.setattr)throw new i.ErrnoError(63);h.node_ops.setattr(h,{timestamp:Date.now()})},lchown:(t,a,s)=>{i.chown(t,a,s,!0)},fchown:(t,a,s)=>{var l=i.getStream(t);if(!l)throw new i.ErrnoError(8);i.chown(l.node,a,s)},truncate:(t,a)=>{if(a<0)throw new i.ErrnoError(28);var s;if(typeof t=="string"){var l=i.lookupPath(t,{follow:!0});s=l.node}else s=t;if(!s.node_ops.setattr)throw new i.ErrnoError(63);if(i.isDir(s.mode))throw new i.ErrnoError(31);if(!i.isFile(s.mode))throw new i.ErrnoError(28);var h=i.nodePermissions(s,"w");if(h)throw new i.ErrnoError(h);s.node_ops.setattr(s,{size:a,timestamp:Date.now()})},ftruncate:(t,a)=>{var s=i.getStream(t);if(!s)throw new i.ErrnoError(8);if(!(s.flags&2097155))throw new i.ErrnoError(28);i.truncate(s.node,a)},utime:(t,a,s)=>{var l=i.lookupPath(t,{follow:!0}),h=l.node;h.node_ops.setattr(h,{timestamp:Math.max(a,s)})},open:(t,a,s)=>{if(t==="")throw new i.ErrnoError(44);a=typeof a=="string"?i.modeStringToFlags(a):a,s=typeof s>"u"?438:s,a&64?s=s&4095|32768:s=0;var l;if(typeof t=="object")l=t;else{t=Y.normalize(t);try{var h=i.lookupPath(t,{follow:!(a&131072)});l=h.node}catch{}}var w=!1;if(a&64)if(l){if(a&128)throw new i.ErrnoError(20)}else l=i.mknod(t,s,0),w=!0;if(!l)throw new i.ErrnoError(44);if(i.isChrdev(l.mode)&&(a&=-513),a&65536&&!i.isDir(l.mode))throw new i.ErrnoError(54);if(!w){var S=i.mayOpen(l,a);if(S)throw new i.ErrnoError(S)}a&512&&!w&&i.truncate(l,0),a&=-131713;var O=i.createStream({node:l,path:i.getPath(l),flags:a,seekable:!0,position:0,stream_ops:l.stream_ops,ungotten:[],error:!1});return O.stream_ops.open&&O.stream_ops.open(O),f.logReadFiles&&!(a&1)&&(i.readFiles||(i.readFiles={}),t in i.readFiles||(i.readFiles[t]=1)),O},close:t=>{if(i.isClosed(t))throw new i.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(a){throw a}finally{i.closeStream(t.fd)}t.fd=null},isClosed:t=>t.fd===null,llseek:(t,a,s)=>{if(i.isClosed(t))throw new i.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new i.ErrnoError(70);if(s!=0&&s!=1&&s!=2)throw new i.ErrnoError(28);return t.position=t.stream_ops.llseek(t,a,s),t.ungotten=[],t.position},read:(t,a,s,l,h)=>{if(l<0||h<0)throw new i.ErrnoError(28);if(i.isClosed(t))throw new i.ErrnoError(8);if((t.flags&2097155)===1)throw new i.ErrnoError(8);if(i.isDir(t.node.mode))throw new i.ErrnoError(31);if(!t.stream_ops.read)throw new i.ErrnoError(28);var w=typeof h<"u";if(!w)h=t.position;else if(!t.seekable)throw new i.ErrnoError(70);var S=t.stream_ops.read(t,a,s,l,h);return w||(t.position+=S),S},write:(t,a,s,l,h,w)=>{if(l<0||h<0)throw new i.ErrnoError(28);if(i.isClosed(t))throw new i.ErrnoError(8);if(!(t.flags&2097155))throw new i.ErrnoError(8);if(i.isDir(t.node.mode))throw new i.ErrnoError(31);if(!t.stream_ops.write)throw new i.ErrnoError(28);t.seekable&&t.flags&1024&&i.llseek(t,0,2);var S=typeof h<"u";if(!S)h=t.position;else if(!t.seekable)throw new i.ErrnoError(70);var O=t.stream_ops.write(t,a,s,l,h,w);return S||(t.position+=O),O},allocate:(t,a,s)=>{if(i.isClosed(t))throw new i.ErrnoError(8);if(a<0||s<=0)throw new i.ErrnoError(28);if(!(t.flags&2097155))throw new i.ErrnoError(8);if(!i.isFile(t.node.mode)&&!i.isDir(t.node.mode))throw new i.ErrnoError(43);if(!t.stream_ops.allocate)throw new i.ErrnoError(138);t.stream_ops.allocate(t,a,s)},mmap:(t,a,s,l,h)=>{if(l&2&&!(h&2)&&(t.flags&2097155)!==2)throw new i.ErrnoError(2);if((t.flags&2097155)===1)throw new i.ErrnoError(2);if(!t.stream_ops.mmap)throw new i.ErrnoError(43);return t.stream_ops.mmap(t,a,s,l,h)},msync:(t,a,s,l,h)=>t.stream_ops.msync?t.stream_ops.msync(t,a,s,l,h):0,munmap:t=>0,ioctl:(t,a,s)=>{if(!t.stream_ops.ioctl)throw new i.ErrnoError(59);return t.stream_ops.ioctl(t,a,s)},readFile:(t,a={})=>{if(a.flags=a.flags||0,a.encoding=a.encoding||"binary",a.encoding!=="utf8"&&a.encoding!=="binary")throw new Error('Invalid encoding type "'+a.encoding+'"');var s,l=i.open(t,a.flags),h=i.stat(t),w=h.size,S=new Uint8Array(w);return i.read(l,S,0,w,0),a.encoding==="utf8"?s=ze(S,0):a.encoding==="binary"&&(s=S),i.close(l),s},writeFile:(t,a,s={})=>{s.flags=s.flags||577;var l=i.open(t,s.flags,s.mode);if(typeof a=="string"){var h=new Uint8Array(Ce(a)+1),w=Ze(a,h,0,h.length);i.write(l,h,0,w,void 0,s.canOwn)}else if(ArrayBuffer.isView(a))i.write(l,a,0,a.byteLength,void 0,s.canOwn);else throw new Error("Unsupported data type");i.close(l)},cwd:()=>i.currentPath,chdir:t=>{var a=i.lookupPath(t,{follow:!0});if(a.node===null)throw new i.ErrnoError(44);if(!i.isDir(a.node.mode))throw new i.ErrnoError(54);var s=i.nodePermissions(a.node,"x");if(s)throw new i.ErrnoError(s);i.currentPath=a.path},createDefaultDirectories:()=>{i.mkdir("/tmp"),i.mkdir("/home"),i.mkdir("/home/web_user")},createDefaultDevices:()=>{i.mkdir("/dev"),i.registerDevice(i.makedev(1,3),{read:()=>0,write:(a,s,l,h,w)=>h}),i.mkdev("/dev/null",i.makedev(1,3)),ge.register(i.makedev(5,0),ge.default_tty_ops),ge.register(i.makedev(6,0),ge.default_tty1_ops),i.mkdev("/dev/tty",i.makedev(5,0)),i.mkdev("/dev/tty1",i.makedev(6,0));var t=no();i.createDevice("/dev","random",t),i.createDevice("/dev","urandom",t),i.mkdir("/dev/shm"),i.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{i.mkdir("/proc");var t=i.mkdir("/proc/self");i.mkdir("/proc/self/fd"),i.mount({mount:()=>{var a=i.createNode(t,"fd",16895,73);return a.node_ops={lookup:(s,l)=>{var h=+l,w=i.getStream(h);if(!w)throw new i.ErrnoError(8);var S={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>w.path}};return S.parent=S,S}},a}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?i.createDevice("/dev","stdin",f.stdin):i.symlink("/dev/tty","/dev/stdin"),f.stdout?i.createDevice("/dev","stdout",null,f.stdout):i.symlink("/dev/tty","/dev/stdout"),f.stderr?i.createDevice("/dev","stderr",null,f.stderr):i.symlink("/dev/tty1","/dev/stderr");var t=i.open("/dev/stdin",0),a=i.open("/dev/stdout",1),s=i.open("/dev/stderr",1)},ensureErrnoError:()=>{i.ErrnoError||(i.ErrnoError=function(a,s){this.node=s,this.setErrno=function(l){this.errno=l},this.setErrno(a),this.message="FS error"},i.ErrnoError.prototype=new Error,i.ErrnoError.prototype.constructor=i.ErrnoError,[44].forEach(t=>{i.genericErrors[t]=new i.ErrnoError(t),i.genericErrors[t].stack="<generic error, no stack>"}))},staticInit:()=>{i.ensureErrnoError(),i.nameTable=new Array(4096),i.mount(G,{},"/"),i.createDefaultDirectories(),i.createDefaultDevices(),i.createSpecialDirectories(),i.filesystems={MEMFS:G,NODEFS:V}},init:(t,a,s)=>{i.init.initialized=!0,i.ensureErrnoError(),f.stdin=t||f.stdin,f.stdout=a||f.stdout,f.stderr=s||f.stderr,i.createStandardStreams()},quit:()=>{i.init.initialized=!1,an(0);for(var t=0;t<i.streams.length;t++){var a=i.streams[t];a&&i.close(a)}},getMode:(t,a)=>{var s=0;return t&&(s|=365),a&&(s|=146),s},findObject:(t,a)=>{var s=i.analyzePath(t,a);return s.exists?s.object:null},analyzePath:(t,a)=>{try{var s=i.lookupPath(t,{follow:!a});t=s.path}catch{}var l={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var s=i.lookupPath(t,{parent:!0});l.parentExists=!0,l.parentPath=s.path,l.parentObject=s.node,l.name=Y.basename(t),s=i.lookupPath(t,{follow:!a}),l.exists=!0,l.path=s.path,l.object=s.node,l.name=s.node.name,l.isRoot=s.path==="/"}catch(h){l.error=h.errno}return l},createPath:(t,a,s,l)=>{t=typeof t=="string"?t:i.getPath(t);for(var h=a.split("/").reverse();h.length;){var w=h.pop();if(w){var S=Y.join2(t,w);try{i.mkdir(S)}catch{}t=S}}return S},createFile:(t,a,s,l,h)=>{var w=Y.join2(typeof t=="string"?t:i.getPath(t),a),S=i.getMode(l,h);return i.create(w,S)},createDataFile:(t,a,s,l,h,w)=>{var S=a;t&&(t=typeof t=="string"?t:i.getPath(t),S=a?Y.join2(t,a):t);var O=i.getMode(l,h),N=i.create(S,O);if(s){if(typeof s=="string"){for(var T=new Array(s.length),F=0,L=s.length;F<L;++F)T[F]=s.charCodeAt(F);s=T}i.chmod(N,O|146);var R=i.open(N,577);i.write(R,s,0,s.length,0,w),i.close(R),i.chmod(N,O)}return N},createDevice:(t,a,s,l)=>{var h=Y.join2(typeof t=="string"?t:i.getPath(t),a),w=i.getMode(!!s,!!l);i.createDevice.major||(i.createDevice.major=64);var S=i.makedev(i.createDevice.major++,0);return i.registerDevice(S,{open:O=>{O.seekable=!1},close:O=>{l&&l.buffer&&l.buffer.length&&l(10)},read:(O,N,T,F,L)=>{for(var R=0,B=0;B<F;B++){var P;try{P=s()}catch{throw new i.ErrnoError(29)}if(P===void 0&&R===0)throw new i.ErrnoError(6);if(P==null)break;R++,N[T+B]=P}return R&&(O.node.timestamp=Date.now()),R},write:(O,N,T,F,L)=>{for(var R=0;R<F;R++)try{l(N[T+R])}catch{throw new i.ErrnoError(29)}return F&&(O.node.timestamp=Date.now()),R}}),i.mkdev(h,w,S)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{t.contents=Er(We(t.url),!0),t.usedBytes=t.contents.length}catch{throw new i.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(t,a,s,l,h)=>{function w(){this.lengthKnown=!1,this.chunks=[]}if(w.prototype.get=function(B){if(!(B>this.length-1||B<0)){var P=B%this.chunkSize,M=B/this.chunkSize|0;return this.getter(M)[P]}},w.prototype.setDataGetter=function(B){this.getter=B},w.prototype.cacheLength=function(){var B=new XMLHttpRequest;if(B.open("HEAD",s,!1),B.send(null),!(B.status>=200&&B.status<300||B.status===304))throw new Error("Couldn't load "+s+". Status: "+B.status);var P=Number(B.getResponseHeader("Content-length")),M,z=(M=B.getResponseHeader("Accept-Ranges"))&&M==="bytes",q=(M=B.getResponseHeader("Content-Encoding"))&&M==="gzip",W=1024*1024;z||(W=P);var X=(se,Oe)=>{if(se>Oe)throw new Error("invalid range ("+se+", "+Oe+") or no bytes requested!");if(Oe>P-1)throw new Error("only "+P+" bytes available! programmer error!");var Ae=new XMLHttpRequest;if(Ae.open("GET",s,!1),P!==W&&Ae.setRequestHeader("Range","bytes="+se+"-"+Oe),Ae.responseType="arraybuffer",Ae.overrideMimeType&&Ae.overrideMimeType("text/plain; charset=x-user-defined"),Ae.send(null),!(Ae.status>=200&&Ae.status<300||Ae.status===304))throw new Error("Couldn't load "+s+". Status: "+Ae.status);return Ae.response!==void 0?new Uint8Array(Ae.response||[]):Er(Ae.responseText||"",!0)},oe=this;oe.setDataGetter(se=>{var Oe=se*W,Ae=(se+1)*W-1;if(Ae=Math.min(Ae,P-1),typeof oe.chunks[se]>"u"&&(oe.chunks[se]=X(Oe,Ae)),typeof oe.chunks[se]>"u")throw new Error("doXHR failed!");return oe.chunks[se]}),(q||!P)&&(W=P=1,P=this.getter(0).length,W=P,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=P,this._chunkSize=W,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var S=new w;Object.defineProperties(S,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var O={isDevice:!1,contents:S}}else var O={isDevice:!1,url:s};var N=i.createFile(t,a,O,l,h);O.contents?N.contents=O.contents:O.url&&(N.contents=null,N.url=O.url),Object.defineProperties(N,{usedBytes:{get:function(){return this.contents.length}}});var T={},F=Object.keys(N.stream_ops);F.forEach(R=>{var B=N.stream_ops[R];T[R]=function(){return i.forceLoadFile(N),B.apply(null,arguments)}});function L(R,B,P,M,z){var q=R.node.contents;if(z>=q.length)return 0;var W=Math.min(q.length-z,M);if(q.slice)for(var X=0;X<W;X++)B[P+X]=q[z+X];else for(var X=0;X<W;X++)B[P+X]=q.get(z+X);return W}return T.read=(R,B,P,M,z)=>(i.forceLoadFile(N),L(R,B,P,M,z)),T.mmap=(R,B,P,M,z)=>{i.forceLoadFile(N);var q=Ir(B);if(!q)throw new i.ErrnoError(48);return L(R,ee,q,B,P),{ptr:q,allocated:!0}},N.stream_ops=T,N},createPreloadedFile:(t,a,s,l,h,w,S,O,N,T)=>{var F=a?Q.resolve(Y.join2(t,a)):t,L="cp "+F;function R(B){function P(M){T&&T(),O||i.createDataFile(t,a,M,l,h,N),w&&w(),Je(L)}Browser.handledByPreloadPlugin(B,F,P,()=>{S&&S(),Je(L)})||P(B)}dr(L),typeof s=="string"?Ct(s,B=>R(B),S):R(s)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(t,a,s)=>{a=a||(()=>{}),s=s||(()=>{});var l=i.indexedDB();try{var h=l.open(i.DB_NAME(),i.DB_VERSION)}catch(w){return s(w)}h.onupgradeneeded=()=>{er("creating db");var w=h.result;w.createObjectStore(i.DB_STORE_NAME)},h.onsuccess=()=>{var w=h.result,S=w.transaction([i.DB_STORE_NAME],"readwrite"),O=S.objectStore(i.DB_STORE_NAME),N=0,T=0,F=t.length;function L(){T==0?a():s()}t.forEach(R=>{var B=O.put(i.analyzePath(R).object.contents,R);B.onsuccess=()=>{N++,N+T==F&&L()},B.onerror=()=>{T++,N+T==F&&L()}}),S.onerror=s},h.onerror=s},loadFilesFromDB:(t,a,s)=>{a=a||(()=>{}),s=s||(()=>{});var l=i.indexedDB();try{var h=l.open(i.DB_NAME(),i.DB_VERSION)}catch(w){return s(w)}h.onupgradeneeded=s,h.onsuccess=()=>{var w=h.result;try{var S=w.transaction([i.DB_STORE_NAME],"readonly")}catch(R){s(R);return}var O=S.objectStore(i.DB_STORE_NAME),N=0,T=0,F=t.length;function L(){T==0?a():s()}t.forEach(R=>{var B=O.get(R);B.onsuccess=()=>{i.analyzePath(R).exists&&i.unlink(R),i.createDataFile(Y.dirname(R),Y.basename(R),B.result,!0,!0,!0),N++,N+T==F&&L()},B.onerror=()=>{T++,N+T==F&&L()}}),S.onerror=s},h.onerror=s}},C={DEFAULT_POLLMASK:5,calculateAt:function(t,a,s){if(Y.isAbs(a))return a;var l;if(t===-100)l=i.cwd();else{var h=C.getStreamFromFD(t);l=h.path}if(a.length==0){if(!s)throw new i.ErrnoError(44);return l}return Y.join2(l,a)},doStat:function(t,a,s){try{var l=t(a)}catch(h){if(h&&h.node&&Y.normalize(a)!==Y.normalize(i.getPath(h.node)))return-54;throw h}return E[s>>2]=l.dev,E[s+8>>2]=l.ino,E[s+12>>2]=l.mode,j[s+16>>2]=l.nlink,E[s+20>>2]=l.uid,E[s+24>>2]=l.gid,E[s+28>>2]=l.rdev,Z=[l.size>>>0,(U=l.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[s+40>>2]=Z[0],E[s+44>>2]=Z[1],E[s+48>>2]=4096,E[s+52>>2]=l.blocks,Z=[Math.floor(l.atime.getTime()/1e3)>>>0,(U=Math.floor(l.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[s+56>>2]=Z[0],E[s+60>>2]=Z[1],j[s+64>>2]=0,Z=[Math.floor(l.mtime.getTime()/1e3)>>>0,(U=Math.floor(l.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[s+72>>2]=Z[0],E[s+76>>2]=Z[1],j[s+80>>2]=0,Z=[Math.floor(l.ctime.getTime()/1e3)>>>0,(U=Math.floor(l.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[s+88>>2]=Z[0],E[s+92>>2]=Z[1],j[s+96>>2]=0,Z=[l.ino>>>0,(U=l.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[s+104>>2]=Z[0],E[s+108>>2]=Z[1],0},doMsync:function(t,a,s,l,h){if(!i.isFile(a.node.mode))throw new i.ErrnoError(43);if(l&2)return 0;var w=le.slice(t,t+s);i.msync(a,w,h,s,l)},varargs:void 0,get:function(){C.varargs+=4;var t=E[C.varargs-4>>2];return t},getStr:function(t){var a=ne(t);return a},getStreamFromFD:function(t){var a=i.getStream(t);if(!a)throw new i.ErrnoError(8);return a}};function v(t,a,s,l,h){try{for(var w=0,S=a?E[a>>2]:0,O=a?E[a+4>>2]:0,N=s?E[s>>2]:0,T=s?E[s+4>>2]:0,F=l?E[l>>2]:0,L=l?E[l+4>>2]:0,R=0,B=0,P=0,M=0,z=0,q=0,W=(a?E[a>>2]:0)|(s?E[s>>2]:0)|(l?E[l>>2]:0),X=(a?E[a+4>>2]:0)|(s?E[s+4>>2]:0)|(l?E[l+4>>2]:0),oe=function(Ke,rr,je,nr){return Ke<32?rr&nr:je&nr},se=0;se<t;se++){var Oe=1<<se%32;if(oe(se,W,X,Oe)){var Ae=C.getStreamFromFD(se),Qe=C.DEFAULT_POLLMASK;Ae.stream_ops?.poll&&(Qe=Ae.stream_ops.poll(Ae)),Qe&1&&oe(se,S,O,Oe)&&(se<32?R=R|Oe:B=B|Oe,w++),Qe&4&&oe(se,N,T,Oe)&&(se<32?P=P|Oe:M=M|Oe,w++),Qe&2&&oe(se,F,L,Oe)&&(se<32?z=z|Oe:q=q|Oe,w++)}}return a&&(E[a>>2]=R,E[a+4>>2]=B),s&&(E[s>>2]=P,E[s+4>>2]=M),l&&(E[l>>2]=z,E[l+4>>2]=q),w}catch(Ke){if(typeof i>"u"||!(Ke instanceof i.ErrnoError))throw Ke;return-Ke.errno}}var H={mount:function(t){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(a,s){return typeof s=="function"&&(this._callbacks[a]=s),this},f.websocket.emit=function(a,s){typeof this._callbacks[a]=="function"&&this._callbacks[a].call(this,s)},i.createNode(null,"/",16895,0)},createSocket:function(t,a,s){a&=-526337;var l=a==1;if(l&&s&&s!=6)throw new i.ErrnoError(66);var h={family:t,type:a,protocol:s,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:H.websocket_sock_ops},w=H.nextname(),S=i.createNode(H.root,w,49152,0);S.sock=h;var O=i.createStream({path:w,node:S,flags:2,seekable:!1,stream_ops:H.stream_ops});return h.stream=O,h},getSocket:function(t){var a=i.getStream(t);return!a||!i.isSocket(a.node.mode)?null:a.node.sock},stream_ops:{poll:function(t){var a=t.node.sock;return a.sock_ops.poll(a)},ioctl:function(t,a,s){var l=t.node.sock;return l.sock_ops.ioctl(l,a,s)},read:function(t,a,s,l,h){var w=t.node.sock,S=w.sock_ops.recvmsg(w,l);return S?(a.set(S.buffer,s),S.buffer.length):0},write:function(t,a,s,l,h){var w=t.node.sock;return w.sock_ops.sendmsg(w,a,s,l)},close:function(t){var a=t.node.sock;a.sock_ops.close(a)}},nextname:function(){return H.nextname.current||(H.nextname.current=0),"socket["+H.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(t,a,s){var l;if(typeof a=="object"&&(l=a,a=null,s=null),l)if(l._socket)a=l._socket.remoteAddress,s=l._socket.remotePort;else{var h=/ws[s]?:\/\/([^:]+):(\d+)/.exec(l.url);if(!h)throw new Error("WebSocket URL must be in the format ws(s)://address:port");a=h[1],s=parseInt(h[2],10)}else try{var w=f.websocket&&typeof f.websocket=="object",S="ws:#".replace("#","//");if(w&&(typeof f.websocket.url=="function"?S=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(S=f.websocket.url)),S==="ws://"||S==="wss://"){var O=a.split("/");S=S+O[0]+":"+s+"/"+O.slice(1).join("/")}var N="binary";w&&typeof f.websocket.subprotocol=="string"&&(N=f.websocket.subprotocol);var T=void 0;N!=="null"&&(N=N.replace(/^ +| +$/g,"").split(/ *, */),T=N),w&&f.websocket.subprotocol===null&&(N="null",T=void 0);var F;te?F=An():F=WebSocket,f.websocket.decorator&&(F=f.websocket.decorator(F)),l=new F(S,T),l.binaryType="arraybuffer"}catch{throw new i.ErrnoError(23)}var L={addr:a,port:s,socket:l,dgram_send_queue:[]};return H.websocket_sock_ops.addPeer(t,L),H.websocket_sock_ops.handlePeerEvents(t,L),t.type===2&&typeof t.sport<"u"&&L.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(t.sport&65280)>>8,t.sport&255])),L},getPeer:function(t,a,s){return t.peers[a+":"+s]},addPeer:function(t,a){t.peers[a.addr+":"+a.port]=a},removePeer:function(t,a){delete t.peers[a.addr+":"+a.port]},handlePeerEvents:function(t,a){var s=!0,l=function(){f.websocket.emit("open",t.stream.fd);try{for(var w=a.dgram_send_queue.shift();w;)a.socket.send(w),w=a.dgram_send_queue.shift()}catch{a.socket.close()}};function h(w){if(typeof w=="string"){var S=new TextEncoder;w=S.encode(w)}else{if(Le(w.byteLength!==void 0),w.byteLength==0)return;w=new Uint8Array(w)}var O=s;if(s=!1,O&&w.length===10&&w[0]===255&&w[1]===255&&w[2]===255&&w[3]===255&&w[4]==="p".charCodeAt(0)&&w[5]==="o".charCodeAt(0)&&w[6]==="r".charCodeAt(0)&&w[7]==="t".charCodeAt(0)){var N=w[8]<<8|w[9];H.websocket_sock_ops.removePeer(t,a),a.port=N,H.websocket_sock_ops.addPeer(t,a);return}t.recv_queue.push({addr:a.addr,port:a.port,data:w}),f.websocket.emit("message",t.stream.fd)}te?(a.socket.on("open",l),a.socket.on("message",function(w,S){S&&h(new Uint8Array(w).buffer)}),a.socket.on("close",function(){f.websocket.emit("close",t.stream.fd)}),a.socket.on("error",function(w){t.error=14,f.websocket.emit("error",[t.stream.fd,t.error,"ECONNREFUSED: Connection refused"])})):(a.socket.onopen=l,a.socket.onclose=function(){f.websocket.emit("close",t.stream.fd)},a.socket.onmessage=function(S){h(S.data)},a.socket.onerror=function(w){t.error=14,f.websocket.emit("error",[t.stream.fd,t.error,"ECONNREFUSED: Connection refused"])})},poll:function(t){if(t.type===1&&t.server)return t.pending.length?65:0;var a=0,s=t.type===1?H.websocket_sock_ops.getPeer(t,t.daddr,t.dport):null;return(t.recv_queue.length||!s||s&&s.socket.readyState===s.socket.CLOSING||s&&s.socket.readyState===s.socket.CLOSED)&&(a|=65),(!s||s&&s.socket.readyState===s.socket.OPEN)&&(a|=4),(s&&s.socket.readyState===s.socket.CLOSING||s&&s.socket.readyState===s.socket.CLOSED)&&(a|=16),a},ioctl:function(t,a,s){switch(a){case 21531:var l=0;return t.recv_queue.length&&(l=t.recv_queue[0].data.length),E[s>>2]=l,0;default:return 28}},close:function(t){if(t.server){try{t.server.close()}catch{}t.server=null}for(var a=Object.keys(t.peers),s=0;s<a.length;s++){var l=t.peers[a[s]];try{l.socket.close()}catch{}H.websocket_sock_ops.removePeer(t,l)}return 0},bind:function(t,a,s){if(typeof t.saddr<"u"||typeof t.sport<"u")throw new i.ErrnoError(28);if(t.saddr=a,t.sport=s,t.type===2){t.server&&(t.server.close(),t.server=null);try{t.sock_ops.listen(t,0)}catch(l){if(!(l instanceof i.ErrnoError)||l.errno!==138)throw l}}},connect:function(t,a,s){if(t.server)throw new i.ErrnoError(138);if(typeof t.daddr<"u"&&typeof t.dport<"u"){var l=H.websocket_sock_ops.getPeer(t,t.daddr,t.dport);if(l)throw l.socket.readyState===l.socket.CONNECTING?new i.ErrnoError(7):new i.ErrnoError(30)}var h=H.websocket_sock_ops.createPeer(t,a,s);throw t.daddr=h.addr,t.dport=h.port,new i.ErrnoError(26)},listen:function(t,a){if(!te)throw new i.ErrnoError(138);if(t.server)throw new i.ErrnoError(28);var s=An().Server,l=t.saddr;t.server=new s({host:l,port:t.sport}),f.websocket.emit("listen",t.stream.fd),t.server.on("connection",function(h){if(t.type===1){var w=H.createSocket(t.family,t.type,t.protocol),S=H.websocket_sock_ops.createPeer(w,h);w.daddr=S.addr,w.dport=S.port,t.pending.push(w),f.websocket.emit("connection",w.stream.fd)}else H.websocket_sock_ops.createPeer(t,h),f.websocket.emit("connection",t.stream.fd)}),t.server.on("close",function(){f.websocket.emit("close",t.stream.fd),t.server=null}),t.server.on("error",function(h){t.error=23,f.websocket.emit("error",[t.stream.fd,t.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(t){if(!t.server||!t.pending.length)throw new i.ErrnoError(28);var a=t.pending.shift();return a.stream.flags=t.stream.flags,a},getname:function(t,a){var s,l;if(a){if(t.daddr===void 0||t.dport===void 0)throw new i.ErrnoError(53);s=t.daddr,l=t.dport}else s=t.saddr||0,l=t.sport||0;return{addr:s,port:l}},sendmsg:function(t,a,s,l,h,w){if(t.type===2){if((h===void 0||w===void 0)&&(h=t.daddr,w=t.dport),h===void 0||w===void 0)throw new i.ErrnoError(17)}else h=t.daddr,w=t.dport;var S=H.websocket_sock_ops.getPeer(t,h,w);if(t.type===1){if(!S||S.socket.readyState===S.socket.CLOSING||S.socket.readyState===S.socket.CLOSED)throw new i.ErrnoError(53);if(S.socket.readyState===S.socket.CONNECTING)throw new i.ErrnoError(6)}ArrayBuffer.isView(a)&&(s+=a.byteOffset,a=a.buffer);var O;if(O=a.slice(s,s+l),t.type===2&&(!S||S.socket.readyState!==S.socket.OPEN))return(!S||S.socket.readyState===S.socket.CLOSING||S.socket.readyState===S.socket.CLOSED)&&(S=H.websocket_sock_ops.createPeer(t,h,w)),S.dgram_send_queue.push(O),l;try{return S.socket.send(O),l}catch{throw new i.ErrnoError(28)}},recvmsg:function(t,a){if(t.type===1&&t.server)throw new i.ErrnoError(53);var s=t.recv_queue.shift();if(!s){if(t.type===1){var l=H.websocket_sock_ops.getPeer(t,t.daddr,t.dport);if(!l)throw new i.ErrnoError(53);if(l.socket.readyState===l.socket.CLOSING||l.socket.readyState===l.socket.CLOSED)return null;throw new i.ErrnoError(6)}throw new i.ErrnoError(6)}var h=s.data.byteLength||s.data.length,w=s.data.byteOffset||0,S=s.data.buffer||s.data,O=Math.min(a,h),N={buffer:new Uint8Array(S,w,O),addr:s.addr,port:s.port};if(t.type===1&&O<h){var T=h-O;s.data=new Uint8Array(S,w+O,T),t.recv_queue.unshift(s)}return N}}};function ke(t){var a=H.getSocket(t);if(!a)throw new i.ErrnoError(8);return a}function he(t){return E[Tt()>>2]=t,t}function Ie(t){for(var a=t.split("."),s=0;s<4;s++){var l=Number(a[s]);if(isNaN(l))return null;a[s]=l}return(a[0]|a[1]<<8|a[2]<<16|a[3]<<24)>>>0}function ce(t){return parseInt(t)}function Ar(t){var a,s,l,h,w=/^((?=.*::)(?!.*::.+::)(::)?([\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(!w.test(t))return null;if(t==="::")return[0,0,0,0,0,0,0,0];for(t.startsWith("::")?t=t.replace("::","Z:"):t=t.replace("::",":Z:"),t.indexOf(".")>0?(t=t.replace(new RegExp("[.]","g"),":"),a=t.split(":"),a[a.length-4]=ce(a[a.length-4])+ce(a[a.length-3])*256,a[a.length-3]=ce(a[a.length-2])+ce(a[a.length-1])*256,a=a.slice(0,a.length-2)):a=t.split(":"),l=0,h=0,s=0;s<a.length;s++)if(typeof a[s]=="string")if(a[s]==="Z"){for(h=0;h<8-a.length+1;h++)S[s+h]=0;l=h-1}else S[s+l]=Br(parseInt(a[s],16));else S[s+l]=a[s];return[S[1]<<16|S[0],S[3]<<16|S[2],S[5]<<16|S[4],S[7]<<16|S[6]]}function be(t,a,s,l,h){switch(a){case 2:s=Ie(s),wr(t,16),h&&(E[h>>2]=16),we[t>>1]=a,E[t+4>>2]=s,we[t+2>>1]=Br(l);break;case 10:s=Ar(s),wr(t,28),h&&(E[h>>2]=28),E[t>>2]=a,E[t+8>>2]=s[0],E[t+12>>2]=s[1],E[t+16>>2]=s[2],E[t+20>>2]=s[3],we[t+2>>1]=Br(l);break;default:return 5}return 0}var ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(t){var a=Ie(t);if(a!==null||(a=Ar(t),a!==null))return t;var s;if(ue.address_map.addrs[t])s=ue.address_map.addrs[t];else{var l=ue.address_map.id++;Le(l<65535,"exceeded max address mappings of 65535"),s="172.29."+(l&255)+"."+(l&65280),ue.address_map.names[s]=t,ue.address_map.addrs[t]=s}return s},lookup_addr:function(t){return ue.address_map.names[t]?ue.address_map.names[t]:null}};function Zr(t,a,s,l){try{var h=ke(t),w=h.sock_ops.accept(h);if(a)var S=be(a,w.family,ue.lookup_name(w.daddr),w.dport,s);return w.stream.fd}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function Ne(t){return(t&255)+"."+(t>>8&255)+"."+(t>>16&255)+"."+(t>>24&255)}function kn(t){var a="",s=0,l=0,h=0,w=0,S=0,O=0,N=[t[0]&65535,t[0]>>16,t[1]&65535,t[1]>>16,t[2]&65535,t[2]>>16,t[3]&65535,t[3]>>16],T=!0,F="";for(O=0;O<5;O++)if(N[O]!==0){T=!1;break}if(T){if(F=Ne(N[6]|N[7]<<16),N[5]===-1)return a="::ffff:",a+=F,a;if(N[5]===0)return a="::",F==="0.0.0.0"&&(F=""),F==="0.0.0.1"&&(F="1"),a+=F,a}for(s=0;s<8;s++)N[s]===0&&(s-h>1&&(S=0),h=s,S++),S>l&&(l=S,w=s-l+1);for(s=0;s<8;s++){if(l>1&&N[s]===0&&s>=w&&s<w+l){s===w&&(a+=":",w===0&&(a+=":"));continue}a+=Number(Vr(N[s]&65535)).toString(16),a+=s<7?":":""}return a}function Gr(t,a){var s=we[t>>1],l=Vr(lt[t+2>>1]),h;switch(s){case 2:if(a!==16)return{errno:28};h=E[t+4>>2],h=Ne(h);break;case 10:if(a!==28)return{errno:28};h=[E[t+8>>2],E[t+12>>2],E[t+16>>2],E[t+20>>2]],h=kn(h);break;default:return{errno:5}}return{family:s,addr:h,port:l}}function Yr(t,a,s){if(s&&t===0)return null;var l=Gr(t,a);if(l.errno)throw new i.ErrnoError(l.errno);return l.addr=ue.lookup_addr(l.addr)||l.addr,l}function dn(t,a,s){try{var l=ke(t),h=Yr(a,s);return l.sock_ops.bind(l,h.addr,h.port),0}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function Pt(t){try{return t=C.getStr(t),i.chdir(t),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function oo(t,a){try{return t=C.getStr(t),i.chmod(t,a),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function io(t,a,s){try{var l=ke(t),h=Yr(a,s);return l.sock_ops.connect(l,h.addr,h.port),0}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function ao(t){try{var a=C.getStreamFromFD(t);return i.createStream(a,0).fd}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function so(t,a,s){try{var l=C.getStreamFromFD(t);if(l.fd===a)return-28;var h=i.getStream(a);return h&&i.close(h),i.createStream(l,a,a+1).fd}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function uo(t,a,s,l){try{if(a=C.getStr(a),a=C.calculateAt(t,a),s&-8)return-28;var h=i.lookupPath(a,{follow:!0}),w=h.node;if(!w)return-44;var S="";return s&4&&(S+="r"),s&2&&(S+="w"),s&1&&(S+="x"),S&&i.nodePermissions(w,S)?-2:0}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function _n(t,a){return a+2097152>>>0<4194305-!!t?(t>>>0)+a*4294967296:NaN}function fo(t,a,s,l,h,w){try{var S=_n(s,l);if(isNaN(S))return-61;var O=_n(h,w);if(isNaN(O))return-61;var N=C.getStreamFromFD(t);return i.allocate(N,S,O),0}catch(T){if(typeof i>"u"||!(T instanceof i.ErrnoError))throw T;return-T.errno}}function gt(t,a){try{return i.fchmod(t,a),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function co(t,a,s){try{return i.fchown(t,a,s),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function lo(t,a,s,l,h){try{a=C.getStr(a);var w=h&256;return h=h&-257,a=C.calculateAt(t,a),(w?i.lchown:i.chown)(a,s,l),0}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function qt(t,a,s){C.varargs=s;try{var l=C.getStreamFromFD(t);switch(a){case 0:{var h=C.get();if(h<0)return-28;var w;return w=i.createStream(l,h),w.fd}case 1:case 2:return 0;case 3:return l.flags;case 4:{var h=C.get();return l.flags|=h,0}case 5:{var h=C.get(),S=0;return we[h+S>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return he(28),-1;default:return-28}}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function _o(t){try{var a=C.getStreamFromFD(t);return 0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function mo(t,a){try{var s=C.getStreamFromFD(t);return C.doStat(i.stat,s.path,a)}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function vo(t,a,s){try{var l=_n(a,s);return isNaN(l)?-61:(i.ftruncate(t,l),0)}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function po(t,a){try{if(a===0)return-28;var s=i.cwd(),l=Ce(s)+1;return a<l?-68:(Fe(s,t,a),l)}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function ho(t,a,s){try{var l=C.getStreamFromFD(t);l.getdents||(l.getdents=i.readdir(l.path));for(var h=280,w=0,S=i.llseek(l,0,1),O=Math.floor(S/h);O<l.getdents.length&&w+h<=s;){var N,T,F=l.getdents[O];if(F===".")N=l.node.id,T=4;else if(F===".."){var L=i.lookupPath(l.path,{parent:!0});N=L.node.id,T=4}else{var R=i.lookupNode(l.node,F);N=R.id,T=i.isChrdev(R.mode)?2:i.isDir(R.mode)?4:i.isLink(R.mode)?10:8}Z=[N>>>0,(U=N,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[a+w>>2]=Z[0],E[a+w+4>>2]=Z[1],Z=[(O+1)*h>>>0,(U=(O+1)*h,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[a+w+8>>2]=Z[0],E[a+w+12>>2]=Z[1],we[a+w+16>>1]=280,ee[a+w+18>>0]=T,Fe(F,a+w+19,256),w+=h,O+=1}return i.llseek(l,O*h,0),w}catch(B){if(typeof i>"u"||!(B instanceof i.ErrnoError))throw B;return-B.errno}}function yo(t,a,s){try{var l=ke(t);if(!l.daddr)return-53;var h=be(a,l.family,ue.lookup_name(l.daddr),l.dport,s);return 0}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function Eo(t,a,s){try{fe("__syscall_getsockname "+t);var l=ke(t),h=be(a,l.family,ue.lookup_name(l.saddr||"0.0.0.0"),l.sport,s);return 0}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function wo(t,a,s,l,h){try{var w=ke(t);return a===1&&s===4?(E[l>>2]=w.error,E[h>>2]=4,w.error=null,0):-50}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function go(t,a,s){C.varargs=s;try{var l=C.getStreamFromFD(t);switch(a){case 21509:case 21505:return l.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return l.tty?0:-59;case 21519:{if(!l.tty)return-59;var h=C.get();return E[h>>2]=0,0}case 21520:return l.tty?-28:-59;case 21531:{var h=C.get();return i.ioctl(l,a,h)}case 21523:return l.tty?0:-59;case 21524:return l.tty?0:-59;default:return-28}}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function So(t,a){try{var s=ke(t);return s.sock_ops.listen(s,a),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function bo(t,a){try{return t=C.getStr(t),C.doStat(i.lstat,t,a)}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function ko(t,a,s){try{return a=C.getStr(a),a=C.calculateAt(t,a),a=Y.normalize(a),a[a.length-1]==="/"&&(a=a.substr(0,a.length-1)),i.mkdir(a,s,0),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function ae(t,a,s,l){try{a=C.getStr(a);var h=l&256,w=l&4096;return l=l&-4353,a=C.calculateAt(t,a,w),C.doStat(h?i.lstat:i.stat,a,s)}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function Oo(t,a,s,l){C.varargs=l;try{a=C.getStr(a),a=C.calculateAt(t,a);var h=l?C.get():0;return i.open(a,s,h).fd}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}var kr={BUCKET_BUFFER_SIZE:8192,mount:function(t){return i.createNode(null,"/",16895,0)},createPipe:function(){var t={buckets:[],refcnt:2};t.buckets.push({buffer:new Uint8Array(kr.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var a=kr.nextname(),s=kr.nextname(),l=i.createNode(kr.root,a,4096,0),h=i.createNode(kr.root,s,4096,0);l.pipe=t,h.pipe=t;var w=i.createStream({path:a,node:l,flags:0,seekable:!1,stream_ops:kr.stream_ops});l.stream=w;var S=i.createStream({path:s,node:h,flags:1,seekable:!1,stream_ops:kr.stream_ops});return h.stream=S,{readable_fd:w.fd,writable_fd:S.fd}},stream_ops:{poll:function(t){var a=t.node.pipe;if((t.flags&2097155)===1)return 260;if(a.buckets.length>0)for(var s=0;s<a.buckets.length;s++){var l=a.buckets[s];if(l.offset-l.roffset>0)return 65}return 0},ioctl:function(t,a,s){return 28},fsync:function(t){return 28},read:function(t,a,s,l,h){for(var w=t.node.pipe,S=0,O=0;O<w.buckets.length;O++){var N=w.buckets[O];S+=N.offset-N.roffset}Le(a instanceof ArrayBuffer||ArrayBuffer.isView(a));var T=a.subarray(s,s+l);if(l<=0)return 0;if(S==0)throw new i.ErrnoError(6);for(var F=Math.min(S,l),L=F,R=0,O=0;O<w.buckets.length;O++){var B=w.buckets[O],P=B.offset-B.roffset;if(F<=P){var M=B.buffer.subarray(B.roffset,B.offset);F<P?(M=M.subarray(0,F),B.roffset+=F):R++,T.set(M);break}else{var M=B.buffer.subarray(B.roffset,B.offset);T.set(M),T=T.subarray(M.byteLength),F-=M.byteLength,R++}}return R&&R==w.buckets.length&&(R--,w.buckets[R].offset=0,w.buckets[R].roffset=0),w.buckets.splice(0,R),L},write:function(t,a,s,l,h){var w=t.node.pipe;Le(a instanceof ArrayBuffer||ArrayBuffer.isView(a));var S=a.subarray(s,s+l),O=S.byteLength;if(O<=0)return 0;var N=null;w.buckets.length==0?(N={buffer:new Uint8Array(kr.BUCKET_BUFFER_SIZE),offset:0,roffset:0},w.buckets.push(N)):N=w.buckets[w.buckets.length-1],Le(N.offset<=kr.BUCKET_BUFFER_SIZE);var T=kr.BUCKET_BUFFER_SIZE-N.offset;if(T>=O)return N.buffer.set(S,N.offset),N.offset+=O,O;T>0&&(N.buffer.set(S.subarray(0,T),N.offset),N.offset+=T,S=S.subarray(T,S.byteLength));for(var F=S.byteLength/kr.BUCKET_BUFFER_SIZE|0,L=S.byteLength%kr.BUCKET_BUFFER_SIZE,R=0;R<F;R++){var B={buffer:new Uint8Array(kr.BUCKET_BUFFER_SIZE),offset:kr.BUCKET_BUFFER_SIZE,roffset:0};w.buckets.push(B),B.buffer.set(S.subarray(0,kr.BUCKET_BUFFER_SIZE)),S=S.subarray(kr.BUCKET_BUFFER_SIZE,S.byteLength)}if(L>0){var B={buffer:new Uint8Array(kr.BUCKET_BUFFER_SIZE),offset:S.byteLength,roffset:0};w.buckets.push(B),B.buffer.set(S)}return O},close:function(t){var a=t.node.pipe;a.refcnt--,a.refcnt===0&&(a.buckets=null)}},nextname:function(){return kr.nextname.current||(kr.nextname.current=0),"pipe["+kr.nextname.current+++"]"}};function Do(t){try{if(t==0)throw new i.ErrnoError(21);var a=kr.createPipe();return E[t>>2]=a.readable_fd,E[t+4>>2]=a.writable_fd,0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function Se(t,a,s){try{for(var l=0,h=0;h<a;h++){var w=t+8*h,S=E[w>>2],O=we[w+4>>1],N=32,T=i.getStream(S);T&&(N=C.DEFAULT_POLLMASK,T.stream_ops?.poll&&(N=T.stream_ops.poll(T))),N&=O|8|16,N&&l++,we[w+6>>1]=N}return l}catch(F){if(typeof i>"u"||!(F instanceof i.ErrnoError))throw F;return-F.errno}}function No(t,a,s,l){try{if(a=C.getStr(a),a=C.calculateAt(t,a),l<=0)return-28;var h=i.readlink(a),w=Math.min(l,Ce(h)),S=ee[s+w];return Fe(h,s,l+1),ee[s+w]=S,w}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function To(t,a,s,l,h,w){try{var S=ke(t),O=S.sock_ops.recvmsg(S,s);if(!O)return 0;if(h)var N=be(h,S.family,ue.lookup_name(O.addr),O.port,w);return le.set(O.buffer,a),O.buffer.byteLength}catch(T){if(typeof i>"u"||!(T instanceof i.ErrnoError))throw T;return-T.errno}}function Ao(t,a,s,l){try{return a=C.getStr(a),l=C.getStr(l),a=C.calculateAt(t,a),l=C.calculateAt(s,l),i.rename(a,l),0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Fo(t){try{return t=C.getStr(t),i.rmdir(t),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function Co(t,a,s,l,h,w){try{var S=ke(t),O=Yr(h,w,!0);return O?S.sock_ops.sendmsg(S,ee,a,s,O.addr,O.port):i.write(S.stream,ee,a,s)}catch(N){if(typeof i>"u"||!(N instanceof i.ErrnoError))throw N;return-N.errno}}function Po(t,a,s){try{var l=H.createSocket(t,a,s);return l.stream.fd}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Ro(t,a){try{return t=C.getStr(t),C.doStat(i.stat,t,a)}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function Mo(t,a,s){try{return t=C.getStr(t),E[s+4>>2]=4096,E[s+40>>2]=4096,E[s+8>>2]=1e6,E[s+12>>2]=5e5,E[s+16>>2]=5e5,E[s+20>>2]=i.nextInode,E[s+24>>2]=1e6,E[s+28>>2]=42,E[s+44>>2]=2,E[s+36>>2]=255,0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function jr(t,a){try{return t=C.getStr(t),a=C.getStr(a),i.symlink(t,a),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function Lo(t,a,s){try{return a=C.getStr(a),a=C.calculateAt(t,a),s===0?i.unlink(a):s===512?i.rmdir(a):me("Invalid flags passed to unlinkat"),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function mn(t){return j[t>>2]+E[t+4>>2]*4294967296}function Vt(t,a,s,l){try{if(a=C.getStr(a),a=C.calculateAt(t,a,!0),s){var S=mn(s),O=E[s+8>>2];h=S*1e3+O/(1e3*1e3),s+=16,S=mn(s),O=E[s+8>>2],w=S*1e3+O/(1e3*1e3)}else var h=Date.now(),w=h;return i.utime(a,h,w),0}catch(N){if(typeof i>"u"||!(N instanceof i.ErrnoError))throw N;return-N.errno}}function St(t){}var Fn="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Uo(t,a){me(Fn)}function vn(t,a){me(Fn)}var Io=!0;function Bo(){return Io}function xo(){throw 1/0}function zo(t,a){var s=new Date(mn(t)*1e3);E[a>>2]=s.getUTCSeconds(),E[a+4>>2]=s.getUTCMinutes(),E[a+8>>2]=s.getUTCHours(),E[a+12>>2]=s.getUTCDate(),E[a+16>>2]=s.getUTCMonth(),E[a+20>>2]=s.getUTCFullYear()-1900,E[a+24>>2]=s.getUTCDay();var l=Date.UTC(s.getUTCFullYear(),0,1,0,0,0,0),h=(s.getTime()-l)/(1e3*60*60*24)|0;E[a+28>>2]=h}function Ho(t,a){var s=new Date(mn(t)*1e3);E[a>>2]=s.getSeconds(),E[a+4>>2]=s.getMinutes(),E[a+8>>2]=s.getHours(),E[a+12>>2]=s.getDate(),E[a+16>>2]=s.getMonth(),E[a+20>>2]=s.getFullYear()-1900,E[a+24>>2]=s.getDay();var l=new Date(s.getFullYear(),0,1),h=(s.getTime()-l.getTime())/(1e3*60*60*24)|0;E[a+28>>2]=h,E[a+36>>2]=-(s.getTimezoneOffset()*60);var w=new Date(s.getFullYear(),6,1).getTimezoneOffset(),S=l.getTimezoneOffset(),O=(w!=S&&s.getTimezoneOffset()==Math.min(S,w))|0;E[a+32>>2]=O}function Wo(t){var a=new Date(E[t+20>>2]+1900,E[t+16>>2],E[t+12>>2],E[t+8>>2],E[t+4>>2],E[t>>2],0),s=E[t+32>>2],l=a.getTimezoneOffset(),h=new Date(a.getFullYear(),0,1),w=new Date(a.getFullYear(),6,1).getTimezoneOffset(),S=h.getTimezoneOffset(),O=Math.min(S,w);if(s<0)E[t+32>>2]=+(w!=S&&O==l);else if(s>0!=(O==l)){var N=Math.max(S,w),T=s>0?O:N;a.setTime(a.getTime()+(T-l)*6e4)}E[t+24>>2]=a.getDay();var F=(a.getTime()-h.getTime())/(1e3*60*60*24)|0;return E[t+28>>2]=F,E[t>>2]=a.getSeconds(),E[t+4>>2]=a.getMinutes(),E[t+8>>2]=a.getHours(),E[t+12>>2]=a.getDate(),E[t+16>>2]=a.getMonth(),E[t+20>>2]=a.getYear(),a.getTime()/1e3|0}function Gt(t,a,s,l,h,w){try{var S=C.getStreamFromFD(l),O=i.mmap(S,t,h,a,s),N=O.ptr;return E[w>>2]=O.allocated,N}catch(T){if(typeof i>"u"||!(T instanceof i.ErrnoError))throw T;return-T.errno}}function Yo(t,a,s,l,h,w){try{var S=C.getStreamFromFD(h);s&2&&C.doMsync(t,S,a,l,w),i.munmap(S)}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function rt(t){var a=Ce(t)+1,s=zr(a);return s&&Ze(t,ee,s,a),s}function jo(t,a,s){var l=new Date().getFullYear(),h=new Date(l,0,1),w=new Date(l,6,1),S=h.getTimezoneOffset(),O=w.getTimezoneOffset(),N=Math.max(S,O);E[t>>2]=N*60,E[a>>2]=+(S!=O);function T(P){var M=P.toTimeString().match(/\(([A-Za-z ]+)\)$/);return M?M[1]:"GMT"}var F=T(h),L=T(w),R=rt(F),B=rt(L);O<S?(j[s>>2]=R,j[s+4>>2]=B):(j[s>>2]=B,j[s+4>>2]=R)}function Kt(t,a,s){Kt.called||(Kt.called=!0,jo(t,a,s))}function Xt(){me("")}function Rt(){return Date.now()}function tt(){return 2147483648}function qo(){return tt()}var Zt;te?Zt=()=>{var t=process.hrtime();return t[0]*1e3+t[1]/1e6}:Zt=()=>performance.now();function Vo(t,a,s){le.copyWithin(t,a,a+s)}function Mt(t){try{return ir.grow(t-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function it(t){var a=le.length;t=t>>>0;var s=tt();if(t>s)return!1;let l=(N,T)=>N+(T-N%T)%T;for(var h=1;h<=4;h*=2){var w=a*(1+.2/h);w=Math.min(w,t+100663296);var S=Math.min(s,l(Math.max(t,w),65536)),O=Mt(S);if(O)return!0}return!1}function Go(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var Or=A.ENV||{};function at(){return ie||"./this.program"}function st(){if(!st.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:at()};for(var s in Or)Or[s]===void 0?delete a[s]:a[s]=Or[s];var l=[];for(var s in a)l.push(s+"="+a[s]);st.strings=l}return st.strings}function On(t,a,s){for(var l=0;l<t.length;++l)ee[a++>>0]=t.charCodeAt(l);s||(ee[a>>0]=0)}function qr(t,a){var s=0;return st().forEach(function(l,h){var w=a+s;j[t+h*4>>2]=w,On(l,w),s+=l.length+1}),0}function Lt(t,a){var s=st();j[t>>2]=s.length;var l=0;return s.forEach(function(h){l+=h.length+1}),j[a>>2]=l,0}function Cn(t){Pr=t,Mr()||(f.onExit&&f.onExit(t),Tr=!0),_e(t,new Ur(t))}function Ko(t,a){Pr=t,Mr()||Kn(),Cn(t)}var pn=Ko;function Xo(t){try{var a=C.getStreamFromFD(t);return i.close(a),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return s.errno}}function Zo(t,a){try{var s=C.getStreamFromFD(t),l=s.tty?2:i.isDir(s.mode)?3:i.isLink(s.mode)?7:4;return ee[a>>0]=l,0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return h.errno}}function $o(t,a,s,l){for(var h=0,w=0;w<s;w++){var S=j[a>>2],O=j[a+4>>2];a+=8;var N=i.read(t,ee,S,O,l);if(N<0)return-1;if(h+=N,N<O)break}return h}function Jo(t,a,s,l){try{var h=C.getStreamFromFD(t),w=$o(h,a,s);return j[l>>2]=w,0}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return S.errno}}function Qo(t,a,s,l,h){try{var w=_n(a,s);if(isNaN(w))return 61;var S=C.getStreamFromFD(t);return i.llseek(S,w,l),Z=[S.position>>>0,(U=S.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[h>>2]=Z[0],E[h+4>>2]=Z[1],S.getdents&&w===0&&l===0&&(S.getdents=null),0}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return O.errno}}function ei(t,a,s,l){for(var h=0,w=0;w<s;w++){var S=j[a>>2],O=j[a+4>>2];a+=8;var N=i.write(t,ee,S,O,l);if(N<0)return-1;h+=N}return h}function nn(t,a,s,l){try{var h=C.getStreamFromFD(t),w=ei(h,a,s);return j[l>>2]=w,0}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return S.errno}}function Pn(t,a,s,l){var h=0,w=0,S=0,O=0,N=0,T=0,F;function L(R,B,P,M,z,q){var W,X,oe,se;return X=R===10?28:16,z=R===10?kn(z):Ne(z),W=zr(X),se=be(W,R,z,q),Le(!se),oe=zr(32),E[oe+4>>2]=R,E[oe+8>>2]=B,E[oe+12>>2]=P,E[oe+24>>2]=M,j[oe+20>>2]=W,R===10?E[oe+16>>2]=28:E[oe+16>>2]=16,E[oe+28>>2]=0,oe}if(s&&(S=E[s>>2],O=E[s+4>>2],N=E[s+8>>2],T=E[s+12>>2]),N&&!T&&(T=N===2?17:6),!N&&T&&(N=T===17?2:1),T===0&&(T=6),N===0&&(N=1),!t&&!a)return-2;if(S&-1088||s!==0&&E[s>>2]&2&&!t)return-1;if(S&32)return-2;if(N!==0&&N!==1&&N!==2)return-7;if(O!==0&&O!==2&&O!==10)return-6;if(a&&(a=ne(a),w=parseInt(a,10),isNaN(w)))return S&1024?-2:-8;if(!t)return O===0&&(O=2),S&1||(O===2?h=Ft(2130706433):h=[0,0,0,1]),F=L(O,N,T,null,h,w),j[l>>2]=F,0;if(t=ne(t),h=Ie(t),h!==null)if(O===0||O===2)O=2;else if(O===10&&S&8)h=[0,0,Ft(65535),h],O=10;else return-2;else if(h=Ar(t),h!==null)if(O===0||O===10)O=10;else return-2;return h!=null?(F=L(O,N,T,t,h,w),j[l>>2]=F,0):S&4?-2:(t=ue.lookup_name(t),h=Ie(t),O===0?O=2:O===10&&(h=[0,0,Ft(65535),h]),F=L(O,N,T,null,h,w),j[l>>2]=F,0)}function Rn(t){var a=zr(20),s=zr(t.length+1);Fe(t,s,t.length+1),j[a>>2]=s;var l=zr(4);j[l>>2]=0,j[a+4>>2]=l;var h=2;E[a+8>>2]=h,E[a+12>>2]=4;var w=zr(12);return j[w>>2]=w+8,j[w+4>>2]=0,E[w+8>>2]=Ie(ue.lookup_name(t)),j[a+16>>2]=w,a}function ri(t,a,s){if(s!==2)return he(5),null;t=E[t>>2];var l=Ne(t),h=ue.lookup_addr(l);return h&&(l=h),Rn(l)}function Mn(t){return Rn(ne(t))}function hn(t,a,s,l,h,w){var S=Mn(t);return Dr(a,S,20),At(S),E[w>>2]=0,j[h>>2]=a,0}function nt(t,a){for(var s=Math.min(a,3),l=8,h=0;h<s;h++)dt[t+h*l>>3]=.1;return s}function bt(t,a,s,l,h,w,S){var O=Gr(t,a);if(O.errno)return-6;var N=O.port,T=O.addr,F=!1;if(s&&l){var L;if(S&1||!(L=ue.lookup_addr(T))){if(S&8)return-2}else T=L;var R=Fe(T,s,l);R+1>=l&&(F=!0)}if(h&&w){N=""+N;var R=Fe(N,h,w);R+1>=w&&(F=!0)}return F?-12:0}var $t={list:[],map:{}};function yn(t){function a(w,S,O){var N=zr(w.length+1);On(w,N);for(var T=0,F=O.length,L=zr((F+1)*4),R=0;R<F;R++,T+=4){var B=O[R],P=zr(B.length+1);On(B,P),j[L+T>>2]=P}j[L+T>>2]=0;var M=zr(12);return j[M>>2]=N,j[M+4>>2]=L,E[M+8>>2]=S,M}var s=$t.list,l=$t.map;if(s.length===0){var h=a("tcp",6,["TCP"]);s.push(h),l.tcp=l[6]=h,h=a("udp",17,["UDP"]),s.push(h),l.udp=l[17]=h}yn.index=0}function Fr(t){t=ne(t),yn(!0);var a=$t.map[t];return a}function Ue(t){yn(!0);var a=$t.map[t];return a}function hr(t){var a=Ce(t)+1,s=ur(a);return Ze(t,ee,s,a),s}var tr={getAllWebSockets:function(t){let a=new Set;t.server&&t.server.clients.forEach(s=>{a.add(s)});for(let s of tr.getAllPeers(t))a.add(s.socket);return Array.from(a)},getAllPeers:function(t){let a=new Set;if(t.server&&t.pending.filter(s=>s.peers).forEach(s=>{for(let l of Object.values(s.peers))a.add(l)}),t.peers)for(let s of Object.values(t.peers))a.add(s);return Array.from(a)},awaitData:function(t){return tr.awaitWsEvent(t,"message")},awaitConnection:function(t){return t.OPEN===t.readyState?[Promise.resolve(),tr.noop]:tr.awaitWsEvent(t,"open")},awaitClose:function(t){return[t.CLOSING,t.CLOSED].includes(t.readyState)?[Promise.resolve(),tr.noop]:tr.awaitWsEvent(t,"close")},awaitError:function(t){return[t.CLOSING,t.CLOSED].includes(t.readyState)?[Promise.resolve(),tr.noop]:tr.awaitWsEvent(t,"error")},awaitWsEvent:function(t,a){let s,l=()=>{s()};return[new Promise(function(S){s=S,t.once(a,l)}),()=>{t.removeListener(a,l),setTimeout(s)}]},noop:function(){},shutdownSocket:function(t,a){let s=ke(t),l=Object.values(s.peers)[0];if(!l)return-1;try{return l.socket.close(),H.websocket_sock_ops.removePeer(s,l),0}catch(h){return console.log("Socket shutdown error",h),-1}}};function Hr(t,a,s){if(!t)return 1;let l=ne(t);if(!l.length)return 0;let h=ne(a);if(!h.length)return 0;if(f.popen_to_file){let{path:w,exitCode:S}=f.popen_to_file(l,h);return le[s]=S,hr(w)}if(te){let w=require("os").tmpdir(),S="php-process-stream",O=w+"/"+S,N=require("child_process"),T;if(h==="r")T=N.spawnSync(l,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[s]=T.status,require("fs").writeFileSync(O,T.stdout,{encoding:"utf8",flag:"w+"});else return h==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+h+" (should be r or w)"),_W_EXITCODE(0,2));return hr(O)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function Ge(t){return t%4===0&&(t%100!==0||t%400===0)}function Xe(t,a){for(var s=0,l=0;l<=a;s+=t[l++]);return s}var Ve=[31,29,31,30,31,30,31,31,30,31,30,31],ut=[31,28,31,30,31,30,31,31,30,31,30,31];function Kr(t,a){for(var s=new Date(t.getTime());a>0;){var l=Ge(s.getFullYear()),h=s.getMonth(),w=(l?Ve:ut)[h];if(a>w-s.getDate())a-=w-s.getDate()+1,s.setDate(1),h<11?s.setMonth(h+1):(s.setMonth(0),s.setFullYear(s.getFullYear()+1));else return s.setDate(s.getDate()+a),s}return s}function ot(t,a,s,l){var h=E[l+40>>2],w={tm_sec:E[l>>2],tm_min:E[l+4>>2],tm_hour:E[l+8>>2],tm_mday:E[l+12>>2],tm_mon:E[l+16>>2],tm_year:E[l+20>>2],tm_wday:E[l+24>>2],tm_yday:E[l+28>>2],tm_isdst:E[l+32>>2],tm_gmtoff:E[l+36>>2],tm_zone:h?ne(h):""},S=ne(s),O={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var N in O)S=S.replace(new RegExp(N,"g"),O[N]);var T=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],F=["January","February","March","April","May","June","July","August","September","October","November","December"];function L(W,X,oe){for(var se=typeof W=="number"?W.toString():W||"";se.length<X;)se=oe[0]+se;return se}function R(W,X){return L(W,X,"0")}function B(W,X){function oe(Oe){return Oe<0?-1:Oe>0?1:0}var se;return(se=oe(W.getFullYear()-X.getFullYear()))===0&&(se=oe(W.getMonth()-X.getMonth()))===0&&(se=oe(W.getDate()-X.getDate())),se}function P(W){switch(W.getDay()){case 0:return new Date(W.getFullYear()-1,11,29);case 1:return W;case 2:return new Date(W.getFullYear(),0,3);case 3:return new Date(W.getFullYear(),0,2);case 4:return new Date(W.getFullYear(),0,1);case 5:return new Date(W.getFullYear()-1,11,31);case 6:return new Date(W.getFullYear()-1,11,30)}}function M(W){var X=Kr(new Date(W.tm_year+1900,0,1),W.tm_yday),oe=new Date(X.getFullYear(),0,4),se=new Date(X.getFullYear()+1,0,4),Oe=P(oe),Ae=P(se);return B(Oe,X)<=0?B(Ae,X)<=0?X.getFullYear()+1:X.getFullYear():X.getFullYear()-1}var z={"%a":function(W){return T[W.tm_wday].substring(0,3)},"%A":function(W){return T[W.tm_wday]},"%b":function(W){return F[W.tm_mon].substring(0,3)},"%B":function(W){return F[W.tm_mon]},"%C":function(W){var X=W.tm_year+1900;return R(X/100|0,2)},"%d":function(W){return R(W.tm_mday,2)},"%e":function(W){return L(W.tm_mday,2," ")},"%g":function(W){return M(W).toString().substring(2)},"%G":function(W){return M(W)},"%H":function(W){return R(W.tm_hour,2)},"%I":function(W){var X=W.tm_hour;return X==0?X=12:X>12&&(X-=12),R(X,2)},"%j":function(W){return R(W.tm_mday+Xe(Ge(W.tm_year+1900)?Ve:ut,W.tm_mon-1),3)},"%m":function(W){return R(W.tm_mon+1,2)},"%M":function(W){return R(W.tm_min,2)},"%n":function(){return`
19
+ `},"%p":function(W){return W.tm_hour>=0&&W.tm_hour<12?"AM":"PM"},"%S":function(W){return R(W.tm_sec,2)},"%t":function(){return" "},"%u":function(W){return W.tm_wday||7},"%U":function(W){var X=W.tm_yday+7-W.tm_wday;return R(Math.floor(X/7),2)},"%V":function(W){var X=Math.floor((W.tm_yday+7-(W.tm_wday+6)%7)/7);if((W.tm_wday+371-W.tm_yday-2)%7<=2&&X++,X){if(X==53){var se=(W.tm_wday+371-W.tm_yday)%7;se!=4&&(se!=3||!Ge(W.tm_year))&&(X=1)}}else{X=52;var oe=(W.tm_wday+7-W.tm_yday-1)%7;(oe==4||oe==5&&Ge(W.tm_year%400-1))&&X++}return R(X,2)},"%w":function(W){return W.tm_wday},"%W":function(W){var X=W.tm_yday+7-(W.tm_wday+6)%7;return R(Math.floor(X/7),2)},"%y":function(W){return(W.tm_year+1900).toString().substring(2)},"%Y":function(W){return W.tm_year+1900},"%z":function(W){var X=W.tm_gmtoff,oe=X>=0;return X=Math.abs(X)/60,X=X/60*100+X%60,(oe?"+":"-")+("0000"+X).slice(-4)},"%Z":function(W){return W.tm_zone},"%%":function(){return"%"}};S=S.replace(/%%/g,"\0\0");for(var N in z)S.includes(N)&&(S=S.replace(new RegExp(N,"g"),z[N](w)));S=S.replace(/\0\0/g,"%");var q=Er(S,!1);return q.length>a?0:(Et(q,t),q.length-1)}function ft(t,a,s){for(var l=ne(a),h="\\!@#$^&*()+=-[]/{}|:<>?,.",w=0,S=h.length;w<S;++w)l=l.replace(new RegExp("\\"+h[w],"g"),"\\"+h[w]);var O={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var N in O)l=l.replace(N,O[N]);var T={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},F={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},L={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},R={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var B in T)l=l.replace(B,"("+B+T[B]+")");for(var P=[],w=l.indexOf("%");w>=0;w=l.indexOf("%"))P.push(l[w+1]),l=l.replace(new RegExp("\\%"+l[w+1],"g"),"");var M=new RegExp("^"+l,"i").exec(ne(t));function z(){function pi(Ei,ha,Ha){return typeof Ei!="number"||isNaN(Ei)?ha:Ei>=ha?Ei<=Ha?Ei:Ha:ha}return{year:pi(E[s+20>>2]+1900,1970,9999),month:pi(E[s+16>>2],0,11),day:pi(E[s+12>>2],1,31),hour:pi(E[s+8>>2],0,23),min:pi(E[s+4>>2],0,59),sec:pi(E[s>>2],0,59)}}if(M){var q=z(),W,X=pi=>{var Ei=P.indexOf(pi);if(Ei>=0)return M[Ei+1]};if((W=X("S"))&&(q.sec=ce(W)),(W=X("M"))&&(q.min=ce(W)),W=X("H"))q.hour=ce(W);else if(W=X("I")){var oe=ce(W);(W=X("p"))&&(oe+=W.toUpperCase()[0]==="P"?12:0),q.hour=oe}if(W=X("Y"))q.year=ce(W);else if(W=X("y")){var se=ce(W);(W=X("C"))?se+=ce(W)*100:se+=se<69?2e3:1900,q.year=se}if((W=X("m"))?q.month=ce(W)-1:(W=X("b"))&&(q.month=F[W.substring(0,3).toUpperCase()]||0),W=X("d"))q.day=ce(W);else if(W=X("j"))for(var Oe=ce(W),Ae=Ge(q.year),Qe=0;Qe<12;++Qe){var Ke=Xe(Ae?Ve:ut,Qe-1);Oe<=Ke+(Ae?Ve:ut)[Qe]&&(q.day=Oe-Ke)}else if(W=X("a")){var rr=W.substring(0,3).toUpperCase();if(W=X("U")){var je=L[rr],nr=ce(W),or=new Date(q.year,0,1),xr;or.getDay()===0?xr=Kr(or,je+7*(nr-1)):xr=Kr(or,7-or.getDay()+je+7*(nr-1)),q.day=xr.getDate(),q.month=xr.getMonth()}else if(W=X("W")){var je=R[rr],nr=ce(W),or=new Date(q.year,0,1),xr;or.getDay()===1?xr=Kr(or,je+7*(nr-1)):xr=Kr(or,7-or.getDay()+1+je+7*(nr-1)),q.day=xr.getDate(),q.month=xr.getMonth()}}var et=new Date(q.year,q.month,q.day,q.hour,q.min,q.sec,0);return E[s>>2]=et.getSeconds(),E[s+4>>2]=et.getMinutes(),E[s+8>>2]=et.getHours(),E[s+12>>2]=et.getDate(),E[s+16>>2]=et.getMonth(),E[s+20>>2]=et.getFullYear()-1900,E[s+24>>2]=et.getDay(),E[s+28>>2]=Xe(Ge(et.getFullYear())?Ve:ut,et.getMonth()-1)+et.getDate()-1,E[s+32>>2]=0,t+Er(M[0]).length-1}return 0}function Ot(t){return tr.shutdownSocket(t,2)}function Dt(t,a,s){if(typeof Asyncify>"u")return 0;let l=1,h=2,w=4,S=8,O=16,N=32;return Asyncify.handleSleep(T=>{let F=ke(t);if(!F){T(0);return}let L=[],R=new Set;if(a&l||a&h){if(F.server){for(let W of F.pending)if((W.recv_queue||[]).length>0){T(1);return}}else if((F.recv_queue||[]).length>0){T(1);return}}let B=tr.getAllWebSockets(F);if(!B.length){T(0);return}for(let W of B)(a&l||a&h)&&(L.push(tr.awaitData(W)),R.add("POLLIN")),a&w&&(L.push(tr.awaitConnection(W)),R.add("POLLOUT")),a&O&&(L.push(tr.awaitClose(W)),R.add("POLLHUP")),(a&S||a&N)&&(L.push(tr.awaitError(W)),R.add("POLLERR"));if(L.length===0){console.warn("Unsupported poll event "+a+", defaulting to setTimeout()."),setTimeout(function(){T(0)},s);return}let P=L.map(([W])=>W),M=()=>L.forEach(([,W])=>W()),z=!1;Promise.race(P).then(function(W){z||(z=!0,T(1),clearTimeout(q),M())});let q=setTimeout(function(){z||(z=!0,T(0),M())},s)})}function Jt(t,a,s,l,h){let w=le[l];if(!(a===1&&s===9||a===6&&s===1))return console.warn(`Unsupported socket option: ${a}, ${s}, ${w}`),-1;let L=tr.getAllWebSockets(t)[0];return L?(L.setSocketOpt(a,s,l),0):-1}function Ut(t,a){return tr.shutdownSocket(t,a)}function Xr(t){var a=f["_"+t];return a}function $r(t,a,s,l,h){var w={string:P=>{var M=0;if(P!=null&&P!==0){var z=(P.length<<2)+1;M=ur(z),Fe(P,M,z)}return M},array:P=>{var M=ur(P.length);return Et(P,M),M}};function S(P){return a==="string"?ne(P):a==="boolean"?!!P:P}var O=Xr(t),N=[],T=0;if(l)for(var F=0;F<l.length;F++){var L=w[s[F]];L?(T===0&&(T=vr()),N[F]=L(l[F])):N[F]=l[F]}var R=O.apply(null,N);function B(P){return T!==0&&Be(T),S(P)}return R=B(R),R}var En=function(t,a,s,l){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=i.nextInode++,this.name=a,this.mode=s,this.node_ops={},this.stream_ops={},this.rdev=l},ti=365,wn=146;Object.defineProperties(En.prototype,{read:{get:function(){return(this.mode&ti)===ti},set:function(t){t?this.mode|=ti:this.mode&=~ti}},write:{get:function(){return(this.mode&wn)===wn},set:function(t){t?this.mode|=wn:this.mode&=~wn}},isFolder:{get:function(){return i.isDir(this.mode)}},isDevice:{get:function(){return i.isChrdev(this.mode)}}}),i.FSNode=En,i.staticInit(),f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_unlink=i.unlink,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,te&&(yr(),V.staticInit()),re={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};var on={j:to,Va:wt,Ua:v,Ta:Zr,Sa:dn,Ra:Pt,P:oo,Qa:io,Pa:ao,Oa:so,Na:uo,U:fo,Ma:gt,La:co,O:lo,o:qt,Ka:_o,Ja:mo,T:vo,Ia:po,Ha:ho,Ga:yo,Fa:Eo,Ea:wo,N:go,Da:So,Ca:bo,Ba:ko,Aa:ae,w:Oo,za:Do,ya:Se,xa:No,wa:To,va:Ao,M:Fo,ua:Co,L:Po,ta:Ro,sa:Mo,ra:jr,D:Lo,qa:Vt,ma:St,la:Uo,ka:vn,ja:Bo,ia:xo,ha:zo,ga:Ho,fa:Wo,ea:Gt,da:Yo,ca:Kt,m:Xt,B:Rt,ba:qo,A:Zt,aa:Vo,$:it,_:Go,pa:qr,oa:Lt,p:pn,r:Xo,K:Zo,J:Jo,S:Qo,C:nn,Z:Pn,I:ri,H:hn,Y:nt,G:bt,X:Fr,W:Ue,h:xn,d:D,b:_i,f:c,g:u,u:p,t:li,v:r,F:d,e:k,a:di,c:bn,z:b,l:g,k:_,n:y,i:m,y:n,V:Hr,na:Cn,E:ot,R:ft,s:Ot,x:Dt,q:Jt,Q:Ut},Qt=ro(),Dn=f.___wasm_call_ctors=function(){return(Dn=f.___wasm_call_ctors=f.asm.Xa).apply(null,arguments)},gn=f._wasm_popen=function(){return(gn=f._wasm_popen=f.asm.Ya).apply(null,arguments)},Tt=f.___errno_location=function(){return(Tt=f.___errno_location=f.asm.Za).apply(null,arguments)},Jr=f._wasm_pclose=function(){return(Jr=f._wasm_pclose=f.asm._a).apply(null,arguments)},mr=f._php_pollfd_for=function(){return(mr=f._php_pollfd_for=f.asm.$a).apply(null,arguments)},Qr=f._wasm_select=function(){return(Qr=f._wasm_select=f.asm.ab).apply(null,arguments)},It=f._wasm_add_cli_arg=function(){return(It=f._wasm_add_cli_arg=f.asm.bb).apply(null,arguments)},zr=f._malloc=function(){return(zr=f._malloc=f.asm.cb).apply(null,arguments)},Nt=f._run_cli=function(){return(Nt=f._run_cli=f.asm.db).apply(null,arguments)},Dr=f._memcpy=function(){return(Dr=f._memcpy=f.asm.eb).apply(null,arguments)},At=f._free=function(){return(At=f._free=f.asm.fb).apply(null,arguments)},an=f._fflush=function(){return(an=f._fflush=f.asm.hb).apply(null,arguments)},Br=f._htons=function(){return(Br=f._htons=f.asm.ib).apply(null,arguments)},Vr=f._ntohs=function(){return(Vr=f._ntohs=f.asm.jb).apply(null,arguments)},Ft=f._htonl=function(){return(Ft=f._htonl=f.asm.kb).apply(null,arguments)},sn=f._wasm_set_phpini_path=function(){return(sn=f._wasm_set_phpini_path=f.asm.lb).apply(null,arguments)},en=f._wasm_set_phpini_entries=function(){return(en=f._wasm_set_phpini_entries=f.asm.mb).apply(null,arguments)},un=f._wasm_add_SERVER_entry=function(){return(un=f._wasm_add_SERVER_entry=f.asm.nb).apply(null,arguments)},rn=f._wasm_add_uploaded_file=function(){return(rn=f._wasm_add_uploaded_file=f.asm.ob).apply(null,arguments)},tn=f._wasm_set_query_string=function(){return(tn=f._wasm_set_query_string=f.asm.pb).apply(null,arguments)},Sn=f._wasm_set_path_translated=function(){return(Sn=f._wasm_set_path_translated=f.asm.qb).apply(null,arguments)},ni=f._wasm_set_skip_shebang=function(){return(ni=f._wasm_set_skip_shebang=f.asm.rb).apply(null,arguments)},oi=f._wasm_set_request_uri=function(){return(oi=f._wasm_set_request_uri=f.asm.sb).apply(null,arguments)},ii=f._wasm_set_request_method=function(){return(ii=f._wasm_set_request_method=f.asm.tb).apply(null,arguments)},ai=f._wasm_set_request_host=function(){return(ai=f._wasm_set_request_host=f.asm.ub).apply(null,arguments)},si=f._wasm_set_content_type=function(){return(si=f._wasm_set_content_type=f.asm.vb).apply(null,arguments)},ui=f._wasm_set_request_body=function(){return(ui=f._wasm_set_request_body=f.asm.wb).apply(null,arguments)},fi=f._wasm_set_content_length=function(){return(fi=f._wasm_set_content_length=f.asm.xb).apply(null,arguments)},ci=f._wasm_set_cookies=function(){return(ci=f._wasm_set_cookies=f.asm.yb).apply(null,arguments)},Ln=f._wasm_set_php_code=function(){return(Ln=f._wasm_set_php_code=f.asm.zb).apply(null,arguments)},Un=f._wasm_set_request_port=function(){return(Un=f._wasm_set_request_port=f.asm.Ab).apply(null,arguments)},Cr=f._phpwasm_init_uploaded_files_hash=function(){return(Cr=f._phpwasm_init_uploaded_files_hash=f.asm.Bb).apply(null,arguments)},Sr=f._phpwasm_register_uploaded_file=function(){return(Sr=f._phpwasm_register_uploaded_file=f.asm.Cb).apply(null,arguments)},br=f._phpwasm_destroy_uploaded_files_hash=function(){return(br=f._phpwasm_destroy_uploaded_files_hash=f.asm.Db).apply(null,arguments)},Te=f._wasm_sapi_handle_request=function(){return(Te=f._wasm_sapi_handle_request=f.asm.Eb).apply(null,arguments)},De=f._php_wasm_init=function(){return(De=f._php_wasm_init=f.asm.Fb).apply(null,arguments)},ye=f.___funcs_on_exit=function(){return(ye=f.___funcs_on_exit=f.asm.Gb).apply(null,arguments)},sr=f._emscripten_builtin_memalign=function(){return(sr=f._emscripten_builtin_memalign=f.asm.Hb).apply(null,arguments)},Ye=f._setThrew=function(){return(Ye=f._setThrew=f.asm.Ib).apply(null,arguments)},vr=f.stackSave=function(){return(vr=f.stackSave=f.asm.Jb).apply(null,arguments)},Be=f.stackRestore=function(){return(Be=f.stackRestore=f.asm.Kb).apply(null,arguments)},ur=f.stackAlloc=function(){return(ur=f.stackAlloc=f.asm.Lb).apply(null,arguments)},fr=f.dynCall_vi=function(){return(fr=f.dynCall_vi=f.asm.Mb).apply(null,arguments)},cr=f.dynCall_iiii=function(){return(cr=f.dynCall_iiii=f.asm.Nb).apply(null,arguments)},He=f.dynCall_ii=function(){return(He=f.dynCall_ii=f.asm.Ob).apply(null,arguments)},xe=f.dynCall_iiiiii=function(){return(xe=f.dynCall_iiiiii=f.asm.Pb).apply(null,arguments)},lr=f.dynCall_iiiii=function(){return(lr=f.dynCall_iiiii=f.asm.Qb).apply(null,arguments)},kt=f.dynCall_viii=function(){return(kt=f.dynCall_viii=f.asm.Rb).apply(null,arguments)},Bt=f.dynCall_vii=function(){return(Bt=f.dynCall_vii=f.asm.Sb).apply(null,arguments)},xt=f.dynCall_iii=function(){return(xt=f.dynCall_iii=f.asm.Tb).apply(null,arguments)},zt=f.dynCall_viiiii=function(){return(zt=f.dynCall_viiiii=f.asm.Ub).apply(null,arguments)},Ht=f.dynCall_iiiiiii=function(){return(Ht=f.dynCall_iiiiiii=f.asm.Vb).apply(null,arguments)},Wt=f.dynCall_i=function(){return(Wt=f.dynCall_i=f.asm.Wb).apply(null,arguments)},Yt=f.dynCall_v=function(){return(Yt=f.dynCall_v=f.asm.Xb).apply(null,arguments)},jt=f.dynCall_viiii=function(){return(jt=f.dynCall_viiii=f.asm.Yb).apply(null,arguments)},fn=f.dynCall_iiiiiiiiii=function(){return(fn=f.dynCall_iiiiiiiiii=f.asm.Zb).apply(null,arguments)},Nn=f.dynCall_viiiiiiiii=function(){return(Nn=f.dynCall_viiiiiiiii=f.asm._b).apply(null,arguments)},Tn=f.dynCall_viiiiii=function(){return(Tn=f.dynCall_viiiiii=f.asm.$b).apply(null,arguments)},In=f.dynCall_iiiiiiii=function(){return(In=f.dynCall_iiiiiiii=f.asm.ac).apply(null,arguments)},Bn=f.dynCall_viidii=function(){return(Bn=f.dynCall_viidii=f.asm.bc).apply(null,arguments)};function li(t,a,s,l,h,w,S){var O=vr();try{return Ht(t,a,s,l,h,w,S)}catch(N){if(Be(O),N!==N+0)throw N;Ye(1,0)}}function di(t,a){var s=vr();try{fr(t,a)}catch(l){if(Be(s),l!==l+0)throw l;Ye(1,0)}}function _i(t,a,s){var l=vr();try{return xt(t,a,s)}catch(h){if(Be(l),h!==h+0)throw h;Ye(1,0)}}function bn(t,a,s){var l=vr();try{Bt(t,a,s)}catch(h){if(Be(l),h!==h+0)throw h;Ye(1,0)}}function xn(t){var a=vr();try{return Wt(t)}catch(s){if(Be(a),s!==s+0)throw s;Ye(1,0)}}function g(t,a,s,l){var h=vr();try{kt(t,a,s,l)}catch(w){if(Be(h),w!==w+0)throw w;Ye(1,0)}}function k(t){var a=vr();try{Yt(t)}catch(s){if(Be(a),s!==s+0)throw s;Ye(1,0)}}function D(t,a){var s=vr();try{return He(t,a)}catch(l){if(Be(s),l!==l+0)throw l;Ye(1,0)}}function _(t,a,s,l,h){var w=vr();try{jt(t,a,s,l,h)}catch(S){if(Be(w),S!==S+0)throw S;Ye(1,0)}}function u(t,a,s,l,h){var w=vr();try{return lr(t,a,s,l,h)}catch(S){if(Be(w),S!==S+0)throw S;Ye(1,0)}}function c(t,a,s,l){var h=vr();try{return cr(t,a,s,l)}catch(w){if(Be(h),w!==w+0)throw w;Ye(1,0)}}function m(t,a,s,l,h,w,S){var O=vr();try{Tn(t,a,s,l,h,w,S)}catch(N){if(Be(O),N!==N+0)throw N;Ye(1,0)}}function y(t,a,s,l,h,w){var S=vr();try{zt(t,a,s,l,h,w)}catch(O){if(Be(S),O!==O+0)throw O;Ye(1,0)}}function b(t,a,s,l,h,w){var S=vr();try{Bn(t,a,s,l,h,w)}catch(O){if(Be(S),O!==O+0)throw O;Ye(1,0)}}function d(t,a,s,l,h,w,S,O,N,T){var F=vr();try{return fn(t,a,s,l,h,w,S,O,N,T)}catch(L){if(Be(F),L!==L+0)throw L;Ye(1,0)}}function p(t,a,s,l,h,w){var S=vr();try{return xe(t,a,s,l,h,w)}catch(O){if(Be(S),O!==O+0)throw O;Ye(1,0)}}function n(t,a,s,l,h,w,S,O,N,T){var F=vr();try{Nn(t,a,s,l,h,w,S,O,N,T)}catch(L){if(Be(F),L!==L+0)throw L;Ye(1,0)}}function r(t,a,s,l,h,w,S,O){var N=vr();try{return In(t,a,s,l,h,w,S,O)}catch(T){if(Be(N),T!==T+0)throw T;Ye(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,f.FS_unlink=i.unlink,f.ccall=$r,f.FS=i;var e;$e=function t(){e||o(),e||($e=t)};function o(t){if(t=t||$,Pe>0||(Vn(),Pe>0))return;function a(){e||(e=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),a()},1)):a()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return o(),A}var Bf,Qs,ru=Oi(()=>{"use strict";Bf=10832154,Qs=__dirname+"/php_7_4.wasm"});var nu={};gi(nu,{default:()=>Hf,dependenciesTotalSize:()=>zf,dependencyFilename:()=>tu});function Hf(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(e,o)=>{throw o},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(e){return f.locateFile?f.locateFile(e,ve):ve+e}var We,ar,Re;function Wr(e){if(e instanceof Ur)return;fe("exiting due to exception: "+e)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(e,o)=>(yr(),e=Me.normalize(e),J.readFileSync(e,o?void 0:"utf8")),Re=e=>{var o=We(e,!0);return o.buffer||(o=new Uint8Array(o)),o},ar=(e,o,t)=>{yr(),e=Me.normalize(e),J.readFile(e,function(a,s){a?t(a):o(s.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(e){if(!(e instanceof Ur))throw e}),process.on("unhandledRejection",function(e){throw e}),_e=(e,o)=>{if(Mr())throw process.exitCode=e,o;Wr(o),process.exit(e)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(e,o){e||me(o)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(e,o,t){for(var a=o+t,s=o;e[s]&&!(s>=a);)++s;if(s-o>16&&e.buffer&&ct)return ct.decode(e.subarray(o,s));for(var l="";o<s;){var h=e[o++];if(!(h&128)){l+=String.fromCharCode(h);continue}var w=e[o++]&63;if((h&224)==192){l+=String.fromCharCode((h&31)<<6|w);continue}var S=e[o++]&63;if((h&240)==224?h=(h&15)<<12|w<<6|S:h=(h&7)<<18|w<<12|S<<6|e[o++]&63,h<65536)l+=String.fromCharCode(h);else{var O=h-65536;l+=String.fromCharCode(55296|O>>10,56320|O&1023)}}return l}function ne(e,o){return e?ze(le,e,o):""}function Ze(e,o,t,a){if(!(a>0))return 0;for(var s=t,l=t+a-1,h=0;h<e.length;++h){var w=e.charCodeAt(h);if(w>=55296&&w<=57343){var S=e.charCodeAt(++h);w=65536+((w&1023)<<10)|S&1023}if(w<=127){if(t>=l)break;o[t++]=w}else if(w<=2047){if(t+1>=l)break;o[t++]=192|w>>6,o[t++]=128|w&63}else if(w<=65535){if(t+2>=l)break;o[t++]=224|w>>12,o[t++]=128|w>>6&63,o[t++]=128|w&63}else{if(t+3>=l)break;o[t++]=240|w>>18,o[t++]=128|w>>12&63,o[t++]=128|w>>6&63,o[t++]=128|w&63}}return o[t]=0,t-s}function Fe(e,o,t){return Ze(e,le,o,t)}function Ce(e){for(var o=0,t=0;t<e.length;++t){var a=e.charCodeAt(t);a<=127?o++:a<=2047?o+=2:a>=55296&&a<=57343?(o+=4,++t):o+=3}return o}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(e){Rr=e,f.HEAP8=ee=new Int8Array(e),f.HEAP16=we=new Int16Array(e),f.HEAP32=E=new Int32Array(e),f.HEAPU8=le=new Uint8Array(e),f.HEAPU16=lt=new Uint16Array(e),f.HEAPU32=j=new Uint32Array(e),f.HEAPF32=Hn=new Float32Array(e),f.HEAPF64=dt=new Float64Array(e)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!i.init.initialized&&i.init(),i.ignorePermissions=!1,ge.init(),H.root=i.mount(H,{},null),ae.root=i.mount(ae,{},null),_r(vt)}function Kn(){Te(),_r(Wn),i.quit(),ge.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(e){mt.unshift(e)}function $n(e){vt.unshift(e)}function Jn(e){pt.unshift(e)}var Pe=0,Lr=null,$e=null;function Ci(e){return e}function dr(e){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(e){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var o=$e;$e=null,o()}}function me(e){f.onAbort&&f.onAbort(e),e="Aborted("+e+")",fe(e),Tr=!0,Pr=1,e+=". Build with -sASSERTIONS for more info.";var o=new WebAssembly.RuntimeError(e);throw o}var Qn="data:application/octet-stream;base64,";function ht(e){return e.startsWith(Qn)}var de;de=tu,ht(de)||(de=Nr(de));function yt(e){try{if(e==de&&qe)return new Uint8Array(qe);if(Re)return Re(e);throw"both async and sync fetching of the wasm failed"}catch(o){me(o)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+de+"'";return e.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var e={a:ti};function o(h,w){var S=h.exports;f.asm=S,ir=f.asm.Ua,_t(ir.buffer),ln=f.asm.eb,$n(f.asm.Va),Je("wasm-instantiate")}dr("wasm-instantiate");function t(h){o(h.instance)}function a(h){return eo().then(function(w){return WebAssembly.instantiate(w,e)}).then(function(w){return w}).then(h,function(w){fe("failed to asynchronously prepare wasm: "+w),me(w)})}function s(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(h){var w=WebAssembly.instantiateStreaming(h,e);return w.then(t,function(S){return fe("wasm streaming compile failed: "+S),fe("falling back to ArrayBuffer instantiation"),a(t)})}):a(t)}if(f.instantiateWasm)try{var l=f.instantiateWasm(e,o);return l}catch(h){return fe("Module.instantiateWasm callback failed with error: "+h),!1}return s(),{}}var U,Z;function Ur(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function _r(e){for(;e.length>0;)e.shift()(f)}function Et(e,o){ee.set(e,o)}function to(e,o,t,a){me("Assertion failed: "+ne(e)+", at: "+[o?ne(o):"unknown filename",t,a?ne(a):"unknown function"])}function wt(e,o){(function(t){Be.apply(null,[e,t])})(o)}var Y={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return o.exec(e).slice(1)},normalizeArray:(e,o)=>{for(var t=0,a=e.length-1;a>=0;a--){var s=e[a];s==="."?e.splice(a,1):s===".."?(e.splice(a,1),t++):t&&(e.splice(a,1),t--)}if(o)for(;t;t--)e.unshift("..");return e},normalize:e=>{var o=Y.isAbs(e),t=e.substr(-1)==="/";return e=Y.normalizeArray(e.split("/").filter(a=>!!a),!o).join("/"),!e&&!o&&(e="."),e&&t&&(e+="/"),(o?"/":"")+e},dirname:e=>{var o=Y.splitPath(e),t=o[0],a=o[1];return!t&&!a?".":(a&&(a=a.substr(0,a.length-1)),t+a)},basename:e=>{if(e==="/")return"/";e=Y.normalize(e),e=e.replace(/\/$/,"");var o=e.lastIndexOf("/");return o===-1?e:e.substr(o+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Y.normalize(e.join("/"))},join2:(e,o)=>Y.normalize(e+"/"+o)};function no(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}else if(te)try{var o=require("crypto");return()=>o.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var Q={resolve:function(){for(var e="",o=!1,t=arguments.length-1;t>=-1&&!o;t--){var a=t>=0?arguments[t]:i.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";e=a+"/"+e,o=Y.isAbs(a)}return e=Y.normalizeArray(e.split("/").filter(s=>!!s),!o).join("/"),(o?"/":"")+e||"."},relative:(e,o)=>{e=Q.resolve(e).substr(1),o=Q.resolve(o).substr(1);function t(O){for(var N=0;N<O.length&&O[N]==="";N++);for(var T=O.length-1;T>=0&&O[T]==="";T--);return N>T?[]:O.slice(N,T-N+1)}for(var a=t(e.split("/")),s=t(o.split("/")),l=Math.min(a.length,s.length),h=l,w=0;w<l;w++)if(a[w]!==s[w]){h=w;break}for(var S=[],w=h;w<a.length;w++)S.push("..");return S=S.concat(s.slice(h)),S.join("/")}};function Er(e,o,t){var a=t>0?t:Ce(e)+1,s=new Array(a),l=Ze(e,s,0,s.length);return o&&(s.length=l),s}var ge={ttys:[],init:function(){},shutdown:function(){},register:function(e,o){ge.ttys[e]={input:[],output:[],ops:o},i.registerDevice(e,ge.stream_ops)},stream_ops:{open:function(e){var o=ge.ttys[e.node.rdev];if(!o)throw new i.ErrnoError(43);e.tty=o,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,o,t,a,s){if(!e.tty||!e.tty.ops.get_char)throw new i.ErrnoError(60);for(var l=0,h=0;h<a;h++){var w;try{w=e.tty.ops.get_char(e.tty)}catch{throw new i.ErrnoError(29)}if(w===void 0&&l===0)throw new i.ErrnoError(6);if(w==null)break;l++,o[t+h]=w}return l&&(e.node.timestamp=Date.now()),l},write:function(e,o,t,a,s){if(!e.tty||!e.tty.ops.put_char)throw new i.ErrnoError(60);try{for(var l=0;l<a;l++)e.tty.ops.put_char(e.tty,o[t+l])}catch{throw new i.ErrnoError(29)}return a&&(e.node.timestamp=Date.now()),l}},default_tty_ops:{get_char:function(e){if(!e.input.length){var o=null;if(te){var t=256,a=Buffer.alloc(t),s=0;try{s=J.readSync(process.stdin.fd,a,0,t,-1)}catch(l){if(l.toString().includes("EOF"))s=0;else throw l}s>0?o=a.slice(0,s).toString("utf-8"):o=null}else typeof window<"u"&&typeof window.prompt=="function"?(o=window.prompt("Input: "),o!==null&&(o+=`
20
+ `)):typeof readline=="function"&&(o=readline(),o!==null&&(o+=`
21
+ `));if(!o)return null;e.input=Er(o,!0)}return e.input.shift()},put_char:function(e,o){o===null||o===10?(er(ze(e.output,0)),e.output=[]):o!=0&&e.output.push(o)},fsync:function(e){e.output&&e.output.length>0&&(er(ze(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,o){o===null||o===10?(fe(ze(e.output,0)),e.output=[]):o!=0&&e.output.push(o)},fsync:function(e){e.output&&e.output.length>0&&(fe(ze(e.output,0)),e.output=[])}}};function wr(e,o){return le.fill(0,e,e+o),e}function gr(e,o){return Math.ceil(e/o)*o}function Ir(e){e=gr(e,65536);var o=De(65536,e);return o?wr(o,e):0}var G={ops_table:null,mount:function(e){return G.createNode(null,"/",16895,0)},createNode:function(e,o,t,a){if(i.isBlkdev(t)||i.isFIFO(t))throw new i.ErrnoError(63);G.ops_table||(G.ops_table={dir:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,lookup:G.node_ops.lookup,mknod:G.node_ops.mknod,rename:G.node_ops.rename,unlink:G.node_ops.unlink,rmdir:G.node_ops.rmdir,readdir:G.node_ops.readdir,symlink:G.node_ops.symlink},stream:{llseek:G.stream_ops.llseek}},file:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:{llseek:G.stream_ops.llseek,read:G.stream_ops.read,write:G.stream_ops.write,allocate:G.stream_ops.allocate,mmap:G.stream_ops.mmap,msync:G.stream_ops.msync}},link:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,readlink:G.node_ops.readlink},stream:{}},chrdev:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:i.chrdev_stream_ops}});var s=i.createNode(e,o,t,a);return i.isDir(s.mode)?(s.node_ops=G.ops_table.dir.node,s.stream_ops=G.ops_table.dir.stream,s.contents={}):i.isFile(s.mode)?(s.node_ops=G.ops_table.file.node,s.stream_ops=G.ops_table.file.stream,s.usedBytes=0,s.contents=null):i.isLink(s.mode)?(s.node_ops=G.ops_table.link.node,s.stream_ops=G.ops_table.link.stream):i.isChrdev(s.mode)&&(s.node_ops=G.ops_table.chrdev.node,s.stream_ops=G.ops_table.chrdev.stream),s.timestamp=Date.now(),e&&(e.contents[o]=s,e.timestamp=s.timestamp),s},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,o){var t=e.contents?e.contents.length:0;if(!(t>=o)){var a=1024*1024;o=Math.max(o,t*(t<a?2:1.125)>>>0),t!=0&&(o=Math.max(o,256));var s=e.contents;e.contents=new Uint8Array(o),e.usedBytes>0&&e.contents.set(s.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,o){if(e.usedBytes!=o)if(o==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(o),t&&e.contents.set(t.subarray(0,Math.min(o,e.usedBytes))),e.usedBytes=o}},node_ops:{getattr:function(e){var o={};return o.dev=i.isChrdev(e.mode)?e.id:1,o.ino=e.id,o.mode=e.mode,o.nlink=1,o.uid=0,o.gid=0,o.rdev=e.rdev,i.isDir(e.mode)?o.size=4096:i.isFile(e.mode)?o.size=e.usedBytes:i.isLink(e.mode)?o.size=e.link.length:o.size=0,o.atime=new Date(e.timestamp),o.mtime=new Date(e.timestamp),o.ctime=new Date(e.timestamp),o.blksize=4096,o.blocks=Math.ceil(o.size/o.blksize),o},setattr:function(e,o){o.mode!==void 0&&(e.mode=o.mode),o.timestamp!==void 0&&(e.timestamp=o.timestamp),o.size!==void 0&&G.resizeFileStorage(e,o.size)},lookup:function(e,o){throw i.genericErrors[44]},mknod:function(e,o,t,a){return G.createNode(e,o,t,a)},rename:function(e,o,t){if(i.isDir(e.mode)){var a;try{a=i.lookupNode(o,t)}catch{}if(a)for(var s in a.contents)throw new i.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,o.contents[t]=e,o.timestamp=e.parent.timestamp,e.parent=o},unlink:function(e,o){delete e.contents[o],e.timestamp=Date.now()},rmdir:function(e,o){var t=i.lookupNode(e,o);for(var a in t.contents)throw new i.ErrnoError(55);delete e.contents[o],e.timestamp=Date.now()},readdir:function(e){var o=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&o.push(t);return o},symlink:function(e,o,t){var a=G.createNode(e,o,41471,0);return a.link=t,a},readlink:function(e){if(!i.isLink(e.mode))throw new i.ErrnoError(28);return e.link}},stream_ops:{read:function(e,o,t,a,s){var l=e.node.contents;if(s>=e.node.usedBytes)return 0;var h=Math.min(e.node.usedBytes-s,a);if(h>8&&l.subarray)o.set(l.subarray(s,s+h),t);else for(var w=0;w<h;w++)o[t+w]=l[s+w];return h},write:function(e,o,t,a,s,l){if(o.buffer===ee.buffer&&(l=!1),!a)return 0;var h=e.node;if(h.timestamp=Date.now(),o.subarray&&(!h.contents||h.contents.subarray)){if(l)return h.contents=o.subarray(t,t+a),h.usedBytes=a,a;if(h.usedBytes===0&&s===0)return h.contents=o.slice(t,t+a),h.usedBytes=a,a;if(s+a<=h.usedBytes)return h.contents.set(o.subarray(t,t+a),s),a}if(G.expandFileStorage(h,s+a),h.contents.subarray&&o.subarray)h.contents.set(o.subarray(t,t+a),s);else for(var w=0;w<a;w++)h.contents[s+w]=o[t+w];return h.usedBytes=Math.max(h.usedBytes,s+a),a},llseek:function(e,o,t){var a=o;if(t===1?a+=e.position:t===2&&i.isFile(e.node.mode)&&(a+=e.node.usedBytes),a<0)throw new i.ErrnoError(28);return a},allocate:function(e,o,t){G.expandFileStorage(e.node,o+t),e.node.usedBytes=Math.max(e.node.usedBytes,o+t)},mmap:function(e,o,t,a,s){if(!i.isFile(e.node.mode))throw new i.ErrnoError(43);var l,h,w=e.node.contents;if(!(s&2)&&w.buffer===Rr)h=!1,l=w.byteOffset;else{if((t>0||t+o<w.length)&&(w.subarray?w=w.subarray(t,t+o):w=Array.prototype.slice.call(w,t,t+o)),h=!0,l=Ir(o),!l)throw new i.ErrnoError(48);ee.set(w,l)}return{ptr:l,allocated:h}},msync:function(e,o,t,a,s){return G.stream_ops.write(e,o,0,a,t,!1),0}}};function Ct(e,o,t,a){var s=a?"":"al "+e;ar(e,l=>{Le(l,'Loading data file "'+e+'" failed (no arrayBuffer).'),o(new Uint8Array(l)),s&&Je(s)},l=>{if(t)t();else throw'Loading data file "'+e+'" failed.'}),s&&dr(s)}var re={},V={isWindows:!1,staticInit:()=>{V.isWindows=!!process.platform.match(/^win/);var e=process.binding("constants");e.fs&&(e=e.fs),V.flagsForNodeMap={1024:e.O_APPEND,64:e.O_CREAT,128:e.O_EXCL,256:e.O_NOCTTY,0:e.O_RDONLY,2:e.O_RDWR,4096:e.O_SYNC,512:e.O_TRUNC,1:e.O_WRONLY,131072:e.O_NOFOLLOW}},convertNodeCode:e=>{var o=e.code;return re[o]},mount:e=>V.createNode(null,"/",V.getMode(e.opts.root),0),createNode:(e,o,t,a)=>{if(!i.isDir(t)&&!i.isFile(t)&&!i.isLink(t))throw new i.ErrnoError(28);var s=i.createNode(e,o,t);return s.node_ops=V.node_ops,s.stream_ops=V.stream_ops,s},getMode:e=>{var o;try{o=J.lstatSync(e),V.isWindows&&(o.mode=o.mode|(o.mode&292)>>2)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}return o.mode},realPath:e=>{for(var o=[];e.parent!==e;)o.push(e.name),e=e.parent;return o.push(e.mount.opts.root),o.reverse(),Y.join.apply(null,o)},flagsForNode:e=>{e&=-2097153,e&=-2049,e&=-32769,e&=-524289,e&=-65537;var o=0;for(var t in V.flagsForNodeMap)e&t&&(o|=V.flagsForNodeMap[t],e^=t);if(e)throw new i.ErrnoError(28);return o},node_ops:{getattr:e=>{var o=V.realPath(e),t;try{t=J.lstatSync(o)}catch(a){throw a.code?new i.ErrnoError(V.convertNodeCode(a)):a}return V.isWindows&&!t.blksize&&(t.blksize=4096),V.isWindows&&!t.blocks&&(t.blocks=(t.size+t.blksize-1)/t.blksize|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,blksize:t.blksize,blocks:t.blocks}},setattr:(e,o)=>{var t=V.realPath(e);try{if(o.mode!==void 0&&(J.chmodSync(t,o.mode),e.mode=o.mode),o.timestamp!==void 0){var a=new Date(o.timestamp);J.utimesSync(t,a,a)}o.size!==void 0&&J.truncateSync(t,o.size)}catch(s){throw s.code?new i.ErrnoError(V.convertNodeCode(s)):s}},lookup:(e,o)=>{var t=Y.join2(V.realPath(e),o),a=V.getMode(t);return V.createNode(e,o,a)},mknod:(e,o,t,a)=>{var s=V.createNode(e,o,t,a),l=V.realPath(s);try{i.isDir(s.mode)?J.mkdirSync(l,s.mode):J.writeFileSync(l,"",{mode:s.mode})}catch(h){throw h.code?new i.ErrnoError(V.convertNodeCode(h)):h}return s},rename:(e,o,t)=>{var a=V.realPath(e),s=Y.join2(V.realPath(o),t);try{J.renameSync(a,s)}catch(l){throw l.code?new i.ErrnoError(V.convertNodeCode(l)):l}e.name=t},unlink:(e,o)=>{var t=Y.join2(V.realPath(e),o);try{J.unlinkSync(t)}catch(a){throw a.code?new i.ErrnoError(V.convertNodeCode(a)):a}},rmdir:(e,o)=>{var t=Y.join2(V.realPath(e),o);try{J.rmdirSync(t)}catch(a){throw a.code?new i.ErrnoError(V.convertNodeCode(a)):a}},readdir:e=>{var o=V.realPath(e);try{return J.readdirSync(o)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}},symlink:(e,o,t)=>{var a=Y.join2(V.realPath(e),o);try{J.symlinkSync(t,a)}catch(s){throw s.code?new i.ErrnoError(V.convertNodeCode(s)):s}},readlink:e=>{var o=V.realPath(e);try{return o=J.readlinkSync(o),o=Me.relative(Me.resolve(e.mount.opts.root),o),o}catch(t){throw t.code?t.code==="UNKNOWN"?new i.ErrnoError(28):new i.ErrnoError(V.convertNodeCode(t)):t}}},stream_ops:{open:e=>{var o=V.realPath(e.node);try{i.isFile(e.node.mode)&&(e.nfd=J.openSync(o,V.flagsForNode(e.flags)))}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}},close:e=>{try{i.isFile(e.node.mode)&&e.nfd&&J.closeSync(e.nfd)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}},read:(e,o,t,a,s)=>{if(a===0)return 0;try{return J.readSync(e.nfd,Buffer.from(o.buffer),t,a,s)}catch(l){throw new i.ErrnoError(V.convertNodeCode(l))}},write:(e,o,t,a,s)=>{try{return J.writeSync(e.nfd,Buffer.from(o.buffer),t,a,s)}catch(l){throw new i.ErrnoError(V.convertNodeCode(l))}},llseek:(e,o,t)=>{var a=o;if(t===1)a+=e.position;else if(t===2&&i.isFile(e.node.mode))try{var s=J.fstatSync(e.nfd);a+=s.size}catch(l){throw new i.ErrnoError(V.convertNodeCode(l))}if(a<0)throw new i.ErrnoError(28);return a},mmap:(e,o,t,a,s)=>{if(!i.isFile(e.node.mode))throw new i.ErrnoError(43);var l=Ir(o);return V.stream_ops.read(e,ee,l,o,t),{ptr:l,allocated:!0}},msync:(e,o,t,a,s)=>(V.stream_ops.write(e,o,0,a,t,!1),0)}},i={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,o={})=>{if(e=Q.resolve(i.cwd(),e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(o=Object.assign(t,o),o.recurse_count>8)throw new i.ErrnoError(32);for(var a=Y.normalizeArray(e.split("/").filter(T=>!!T),!1),s=i.root,l="/",h=0;h<a.length;h++){var w=h===a.length-1;if(w&&o.parent)break;if(s=i.lookupNode(s,a[h]),l=Y.join2(l,a[h]),i.isMountpoint(s)&&(!w||w&&o.follow_mount)&&(s=s.mounted.root),!w||o.follow)for(var S=0;i.isLink(s.mode);){var O=i.readlink(l);l=Q.resolve(Y.dirname(l),O);var N=i.lookupPath(l,{recurse_count:o.recurse_count+1});if(s=N.node,S++>40)throw new i.ErrnoError(32)}}return{path:l,node:s}},getPath:e=>{for(var o;;){if(i.isRoot(e)){var t=e.mount.mountpoint;return o?t[t.length-1]!=="/"?t+"/"+o:t+o:t}o=o?e.name+"/"+o:e.name,e=e.parent}},hashName:(e,o)=>{for(var t=0,a=0;a<o.length;a++)t=(t<<5)-t+o.charCodeAt(a)|0;return(e+t>>>0)%i.nameTable.length},hashAddNode:e=>{var o=i.hashName(e.parent.id,e.name);e.name_next=i.nameTable[o],i.nameTable[o]=e},hashRemoveNode:e=>{var o=i.hashName(e.parent.id,e.name);if(i.nameTable[o]===e)i.nameTable[o]=e.name_next;else for(var t=i.nameTable[o];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:(e,o)=>{var t=i.mayLookup(e);if(t)throw new i.ErrnoError(t,e);for(var a=i.hashName(e.id,o),s=i.nameTable[a];s;s=s.name_next){var l=s.name;if(s.parent.id===e.id&&l===o)return s}return i.lookup(e,o)},createNode:(e,o,t,a)=>{var s=new i.FSNode(e,o,t,a);return i.hashAddNode(s),s},destroyNode:e=>{i.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>(e&61440)===32768,isDir:e=>(e&61440)===16384,isLink:e=>(e&61440)===40960,isChrdev:e=>(e&61440)===8192,isBlkdev:e=>(e&61440)===24576,isFIFO:e=>(e&61440)===4096,isSocket:e=>(e&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var o=i.flagModes[e];if(typeof o>"u")throw new Error("Unknown file open mode: "+e);return o},flagsToPermissionString:e=>{var o=["r","w","rw"][e&3];return e&512&&(o+="w"),o},nodePermissions:(e,o)=>i.ignorePermissions?0:o.includes("r")&&!(e.mode&292)||o.includes("w")&&!(e.mode&146)||o.includes("x")&&!(e.mode&73)?2:0,mayLookup:e=>{var o=i.nodePermissions(e,"x");return o||(e.node_ops.lookup?0:2)},mayCreate:(e,o)=>{try{var t=i.lookupNode(e,o);return 20}catch{}return i.nodePermissions(e,"wx")},mayDelete:(e,o,t)=>{var a;try{a=i.lookupNode(e,o)}catch(l){return l.errno}var s=i.nodePermissions(e,"wx");if(s)return s;if(t){if(!i.isDir(a.mode))return 54;if(i.isRoot(a)||i.getPath(a)===i.cwd())return 10}else if(i.isDir(a.mode))return 31;return 0},mayOpen:(e,o)=>e?i.isLink(e.mode)?32:i.isDir(e.mode)&&(i.flagsToPermissionString(o)!=="r"||o&512)?31:i.nodePermissions(e,i.flagsToPermissionString(o)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,o=i.MAX_OPEN_FDS)=>{for(var t=e;t<=o;t++)if(!i.streams[t])return t;throw new i.ErrnoError(33)},getStream:e=>i.streams[e],createStream:(e,o,t)=>{i.FSStream||(i.FSStream=function(){this.shared={}},i.FSStream.prototype={},Object.defineProperties(i.FSStream.prototype,{object:{get:function(){return this.node},set:function(s){this.node=s}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(s){this.shared.flags=s}},position:{get:function(){return this.shared.position},set:function(s){this.shared.position=s}}})),e=Object.assign(new i.FSStream,e);var a=i.nextfd(o,t);return e.fd=a,i.streams[a]=e,e},closeStream:e=>{i.streams[e]=null},chrdev_stream_ops:{open:e=>{var o=i.getDevice(e.node.rdev);e.stream_ops=o.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new i.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,o)=>e<<8|o,registerDevice:(e,o)=>{i.devices[e]={stream_ops:o}},getDevice:e=>i.devices[e],getMounts:e=>{for(var o=[],t=[e];t.length;){var a=t.pop();o.push(a),t.push.apply(t,a.mounts)}return o},syncfs:(e,o)=>{typeof e=="function"&&(o=e,e=!1),i.syncFSRequests++,i.syncFSRequests>1&&fe("warning: "+i.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=i.getMounts(i.root.mount),a=0;function s(h){return i.syncFSRequests--,o(h)}function l(h){if(h)return l.errored?void 0:(l.errored=!0,s(h));++a>=t.length&&s(null)}t.forEach(h=>{if(!h.type.syncfs)return l(null);h.type.syncfs(h,e,l)})},mount:(e,o,t)=>{var a=t==="/",s=!t,l;if(a&&i.root)throw new i.ErrnoError(10);if(!a&&!s){var h=i.lookupPath(t,{follow_mount:!1});if(t=h.path,l=h.node,i.isMountpoint(l))throw new i.ErrnoError(10);if(!i.isDir(l.mode))throw new i.ErrnoError(54)}var w={type:e,opts:o,mountpoint:t,mounts:[]},S=e.mount(w);return S.mount=w,w.root=S,a?i.root=S:l&&(l.mounted=w,l.mount&&l.mount.mounts.push(w)),S},unmount:e=>{var o=i.lookupPath(e,{follow_mount:!1});if(!i.isMountpoint(o.node))throw new i.ErrnoError(28);var t=o.node,a=t.mounted,s=i.getMounts(a);Object.keys(i.nameTable).forEach(h=>{for(var w=i.nameTable[h];w;){var S=w.name_next;s.includes(w.mount)&&i.destroyNode(w),w=S}}),t.mounted=null;var l=t.mount.mounts.indexOf(a);t.mount.mounts.splice(l,1)},lookup:(e,o)=>e.node_ops.lookup(e,o),mknod:(e,o,t)=>{var a=i.lookupPath(e,{parent:!0}),s=a.node,l=Y.basename(e);if(!l||l==="."||l==="..")throw new i.ErrnoError(28);var h=i.mayCreate(s,l);if(h)throw new i.ErrnoError(h);if(!s.node_ops.mknod)throw new i.ErrnoError(63);return s.node_ops.mknod(s,l,o,t)},create:(e,o)=>(o=o!==void 0?o:438,o&=4095,o|=32768,i.mknod(e,o,0)),mkdir:(e,o)=>(o=o!==void 0?o:511,o&=1023,o|=16384,i.mknod(e,o,0)),mkdirTree:(e,o)=>{for(var t=e.split("/"),a="",s=0;s<t.length;++s)if(t[s]){a+="/"+t[s];try{i.mkdir(a,o)}catch(l){if(l.errno!=20)throw l}}},mkdev:(e,o,t)=>(typeof t>"u"&&(t=o,o=438),o|=8192,i.mknod(e,o,t)),symlink:(e,o)=>{if(!Q.resolve(e))throw new i.ErrnoError(44);var t=i.lookupPath(o,{parent:!0}),a=t.node;if(!a)throw new i.ErrnoError(44);var s=Y.basename(o),l=i.mayCreate(a,s);if(l)throw new i.ErrnoError(l);if(!a.node_ops.symlink)throw new i.ErrnoError(63);return a.node_ops.symlink(a,s,e)},rename:(e,o)=>{var t=Y.dirname(e),a=Y.dirname(o),s=Y.basename(e),l=Y.basename(o),h,w,S;if(h=i.lookupPath(e,{parent:!0}),w=h.node,h=i.lookupPath(o,{parent:!0}),S=h.node,!w||!S)throw new i.ErrnoError(44);if(w.mount!==S.mount)throw new i.ErrnoError(75);var O=i.lookupNode(w,s),N=Q.relative(e,a);if(N.charAt(0)!==".")throw new i.ErrnoError(28);if(N=Q.relative(o,t),N.charAt(0)!==".")throw new i.ErrnoError(55);var T;try{T=i.lookupNode(S,l)}catch{}if(O!==T){var F=i.isDir(O.mode),L=i.mayDelete(w,s,F);if(L)throw new i.ErrnoError(L);if(L=T?i.mayDelete(S,l,F):i.mayCreate(S,l),L)throw new i.ErrnoError(L);if(!w.node_ops.rename)throw new i.ErrnoError(63);if(i.isMountpoint(O)||T&&i.isMountpoint(T))throw new i.ErrnoError(10);if(S!==w&&(L=i.nodePermissions(w,"w"),L))throw new i.ErrnoError(L);i.hashRemoveNode(O);try{w.node_ops.rename(O,S,l)}catch(R){throw R}finally{i.hashAddNode(O)}}},rmdir:e=>{var o=i.lookupPath(e,{parent:!0}),t=o.node,a=Y.basename(e),s=i.lookupNode(t,a),l=i.mayDelete(t,a,!0);if(l)throw new i.ErrnoError(l);if(!t.node_ops.rmdir)throw new i.ErrnoError(63);if(i.isMountpoint(s))throw new i.ErrnoError(10);t.node_ops.rmdir(t,a),i.destroyNode(s)},readdir:e=>{var o=i.lookupPath(e,{follow:!0}),t=o.node;if(!t.node_ops.readdir)throw new i.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var o=i.lookupPath(e,{parent:!0}),t=o.node;if(!t)throw new i.ErrnoError(44);var a=Y.basename(e),s=i.lookupNode(t,a),l=i.mayDelete(t,a,!1);if(l)throw new i.ErrnoError(l);if(!t.node_ops.unlink)throw new i.ErrnoError(63);if(i.isMountpoint(s))throw new i.ErrnoError(10);t.node_ops.unlink(t,a),i.destroyNode(s)},readlink:e=>{var o=i.lookupPath(e),t=o.node;if(!t)throw new i.ErrnoError(44);if(!t.node_ops.readlink)throw new i.ErrnoError(28);return Q.resolve(i.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,o)=>{var t=i.lookupPath(e,{follow:!o}),a=t.node;if(!a)throw new i.ErrnoError(44);if(!a.node_ops.getattr)throw new i.ErrnoError(63);return a.node_ops.getattr(a)},lstat:e=>i.stat(e,!0),chmod:(e,o,t)=>{var a;if(typeof e=="string"){var s=i.lookupPath(e,{follow:!t});a=s.node}else a=e;if(!a.node_ops.setattr)throw new i.ErrnoError(63);a.node_ops.setattr(a,{mode:o&4095|a.mode&-4096,timestamp:Date.now()})},lchmod:(e,o)=>{i.chmod(e,o,!0)},fchmod:(e,o)=>{var t=i.getStream(e);if(!t)throw new i.ErrnoError(8);i.chmod(t.node,o)},chown:(e,o,t,a)=>{var s;if(typeof e=="string"){var l=i.lookupPath(e,{follow:!a});s=l.node}else s=e;if(!s.node_ops.setattr)throw new i.ErrnoError(63);s.node_ops.setattr(s,{timestamp:Date.now()})},lchown:(e,o,t)=>{i.chown(e,o,t,!0)},fchown:(e,o,t)=>{var a=i.getStream(e);if(!a)throw new i.ErrnoError(8);i.chown(a.node,o,t)},truncate:(e,o)=>{if(o<0)throw new i.ErrnoError(28);var t;if(typeof e=="string"){var a=i.lookupPath(e,{follow:!0});t=a.node}else t=e;if(!t.node_ops.setattr)throw new i.ErrnoError(63);if(i.isDir(t.mode))throw new i.ErrnoError(31);if(!i.isFile(t.mode))throw new i.ErrnoError(28);var s=i.nodePermissions(t,"w");if(s)throw new i.ErrnoError(s);t.node_ops.setattr(t,{size:o,timestamp:Date.now()})},ftruncate:(e,o)=>{var t=i.getStream(e);if(!t)throw new i.ErrnoError(8);if(!(t.flags&2097155))throw new i.ErrnoError(28);i.truncate(t.node,o)},utime:(e,o,t)=>{var a=i.lookupPath(e,{follow:!0}),s=a.node;s.node_ops.setattr(s,{timestamp:Math.max(o,t)})},open:(e,o,t)=>{if(e==="")throw new i.ErrnoError(44);o=typeof o=="string"?i.modeStringToFlags(o):o,t=typeof t>"u"?438:t,o&64?t=t&4095|32768:t=0;var a;if(typeof e=="object")a=e;else{e=Y.normalize(e);try{var s=i.lookupPath(e,{follow:!(o&131072)});a=s.node}catch{}}var l=!1;if(o&64)if(a){if(o&128)throw new i.ErrnoError(20)}else a=i.mknod(e,t,0),l=!0;if(!a)throw new i.ErrnoError(44);if(i.isChrdev(a.mode)&&(o&=-513),o&65536&&!i.isDir(a.mode))throw new i.ErrnoError(54);if(!l){var h=i.mayOpen(a,o);if(h)throw new i.ErrnoError(h)}o&512&&!l&&i.truncate(a,0),o&=-131713;var w=i.createStream({node:a,path:i.getPath(a),flags:o,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1});return w.stream_ops.open&&w.stream_ops.open(w),f.logReadFiles&&!(o&1)&&(i.readFiles||(i.readFiles={}),e in i.readFiles||(i.readFiles[e]=1)),w},close:e=>{if(i.isClosed(e))throw new i.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(o){throw o}finally{i.closeStream(e.fd)}e.fd=null},isClosed:e=>e.fd===null,llseek:(e,o,t)=>{if(i.isClosed(e))throw new i.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new i.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new i.ErrnoError(28);return e.position=e.stream_ops.llseek(e,o,t),e.ungotten=[],e.position},read:(e,o,t,a,s)=>{if(a<0||s<0)throw new i.ErrnoError(28);if(i.isClosed(e))throw new i.ErrnoError(8);if((e.flags&2097155)===1)throw new i.ErrnoError(8);if(i.isDir(e.node.mode))throw new i.ErrnoError(31);if(!e.stream_ops.read)throw new i.ErrnoError(28);var l=typeof s<"u";if(!l)s=e.position;else if(!e.seekable)throw new i.ErrnoError(70);var h=e.stream_ops.read(e,o,t,a,s);return l||(e.position+=h),h},write:(e,o,t,a,s,l)=>{if(a<0||s<0)throw new i.ErrnoError(28);if(i.isClosed(e))throw new i.ErrnoError(8);if(!(e.flags&2097155))throw new i.ErrnoError(8);if(i.isDir(e.node.mode))throw new i.ErrnoError(31);if(!e.stream_ops.write)throw new i.ErrnoError(28);e.seekable&&e.flags&1024&&i.llseek(e,0,2);var h=typeof s<"u";if(!h)s=e.position;else if(!e.seekable)throw new i.ErrnoError(70);var w=e.stream_ops.write(e,o,t,a,s,l);return h||(e.position+=w),w},allocate:(e,o,t)=>{if(i.isClosed(e))throw new i.ErrnoError(8);if(o<0||t<=0)throw new i.ErrnoError(28);if(!(e.flags&2097155))throw new i.ErrnoError(8);if(!i.isFile(e.node.mode)&&!i.isDir(e.node.mode))throw new i.ErrnoError(43);if(!e.stream_ops.allocate)throw new i.ErrnoError(138);e.stream_ops.allocate(e,o,t)},mmap:(e,o,t,a,s)=>{if(a&2&&!(s&2)&&(e.flags&2097155)!==2)throw new i.ErrnoError(2);if((e.flags&2097155)===1)throw new i.ErrnoError(2);if(!e.stream_ops.mmap)throw new i.ErrnoError(43);return e.stream_ops.mmap(e,o,t,a,s)},msync:(e,o,t,a,s)=>e.stream_ops.msync?e.stream_ops.msync(e,o,t,a,s):0,munmap:e=>0,ioctl:(e,o,t)=>{if(!e.stream_ops.ioctl)throw new i.ErrnoError(59);return e.stream_ops.ioctl(e,o,t)},readFile:(e,o={})=>{if(o.flags=o.flags||0,o.encoding=o.encoding||"binary",o.encoding!=="utf8"&&o.encoding!=="binary")throw new Error('Invalid encoding type "'+o.encoding+'"');var t,a=i.open(e,o.flags),s=i.stat(e),l=s.size,h=new Uint8Array(l);return i.read(a,h,0,l,0),o.encoding==="utf8"?t=ze(h,0):o.encoding==="binary"&&(t=h),i.close(a),t},writeFile:(e,o,t={})=>{t.flags=t.flags||577;var a=i.open(e,t.flags,t.mode);if(typeof o=="string"){var s=new Uint8Array(Ce(o)+1),l=Ze(o,s,0,s.length);i.write(a,s,0,l,void 0,t.canOwn)}else if(ArrayBuffer.isView(o))i.write(a,o,0,o.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");i.close(a)},cwd:()=>i.currentPath,chdir:e=>{var o=i.lookupPath(e,{follow:!0});if(o.node===null)throw new i.ErrnoError(44);if(!i.isDir(o.node.mode))throw new i.ErrnoError(54);var t=i.nodePermissions(o.node,"x");if(t)throw new i.ErrnoError(t);i.currentPath=o.path},createDefaultDirectories:()=>{i.mkdir("/tmp"),i.mkdir("/home"),i.mkdir("/home/web_user")},createDefaultDevices:()=>{i.mkdir("/dev"),i.registerDevice(i.makedev(1,3),{read:()=>0,write:(o,t,a,s,l)=>s}),i.mkdev("/dev/null",i.makedev(1,3)),ge.register(i.makedev(5,0),ge.default_tty_ops),ge.register(i.makedev(6,0),ge.default_tty1_ops),i.mkdev("/dev/tty",i.makedev(5,0)),i.mkdev("/dev/tty1",i.makedev(6,0));var e=no();i.createDevice("/dev","random",e),i.createDevice("/dev","urandom",e),i.mkdir("/dev/shm"),i.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{i.mkdir("/proc");var e=i.mkdir("/proc/self");i.mkdir("/proc/self/fd"),i.mount({mount:()=>{var o=i.createNode(e,"fd",16895,73);return o.node_ops={lookup:(t,a)=>{var s=+a,l=i.getStream(s);if(!l)throw new i.ErrnoError(8);var h={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>l.path}};return h.parent=h,h}},o}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?i.createDevice("/dev","stdin",f.stdin):i.symlink("/dev/tty","/dev/stdin"),f.stdout?i.createDevice("/dev","stdout",null,f.stdout):i.symlink("/dev/tty","/dev/stdout"),f.stderr?i.createDevice("/dev","stderr",null,f.stderr):i.symlink("/dev/tty1","/dev/stderr");var e=i.open("/dev/stdin",0),o=i.open("/dev/stdout",1),t=i.open("/dev/stderr",1)},ensureErrnoError:()=>{i.ErrnoError||(i.ErrnoError=function(o,t){this.node=t,this.setErrno=function(a){this.errno=a},this.setErrno(o),this.message="FS error"},i.ErrnoError.prototype=new Error,i.ErrnoError.prototype.constructor=i.ErrnoError,[44].forEach(e=>{i.genericErrors[e]=new i.ErrnoError(e),i.genericErrors[e].stack="<generic error, no stack>"}))},staticInit:()=>{i.ensureErrnoError(),i.nameTable=new Array(4096),i.mount(G,{},"/"),i.createDefaultDirectories(),i.createDefaultDevices(),i.createSpecialDirectories(),i.filesystems={MEMFS:G,NODEFS:V}},init:(e,o,t)=>{i.init.initialized=!0,i.ensureErrnoError(),f.stdin=e||f.stdin,f.stdout=o||f.stdout,f.stderr=t||f.stderr,i.createStandardStreams()},quit:()=>{i.init.initialized=!1,Dr(0);for(var e=0;e<i.streams.length;e++){var o=i.streams[e];o&&i.close(o)}},getMode:(e,o)=>{var t=0;return e&&(t|=365),o&&(t|=146),t},findObject:(e,o)=>{var t=i.analyzePath(e,o);return t.exists?t.object:null},analyzePath:(e,o)=>{try{var t=i.lookupPath(e,{follow:!o});e=t.path}catch{}var a={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=i.lookupPath(e,{parent:!0});a.parentExists=!0,a.parentPath=t.path,a.parentObject=t.node,a.name=Y.basename(e),t=i.lookupPath(e,{follow:!o}),a.exists=!0,a.path=t.path,a.object=t.node,a.name=t.node.name,a.isRoot=t.path==="/"}catch(s){a.error=s.errno}return a},createPath:(e,o,t,a)=>{e=typeof e=="string"?e:i.getPath(e);for(var s=o.split("/").reverse();s.length;){var l=s.pop();if(l){var h=Y.join2(e,l);try{i.mkdir(h)}catch{}e=h}}return h},createFile:(e,o,t,a,s)=>{var l=Y.join2(typeof e=="string"?e:i.getPath(e),o),h=i.getMode(a,s);return i.create(l,h)},createDataFile:(e,o,t,a,s,l)=>{var h=o;e&&(e=typeof e=="string"?e:i.getPath(e),h=o?Y.join2(e,o):e);var w=i.getMode(a,s),S=i.create(h,w);if(t){if(typeof t=="string"){for(var O=new Array(t.length),N=0,T=t.length;N<T;++N)O[N]=t.charCodeAt(N);t=O}i.chmod(S,w|146);var F=i.open(S,577);i.write(F,t,0,t.length,0,l),i.close(F),i.chmod(S,w)}return S},createDevice:(e,o,t,a)=>{var s=Y.join2(typeof e=="string"?e:i.getPath(e),o),l=i.getMode(!!t,!!a);i.createDevice.major||(i.createDevice.major=64);var h=i.makedev(i.createDevice.major++,0);return i.registerDevice(h,{open:w=>{w.seekable=!1},close:w=>{a&&a.buffer&&a.buffer.length&&a(10)},read:(w,S,O,N,T)=>{for(var F=0,L=0;L<N;L++){var R;try{R=t()}catch{throw new i.ErrnoError(29)}if(R===void 0&&F===0)throw new i.ErrnoError(6);if(R==null)break;F++,S[O+L]=R}return F&&(w.node.timestamp=Date.now()),F},write:(w,S,O,N,T)=>{for(var F=0;F<N;F++)try{a(S[O+F])}catch{throw new i.ErrnoError(29)}return N&&(w.node.timestamp=Date.now()),F}}),i.mkdev(s,l,h)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{e.contents=Er(We(e.url),!0),e.usedBytes=e.contents.length}catch{throw new i.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(e,o,t,a,s)=>{function l(){this.lengthKnown=!1,this.chunks=[]}if(l.prototype.get=function(L){if(!(L>this.length-1||L<0)){var R=L%this.chunkSize,B=L/this.chunkSize|0;return this.getter(B)[R]}},l.prototype.setDataGetter=function(L){this.getter=L},l.prototype.cacheLength=function(){var L=new XMLHttpRequest;if(L.open("HEAD",t,!1),L.send(null),!(L.status>=200&&L.status<300||L.status===304))throw new Error("Couldn't load "+t+". Status: "+L.status);var R=Number(L.getResponseHeader("Content-length")),B,P=(B=L.getResponseHeader("Accept-Ranges"))&&B==="bytes",M=(B=L.getResponseHeader("Content-Encoding"))&&B==="gzip",z=1024*1024;P||(z=R);var q=(X,oe)=>{if(X>oe)throw new Error("invalid range ("+X+", "+oe+") or no bytes requested!");if(oe>R-1)throw new Error("only "+R+" bytes available! programmer error!");var se=new XMLHttpRequest;if(se.open("GET",t,!1),R!==z&&se.setRequestHeader("Range","bytes="+X+"-"+oe),se.responseType="arraybuffer",se.overrideMimeType&&se.overrideMimeType("text/plain; charset=x-user-defined"),se.send(null),!(se.status>=200&&se.status<300||se.status===304))throw new Error("Couldn't load "+t+". Status: "+se.status);return se.response!==void 0?new Uint8Array(se.response||[]):Er(se.responseText||"",!0)},W=this;W.setDataGetter(X=>{var oe=X*z,se=(X+1)*z-1;if(se=Math.min(se,R-1),typeof W.chunks[X]>"u"&&(W.chunks[X]=q(oe,se)),typeof W.chunks[X]>"u")throw new Error("doXHR failed!");return W.chunks[X]}),(M||!R)&&(z=R=1,R=this.getter(0).length,z=R,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=R,this._chunkSize=z,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var h=new l;Object.defineProperties(h,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var w={isDevice:!1,contents:h}}else var w={isDevice:!1,url:t};var S=i.createFile(e,o,w,a,s);w.contents?S.contents=w.contents:w.url&&(S.contents=null,S.url=w.url),Object.defineProperties(S,{usedBytes:{get:function(){return this.contents.length}}});var O={},N=Object.keys(S.stream_ops);N.forEach(F=>{var L=S.stream_ops[F];O[F]=function(){return i.forceLoadFile(S),L.apply(null,arguments)}});function T(F,L,R,B,P){var M=F.node.contents;if(P>=M.length)return 0;var z=Math.min(M.length-P,B);if(M.slice)for(var q=0;q<z;q++)L[R+q]=M[P+q];else for(var q=0;q<z;q++)L[R+q]=M.get(P+q);return z}return O.read=(F,L,R,B,P)=>(i.forceLoadFile(S),T(F,L,R,B,P)),O.mmap=(F,L,R,B,P)=>{i.forceLoadFile(S);var M=Ir(L);if(!M)throw new i.ErrnoError(48);return T(F,ee,M,L,R),{ptr:M,allocated:!0}},S.stream_ops=O,S},createPreloadedFile:(e,o,t,a,s,l,h,w,S,O)=>{var N=o?Q.resolve(Y.join2(e,o)):e,T="cp "+N;function F(L){function R(B){O&&O(),w||i.createDataFile(e,o,B,a,s,S),l&&l(),Je(T)}Browser.handledByPreloadPlugin(L,N,R,()=>{h&&h(),Je(T)})||R(L)}dr(T),typeof t=="string"?Ct(t,L=>F(L),h):F(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,o,t)=>{o=o||(()=>{}),t=t||(()=>{});var a=i.indexedDB();try{var s=a.open(i.DB_NAME(),i.DB_VERSION)}catch(l){return t(l)}s.onupgradeneeded=()=>{er("creating db");var l=s.result;l.createObjectStore(i.DB_STORE_NAME)},s.onsuccess=()=>{var l=s.result,h=l.transaction([i.DB_STORE_NAME],"readwrite"),w=h.objectStore(i.DB_STORE_NAME),S=0,O=0,N=e.length;function T(){O==0?o():t()}e.forEach(F=>{var L=w.put(i.analyzePath(F).object.contents,F);L.onsuccess=()=>{S++,S+O==N&&T()},L.onerror=()=>{O++,S+O==N&&T()}}),h.onerror=t},s.onerror=t},loadFilesFromDB:(e,o,t)=>{o=o||(()=>{}),t=t||(()=>{});var a=i.indexedDB();try{var s=a.open(i.DB_NAME(),i.DB_VERSION)}catch(l){return t(l)}s.onupgradeneeded=t,s.onsuccess=()=>{var l=s.result;try{var h=l.transaction([i.DB_STORE_NAME],"readonly")}catch(F){t(F);return}var w=h.objectStore(i.DB_STORE_NAME),S=0,O=0,N=e.length;function T(){O==0?o():t()}e.forEach(F=>{var L=w.get(F);L.onsuccess=()=>{i.analyzePath(F).exists&&i.unlink(F),i.createDataFile(Y.dirname(F),Y.basename(F),L.result,!0,!0,!0),S++,S+O==N&&T()},L.onerror=()=>{O++,S+O==N&&T()}}),h.onerror=t},s.onerror=t}},C={DEFAULT_POLLMASK:5,calculateAt:function(e,o,t){if(Y.isAbs(o))return o;var a;if(e===-100)a=i.cwd();else{var s=C.getStreamFromFD(e);a=s.path}if(o.length==0){if(!t)throw new i.ErrnoError(44);return a}return Y.join2(a,o)},doStat:function(e,o,t){try{var a=e(o)}catch(s){if(s&&s.node&&Y.normalize(o)!==Y.normalize(i.getPath(s.node)))return-54;throw s}return E[t>>2]=a.dev,E[t+8>>2]=a.ino,E[t+12>>2]=a.mode,j[t+16>>2]=a.nlink,E[t+20>>2]=a.uid,E[t+24>>2]=a.gid,E[t+28>>2]=a.rdev,Z=[a.size>>>0,(U=a.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[t+40>>2]=Z[0],E[t+44>>2]=Z[1],E[t+48>>2]=4096,E[t+52>>2]=a.blocks,Z=[Math.floor(a.atime.getTime()/1e3)>>>0,(U=Math.floor(a.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[t+56>>2]=Z[0],E[t+60>>2]=Z[1],j[t+64>>2]=0,Z=[Math.floor(a.mtime.getTime()/1e3)>>>0,(U=Math.floor(a.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[t+72>>2]=Z[0],E[t+76>>2]=Z[1],j[t+80>>2]=0,Z=[Math.floor(a.ctime.getTime()/1e3)>>>0,(U=Math.floor(a.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[t+88>>2]=Z[0],E[t+92>>2]=Z[1],j[t+96>>2]=0,Z=[a.ino>>>0,(U=a.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[t+104>>2]=Z[0],E[t+108>>2]=Z[1],0},doMsync:function(e,o,t,a,s){if(!i.isFile(o.node.mode))throw new i.ErrnoError(43);if(a&2)return 0;var l=le.slice(e,e+t);i.msync(o,l,s,t,a)},varargs:void 0,get:function(){C.varargs+=4;var e=E[C.varargs-4>>2];return e},getStr:function(e){var o=ne(e);return o},getStreamFromFD:function(e){var o=i.getStream(e);if(!o)throw new i.ErrnoError(8);return o}};function v(e,o,t,a,s){try{for(var l=0,h=o?E[o>>2]:0,w=o?E[o+4>>2]:0,S=t?E[t>>2]:0,O=t?E[t+4>>2]:0,N=a?E[a>>2]:0,T=a?E[a+4>>2]:0,F=0,L=0,R=0,B=0,P=0,M=0,z=(o?E[o>>2]:0)|(t?E[t>>2]:0)|(a?E[a>>2]:0),q=(o?E[o+4>>2]:0)|(t?E[t+4>>2]:0)|(a?E[a+4>>2]:0),W=function(Ae,Qe,Ke,rr){return Ae<32?Qe&rr:Ke&rr},X=0;X<e;X++){var oe=1<<X%32;if(W(X,z,q,oe)){var se=C.getStreamFromFD(X),Oe=C.DEFAULT_POLLMASK;se.stream_ops?.poll&&(Oe=se.stream_ops.poll(se)),Oe&1&&W(X,h,w,oe)&&(X<32?F=F|oe:L=L|oe,l++),Oe&4&&W(X,S,O,oe)&&(X<32?R=R|oe:B=B|oe,l++),Oe&2&&W(X,N,T,oe)&&(X<32?P=P|oe:M=M|oe,l++)}}return o&&(E[o>>2]=F,E[o+4>>2]=L),t&&(E[t>>2]=R,E[t+4>>2]=B),a&&(E[a>>2]=P,E[a+4>>2]=M),l}catch(Ae){if(typeof i>"u"||!(Ae instanceof i.ErrnoError))throw Ae;return-Ae.errno}}var H={mount:function(e){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(o,t){return typeof t=="function"&&(this._callbacks[o]=t),this},f.websocket.emit=function(o,t){typeof this._callbacks[o]=="function"&&this._callbacks[o].call(this,t)},i.createNode(null,"/",16895,0)},createSocket:function(e,o,t){o&=-526337;var a=o==1;if(a&&t&&t!=6)throw new i.ErrnoError(66);var s={family:e,type:o,protocol:t,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:H.websocket_sock_ops},l=H.nextname(),h=i.createNode(H.root,l,49152,0);h.sock=s;var w=i.createStream({path:l,node:h,flags:2,seekable:!1,stream_ops:H.stream_ops});return s.stream=w,s},getSocket:function(e){var o=i.getStream(e);return!o||!i.isSocket(o.node.mode)?null:o.node.sock},stream_ops:{poll:function(e){var o=e.node.sock;return o.sock_ops.poll(o)},ioctl:function(e,o,t){var a=e.node.sock;return a.sock_ops.ioctl(a,o,t)},read:function(e,o,t,a,s){var l=e.node.sock,h=l.sock_ops.recvmsg(l,a);return h?(o.set(h.buffer,t),h.buffer.length):0},write:function(e,o,t,a,s){var l=e.node.sock;return l.sock_ops.sendmsg(l,o,t,a)},close:function(e){var o=e.node.sock;o.sock_ops.close(o)}},nextname:function(){return H.nextname.current||(H.nextname.current=0),"socket["+H.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(e,o,t){var a;if(typeof o=="object"&&(a=o,o=null,t=null),a)if(a._socket)o=a._socket.remoteAddress,t=a._socket.remotePort;else{var s=/ws[s]?:\/\/([^:]+):(\d+)/.exec(a.url);if(!s)throw new Error("WebSocket URL must be in the format ws(s)://address:port");o=s[1],t=parseInt(s[2],10)}else try{var l=f.websocket&&typeof f.websocket=="object",h="ws:#".replace("#","//");if(l&&(typeof f.websocket.url=="function"?h=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(h=f.websocket.url)),h==="ws://"||h==="wss://"){var w=o.split("/");h=h+w[0]+":"+t+"/"+w.slice(1).join("/")}var S="binary";l&&typeof f.websocket.subprotocol=="string"&&(S=f.websocket.subprotocol);var O=void 0;S!=="null"&&(S=S.replace(/^ +| +$/g,"").split(/ *, */),O=S),l&&f.websocket.subprotocol===null&&(S="null",O=void 0);var N;te?N=An():N=WebSocket,f.websocket.decorator&&(N=f.websocket.decorator(N)),a=new N(h,O),a.binaryType="arraybuffer"}catch{throw new i.ErrnoError(23)}var T={addr:o,port:t,socket:a,dgram_send_queue:[]};return H.websocket_sock_ops.addPeer(e,T),H.websocket_sock_ops.handlePeerEvents(e,T),e.type===2&&typeof e.sport<"u"&&T.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(e.sport&65280)>>8,e.sport&255])),T},getPeer:function(e,o,t){return e.peers[o+":"+t]},addPeer:function(e,o){e.peers[o.addr+":"+o.port]=o},removePeer:function(e,o){delete e.peers[o.addr+":"+o.port]},handlePeerEvents:function(e,o){var t=!0,a=function(){f.websocket.emit("open",e.stream.fd);try{for(var l=o.dgram_send_queue.shift();l;)o.socket.send(l),l=o.dgram_send_queue.shift()}catch{o.socket.close()}};function s(l){if(typeof l=="string"){var h=new TextEncoder;l=h.encode(l)}else{if(Le(l.byteLength!==void 0),l.byteLength==0)return;l=new Uint8Array(l)}var w=t;if(t=!1,w&&l.length===10&&l[0]===255&&l[1]===255&&l[2]===255&&l[3]===255&&l[4]==="p".charCodeAt(0)&&l[5]==="o".charCodeAt(0)&&l[6]==="r".charCodeAt(0)&&l[7]==="t".charCodeAt(0)){var S=l[8]<<8|l[9];H.websocket_sock_ops.removePeer(e,o),o.port=S,H.websocket_sock_ops.addPeer(e,o);return}e.recv_queue.push({addr:o.addr,port:o.port,data:l}),f.websocket.emit("message",e.stream.fd)}te?(o.socket.on("open",a),o.socket.on("message",function(l,h){h&&s(new Uint8Array(l).buffer)}),o.socket.on("close",function(){f.websocket.emit("close",e.stream.fd)}),o.socket.on("error",function(l){e.error=14,f.websocket.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(o.socket.onopen=a,o.socket.onclose=function(){f.websocket.emit("close",e.stream.fd)},o.socket.onmessage=function(h){s(h.data)},o.socket.onerror=function(l){e.error=14,f.websocket.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})},poll:function(e){if(e.type===1&&e.server)return e.pending.length?65:0;var o=0,t=e.type===1?H.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)&&(o|=65),(!t||t&&t.socket.readyState===t.socket.OPEN)&&(o|=4),(t&&t.socket.readyState===t.socket.CLOSING||t&&t.socket.readyState===t.socket.CLOSED)&&(o|=16),o},ioctl:function(e,o,t){switch(o){case 21531:var a=0;return e.recv_queue.length&&(a=e.recv_queue[0].data.length),E[t>>2]=a,0;default:return 28}},close:function(e){if(e.server){try{e.server.close()}catch{}e.server=null}for(var o=Object.keys(e.peers),t=0;t<o.length;t++){var a=e.peers[o[t]];try{a.socket.close()}catch{}H.websocket_sock_ops.removePeer(e,a)}return 0},bind:function(e,o,t){if(typeof e.saddr<"u"||typeof e.sport<"u")throw new i.ErrnoError(28);if(e.saddr=o,e.sport=t,e.type===2){e.server&&(e.server.close(),e.server=null);try{e.sock_ops.listen(e,0)}catch(a){if(!(a instanceof i.ErrnoError)||a.errno!==138)throw a}}},connect:function(e,o,t){if(e.server)throw new i.ErrnoError(138);if(typeof e.daddr<"u"&&typeof e.dport<"u"){var a=H.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(a)throw a.socket.readyState===a.socket.CONNECTING?new i.ErrnoError(7):new i.ErrnoError(30)}var s=H.websocket_sock_ops.createPeer(e,o,t);throw e.daddr=s.addr,e.dport=s.port,new i.ErrnoError(26)},listen:function(e,o){if(!te)throw new i.ErrnoError(138);if(e.server)throw new i.ErrnoError(28);var t=An().Server,a=e.saddr;e.server=new t({host:a,port:e.sport}),f.websocket.emit("listen",e.stream.fd),e.server.on("connection",function(s){if(e.type===1){var l=H.createSocket(e.family,e.type,e.protocol),h=H.websocket_sock_ops.createPeer(l,s);l.daddr=h.addr,l.dport=h.port,e.pending.push(l),f.websocket.emit("connection",l.stream.fd)}else H.websocket_sock_ops.createPeer(e,s),f.websocket.emit("connection",e.stream.fd)}),e.server.on("close",function(){f.websocket.emit("close",e.stream.fd),e.server=null}),e.server.on("error",function(s){e.error=23,f.websocket.emit("error",[e.stream.fd,e.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(e){if(!e.server||!e.pending.length)throw new i.ErrnoError(28);var o=e.pending.shift();return o.stream.flags=e.stream.flags,o},getname:function(e,o){var t,a;if(o){if(e.daddr===void 0||e.dport===void 0)throw new i.ErrnoError(53);t=e.daddr,a=e.dport}else t=e.saddr||0,a=e.sport||0;return{addr:t,port:a}},sendmsg:function(e,o,t,a,s,l){if(e.type===2){if((s===void 0||l===void 0)&&(s=e.daddr,l=e.dport),s===void 0||l===void 0)throw new i.ErrnoError(17)}else s=e.daddr,l=e.dport;var h=H.websocket_sock_ops.getPeer(e,s,l);if(e.type===1){if(!h||h.socket.readyState===h.socket.CLOSING||h.socket.readyState===h.socket.CLOSED)throw new i.ErrnoError(53);if(h.socket.readyState===h.socket.CONNECTING)throw new i.ErrnoError(6)}ArrayBuffer.isView(o)&&(t+=o.byteOffset,o=o.buffer);var w;if(w=o.slice(t,t+a),e.type===2&&(!h||h.socket.readyState!==h.socket.OPEN))return(!h||h.socket.readyState===h.socket.CLOSING||h.socket.readyState===h.socket.CLOSED)&&(h=H.websocket_sock_ops.createPeer(e,s,l)),h.dgram_send_queue.push(w),a;try{return h.socket.send(w),a}catch{throw new i.ErrnoError(28)}},recvmsg:function(e,o){if(e.type===1&&e.server)throw new i.ErrnoError(53);var t=e.recv_queue.shift();if(!t){if(e.type===1){var a=H.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(!a)throw new i.ErrnoError(53);if(a.socket.readyState===a.socket.CLOSING||a.socket.readyState===a.socket.CLOSED)return null;throw new i.ErrnoError(6)}throw new i.ErrnoError(6)}var s=t.data.byteLength||t.data.length,l=t.data.byteOffset||0,h=t.data.buffer||t.data,w=Math.min(o,s),S={buffer:new Uint8Array(h,l,w),addr:t.addr,port:t.port};if(e.type===1&&w<s){var O=s-w;t.data=new Uint8Array(h,l+w,O),e.recv_queue.unshift(t)}return S}}};function ke(e){var o=H.getSocket(e);if(!o)throw new i.ErrnoError(8);return o}function he(e){return E[Dn()>>2]=e,e}function Ie(e){for(var o=e.split("."),t=0;t<4;t++){var a=Number(o[t]);if(isNaN(a))return null;o[t]=a}return(o[0]|o[1]<<8|o[2]<<16|o[3]<<24)>>>0}function ce(e){return parseInt(e)}function Ar(e){var o,t,a,s,l=/^((?=.*::)(?!.*::.+::)(::)?([\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,h=[];if(!l.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"),":"),o=e.split(":"),o[o.length-4]=ce(o[o.length-4])+ce(o[o.length-3])*256,o[o.length-3]=ce(o[o.length-2])+ce(o[o.length-1])*256,o=o.slice(0,o.length-2)):o=e.split(":"),a=0,s=0,t=0;t<o.length;t++)if(typeof o[t]=="string")if(o[t]==="Z"){for(s=0;s<8-o.length+1;s++)h[t+s]=0;a=s-1}else h[t+a]=At(parseInt(o[t],16));else h[t+a]=o[t];return[h[1]<<16|h[0],h[3]<<16|h[2],h[5]<<16|h[4],h[7]<<16|h[6]]}function be(e,o,t,a,s){switch(o){case 2:t=Ie(t),wr(e,16),s&&(E[s>>2]=16),we[e>>1]=o,E[e+4>>2]=t,we[e+2>>1]=At(a);break;case 10:t=Ar(t),wr(e,28),s&&(E[s>>2]=28),E[e>>2]=o,E[e+8>>2]=t[0],E[e+12>>2]=t[1],E[e+16>>2]=t[2],E[e+20>>2]=t[3],we[e+2>>1]=At(a);break;default:return 5}return 0}var ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(e){var o=Ie(e);if(o!==null||(o=Ar(e),o!==null))return e;var t;if(ue.address_map.addrs[e])t=ue.address_map.addrs[e];else{var a=ue.address_map.id++;Le(a<65535,"exceeded max address mappings of 65535"),t="172.29."+(a&255)+"."+(a&65280),ue.address_map.names[t]=e,ue.address_map.addrs[e]=t}return t},lookup_addr:function(e){return ue.address_map.names[e]?ue.address_map.names[e]:null}};function Zr(e,o,t,a){try{var s=ke(e),l=s.sock_ops.accept(s);if(o)var h=be(o,l.family,ue.lookup_name(l.daddr),l.dport,t);return l.stream.fd}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function Ne(e){return(e&255)+"."+(e>>8&255)+"."+(e>>16&255)+"."+(e>>24&255)}function kn(e){var o="",t=0,a=0,s=0,l=0,h=0,w=0,S=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],O=!0,N="";for(w=0;w<5;w++)if(S[w]!==0){O=!1;break}if(O){if(N=Ne(S[6]|S[7]<<16),S[5]===-1)return o="::ffff:",o+=N,o;if(S[5]===0)return o="::",N==="0.0.0.0"&&(N=""),N==="0.0.0.1"&&(N="1"),o+=N,o}for(t=0;t<8;t++)S[t]===0&&(t-s>1&&(h=0),s=t,h++),h>a&&(a=h,l=t-a+1);for(t=0;t<8;t++){if(a>1&&S[t]===0&&t>=l&&t<l+a){t===l&&(o+=":",l===0&&(o+=":"));continue}o+=Number(an(S[t]&65535)).toString(16),o+=t<7?":":""}return o}function Gr(e,o){var t=we[e>>1],a=an(lt[e+2>>1]),s;switch(t){case 2:if(o!==16)return{errno:28};s=E[e+4>>2],s=Ne(s);break;case 10:if(o!==28)return{errno:28};s=[E[e+8>>2],E[e+12>>2],E[e+16>>2],E[e+20>>2]],s=kn(s);break;default:return{errno:5}}return{family:t,addr:s,port:a}}function Yr(e,o,t){if(t&&e===0)return null;var a=Gr(e,o);if(a.errno)throw new i.ErrnoError(a.errno);return a.addr=ue.lookup_addr(a.addr)||a.addr,a}function dn(e,o,t){try{var a=ke(e),s=Yr(o,t);return a.sock_ops.bind(a,s.addr,s.port),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Pt(e){try{return e=C.getStr(e),i.chdir(e),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function oo(e,o){try{return e=C.getStr(e),i.chmod(e,o),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function io(e,o,t){try{var a=ke(e),s=Yr(o,t);return a.sock_ops.connect(a,s.addr,s.port),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function ao(e){try{var o=C.getStreamFromFD(e);return i.createStream(o,0).fd}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function so(e,o,t){try{var a=C.getStreamFromFD(e);if(a.fd===o)return-28;var s=i.getStream(o);return s&&i.close(s),i.createStream(a,o,o+1).fd}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function uo(e,o,t,a){try{if(o=C.getStr(o),o=C.calculateAt(e,o),t&-8)return-28;var s=i.lookupPath(o,{follow:!0}),l=s.node;if(!l)return-44;var h="";return t&4&&(h+="r"),t&2&&(h+="w"),t&1&&(h+="x"),h&&i.nodePermissions(l,h)?-2:0}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function _n(e,o){try{return i.fchmod(e,o),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function fo(e,o,t){try{return i.fchown(e,o,t),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function gt(e,o,t,a,s){try{o=C.getStr(o);var l=s&256;return s=s&-257,o=C.calculateAt(e,o),(l?i.lchown:i.chown)(o,t,a),0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function co(e,o,t){C.varargs=t;try{var a=C.getStreamFromFD(e);switch(o){case 0:{var s=C.get();if(s<0)return-28;var l;return l=i.createStream(a,s),l.fd}case 1:case 2:return 0;case 3:return a.flags;case 4:{var s=C.get();return a.flags|=s,0}case 5:{var s=C.get(),h=0;return we[s+h>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return he(28),-1;default:return-28}}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function lo(e,o){try{var t=C.getStreamFromFD(e);return C.doStat(i.stat,t.path,o)}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function qt(e,o){return o+2097152>>>0<4194305-!!e?(e>>>0)+o*4294967296:NaN}function _o(e,o,t){try{var a=qt(o,t);return isNaN(a)?-61:(i.ftruncate(e,a),0)}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function mo(e,o){try{if(o===0)return-28;var t=i.cwd(),a=Ce(t)+1;return o<a?-68:(Fe(t,e,o),a)}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function vo(e,o,t){try{var a=C.getStreamFromFD(e);a.getdents||(a.getdents=i.readdir(a.path));for(var s=280,l=0,h=i.llseek(a,0,1),w=Math.floor(h/s);w<a.getdents.length&&l+s<=t;){var S,O,N=a.getdents[w];if(N===".")S=a.node.id,O=4;else if(N===".."){var T=i.lookupPath(a.path,{parent:!0});S=T.node.id,O=4}else{var F=i.lookupNode(a.node,N);S=F.id,O=i.isChrdev(F.mode)?2:i.isDir(F.mode)?4:i.isLink(F.mode)?10:8}Z=[S>>>0,(U=S,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[o+l>>2]=Z[0],E[o+l+4>>2]=Z[1],Z=[(w+1)*s>>>0,(U=(w+1)*s,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[o+l+8>>2]=Z[0],E[o+l+12>>2]=Z[1],we[o+l+16>>1]=280,ee[o+l+18>>0]=O,Fe(N,o+l+19,256),l+=s,w+=1}return i.llseek(a,w*s,0),l}catch(L){if(typeof i>"u"||!(L instanceof i.ErrnoError))throw L;return-L.errno}}function po(e,o,t){try{var a=ke(e);if(!a.daddr)return-53;var s=be(o,a.family,ue.lookup_name(a.daddr),a.dport,t);return 0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function ho(e,o,t){try{fe("__syscall_getsockname "+e);var a=ke(e),s=be(o,a.family,ue.lookup_name(a.saddr||"0.0.0.0"),a.sport,t);return 0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function yo(e,o,t,a,s){try{var l=ke(e);return o===1&&t===4?(E[a>>2]=l.error,E[s>>2]=4,l.error=null,0):-50}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Eo(e,o,t){C.varargs=t;try{var a=C.getStreamFromFD(e);switch(o){case 21509:case 21505:return a.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return a.tty?0:-59;case 21519:{if(!a.tty)return-59;var s=C.get();return E[s>>2]=0,0}case 21520:return a.tty?-28:-59;case 21531:{var s=C.get();return i.ioctl(a,o,s)}case 21523:return a.tty?0:-59;case 21524:return a.tty?0:-59;default:return-28}}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function wo(e,o){try{var t=ke(e);return t.sock_ops.listen(t,o),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function go(e,o){try{return e=C.getStr(e),C.doStat(i.lstat,e,o)}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function So(e,o,t){try{return o=C.getStr(o),o=C.calculateAt(e,o),o=Y.normalize(o),o[o.length-1]==="/"&&(o=o.substr(0,o.length-1)),i.mkdir(o,t,0),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function bo(e,o,t,a){try{o=C.getStr(o);var s=a&256,l=a&4096;return a=a&-4353,o=C.calculateAt(e,o,l),C.doStat(s?i.lstat:i.stat,o,t)}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function ko(e,o,t,a){C.varargs=a;try{o=C.getStr(o),o=C.calculateAt(e,o);var s=a?C.get():0;return i.open(o,t,s).fd}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}var ae={BUCKET_BUFFER_SIZE:8192,mount:function(e){return i.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var o=ae.nextname(),t=ae.nextname(),a=i.createNode(ae.root,o,4096,0),s=i.createNode(ae.root,t,4096,0);a.pipe=e,s.pipe=e;var l=i.createStream({path:o,node:a,flags:0,seekable:!1,stream_ops:ae.stream_ops});a.stream=l;var h=i.createStream({path:t,node:s,flags:1,seekable:!1,stream_ops:ae.stream_ops});return s.stream=h,{readable_fd:l.fd,writable_fd:h.fd}},stream_ops:{poll:function(e){var o=e.node.pipe;if((e.flags&2097155)===1)return 260;if(o.buckets.length>0)for(var t=0;t<o.buckets.length;t++){var a=o.buckets[t];if(a.offset-a.roffset>0)return 65}return 0},ioctl:function(e,o,t){return 28},fsync:function(e){return 28},read:function(e,o,t,a,s){for(var l=e.node.pipe,h=0,w=0;w<l.buckets.length;w++){var S=l.buckets[w];h+=S.offset-S.roffset}Le(o instanceof ArrayBuffer||ArrayBuffer.isView(o));var O=o.subarray(t,t+a);if(a<=0)return 0;if(h==0)throw new i.ErrnoError(6);for(var N=Math.min(h,a),T=N,F=0,w=0;w<l.buckets.length;w++){var L=l.buckets[w],R=L.offset-L.roffset;if(N<=R){var B=L.buffer.subarray(L.roffset,L.offset);N<R?(B=B.subarray(0,N),L.roffset+=N):F++,O.set(B);break}else{var B=L.buffer.subarray(L.roffset,L.offset);O.set(B),O=O.subarray(B.byteLength),N-=B.byteLength,F++}}return F&&F==l.buckets.length&&(F--,l.buckets[F].offset=0,l.buckets[F].roffset=0),l.buckets.splice(0,F),T},write:function(e,o,t,a,s){var l=e.node.pipe;Le(o instanceof ArrayBuffer||ArrayBuffer.isView(o));var h=o.subarray(t,t+a),w=h.byteLength;if(w<=0)return 0;var S=null;l.buckets.length==0?(S={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0},l.buckets.push(S)):S=l.buckets[l.buckets.length-1],Le(S.offset<=ae.BUCKET_BUFFER_SIZE);var O=ae.BUCKET_BUFFER_SIZE-S.offset;if(O>=w)return S.buffer.set(h,S.offset),S.offset+=w,w;O>0&&(S.buffer.set(h.subarray(0,O),S.offset),S.offset+=O,h=h.subarray(O,h.byteLength));for(var N=h.byteLength/ae.BUCKET_BUFFER_SIZE|0,T=h.byteLength%ae.BUCKET_BUFFER_SIZE,F=0;F<N;F++){var L={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:ae.BUCKET_BUFFER_SIZE,roffset:0};l.buckets.push(L),L.buffer.set(h.subarray(0,ae.BUCKET_BUFFER_SIZE)),h=h.subarray(ae.BUCKET_BUFFER_SIZE,h.byteLength)}if(T>0){var L={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:h.byteLength,roffset:0};l.buckets.push(L),L.buffer.set(h)}return w},close:function(e){var o=e.node.pipe;o.refcnt--,o.refcnt===0&&(o.buckets=null)}},nextname:function(){return ae.nextname.current||(ae.nextname.current=0),"pipe["+ae.nextname.current+++"]"}};function Oo(e){try{if(e==0)throw new i.ErrnoError(21);var o=ae.createPipe();return E[e>>2]=o.readable_fd,E[e+4>>2]=o.writable_fd,0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function kr(e,o,t){try{for(var a=0,s=0;s<o;s++){var l=e+8*s,h=E[l>>2],w=we[l+4>>1],S=32,O=i.getStream(h);O&&(S=C.DEFAULT_POLLMASK,O.stream_ops?.poll&&(S=O.stream_ops.poll(O))),S&=w|8|16,S&&a++,we[l+6>>1]=S}return a}catch(N){if(typeof i>"u"||!(N instanceof i.ErrnoError))throw N;return-N.errno}}function Do(e,o,t,a){try{if(o=C.getStr(o),o=C.calculateAt(e,o),a<=0)return-28;var s=i.readlink(o),l=Math.min(a,Ce(s)),h=ee[t+l];return Fe(s,t,a+1),ee[t+l]=h,l}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function Se(e,o,t,a,s,l){try{var h=ke(e),w=h.sock_ops.recvmsg(h,t);if(!w)return 0;if(s)var S=be(s,h.family,ue.lookup_name(w.addr),w.port,l);return le.set(w.buffer,o),w.buffer.byteLength}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function No(e,o,t,a){try{return o=C.getStr(o),a=C.getStr(a),o=C.calculateAt(e,o),a=C.calculateAt(t,a),i.rename(o,a),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function To(e){try{return e=C.getStr(e),i.rmdir(e),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function Ao(e,o,t,a,s,l){try{var h=ke(e),w=Yr(s,l,!0);return w?h.sock_ops.sendmsg(h,ee,o,t,w.addr,w.port):i.write(h.stream,ee,o,t)}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function Fo(e,o,t){try{var a=H.createSocket(e,o,t);return a.stream.fd}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function Co(e,o){try{return e=C.getStr(e),C.doStat(i.stat,e,o)}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function Po(e,o,t){try{return e=C.getStr(e),E[t+4>>2]=4096,E[t+40>>2]=4096,E[t+8>>2]=1e6,E[t+12>>2]=5e5,E[t+16>>2]=5e5,E[t+20>>2]=i.nextInode,E[t+24>>2]=1e6,E[t+28>>2]=42,E[t+44>>2]=2,E[t+36>>2]=255,0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function Ro(e,o){try{return e=C.getStr(e),o=C.getStr(o),i.symlink(e,o),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function Mo(e,o,t){try{return o=C.getStr(o),o=C.calculateAt(e,o),t===0?i.unlink(o):t===512?i.rmdir(o):me("Invalid flags passed to unlinkat"),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function jr(e){return j[e>>2]+E[e+4>>2]*4294967296}function Lo(e,o,t,a){try{if(o=C.getStr(o),o=C.calculateAt(e,o,!0),t){var h=jr(t),w=E[t+8>>2];s=h*1e3+w/(1e3*1e3),t+=16,h=jr(t),w=E[t+8>>2],l=h*1e3+w/(1e3*1e3)}else var s=Date.now(),l=s;return i.utime(o,s,l),0}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function mn(e){}var Vt="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function St(e,o){me(Vt)}function Fn(e,o){me(Vt)}var Uo=!0;function vn(){return Uo}function Io(){throw 1/0}function Bo(e,o){var t=new Date(jr(e)*1e3);E[o>>2]=t.getUTCSeconds(),E[o+4>>2]=t.getUTCMinutes(),E[o+8>>2]=t.getUTCHours(),E[o+12>>2]=t.getUTCDate(),E[o+16>>2]=t.getUTCMonth(),E[o+20>>2]=t.getUTCFullYear()-1900,E[o+24>>2]=t.getUTCDay();var a=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),s=(t.getTime()-a)/(1e3*60*60*24)|0;E[o+28>>2]=s}function xo(e,o){var t=new Date(jr(e)*1e3);E[o>>2]=t.getSeconds(),E[o+4>>2]=t.getMinutes(),E[o+8>>2]=t.getHours(),E[o+12>>2]=t.getDate(),E[o+16>>2]=t.getMonth(),E[o+20>>2]=t.getFullYear()-1900,E[o+24>>2]=t.getDay();var a=new Date(t.getFullYear(),0,1),s=(t.getTime()-a.getTime())/(1e3*60*60*24)|0;E[o+28>>2]=s,E[o+36>>2]=-(t.getTimezoneOffset()*60);var l=new Date(t.getFullYear(),6,1).getTimezoneOffset(),h=a.getTimezoneOffset(),w=(l!=h&&t.getTimezoneOffset()==Math.min(h,l))|0;E[o+32>>2]=w}function zo(e){var o=new Date(E[e+20>>2]+1900,E[e+16>>2],E[e+12>>2],E[e+8>>2],E[e+4>>2],E[e>>2],0),t=E[e+32>>2],a=o.getTimezoneOffset(),s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),h=s.getTimezoneOffset(),w=Math.min(h,l);if(t<0)E[e+32>>2]=+(l!=h&&w==a);else if(t>0!=(w==a)){var S=Math.max(h,l),O=t>0?w:S;o.setTime(o.getTime()+(O-a)*6e4)}E[e+24>>2]=o.getDay();var N=(o.getTime()-s.getTime())/(1e3*60*60*24)|0;return E[e+28>>2]=N,E[e>>2]=o.getSeconds(),E[e+4>>2]=o.getMinutes(),E[e+8>>2]=o.getHours(),E[e+12>>2]=o.getDate(),E[e+16>>2]=o.getMonth(),E[e+20>>2]=o.getYear(),o.getTime()/1e3|0}function Ho(e,o,t,a,s,l){try{var h=C.getStreamFromFD(a),w=i.mmap(h,e,s,o,t),S=w.ptr;return E[l>>2]=w.allocated,S}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function Wo(e,o,t,a,s,l){try{var h=C.getStreamFromFD(s);t&2&&C.doMsync(e,h,o,a,l),i.munmap(h)}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function Gt(e){var o=Ce(e)+1,t=Qr(o);return t&&Ze(e,ee,t,o),t}function Yo(e,o,t){var a=new Date().getFullYear(),s=new Date(a,0,1),l=new Date(a,6,1),h=s.getTimezoneOffset(),w=l.getTimezoneOffset(),S=Math.max(h,w);E[e>>2]=S*60,E[o>>2]=+(h!=w);function O(R){var B=R.toTimeString().match(/\(([A-Za-z ]+)\)$/);return B?B[1]:"GMT"}var N=O(s),T=O(l),F=Gt(N),L=Gt(T);w<h?(j[t>>2]=F,j[t+4>>2]=L):(j[t>>2]=L,j[t+4>>2]=F)}function rt(e,o,t){rt.called||(rt.called=!0,Yo(e,o,t))}function jo(){me("")}function Kt(){return Date.now()}function Xt(){return 2147483648}function Rt(){return Xt()}var tt;te?tt=()=>{var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:tt=()=>performance.now();function qo(e,o,t){le.copyWithin(e,o,o+t)}function Zt(e){try{return ir.grow(e-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function Vo(e){var o=le.length;e=e>>>0;var t=Xt();if(e>t)return!1;let a=(S,O)=>S+(O-S%O)%O;for(var s=1;s<=4;s*=2){var l=o*(1+.2/s);l=Math.min(l,e+100663296);var h=Math.min(t,a(Math.max(e,l),65536)),w=Zt(h);if(w)return!0}return!1}function Mt(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var it=A.ENV||{};function Go(){return ie||"./this.program"}function Or(){if(!Or.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",o={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Go()};for(var t in it)it[t]===void 0?delete o[t]:o[t]=it[t];var a=[];for(var t in o)a.push(t+"="+o[t]);Or.strings=a}return Or.strings}function at(e,o,t){for(var a=0;a<e.length;++a)ee[o++>>0]=e.charCodeAt(a);t||(ee[o>>0]=0)}function st(e,o){var t=0;return Or().forEach(function(a,s){var l=o+t;j[e+s*4>>2]=l,at(a,l),t+=a.length+1}),0}function On(e,o){var t=Or();j[e>>2]=t.length;var a=0;return t.forEach(function(s){a+=s.length+1}),j[o>>2]=a,0}function qr(e){Pr=e,Mr()||(f.onExit&&f.onExit(e),Tr=!0),_e(e,new Ur(e))}function Lt(e,o){Pr=e,Mr()||Kn(),qr(e)}var Cn=Lt;function Ko(e){try{var o=C.getStreamFromFD(e);return i.close(o),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return t.errno}}function pn(e,o){try{var t=C.getStreamFromFD(e),a=t.tty?2:i.isDir(t.mode)?3:i.isLink(t.mode)?7:4;return ee[o>>0]=a,0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return s.errno}}function Xo(e,o,t,a){for(var s=0,l=0;l<t;l++){var h=j[o>>2],w=j[o+4>>2];o+=8;var S=i.read(e,ee,h,w,a);if(S<0)return-1;if(s+=S,S<w)break}return s}function Zo(e,o,t,a){try{var s=C.getStreamFromFD(e),l=Xo(s,o,t);return j[a>>2]=l,0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return h.errno}}function $o(e,o,t,a,s){try{var l=qt(o,t);if(isNaN(l))return 61;var h=C.getStreamFromFD(e);return i.llseek(h,l,a),Z=[h.position>>>0,(U=h.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[s>>2]=Z[0],E[s+4>>2]=Z[1],h.getdents&&l===0&&a===0&&(h.getdents=null),0}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return w.errno}}function Jo(e){try{var o=C.getStreamFromFD(e);return o.stream_ops&&o.stream_ops.fsync?o.stream_ops.fsync(o):0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return t.errno}}function Qo(e,o,t,a){for(var s=0,l=0;l<t;l++){var h=j[o>>2],w=j[o+4>>2];o+=8;var S=i.write(e,ee,h,w,a);if(S<0)return-1;s+=S}return s}function ei(e,o,t,a){try{var s=C.getStreamFromFD(e),l=Qo(s,o,t);return j[a>>2]=l,0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return h.errno}}function nn(e,o,t,a){var s=0,l=0,h=0,w=0,S=0,O=0,N;function T(F,L,R,B,P,M){var z,q,W,X;return q=F===10?28:16,P=F===10?kn(P):Ne(P),z=Qr(q),X=be(z,F,P,M),Le(!X),W=Qr(32),E[W+4>>2]=F,E[W+8>>2]=L,E[W+12>>2]=R,E[W+24>>2]=B,j[W+20>>2]=z,F===10?E[W+16>>2]=28:E[W+16>>2]=16,E[W+28>>2]=0,W}if(t&&(h=E[t>>2],w=E[t+4>>2],S=E[t+8>>2],O=E[t+12>>2]),S&&!O&&(O=S===2?17:6),!S&&O&&(S=O===17?2:1),O===0&&(O=6),S===0&&(S=1),!e&&!o)return-2;if(h&-1088||t!==0&&E[t>>2]&2&&!e)return-1;if(h&32)return-2;if(S!==0&&S!==1&&S!==2)return-7;if(w!==0&&w!==2&&w!==10)return-6;if(o&&(o=ne(o),l=parseInt(o,10),isNaN(l)))return h&1024?-2:-8;if(!e)return w===0&&(w=2),h&1||(w===2?s=Br(2130706433):s=[0,0,0,1]),N=T(w,S,O,null,s,l),j[a>>2]=N,0;if(e=ne(e),s=Ie(e),s!==null)if(w===0||w===2)w=2;else if(w===10&&h&8)s=[0,0,Br(65535),s],w=10;else return-2;else if(s=Ar(e),s!==null)if(w===0||w===10)w=10;else return-2;return s!=null?(N=T(w,S,O,e,s,l),j[a>>2]=N,0):h&4?-2:(e=ue.lookup_name(e),s=Ie(e),w===0?w=2:w===10&&(s=[0,0,Br(65535),s]),N=T(w,S,O,null,s,l),j[a>>2]=N,0)}function Pn(e){var o=Qr(20),t=Qr(e.length+1);Fe(e,t,e.length+1),j[o>>2]=t;var a=Qr(4);j[a>>2]=0,j[o+4>>2]=a;var s=2;E[o+8>>2]=s,E[o+12>>2]=4;var l=Qr(12);return j[l>>2]=l+8,j[l+4>>2]=0,E[l+8>>2]=Ie(ue.lookup_name(e)),j[o+16>>2]=l,o}function Rn(e,o,t){if(t!==2)return he(5),null;e=E[e>>2];var a=Ne(e),s=ue.lookup_addr(a);return s&&(a=s),Pn(a)}function ri(e){return Pn(ne(e))}function Mn(e,o,t,a,s,l){var h=ri(e);return Nt(o,h,20),zr(h),E[l>>2]=0,j[s>>2]=o,0}function hn(e,o){for(var t=Math.min(o,3),a=8,s=0;s<t;s++)dt[e+s*a>>3]=.1;return t}function nt(e,o,t,a,s,l,h){var w=Gr(e,o);if(w.errno)return-6;var S=w.port,O=w.addr,N=!1;if(t&&a){var T;if(h&1||!(T=ue.lookup_addr(O))){if(h&8)return-2}else O=T;var F=Fe(O,t,a);F+1>=a&&(N=!0)}if(s&&l){S=""+S;var F=Fe(S,s,l);F+1>=l&&(N=!0)}return N?-12:0}var bt={list:[],map:{}};function $t(e){function o(l,h,w){var S=Qr(l.length+1);at(l,S);for(var O=0,N=w.length,T=Qr((N+1)*4),F=0;F<N;F++,O+=4){var L=w[F],R=Qr(L.length+1);at(L,R),j[T+O>>2]=R}j[T+O>>2]=0;var B=Qr(12);return j[B>>2]=S,j[B+4>>2]=T,E[B+8>>2]=h,B}var t=bt.list,a=bt.map;if(t.length===0){var s=o("tcp",6,["TCP"]);t.push(s),a.tcp=a[6]=s,s=o("udp",17,["UDP"]),t.push(s),a.udp=a[17]=s}$t.index=0}function yn(e){e=ne(e),$t(!0);var o=bt.map[e];return o}function Fr(e){$t(!0);var o=bt.map[e];return o}function Ue(e){var o=Ce(e)+1,t=vr(o);return Ze(e,ee,t,o),t}var hr={getAllWebSockets:function(e){let o=new Set;e.server&&e.server.clients.forEach(t=>{o.add(t)});for(let t of hr.getAllPeers(e))o.add(t.socket);return Array.from(o)},getAllPeers:function(e){let o=new Set;if(e.server&&e.pending.filter(t=>t.peers).forEach(t=>{for(let a of Object.values(t.peers))o.add(a)}),e.peers)for(let t of Object.values(e.peers))o.add(t);return Array.from(o)},awaitData:function(e){return hr.awaitWsEvent(e,"message")},awaitConnection:function(e){return e.OPEN===e.readyState?[Promise.resolve(),hr.noop]:hr.awaitWsEvent(e,"open")},awaitClose:function(e){return[e.CLOSING,e.CLOSED].includes(e.readyState)?[Promise.resolve(),hr.noop]:hr.awaitWsEvent(e,"close")},awaitError:function(e){return[e.CLOSING,e.CLOSED].includes(e.readyState)?[Promise.resolve(),hr.noop]:hr.awaitWsEvent(e,"error")},awaitWsEvent:function(e,o){let t,a=()=>{t()};return[new Promise(function(h){t=h,e.once(o,a)}),()=>{e.removeListener(o,a),setTimeout(t)}]},noop:function(){},shutdownSocket:function(e,o){let t=ke(e),a=Object.values(t.peers)[0];if(!a)return-1;try{return a.socket.close(),H.websocket_sock_ops.removePeer(t,a),0}catch(s){return console.log("Socket shutdown error",s),-1}}};function tr(e,o,t){if(!e)return 1;let a=ne(e);if(!a.length)return 0;let s=ne(o);if(!s.length)return 0;if(f.popen_to_file){let{path:l,exitCode:h}=f.popen_to_file(a,s);return le[t]=h,Ue(l)}if(te){let l=require("os").tmpdir(),h="php-process-stream",w=l+"/"+h,S=require("child_process"),O;if(s==="r")O=S.spawnSync(a,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[t]=O.status,require("fs").writeFileSync(w,O.stdout,{encoding:"utf8",flag:"w+"});else return s==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+s+" (should be r or w)"),_W_EXITCODE(0,2));return Ue(w)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function Hr(e){return e%4===0&&(e%100!==0||e%400===0)}function Ge(e,o){for(var t=0,a=0;a<=o;t+=e[a++]);return t}var Xe=[31,29,31,30,31,30,31,31,30,31,30,31],Ve=[31,28,31,30,31,30,31,31,30,31,30,31];function ut(e,o){for(var t=new Date(e.getTime());o>0;){var a=Hr(t.getFullYear()),s=t.getMonth(),l=(a?Xe:Ve)[s];if(o>l-t.getDate())o-=l-t.getDate()+1,t.setDate(1),s<11?t.setMonth(s+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));else return t.setDate(t.getDate()+o),t}return t}function Kr(e,o,t,a){var s=E[a+40>>2],l={tm_sec:E[a>>2],tm_min:E[a+4>>2],tm_hour:E[a+8>>2],tm_mday:E[a+12>>2],tm_mon:E[a+16>>2],tm_year:E[a+20>>2],tm_wday:E[a+24>>2],tm_yday:E[a+28>>2],tm_isdst:E[a+32>>2],tm_gmtoff:E[a+36>>2],tm_zone:s?ne(s):""},h=ne(t),w={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var S in w)h=h.replace(new RegExp(S,"g"),w[S]);var O=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],N=["January","February","March","April","May","June","July","August","September","October","November","December"];function T(z,q,W){for(var X=typeof z=="number"?z.toString():z||"";X.length<q;)X=W[0]+X;return X}function F(z,q){return T(z,q,"0")}function L(z,q){function W(oe){return oe<0?-1:oe>0?1:0}var X;return(X=W(z.getFullYear()-q.getFullYear()))===0&&(X=W(z.getMonth()-q.getMonth()))===0&&(X=W(z.getDate()-q.getDate())),X}function R(z){switch(z.getDay()){case 0:return new Date(z.getFullYear()-1,11,29);case 1:return z;case 2:return new Date(z.getFullYear(),0,3);case 3:return new Date(z.getFullYear(),0,2);case 4:return new Date(z.getFullYear(),0,1);case 5:return new Date(z.getFullYear()-1,11,31);case 6:return new Date(z.getFullYear()-1,11,30)}}function B(z){var q=ut(new Date(z.tm_year+1900,0,1),z.tm_yday),W=new Date(q.getFullYear(),0,4),X=new Date(q.getFullYear()+1,0,4),oe=R(W),se=R(X);return L(oe,q)<=0?L(se,q)<=0?q.getFullYear()+1:q.getFullYear():q.getFullYear()-1}var P={"%a":function(z){return O[z.tm_wday].substring(0,3)},"%A":function(z){return O[z.tm_wday]},"%b":function(z){return N[z.tm_mon].substring(0,3)},"%B":function(z){return N[z.tm_mon]},"%C":function(z){var q=z.tm_year+1900;return F(q/100|0,2)},"%d":function(z){return F(z.tm_mday,2)},"%e":function(z){return T(z.tm_mday,2," ")},"%g":function(z){return B(z).toString().substring(2)},"%G":function(z){return B(z)},"%H":function(z){return F(z.tm_hour,2)},"%I":function(z){var q=z.tm_hour;return q==0?q=12:q>12&&(q-=12),F(q,2)},"%j":function(z){return F(z.tm_mday+Ge(Hr(z.tm_year+1900)?Xe:Ve,z.tm_mon-1),3)},"%m":function(z){return F(z.tm_mon+1,2)},"%M":function(z){return F(z.tm_min,2)},"%n":function(){return`
22
+ `},"%p":function(z){return z.tm_hour>=0&&z.tm_hour<12?"AM":"PM"},"%S":function(z){return F(z.tm_sec,2)},"%t":function(){return" "},"%u":function(z){return z.tm_wday||7},"%U":function(z){var q=z.tm_yday+7-z.tm_wday;return F(Math.floor(q/7),2)},"%V":function(z){var q=Math.floor((z.tm_yday+7-(z.tm_wday+6)%7)/7);if((z.tm_wday+371-z.tm_yday-2)%7<=2&&q++,q){if(q==53){var X=(z.tm_wday+371-z.tm_yday)%7;X!=4&&(X!=3||!Hr(z.tm_year))&&(q=1)}}else{q=52;var W=(z.tm_wday+7-z.tm_yday-1)%7;(W==4||W==5&&Hr(z.tm_year%400-1))&&q++}return F(q,2)},"%w":function(z){return z.tm_wday},"%W":function(z){var q=z.tm_yday+7-(z.tm_wday+6)%7;return F(Math.floor(q/7),2)},"%y":function(z){return(z.tm_year+1900).toString().substring(2)},"%Y":function(z){return z.tm_year+1900},"%z":function(z){var q=z.tm_gmtoff,W=q>=0;return q=Math.abs(q)/60,q=q/60*100+q%60,(W?"+":"-")+("0000"+q).slice(-4)},"%Z":function(z){return z.tm_zone},"%%":function(){return"%"}};h=h.replace(/%%/g,"\0\0");for(var S in P)h.includes(S)&&(h=h.replace(new RegExp(S,"g"),P[S](l)));h=h.replace(/\0\0/g,"%");var M=Er(h,!1);return M.length>o?0:(Et(M,e),M.length-1)}function ot(e,o,t){for(var a=ne(o),s="\\!@#$^&*()+=-[]/{}|:<>?,.",l=0,h=s.length;l<h;++l)a=a.replace(new RegExp("\\"+s[l],"g"),"\\"+s[l]);var w={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var S in w)a=a.replace(S,w[S]);var O={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},N={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},T={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},F={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var L in O)a=a.replace(L,"("+L+O[L]+")");for(var R=[],l=a.indexOf("%");l>=0;l=a.indexOf("%"))R.push(a[l+1]),a=a.replace(new RegExp("\\%"+a[l+1],"g"),"");var B=new RegExp("^"+a,"i").exec(ne(e));function P(){function xr(et,pi,Ei){return typeof et!="number"||isNaN(et)?pi:et>=pi?et<=Ei?et:Ei:pi}return{year:xr(E[t+20>>2]+1900,1970,9999),month:xr(E[t+16>>2],0,11),day:xr(E[t+12>>2],1,31),hour:xr(E[t+8>>2],0,23),min:xr(E[t+4>>2],0,59),sec:xr(E[t>>2],0,59)}}if(B){var M=P(),z,q=xr=>{var et=R.indexOf(xr);if(et>=0)return B[et+1]};if((z=q("S"))&&(M.sec=ce(z)),(z=q("M"))&&(M.min=ce(z)),z=q("H"))M.hour=ce(z);else if(z=q("I")){var W=ce(z);(z=q("p"))&&(W+=z.toUpperCase()[0]==="P"?12:0),M.hour=W}if(z=q("Y"))M.year=ce(z);else if(z=q("y")){var X=ce(z);(z=q("C"))?X+=ce(z)*100:X+=X<69?2e3:1900,M.year=X}if((z=q("m"))?M.month=ce(z)-1:(z=q("b"))&&(M.month=N[z.substring(0,3).toUpperCase()]||0),z=q("d"))M.day=ce(z);else if(z=q("j"))for(var oe=ce(z),se=Hr(M.year),Oe=0;Oe<12;++Oe){var Ae=Ge(se?Xe:Ve,Oe-1);oe<=Ae+(se?Xe:Ve)[Oe]&&(M.day=oe-Ae)}else if(z=q("a")){var Qe=z.substring(0,3).toUpperCase();if(z=q("U")){var Ke=T[Qe],rr=ce(z),je=new Date(M.year,0,1),nr;je.getDay()===0?nr=ut(je,Ke+7*(rr-1)):nr=ut(je,7-je.getDay()+Ke+7*(rr-1)),M.day=nr.getDate(),M.month=nr.getMonth()}else if(z=q("W")){var Ke=F[Qe],rr=ce(z),je=new Date(M.year,0,1),nr;je.getDay()===1?nr=ut(je,Ke+7*(rr-1)):nr=ut(je,7-je.getDay()+1+Ke+7*(rr-1)),M.day=nr.getDate(),M.month=nr.getMonth()}}var or=new Date(M.year,M.month,M.day,M.hour,M.min,M.sec,0);return E[t>>2]=or.getSeconds(),E[t+4>>2]=or.getMinutes(),E[t+8>>2]=or.getHours(),E[t+12>>2]=or.getDate(),E[t+16>>2]=or.getMonth(),E[t+20>>2]=or.getFullYear()-1900,E[t+24>>2]=or.getDay(),E[t+28>>2]=Ge(Hr(or.getFullYear())?Xe:Ve,or.getMonth()-1)+or.getDate()-1,E[t+32>>2]=0,e+Er(B[0]).length-1}return 0}function ft(e){return hr.shutdownSocket(e,2)}function Ot(e,o,t){if(typeof Asyncify>"u")return 0;let a=1,s=2,l=4,h=8,w=16,S=32;return Asyncify.handleSleep(O=>{let N=ke(e);if(!N){O(0);return}let T=[],F=new Set;if(o&a||o&s){if(N.server){for(let z of N.pending)if((z.recv_queue||[]).length>0){O(1);return}}else if((N.recv_queue||[]).length>0){O(1);return}}let L=hr.getAllWebSockets(N);if(!L.length){O(0);return}for(let z of L)(o&a||o&s)&&(T.push(hr.awaitData(z)),F.add("POLLIN")),o&l&&(T.push(hr.awaitConnection(z)),F.add("POLLOUT")),o&w&&(T.push(hr.awaitClose(z)),F.add("POLLHUP")),(o&h||o&S)&&(T.push(hr.awaitError(z)),F.add("POLLERR"));if(T.length===0){console.warn("Unsupported poll event "+o+", defaulting to setTimeout()."),setTimeout(function(){O(0)},t);return}let R=T.map(([z])=>z),B=()=>T.forEach(([,z])=>z()),P=!1;Promise.race(R).then(function(z){P||(P=!0,O(1),clearTimeout(M),B())});let M=setTimeout(function(){P||(P=!0,O(0),B())},t)})}function Dt(e,o,t,a,s){let l=le[a];if(!(o===1&&t===9||o===6&&t===1))return console.warn(`Unsupported socket option: ${o}, ${t}, ${l}`),-1;let T=hr.getAllWebSockets(e)[0];return T?(T.setSocketOpt(o,t,a),0):-1}function Jt(e){var o=f["_"+e];return o}function Ut(e,o,t,a,s){var l={string:R=>{var B=0;if(R!=null&&R!==0){var P=(R.length<<2)+1;B=vr(P),Fe(R,B,P)}return B},array:R=>{var B=vr(R.length);return Et(R,B),B}};function h(R){return o==="string"?ne(R):o==="boolean"?!!R:R}var w=Jt(e),S=[],O=0;if(a)for(var N=0;N<a.length;N++){var T=l[t[N]];T?(O===0&&(O=sr()),S[N]=T(a[N])):S[N]=a[N]}var F=w.apply(null,S);function L(R){return O!==0&&Ye(O),h(R)}return F=L(F),F}var Xr=function(e,o,t,a){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=i.nextInode++,this.name=o,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=a},$r=365,En=146;Object.defineProperties(Xr.prototype,{read:{get:function(){return(this.mode&$r)===$r},set:function(e){e?this.mode|=$r:this.mode&=~$r}},write:{get:function(){return(this.mode&En)===En},set:function(e){e?this.mode|=En:this.mode&=~En}},isFolder:{get:function(){return i.isDir(this.mode)}},isDevice:{get:function(){return i.isChrdev(this.mode)}}}),i.FSNode=Xr,i.staticInit(),f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_unlink=i.unlink,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,te&&(yr(),V.staticInit()),re={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};var ti={j:to,Ta:wt,Sa:v,Ra:Zr,Qa:dn,Pa:Pt,P:oo,Oa:io,Na:ao,Ma:so,La:uo,Ka:_n,Ja:fo,O:gt,m:co,Ia:lo,S:_o,Ha:mo,Ga:vo,Fa:po,Ea:ho,Da:yo,N:Eo,Ca:wo,Ba:go,Aa:So,za:bo,w:ko,ya:Oo,xa:kr,wa:Do,va:Se,ua:No,M:To,ta:Ao,L:Fo,sa:Co,ra:Po,qa:Ro,E:Mo,pa:Lo,ka:mn,ja:St,ia:Fn,ha:vn,ga:Io,fa:Bo,ea:xo,da:zo,ca:Ho,ba:Wo,aa:rt,o:jo,C:Kt,$:Rt,B:tt,_:qo,Z:Vo,Y:Mt,oa:st,na:On,p:Cn,r:Ko,K:pn,J:Zo,R:$o,ma:Jo,D:ei,X:nn,I:Rn,H:Mn,W:hn,G:nt,V:yn,U:Fr,h:di,d:xn,b:g,f:_,g:D,u:b,t:In,v:p,A:y,e:_i,a:Bn,c:li,z:m,l:bn,k,n:c,i:u,y:d,T:tr,la:qr,F:Kr,Q:ot,s:ft,x:Ot,q:Dt},wn=ro(),on=f.___wasm_call_ctors=function(){return(on=f.___wasm_call_ctors=f.asm.Va).apply(null,arguments)},Qt=f._wasm_popen=function(){return(Qt=f._wasm_popen=f.asm.Wa).apply(null,arguments)},Dn=f.___errno_location=function(){return(Dn=f.___errno_location=f.asm.Xa).apply(null,arguments)},gn=f._wasm_pclose=function(){return(gn=f._wasm_pclose=f.asm.Ya).apply(null,arguments)},Tt=f._php_pollfd_for=function(){return(Tt=f._php_pollfd_for=f.asm.Za).apply(null,arguments)},Jr=f._wasm_select=function(){return(Jr=f._wasm_select=f.asm._a).apply(null,arguments)},mr=f._wasm_add_cli_arg=function(){return(mr=f._wasm_add_cli_arg=f.asm.$a).apply(null,arguments)},Qr=f._malloc=function(){return(Qr=f._malloc=f.asm.ab).apply(null,arguments)},It=f._run_cli=function(){return(It=f._run_cli=f.asm.bb).apply(null,arguments)},zr=f._free=function(){return(zr=f._free=f.asm.cb).apply(null,arguments)},Nt=f._memcpy=function(){return(Nt=f._memcpy=f.asm.db).apply(null,arguments)},Dr=f._fflush=function(){return(Dr=f._fflush=f.asm.fb).apply(null,arguments)},At=f._htons=function(){return(At=f._htons=f.asm.gb).apply(null,arguments)},an=f._ntohs=function(){return(an=f._ntohs=f.asm.hb).apply(null,arguments)},Br=f._htonl=function(){return(Br=f._htonl=f.asm.ib).apply(null,arguments)},Vr=f._wasm_set_phpini_path=function(){return(Vr=f._wasm_set_phpini_path=f.asm.jb).apply(null,arguments)},Ft=f._wasm_set_phpini_entries=function(){return(Ft=f._wasm_set_phpini_entries=f.asm.kb).apply(null,arguments)},sn=f._wasm_add_SERVER_entry=function(){return(sn=f._wasm_add_SERVER_entry=f.asm.lb).apply(null,arguments)},en=f._wasm_add_uploaded_file=function(){return(en=f._wasm_add_uploaded_file=f.asm.mb).apply(null,arguments)},un=f._wasm_set_query_string=function(){return(un=f._wasm_set_query_string=f.asm.nb).apply(null,arguments)},rn=f._wasm_set_path_translated=function(){return(rn=f._wasm_set_path_translated=f.asm.ob).apply(null,arguments)},tn=f._wasm_set_skip_shebang=function(){return(tn=f._wasm_set_skip_shebang=f.asm.pb).apply(null,arguments)},Sn=f._wasm_set_request_uri=function(){return(Sn=f._wasm_set_request_uri=f.asm.qb).apply(null,arguments)},ni=f._wasm_set_request_method=function(){return(ni=f._wasm_set_request_method=f.asm.rb).apply(null,arguments)},oi=f._wasm_set_request_host=function(){return(oi=f._wasm_set_request_host=f.asm.sb).apply(null,arguments)},ii=f._wasm_set_content_type=function(){return(ii=f._wasm_set_content_type=f.asm.tb).apply(null,arguments)},ai=f._wasm_set_request_body=function(){return(ai=f._wasm_set_request_body=f.asm.ub).apply(null,arguments)},si=f._wasm_set_content_length=function(){return(si=f._wasm_set_content_length=f.asm.vb).apply(null,arguments)},ui=f._wasm_set_cookies=function(){return(ui=f._wasm_set_cookies=f.asm.wb).apply(null,arguments)},fi=f._wasm_set_php_code=function(){return(fi=f._wasm_set_php_code=f.asm.xb).apply(null,arguments)},ci=f._wasm_set_request_port=function(){return(ci=f._wasm_set_request_port=f.asm.yb).apply(null,arguments)},Ln=f._phpwasm_init_uploaded_files_hash=function(){return(Ln=f._phpwasm_init_uploaded_files_hash=f.asm.zb).apply(null,arguments)},Un=f._phpwasm_register_uploaded_file=function(){return(Un=f._phpwasm_register_uploaded_file=f.asm.Ab).apply(null,arguments)},Cr=f._phpwasm_destroy_uploaded_files_hash=function(){return(Cr=f._phpwasm_destroy_uploaded_files_hash=f.asm.Bb).apply(null,arguments)},Sr=f._wasm_sapi_handle_request=function(){return(Sr=f._wasm_sapi_handle_request=f.asm.Cb).apply(null,arguments)},br=f._php_wasm_init=function(){return(br=f._php_wasm_init=f.asm.Db).apply(null,arguments)},Te=f.___funcs_on_exit=function(){return(Te=f.___funcs_on_exit=f.asm.Eb).apply(null,arguments)},De=f._emscripten_builtin_memalign=function(){return(De=f._emscripten_builtin_memalign=f.asm.Fb).apply(null,arguments)},ye=f._setThrew=function(){return(ye=f._setThrew=f.asm.Gb).apply(null,arguments)},sr=f.stackSave=function(){return(sr=f.stackSave=f.asm.Hb).apply(null,arguments)},Ye=f.stackRestore=function(){return(Ye=f.stackRestore=f.asm.Ib).apply(null,arguments)},vr=f.stackAlloc=function(){return(vr=f.stackAlloc=f.asm.Jb).apply(null,arguments)},Be=f.dynCall_vi=function(){return(Be=f.dynCall_vi=f.asm.Kb).apply(null,arguments)},ur=f.dynCall_iiii=function(){return(ur=f.dynCall_iiii=f.asm.Lb).apply(null,arguments)},fr=f.dynCall_iii=function(){return(fr=f.dynCall_iii=f.asm.Mb).apply(null,arguments)},cr=f.dynCall_iiiii=function(){return(cr=f.dynCall_iiiii=f.asm.Nb).apply(null,arguments)},He=f.dynCall_iiiiii=function(){return(He=f.dynCall_iiiiii=f.asm.Ob).apply(null,arguments)},xe=f.dynCall_ii=function(){return(xe=f.dynCall_ii=f.asm.Pb).apply(null,arguments)},lr=f.dynCall_vii=function(){return(lr=f.dynCall_vii=f.asm.Qb).apply(null,arguments)},kt=f.dynCall_viiii=function(){return(kt=f.dynCall_viiii=f.asm.Rb).apply(null,arguments)},Bt=f.dynCall_viii=function(){return(Bt=f.dynCall_viii=f.asm.Sb).apply(null,arguments)},xt=f.dynCall_viiiii=function(){return(xt=f.dynCall_viiiii=f.asm.Tb).apply(null,arguments)},zt=f.dynCall_iiiiiii=function(){return(zt=f.dynCall_iiiiiii=f.asm.Ub).apply(null,arguments)},Ht=f.dynCall_i=function(){return(Ht=f.dynCall_i=f.asm.Vb).apply(null,arguments)},Wt=f.dynCall_v=function(){return(Wt=f.dynCall_v=f.asm.Wb).apply(null,arguments)},Yt=f.dynCall_iiiiiiiiii=function(){return(Yt=f.dynCall_iiiiiiiiii=f.asm.Xb).apply(null,arguments)},jt=f.dynCall_viiiiiiiii=function(){return(jt=f.dynCall_viiiiiiiii=f.asm.Yb).apply(null,arguments)},fn=f.dynCall_viiiiii=function(){return(fn=f.dynCall_viiiiii=f.asm.Zb).apply(null,arguments)},Nn=f.dynCall_iiiiiiii=function(){return(Nn=f.dynCall_iiiiiiii=f.asm._b).apply(null,arguments)},Tn=f.dynCall_viidii=function(){return(Tn=f.dynCall_viidii=f.asm.$b).apply(null,arguments)};function In(e,o,t,a,s,l,h){var w=sr();try{return zt(e,o,t,a,s,l,h)}catch(S){if(Ye(w),S!==S+0)throw S;ye(1,0)}}function Bn(e,o){var t=sr();try{Be(e,o)}catch(a){if(Ye(t),a!==a+0)throw a;ye(1,0)}}function li(e,o,t){var a=sr();try{lr(e,o,t)}catch(s){if(Ye(a),s!==s+0)throw s;ye(1,0)}}function di(e){var o=sr();try{return Ht(e)}catch(t){if(Ye(o),t!==t+0)throw t;ye(1,0)}}function _i(e){var o=sr();try{Wt(e)}catch(t){if(Ye(o),t!==t+0)throw t;ye(1,0)}}function bn(e,o,t,a){var s=sr();try{Bt(e,o,t,a)}catch(l){if(Ye(s),l!==l+0)throw l;ye(1,0)}}function xn(e,o){var t=sr();try{return xe(e,o)}catch(a){if(Ye(t),a!==a+0)throw a;ye(1,0)}}function g(e,o,t){var a=sr();try{return fr(e,o,t)}catch(s){if(Ye(a),s!==s+0)throw s;ye(1,0)}}function k(e,o,t,a,s){var l=sr();try{kt(e,o,t,a,s)}catch(h){if(Ye(l),h!==h+0)throw h;ye(1,0)}}function D(e,o,t,a,s){var l=sr();try{return cr(e,o,t,a,s)}catch(h){if(Ye(l),h!==h+0)throw h;ye(1,0)}}function _(e,o,t,a){var s=sr();try{return ur(e,o,t,a)}catch(l){if(Ye(s),l!==l+0)throw l;ye(1,0)}}function u(e,o,t,a,s,l,h){var w=sr();try{fn(e,o,t,a,s,l,h)}catch(S){if(Ye(w),S!==S+0)throw S;ye(1,0)}}function c(e,o,t,a,s,l){var h=sr();try{xt(e,o,t,a,s,l)}catch(w){if(Ye(h),w!==w+0)throw w;ye(1,0)}}function m(e,o,t,a,s,l){var h=sr();try{Tn(e,o,t,a,s,l)}catch(w){if(Ye(h),w!==w+0)throw w;ye(1,0)}}function y(e,o,t,a,s,l,h,w,S,O){var N=sr();try{return Yt(e,o,t,a,s,l,h,w,S,O)}catch(T){if(Ye(N),T!==T+0)throw T;ye(1,0)}}function b(e,o,t,a,s,l){var h=sr();try{return He(e,o,t,a,s,l)}catch(w){if(Ye(h),w!==w+0)throw w;ye(1,0)}}function d(e,o,t,a,s,l,h,w,S,O){var N=sr();try{jt(e,o,t,a,s,l,h,w,S,O)}catch(T){if(Ye(N),T!==T+0)throw T;ye(1,0)}}function p(e,o,t,a,s,l,h,w){var S=sr();try{return Nn(e,o,t,a,s,l,h,w)}catch(O){if(Ye(S),O!==O+0)throw O;ye(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,f.FS_unlink=i.unlink,f.ccall=Ut,f.FS=i;var n;$e=function e(){n||r(),n||($e=e)};function r(e){if(e=e||$,Pe>0||(Vn(),Pe>0))return;function o(){n||(n=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),o()},1)):o()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return r(),A}var zf,tu,ou=Oi(()=>{"use strict";zf=10568061,tu=__dirname+"/php_7_3.wasm"});var au={};gi(au,{default:()=>Yf,dependenciesTotalSize:()=>Wf,dependencyFilename:()=>iu});function Yf(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(n,r)=>{throw r},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(n){return f.locateFile?f.locateFile(n,ve):ve+n}var We,ar,Re;function Wr(n){if(n instanceof Ur)return;fe("exiting due to exception: "+n)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(n,r)=>(yr(),n=Me.normalize(n),J.readFileSync(n,r?void 0:"utf8")),Re=n=>{var r=We(n,!0);return r.buffer||(r=new Uint8Array(r)),r},ar=(n,r,e)=>{yr(),n=Me.normalize(n),J.readFile(n,function(o,t){o?e(o):r(t.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(n){if(!(n instanceof Ur))throw n}),process.on("unhandledRejection",function(n){throw n}),_e=(n,r)=>{if(Mr())throw process.exitCode=n,r;Wr(r),process.exit(n)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(n,r){n||me(r)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(n,r,e){for(var o=r+e,t=r;n[t]&&!(t>=o);)++t;if(t-r>16&&n.buffer&&ct)return ct.decode(n.subarray(r,t));for(var a="";r<t;){var s=n[r++];if(!(s&128)){a+=String.fromCharCode(s);continue}var l=n[r++]&63;if((s&224)==192){a+=String.fromCharCode((s&31)<<6|l);continue}var h=n[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|h:s=(s&7)<<18|l<<12|h<<6|n[r++]&63,s<65536)a+=String.fromCharCode(s);else{var w=s-65536;a+=String.fromCharCode(55296|w>>10,56320|w&1023)}}return a}function ne(n,r){return n?ze(le,n,r):""}function Ze(n,r,e,o){if(!(o>0))return 0;for(var t=e,a=e+o-1,s=0;s<n.length;++s){var l=n.charCodeAt(s);if(l>=55296&&l<=57343){var h=n.charCodeAt(++s);l=65536+((l&1023)<<10)|h&1023}if(l<=127){if(e>=a)break;r[e++]=l}else if(l<=2047){if(e+1>=a)break;r[e++]=192|l>>6,r[e++]=128|l&63}else if(l<=65535){if(e+2>=a)break;r[e++]=224|l>>12,r[e++]=128|l>>6&63,r[e++]=128|l&63}else{if(e+3>=a)break;r[e++]=240|l>>18,r[e++]=128|l>>12&63,r[e++]=128|l>>6&63,r[e++]=128|l&63}}return r[e]=0,e-t}function Fe(n,r,e){return Ze(n,le,r,e)}function Ce(n){for(var r=0,e=0;e<n.length;++e){var o=n.charCodeAt(e);o<=127?r++:o<=2047?r+=2:o>=55296&&o<=57343?(r+=4,++e):r+=3}return r}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(n){Rr=n,f.HEAP8=ee=new Int8Array(n),f.HEAP16=we=new Int16Array(n),f.HEAP32=E=new Int32Array(n),f.HEAPU8=le=new Uint8Array(n),f.HEAPU16=lt=new Uint16Array(n),f.HEAPU32=j=new Uint32Array(n),f.HEAPF32=Hn=new Float32Array(n),f.HEAPF64=dt=new Float64Array(n)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!i.init.initialized&&i.init(),i.ignorePermissions=!1,ge.init(),H.root=i.mount(H,{},null),ae.root=i.mount(ae,{},null),_r(vt)}function Kn(){Sr(),_r(Wn),i.quit(),ge.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(n){mt.unshift(n)}function $n(n){vt.unshift(n)}function Jn(n){pt.unshift(n)}var Pe=0,Lr=null,$e=null;function Ci(n){return n}function dr(n){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(n){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var r=$e;$e=null,r()}}function me(n){f.onAbort&&f.onAbort(n),n="Aborted("+n+")",fe(n),Tr=!0,Pr=1,n+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(n);throw r}var Qn="data:application/octet-stream;base64,";function ht(n){return n.startsWith(Qn)}var de;de=iu,ht(de)||(de=Nr(de));function yt(n){try{if(n==de&&qe)return new Uint8Array(qe);if(Re)return Re(n);throw"both async and sync fetching of the wasm failed"}catch(r){me(r)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+de+"'";return n.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var n={a:En};function r(s,l){var h=s.exports;f.asm=h,ir=f.asm.Ta,_t(ir.buffer),ln=f.asm.db,$n(f.asm.Ua),Je("wasm-instantiate")}dr("wasm-instantiate");function e(s){r(s.instance)}function o(s){return eo().then(function(l){return WebAssembly.instantiate(l,n)}).then(function(l){return l}).then(s,function(l){fe("failed to asynchronously prepare wasm: "+l),me(l)})}function t(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(s){var l=WebAssembly.instantiateStreaming(s,n);return l.then(e,function(h){return fe("wasm streaming compile failed: "+h),fe("falling back to ArrayBuffer instantiation"),o(e)})}):o(e)}if(f.instantiateWasm)try{var a=f.instantiateWasm(n,r);return a}catch(s){return fe("Module.instantiateWasm callback failed with error: "+s),!1}return t(),{}}var U,Z;function Ur(n){this.name="ExitStatus",this.message="Program terminated with exit("+n+")",this.status=n}function _r(n){for(;n.length>0;)n.shift()(f)}function Et(n,r){ee.set(n,r)}function to(n,r,e,o){me("Assertion failed: "+ne(n)+", at: "+[r?ne(r):"unknown filename",e,o?ne(o):"unknown function"])}function wt(n,r){(function(e){Ye.apply(null,[n,e])})(r)}var Y={isAbs:n=>n.charAt(0)==="/",splitPath:n=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(n).slice(1)},normalizeArray:(n,r)=>{for(var e=0,o=n.length-1;o>=0;o--){var t=n[o];t==="."?n.splice(o,1):t===".."?(n.splice(o,1),e++):e&&(n.splice(o,1),e--)}if(r)for(;e;e--)n.unshift("..");return n},normalize:n=>{var r=Y.isAbs(n),e=n.substr(-1)==="/";return n=Y.normalizeArray(n.split("/").filter(o=>!!o),!r).join("/"),!n&&!r&&(n="."),n&&e&&(n+="/"),(r?"/":"")+n},dirname:n=>{var r=Y.splitPath(n),e=r[0],o=r[1];return!e&&!o?".":(o&&(o=o.substr(0,o.length-1)),e+o)},basename:n=>{if(n==="/")return"/";n=Y.normalize(n),n=n.replace(/\/$/,"");var r=n.lastIndexOf("/");return r===-1?n:n.substr(r+1)},join:function(){var n=Array.prototype.slice.call(arguments);return Y.normalize(n.join("/"))},join2:(n,r)=>Y.normalize(n+"/"+r)};function no(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var n=new Uint8Array(1);return()=>(crypto.getRandomValues(n),n[0])}else if(te)try{var r=require("crypto");return()=>r.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var Q={resolve:function(){for(var n="",r=!1,e=arguments.length-1;e>=-1&&!r;e--){var o=e>=0?arguments[e]:i.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";n=o+"/"+n,r=Y.isAbs(o)}return n=Y.normalizeArray(n.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+n||"."},relative:(n,r)=>{n=Q.resolve(n).substr(1),r=Q.resolve(r).substr(1);function e(w){for(var S=0;S<w.length&&w[S]==="";S++);for(var O=w.length-1;O>=0&&w[O]==="";O--);return S>O?[]:w.slice(S,O-S+1)}for(var o=e(n.split("/")),t=e(r.split("/")),a=Math.min(o.length,t.length),s=a,l=0;l<a;l++)if(o[l]!==t[l]){s=l;break}for(var h=[],l=s;l<o.length;l++)h.push("..");return h=h.concat(t.slice(s)),h.join("/")}};function Er(n,r,e){var o=e>0?e:Ce(n)+1,t=new Array(o),a=Ze(n,t,0,t.length);return r&&(t.length=a),t}var ge={ttys:[],init:function(){},shutdown:function(){},register:function(n,r){ge.ttys[n]={input:[],output:[],ops:r},i.registerDevice(n,ge.stream_ops)},stream_ops:{open:function(n){var r=ge.ttys[n.node.rdev];if(!r)throw new i.ErrnoError(43);n.tty=r,n.seekable=!1},close:function(n){n.tty.ops.fsync(n.tty)},fsync:function(n){n.tty.ops.fsync(n.tty)},read:function(n,r,e,o,t){if(!n.tty||!n.tty.ops.get_char)throw new i.ErrnoError(60);for(var a=0,s=0;s<o;s++){var l;try{l=n.tty.ops.get_char(n.tty)}catch{throw new i.ErrnoError(29)}if(l===void 0&&a===0)throw new i.ErrnoError(6);if(l==null)break;a++,r[e+s]=l}return a&&(n.node.timestamp=Date.now()),a},write:function(n,r,e,o,t){if(!n.tty||!n.tty.ops.put_char)throw new i.ErrnoError(60);try{for(var a=0;a<o;a++)n.tty.ops.put_char(n.tty,r[e+a])}catch{throw new i.ErrnoError(29)}return o&&(n.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(n){if(!n.input.length){var r=null;if(te){var e=256,o=Buffer.alloc(e),t=0;try{t=J.readSync(process.stdin.fd,o,0,e,-1)}catch(a){if(a.toString().includes("EOF"))t=0;else throw a}t>0?r=o.slice(0,t).toString("utf-8"):r=null}else typeof window<"u"&&typeof window.prompt=="function"?(r=window.prompt("Input: "),r!==null&&(r+=`
23
+ `)):typeof readline=="function"&&(r=readline(),r!==null&&(r+=`
24
+ `));if(!r)return null;n.input=Er(r,!0)}return n.input.shift()},put_char:function(n,r){r===null||r===10?(er(ze(n.output,0)),n.output=[]):r!=0&&n.output.push(r)},fsync:function(n){n.output&&n.output.length>0&&(er(ze(n.output,0)),n.output=[])}},default_tty1_ops:{put_char:function(n,r){r===null||r===10?(fe(ze(n.output,0)),n.output=[]):r!=0&&n.output.push(r)},fsync:function(n){n.output&&n.output.length>0&&(fe(ze(n.output,0)),n.output=[])}}};function wr(n,r){return le.fill(0,n,n+r),n}function gr(n,r){return Math.ceil(n/r)*r}function Ir(n){n=gr(n,65536);var r=br(65536,n);return r?wr(r,n):0}var G={ops_table:null,mount:function(n){return G.createNode(null,"/",16895,0)},createNode:function(n,r,e,o){if(i.isBlkdev(e)||i.isFIFO(e))throw new i.ErrnoError(63);G.ops_table||(G.ops_table={dir:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,lookup:G.node_ops.lookup,mknod:G.node_ops.mknod,rename:G.node_ops.rename,unlink:G.node_ops.unlink,rmdir:G.node_ops.rmdir,readdir:G.node_ops.readdir,symlink:G.node_ops.symlink},stream:{llseek:G.stream_ops.llseek}},file:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:{llseek:G.stream_ops.llseek,read:G.stream_ops.read,write:G.stream_ops.write,allocate:G.stream_ops.allocate,mmap:G.stream_ops.mmap,msync:G.stream_ops.msync}},link:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,readlink:G.node_ops.readlink},stream:{}},chrdev:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:i.chrdev_stream_ops}});var t=i.createNode(n,r,e,o);return i.isDir(t.mode)?(t.node_ops=G.ops_table.dir.node,t.stream_ops=G.ops_table.dir.stream,t.contents={}):i.isFile(t.mode)?(t.node_ops=G.ops_table.file.node,t.stream_ops=G.ops_table.file.stream,t.usedBytes=0,t.contents=null):i.isLink(t.mode)?(t.node_ops=G.ops_table.link.node,t.stream_ops=G.ops_table.link.stream):i.isChrdev(t.mode)&&(t.node_ops=G.ops_table.chrdev.node,t.stream_ops=G.ops_table.chrdev.stream),t.timestamp=Date.now(),n&&(n.contents[r]=t,n.timestamp=t.timestamp),t},getFileDataAsTypedArray:function(n){return n.contents?n.contents.subarray?n.contents.subarray(0,n.usedBytes):new Uint8Array(n.contents):new Uint8Array(0)},expandFileStorage:function(n,r){var e=n.contents?n.contents.length:0;if(!(e>=r)){var o=1024*1024;r=Math.max(r,e*(e<o?2:1.125)>>>0),e!=0&&(r=Math.max(r,256));var t=n.contents;n.contents=new Uint8Array(r),n.usedBytes>0&&n.contents.set(t.subarray(0,n.usedBytes),0)}},resizeFileStorage:function(n,r){if(n.usedBytes!=r)if(r==0)n.contents=null,n.usedBytes=0;else{var e=n.contents;n.contents=new Uint8Array(r),e&&n.contents.set(e.subarray(0,Math.min(r,n.usedBytes))),n.usedBytes=r}},node_ops:{getattr:function(n){var r={};return r.dev=i.isChrdev(n.mode)?n.id:1,r.ino=n.id,r.mode=n.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=n.rdev,i.isDir(n.mode)?r.size=4096:i.isFile(n.mode)?r.size=n.usedBytes:i.isLink(n.mode)?r.size=n.link.length:r.size=0,r.atime=new Date(n.timestamp),r.mtime=new Date(n.timestamp),r.ctime=new Date(n.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(n,r){r.mode!==void 0&&(n.mode=r.mode),r.timestamp!==void 0&&(n.timestamp=r.timestamp),r.size!==void 0&&G.resizeFileStorage(n,r.size)},lookup:function(n,r){throw i.genericErrors[44]},mknod:function(n,r,e,o){return G.createNode(n,r,e,o)},rename:function(n,r,e){if(i.isDir(n.mode)){var o;try{o=i.lookupNode(r,e)}catch{}if(o)for(var t in o.contents)throw new i.ErrnoError(55)}delete n.parent.contents[n.name],n.parent.timestamp=Date.now(),n.name=e,r.contents[e]=n,r.timestamp=n.parent.timestamp,n.parent=r},unlink:function(n,r){delete n.contents[r],n.timestamp=Date.now()},rmdir:function(n,r){var e=i.lookupNode(n,r);for(var o in e.contents)throw new i.ErrnoError(55);delete n.contents[r],n.timestamp=Date.now()},readdir:function(n){var r=[".",".."];for(var e in n.contents)n.contents.hasOwnProperty(e)&&r.push(e);return r},symlink:function(n,r,e){var o=G.createNode(n,r,41471,0);return o.link=e,o},readlink:function(n){if(!i.isLink(n.mode))throw new i.ErrnoError(28);return n.link}},stream_ops:{read:function(n,r,e,o,t){var a=n.node.contents;if(t>=n.node.usedBytes)return 0;var s=Math.min(n.node.usedBytes-t,o);if(s>8&&a.subarray)r.set(a.subarray(t,t+s),e);else for(var l=0;l<s;l++)r[e+l]=a[t+l];return s},write:function(n,r,e,o,t,a){if(r.buffer===ee.buffer&&(a=!1),!o)return 0;var s=n.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(a)return s.contents=r.subarray(e,e+o),s.usedBytes=o,o;if(s.usedBytes===0&&t===0)return s.contents=r.slice(e,e+o),s.usedBytes=o,o;if(t+o<=s.usedBytes)return s.contents.set(r.subarray(e,e+o),t),o}if(G.expandFileStorage(s,t+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(e,e+o),t);else for(var l=0;l<o;l++)s.contents[t+l]=r[e+l];return s.usedBytes=Math.max(s.usedBytes,t+o),o},llseek:function(n,r,e){var o=r;if(e===1?o+=n.position:e===2&&i.isFile(n.node.mode)&&(o+=n.node.usedBytes),o<0)throw new i.ErrnoError(28);return o},allocate:function(n,r,e){G.expandFileStorage(n.node,r+e),n.node.usedBytes=Math.max(n.node.usedBytes,r+e)},mmap:function(n,r,e,o,t){if(!i.isFile(n.node.mode))throw new i.ErrnoError(43);var a,s,l=n.node.contents;if(!(t&2)&&l.buffer===Rr)s=!1,a=l.byteOffset;else{if((e>0||e+r<l.length)&&(l.subarray?l=l.subarray(e,e+r):l=Array.prototype.slice.call(l,e,e+r)),s=!0,a=Ir(r),!a)throw new i.ErrnoError(48);ee.set(l,a)}return{ptr:a,allocated:s}},msync:function(n,r,e,o,t){return G.stream_ops.write(n,r,0,o,e,!1),0}}};function Ct(n,r,e,o){var t=o?"":"al "+n;ar(n,a=>{Le(a,'Loading data file "'+n+'" failed (no arrayBuffer).'),r(new Uint8Array(a)),t&&Je(t)},a=>{if(e)e();else throw'Loading data file "'+n+'" failed.'}),t&&dr(t)}var re={},V={isWindows:!1,staticInit:()=>{V.isWindows=!!process.platform.match(/^win/);var n=process.binding("constants");n.fs&&(n=n.fs),V.flagsForNodeMap={1024:n.O_APPEND,64:n.O_CREAT,128:n.O_EXCL,256:n.O_NOCTTY,0:n.O_RDONLY,2:n.O_RDWR,4096:n.O_SYNC,512:n.O_TRUNC,1:n.O_WRONLY,131072:n.O_NOFOLLOW}},convertNodeCode:n=>{var r=n.code;return re[r]},mount:n=>V.createNode(null,"/",V.getMode(n.opts.root),0),createNode:(n,r,e,o)=>{if(!i.isDir(e)&&!i.isFile(e)&&!i.isLink(e))throw new i.ErrnoError(28);var t=i.createNode(n,r,e);return t.node_ops=V.node_ops,t.stream_ops=V.stream_ops,t},getMode:n=>{var r;try{r=J.lstatSync(n),V.isWindows&&(r.mode=r.mode|(r.mode&292)>>2)}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}return r.mode},realPath:n=>{for(var r=[];n.parent!==n;)r.push(n.name),n=n.parent;return r.push(n.mount.opts.root),r.reverse(),Y.join.apply(null,r)},flagsForNode:n=>{n&=-2097153,n&=-2049,n&=-32769,n&=-524289,n&=-65537;var r=0;for(var e in V.flagsForNodeMap)n&e&&(r|=V.flagsForNodeMap[e],n^=e);if(n)throw new i.ErrnoError(28);return r},node_ops:{getattr:n=>{var r=V.realPath(n),e;try{e=J.lstatSync(r)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}return V.isWindows&&!e.blksize&&(e.blksize=4096),V.isWindows&&!e.blocks&&(e.blocks=(e.size+e.blksize-1)/e.blksize|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},setattr:(n,r)=>{var e=V.realPath(n);try{if(r.mode!==void 0&&(J.chmodSync(e,r.mode),n.mode=r.mode),r.timestamp!==void 0){var o=new Date(r.timestamp);J.utimesSync(e,o,o)}r.size!==void 0&&J.truncateSync(e,r.size)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}},lookup:(n,r)=>{var e=Y.join2(V.realPath(n),r),o=V.getMode(e);return V.createNode(n,r,o)},mknod:(n,r,e,o)=>{var t=V.createNode(n,r,e,o),a=V.realPath(t);try{i.isDir(t.mode)?J.mkdirSync(a,t.mode):J.writeFileSync(a,"",{mode:t.mode})}catch(s){throw s.code?new i.ErrnoError(V.convertNodeCode(s)):s}return t},rename:(n,r,e)=>{var o=V.realPath(n),t=Y.join2(V.realPath(r),e);try{J.renameSync(o,t)}catch(a){throw a.code?new i.ErrnoError(V.convertNodeCode(a)):a}n.name=e},unlink:(n,r)=>{var e=Y.join2(V.realPath(n),r);try{J.unlinkSync(e)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}},rmdir:(n,r)=>{var e=Y.join2(V.realPath(n),r);try{J.rmdirSync(e)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}},readdir:n=>{var r=V.realPath(n);try{return J.readdirSync(r)}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}},symlink:(n,r,e)=>{var o=Y.join2(V.realPath(n),r);try{J.symlinkSync(e,o)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}},readlink:n=>{var r=V.realPath(n);try{return r=J.readlinkSync(r),r=Me.relative(Me.resolve(n.mount.opts.root),r),r}catch(e){throw e.code?e.code==="UNKNOWN"?new i.ErrnoError(28):new i.ErrnoError(V.convertNodeCode(e)):e}}},stream_ops:{open:n=>{var r=V.realPath(n.node);try{i.isFile(n.node.mode)&&(n.nfd=J.openSync(r,V.flagsForNode(n.flags)))}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}},close:n=>{try{i.isFile(n.node.mode)&&n.nfd&&J.closeSync(n.nfd)}catch(r){throw r.code?new i.ErrnoError(V.convertNodeCode(r)):r}},read:(n,r,e,o,t)=>{if(o===0)return 0;try{return J.readSync(n.nfd,Buffer.from(r.buffer),e,o,t)}catch(a){throw new i.ErrnoError(V.convertNodeCode(a))}},write:(n,r,e,o,t)=>{try{return J.writeSync(n.nfd,Buffer.from(r.buffer),e,o,t)}catch(a){throw new i.ErrnoError(V.convertNodeCode(a))}},llseek:(n,r,e)=>{var o=r;if(e===1)o+=n.position;else if(e===2&&i.isFile(n.node.mode))try{var t=J.fstatSync(n.nfd);o+=t.size}catch(a){throw new i.ErrnoError(V.convertNodeCode(a))}if(o<0)throw new i.ErrnoError(28);return o},mmap:(n,r,e,o,t)=>{if(!i.isFile(n.node.mode))throw new i.ErrnoError(43);var a=Ir(r);return V.stream_ops.read(n,ee,a,r,e),{ptr:a,allocated:!0}},msync:(n,r,e,o,t)=>(V.stream_ops.write(n,r,0,o,e,!1),0)}},i={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(n,r={})=>{if(n=Q.resolve(i.cwd(),n),!n)return{path:"",node:null};var e={follow_mount:!0,recurse_count:0};if(r=Object.assign(e,r),r.recurse_count>8)throw new i.ErrnoError(32);for(var o=Y.normalizeArray(n.split("/").filter(O=>!!O),!1),t=i.root,a="/",s=0;s<o.length;s++){var l=s===o.length-1;if(l&&r.parent)break;if(t=i.lookupNode(t,o[s]),a=Y.join2(a,o[s]),i.isMountpoint(t)&&(!l||l&&r.follow_mount)&&(t=t.mounted.root),!l||r.follow)for(var h=0;i.isLink(t.mode);){var w=i.readlink(a);a=Q.resolve(Y.dirname(a),w);var S=i.lookupPath(a,{recurse_count:r.recurse_count+1});if(t=S.node,h++>40)throw new i.ErrnoError(32)}}return{path:a,node:t}},getPath:n=>{for(var r;;){if(i.isRoot(n)){var e=n.mount.mountpoint;return r?e[e.length-1]!=="/"?e+"/"+r:e+r:e}r=r?n.name+"/"+r:n.name,n=n.parent}},hashName:(n,r)=>{for(var e=0,o=0;o<r.length;o++)e=(e<<5)-e+r.charCodeAt(o)|0;return(n+e>>>0)%i.nameTable.length},hashAddNode:n=>{var r=i.hashName(n.parent.id,n.name);n.name_next=i.nameTable[r],i.nameTable[r]=n},hashRemoveNode:n=>{var r=i.hashName(n.parent.id,n.name);if(i.nameTable[r]===n)i.nameTable[r]=n.name_next;else for(var e=i.nameTable[r];e;){if(e.name_next===n){e.name_next=n.name_next;break}e=e.name_next}},lookupNode:(n,r)=>{var e=i.mayLookup(n);if(e)throw new i.ErrnoError(e,n);for(var o=i.hashName(n.id,r),t=i.nameTable[o];t;t=t.name_next){var a=t.name;if(t.parent.id===n.id&&a===r)return t}return i.lookup(n,r)},createNode:(n,r,e,o)=>{var t=new i.FSNode(n,r,e,o);return i.hashAddNode(t),t},destroyNode:n=>{i.hashRemoveNode(n)},isRoot:n=>n===n.parent,isMountpoint:n=>!!n.mounted,isFile:n=>(n&61440)===32768,isDir:n=>(n&61440)===16384,isLink:n=>(n&61440)===40960,isChrdev:n=>(n&61440)===8192,isBlkdev:n=>(n&61440)===24576,isFIFO:n=>(n&61440)===4096,isSocket:n=>(n&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:n=>{var r=i.flagModes[n];if(typeof r>"u")throw new Error("Unknown file open mode: "+n);return r},flagsToPermissionString:n=>{var r=["r","w","rw"][n&3];return n&512&&(r+="w"),r},nodePermissions:(n,r)=>i.ignorePermissions?0:r.includes("r")&&!(n.mode&292)||r.includes("w")&&!(n.mode&146)||r.includes("x")&&!(n.mode&73)?2:0,mayLookup:n=>{var r=i.nodePermissions(n,"x");return r||(n.node_ops.lookup?0:2)},mayCreate:(n,r)=>{try{var e=i.lookupNode(n,r);return 20}catch{}return i.nodePermissions(n,"wx")},mayDelete:(n,r,e)=>{var o;try{o=i.lookupNode(n,r)}catch(a){return a.errno}var t=i.nodePermissions(n,"wx");if(t)return t;if(e){if(!i.isDir(o.mode))return 54;if(i.isRoot(o)||i.getPath(o)===i.cwd())return 10}else if(i.isDir(o.mode))return 31;return 0},mayOpen:(n,r)=>n?i.isLink(n.mode)?32:i.isDir(n.mode)&&(i.flagsToPermissionString(r)!=="r"||r&512)?31:i.nodePermissions(n,i.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(n=0,r=i.MAX_OPEN_FDS)=>{for(var e=n;e<=r;e++)if(!i.streams[e])return e;throw new i.ErrnoError(33)},getStream:n=>i.streams[n],createStream:(n,r,e)=>{i.FSStream||(i.FSStream=function(){this.shared={}},i.FSStream.prototype={},Object.defineProperties(i.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),n=Object.assign(new i.FSStream,n);var o=i.nextfd(r,e);return n.fd=o,i.streams[o]=n,n},closeStream:n=>{i.streams[n]=null},chrdev_stream_ops:{open:n=>{var r=i.getDevice(n.node.rdev);n.stream_ops=r.stream_ops,n.stream_ops.open&&n.stream_ops.open(n)},llseek:()=>{throw new i.ErrnoError(70)}},major:n=>n>>8,minor:n=>n&255,makedev:(n,r)=>n<<8|r,registerDevice:(n,r)=>{i.devices[n]={stream_ops:r}},getDevice:n=>i.devices[n],getMounts:n=>{for(var r=[],e=[n];e.length;){var o=e.pop();r.push(o),e.push.apply(e,o.mounts)}return r},syncfs:(n,r)=>{typeof n=="function"&&(r=n,n=!1),i.syncFSRequests++,i.syncFSRequests>1&&fe("warning: "+i.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=i.getMounts(i.root.mount),o=0;function t(s){return i.syncFSRequests--,r(s)}function a(s){if(s)return a.errored?void 0:(a.errored=!0,t(s));++o>=e.length&&t(null)}e.forEach(s=>{if(!s.type.syncfs)return a(null);s.type.syncfs(s,n,a)})},mount:(n,r,e)=>{var o=e==="/",t=!e,a;if(o&&i.root)throw new i.ErrnoError(10);if(!o&&!t){var s=i.lookupPath(e,{follow_mount:!1});if(e=s.path,a=s.node,i.isMountpoint(a))throw new i.ErrnoError(10);if(!i.isDir(a.mode))throw new i.ErrnoError(54)}var l={type:n,opts:r,mountpoint:e,mounts:[]},h=n.mount(l);return h.mount=l,l.root=h,o?i.root=h:a&&(a.mounted=l,a.mount&&a.mount.mounts.push(l)),h},unmount:n=>{var r=i.lookupPath(n,{follow_mount:!1});if(!i.isMountpoint(r.node))throw new i.ErrnoError(28);var e=r.node,o=e.mounted,t=i.getMounts(o);Object.keys(i.nameTable).forEach(s=>{for(var l=i.nameTable[s];l;){var h=l.name_next;t.includes(l.mount)&&i.destroyNode(l),l=h}}),e.mounted=null;var a=e.mount.mounts.indexOf(o);e.mount.mounts.splice(a,1)},lookup:(n,r)=>n.node_ops.lookup(n,r),mknod:(n,r,e)=>{var o=i.lookupPath(n,{parent:!0}),t=o.node,a=Y.basename(n);if(!a||a==="."||a==="..")throw new i.ErrnoError(28);var s=i.mayCreate(t,a);if(s)throw new i.ErrnoError(s);if(!t.node_ops.mknod)throw new i.ErrnoError(63);return t.node_ops.mknod(t,a,r,e)},create:(n,r)=>(r=r!==void 0?r:438,r&=4095,r|=32768,i.mknod(n,r,0)),mkdir:(n,r)=>(r=r!==void 0?r:511,r&=1023,r|=16384,i.mknod(n,r,0)),mkdirTree:(n,r)=>{for(var e=n.split("/"),o="",t=0;t<e.length;++t)if(e[t]){o+="/"+e[t];try{i.mkdir(o,r)}catch(a){if(a.errno!=20)throw a}}},mkdev:(n,r,e)=>(typeof e>"u"&&(e=r,r=438),r|=8192,i.mknod(n,r,e)),symlink:(n,r)=>{if(!Q.resolve(n))throw new i.ErrnoError(44);var e=i.lookupPath(r,{parent:!0}),o=e.node;if(!o)throw new i.ErrnoError(44);var t=Y.basename(r),a=i.mayCreate(o,t);if(a)throw new i.ErrnoError(a);if(!o.node_ops.symlink)throw new i.ErrnoError(63);return o.node_ops.symlink(o,t,n)},rename:(n,r)=>{var e=Y.dirname(n),o=Y.dirname(r),t=Y.basename(n),a=Y.basename(r),s,l,h;if(s=i.lookupPath(n,{parent:!0}),l=s.node,s=i.lookupPath(r,{parent:!0}),h=s.node,!l||!h)throw new i.ErrnoError(44);if(l.mount!==h.mount)throw new i.ErrnoError(75);var w=i.lookupNode(l,t),S=Q.relative(n,o);if(S.charAt(0)!==".")throw new i.ErrnoError(28);if(S=Q.relative(r,e),S.charAt(0)!==".")throw new i.ErrnoError(55);var O;try{O=i.lookupNode(h,a)}catch{}if(w!==O){var N=i.isDir(w.mode),T=i.mayDelete(l,t,N);if(T)throw new i.ErrnoError(T);if(T=O?i.mayDelete(h,a,N):i.mayCreate(h,a),T)throw new i.ErrnoError(T);if(!l.node_ops.rename)throw new i.ErrnoError(63);if(i.isMountpoint(w)||O&&i.isMountpoint(O))throw new i.ErrnoError(10);if(h!==l&&(T=i.nodePermissions(l,"w"),T))throw new i.ErrnoError(T);i.hashRemoveNode(w);try{l.node_ops.rename(w,h,a)}catch(F){throw F}finally{i.hashAddNode(w)}}},rmdir:n=>{var r=i.lookupPath(n,{parent:!0}),e=r.node,o=Y.basename(n),t=i.lookupNode(e,o),a=i.mayDelete(e,o,!0);if(a)throw new i.ErrnoError(a);if(!e.node_ops.rmdir)throw new i.ErrnoError(63);if(i.isMountpoint(t))throw new i.ErrnoError(10);e.node_ops.rmdir(e,o),i.destroyNode(t)},readdir:n=>{var r=i.lookupPath(n,{follow:!0}),e=r.node;if(!e.node_ops.readdir)throw new i.ErrnoError(54);return e.node_ops.readdir(e)},unlink:n=>{var r=i.lookupPath(n,{parent:!0}),e=r.node;if(!e)throw new i.ErrnoError(44);var o=Y.basename(n),t=i.lookupNode(e,o),a=i.mayDelete(e,o,!1);if(a)throw new i.ErrnoError(a);if(!e.node_ops.unlink)throw new i.ErrnoError(63);if(i.isMountpoint(t))throw new i.ErrnoError(10);e.node_ops.unlink(e,o),i.destroyNode(t)},readlink:n=>{var r=i.lookupPath(n),e=r.node;if(!e)throw new i.ErrnoError(44);if(!e.node_ops.readlink)throw new i.ErrnoError(28);return Q.resolve(i.getPath(e.parent),e.node_ops.readlink(e))},stat:(n,r)=>{var e=i.lookupPath(n,{follow:!r}),o=e.node;if(!o)throw new i.ErrnoError(44);if(!o.node_ops.getattr)throw new i.ErrnoError(63);return o.node_ops.getattr(o)},lstat:n=>i.stat(n,!0),chmod:(n,r,e)=>{var o;if(typeof n=="string"){var t=i.lookupPath(n,{follow:!e});o=t.node}else o=n;if(!o.node_ops.setattr)throw new i.ErrnoError(63);o.node_ops.setattr(o,{mode:r&4095|o.mode&-4096,timestamp:Date.now()})},lchmod:(n,r)=>{i.chmod(n,r,!0)},fchmod:(n,r)=>{var e=i.getStream(n);if(!e)throw new i.ErrnoError(8);i.chmod(e.node,r)},chown:(n,r,e,o)=>{var t;if(typeof n=="string"){var a=i.lookupPath(n,{follow:!o});t=a.node}else t=n;if(!t.node_ops.setattr)throw new i.ErrnoError(63);t.node_ops.setattr(t,{timestamp:Date.now()})},lchown:(n,r,e)=>{i.chown(n,r,e,!0)},fchown:(n,r,e)=>{var o=i.getStream(n);if(!o)throw new i.ErrnoError(8);i.chown(o.node,r,e)},truncate:(n,r)=>{if(r<0)throw new i.ErrnoError(28);var e;if(typeof n=="string"){var o=i.lookupPath(n,{follow:!0});e=o.node}else e=n;if(!e.node_ops.setattr)throw new i.ErrnoError(63);if(i.isDir(e.mode))throw new i.ErrnoError(31);if(!i.isFile(e.mode))throw new i.ErrnoError(28);var t=i.nodePermissions(e,"w");if(t)throw new i.ErrnoError(t);e.node_ops.setattr(e,{size:r,timestamp:Date.now()})},ftruncate:(n,r)=>{var e=i.getStream(n);if(!e)throw new i.ErrnoError(8);if(!(e.flags&2097155))throw new i.ErrnoError(28);i.truncate(e.node,r)},utime:(n,r,e)=>{var o=i.lookupPath(n,{follow:!0}),t=o.node;t.node_ops.setattr(t,{timestamp:Math.max(r,e)})},open:(n,r,e)=>{if(n==="")throw new i.ErrnoError(44);r=typeof r=="string"?i.modeStringToFlags(r):r,e=typeof e>"u"?438:e,r&64?e=e&4095|32768:e=0;var o;if(typeof n=="object")o=n;else{n=Y.normalize(n);try{var t=i.lookupPath(n,{follow:!(r&131072)});o=t.node}catch{}}var a=!1;if(r&64)if(o){if(r&128)throw new i.ErrnoError(20)}else o=i.mknod(n,e,0),a=!0;if(!o)throw new i.ErrnoError(44);if(i.isChrdev(o.mode)&&(r&=-513),r&65536&&!i.isDir(o.mode))throw new i.ErrnoError(54);if(!a){var s=i.mayOpen(o,r);if(s)throw new i.ErrnoError(s)}r&512&&!a&&i.truncate(o,0),r&=-131713;var l=i.createStream({node:o,path:i.getPath(o),flags:r,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),f.logReadFiles&&!(r&1)&&(i.readFiles||(i.readFiles={}),n in i.readFiles||(i.readFiles[n]=1)),l},close:n=>{if(i.isClosed(n))throw new i.ErrnoError(8);n.getdents&&(n.getdents=null);try{n.stream_ops.close&&n.stream_ops.close(n)}catch(r){throw r}finally{i.closeStream(n.fd)}n.fd=null},isClosed:n=>n.fd===null,llseek:(n,r,e)=>{if(i.isClosed(n))throw new i.ErrnoError(8);if(!n.seekable||!n.stream_ops.llseek)throw new i.ErrnoError(70);if(e!=0&&e!=1&&e!=2)throw new i.ErrnoError(28);return n.position=n.stream_ops.llseek(n,r,e),n.ungotten=[],n.position},read:(n,r,e,o,t)=>{if(o<0||t<0)throw new i.ErrnoError(28);if(i.isClosed(n))throw new i.ErrnoError(8);if((n.flags&2097155)===1)throw new i.ErrnoError(8);if(i.isDir(n.node.mode))throw new i.ErrnoError(31);if(!n.stream_ops.read)throw new i.ErrnoError(28);var a=typeof t<"u";if(!a)t=n.position;else if(!n.seekable)throw new i.ErrnoError(70);var s=n.stream_ops.read(n,r,e,o,t);return a||(n.position+=s),s},write:(n,r,e,o,t,a)=>{if(o<0||t<0)throw new i.ErrnoError(28);if(i.isClosed(n))throw new i.ErrnoError(8);if(!(n.flags&2097155))throw new i.ErrnoError(8);if(i.isDir(n.node.mode))throw new i.ErrnoError(31);if(!n.stream_ops.write)throw new i.ErrnoError(28);n.seekable&&n.flags&1024&&i.llseek(n,0,2);var s=typeof t<"u";if(!s)t=n.position;else if(!n.seekable)throw new i.ErrnoError(70);var l=n.stream_ops.write(n,r,e,o,t,a);return s||(n.position+=l),l},allocate:(n,r,e)=>{if(i.isClosed(n))throw new i.ErrnoError(8);if(r<0||e<=0)throw new i.ErrnoError(28);if(!(n.flags&2097155))throw new i.ErrnoError(8);if(!i.isFile(n.node.mode)&&!i.isDir(n.node.mode))throw new i.ErrnoError(43);if(!n.stream_ops.allocate)throw new i.ErrnoError(138);n.stream_ops.allocate(n,r,e)},mmap:(n,r,e,o,t)=>{if(o&2&&!(t&2)&&(n.flags&2097155)!==2)throw new i.ErrnoError(2);if((n.flags&2097155)===1)throw new i.ErrnoError(2);if(!n.stream_ops.mmap)throw new i.ErrnoError(43);return n.stream_ops.mmap(n,r,e,o,t)},msync:(n,r,e,o,t)=>n.stream_ops.msync?n.stream_ops.msync(n,r,e,o,t):0,munmap:n=>0,ioctl:(n,r,e)=>{if(!n.stream_ops.ioctl)throw new i.ErrnoError(59);return n.stream_ops.ioctl(n,r,e)},readFile:(n,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 e,o=i.open(n,r.flags),t=i.stat(n),a=t.size,s=new Uint8Array(a);return i.read(o,s,0,a,0),r.encoding==="utf8"?e=ze(s,0):r.encoding==="binary"&&(e=s),i.close(o),e},writeFile:(n,r,e={})=>{e.flags=e.flags||577;var o=i.open(n,e.flags,e.mode);if(typeof r=="string"){var t=new Uint8Array(Ce(r)+1),a=Ze(r,t,0,t.length);i.write(o,t,0,a,void 0,e.canOwn)}else if(ArrayBuffer.isView(r))i.write(o,r,0,r.byteLength,void 0,e.canOwn);else throw new Error("Unsupported data type");i.close(o)},cwd:()=>i.currentPath,chdir:n=>{var r=i.lookupPath(n,{follow:!0});if(r.node===null)throw new i.ErrnoError(44);if(!i.isDir(r.node.mode))throw new i.ErrnoError(54);var e=i.nodePermissions(r.node,"x");if(e)throw new i.ErrnoError(e);i.currentPath=r.path},createDefaultDirectories:()=>{i.mkdir("/tmp"),i.mkdir("/home"),i.mkdir("/home/web_user")},createDefaultDevices:()=>{i.mkdir("/dev"),i.registerDevice(i.makedev(1,3),{read:()=>0,write:(r,e,o,t,a)=>t}),i.mkdev("/dev/null",i.makedev(1,3)),ge.register(i.makedev(5,0),ge.default_tty_ops),ge.register(i.makedev(6,0),ge.default_tty1_ops),i.mkdev("/dev/tty",i.makedev(5,0)),i.mkdev("/dev/tty1",i.makedev(6,0));var n=no();i.createDevice("/dev","random",n),i.createDevice("/dev","urandom",n),i.mkdir("/dev/shm"),i.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{i.mkdir("/proc");var n=i.mkdir("/proc/self");i.mkdir("/proc/self/fd"),i.mount({mount:()=>{var r=i.createNode(n,"fd",16895,73);return r.node_ops={lookup:(e,o)=>{var t=+o,a=i.getStream(t);if(!a)throw new i.ErrnoError(8);var s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?i.createDevice("/dev","stdin",f.stdin):i.symlink("/dev/tty","/dev/stdin"),f.stdout?i.createDevice("/dev","stdout",null,f.stdout):i.symlink("/dev/tty","/dev/stdout"),f.stderr?i.createDevice("/dev","stderr",null,f.stderr):i.symlink("/dev/tty1","/dev/stderr");var n=i.open("/dev/stdin",0),r=i.open("/dev/stdout",1),e=i.open("/dev/stderr",1)},ensureErrnoError:()=>{i.ErrnoError||(i.ErrnoError=function(r,e){this.node=e,this.setErrno=function(o){this.errno=o},this.setErrno(r),this.message="FS error"},i.ErrnoError.prototype=new Error,i.ErrnoError.prototype.constructor=i.ErrnoError,[44].forEach(n=>{i.genericErrors[n]=new i.ErrnoError(n),i.genericErrors[n].stack="<generic error, no stack>"}))},staticInit:()=>{i.ensureErrnoError(),i.nameTable=new Array(4096),i.mount(G,{},"/"),i.createDefaultDirectories(),i.createDefaultDevices(),i.createSpecialDirectories(),i.filesystems={MEMFS:G,NODEFS:V}},init:(n,r,e)=>{i.init.initialized=!0,i.ensureErrnoError(),f.stdin=n||f.stdin,f.stdout=r||f.stdout,f.stderr=e||f.stderr,i.createStandardStreams()},quit:()=>{i.init.initialized=!1,At(0);for(var n=0;n<i.streams.length;n++){var r=i.streams[n];r&&i.close(r)}},getMode:(n,r)=>{var e=0;return n&&(e|=365),r&&(e|=146),e},findObject:(n,r)=>{var e=i.analyzePath(n,r);return e.exists?e.object:null},analyzePath:(n,r)=>{try{var e=i.lookupPath(n,{follow:!r});n=e.path}catch{}var o={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var e=i.lookupPath(n,{parent:!0});o.parentExists=!0,o.parentPath=e.path,o.parentObject=e.node,o.name=Y.basename(n),e=i.lookupPath(n,{follow:!r}),o.exists=!0,o.path=e.path,o.object=e.node,o.name=e.node.name,o.isRoot=e.path==="/"}catch(t){o.error=t.errno}return o},createPath:(n,r,e,o)=>{n=typeof n=="string"?n:i.getPath(n);for(var t=r.split("/").reverse();t.length;){var a=t.pop();if(a){var s=Y.join2(n,a);try{i.mkdir(s)}catch{}n=s}}return s},createFile:(n,r,e,o,t)=>{var a=Y.join2(typeof n=="string"?n:i.getPath(n),r),s=i.getMode(o,t);return i.create(a,s)},createDataFile:(n,r,e,o,t,a)=>{var s=r;n&&(n=typeof n=="string"?n:i.getPath(n),s=r?Y.join2(n,r):n);var l=i.getMode(o,t),h=i.create(s,l);if(e){if(typeof e=="string"){for(var w=new Array(e.length),S=0,O=e.length;S<O;++S)w[S]=e.charCodeAt(S);e=w}i.chmod(h,l|146);var N=i.open(h,577);i.write(N,e,0,e.length,0,a),i.close(N),i.chmod(h,l)}return h},createDevice:(n,r,e,o)=>{var t=Y.join2(typeof n=="string"?n:i.getPath(n),r),a=i.getMode(!!e,!!o);i.createDevice.major||(i.createDevice.major=64);var s=i.makedev(i.createDevice.major++,0);return i.registerDevice(s,{open:l=>{l.seekable=!1},close:l=>{o&&o.buffer&&o.buffer.length&&o(10)},read:(l,h,w,S,O)=>{for(var N=0,T=0;T<S;T++){var F;try{F=e()}catch{throw new i.ErrnoError(29)}if(F===void 0&&N===0)throw new i.ErrnoError(6);if(F==null)break;N++,h[w+T]=F}return N&&(l.node.timestamp=Date.now()),N},write:(l,h,w,S,O)=>{for(var N=0;N<S;N++)try{o(h[w+N])}catch{throw new i.ErrnoError(29)}return S&&(l.node.timestamp=Date.now()),N}}),i.mkdev(t,a,s)},forceLoadFile:n=>{if(n.isDevice||n.isFolder||n.link||n.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{n.contents=Er(We(n.url),!0),n.usedBytes=n.contents.length}catch{throw new i.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(n,r,e,o,t)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(T){if(!(T>this.length-1||T<0)){var F=T%this.chunkSize,L=T/this.chunkSize|0;return this.getter(L)[F]}},a.prototype.setDataGetter=function(T){this.getter=T},a.prototype.cacheLength=function(){var T=new XMLHttpRequest;if(T.open("HEAD",e,!1),T.send(null),!(T.status>=200&&T.status<300||T.status===304))throw new Error("Couldn't load "+e+". Status: "+T.status);var F=Number(T.getResponseHeader("Content-length")),L,R=(L=T.getResponseHeader("Accept-Ranges"))&&L==="bytes",B=(L=T.getResponseHeader("Content-Encoding"))&&L==="gzip",P=1024*1024;R||(P=F);var M=(q,W)=>{if(q>W)throw new Error("invalid range ("+q+", "+W+") or no bytes requested!");if(W>F-1)throw new Error("only "+F+" bytes available! programmer error!");var X=new XMLHttpRequest;if(X.open("GET",e,!1),F!==P&&X.setRequestHeader("Range","bytes="+q+"-"+W),X.responseType="arraybuffer",X.overrideMimeType&&X.overrideMimeType("text/plain; charset=x-user-defined"),X.send(null),!(X.status>=200&&X.status<300||X.status===304))throw new Error("Couldn't load "+e+". Status: "+X.status);return X.response!==void 0?new Uint8Array(X.response||[]):Er(X.responseText||"",!0)},z=this;z.setDataGetter(q=>{var W=q*P,X=(q+1)*P-1;if(X=Math.min(X,F-1),typeof z.chunks[q]>"u"&&(z.chunks[q]=M(W,X)),typeof z.chunks[q]>"u")throw new Error("doXHR failed!");return z.chunks[q]}),(B||!F)&&(P=F=1,F=this.getter(0).length,P=F,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=F,this._chunkSize=P,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new a;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:e};var h=i.createFile(n,r,l,o,t);l.contents?h.contents=l.contents:l.url&&(h.contents=null,h.url=l.url),Object.defineProperties(h,{usedBytes:{get:function(){return this.contents.length}}});var w={},S=Object.keys(h.stream_ops);S.forEach(N=>{var T=h.stream_ops[N];w[N]=function(){return i.forceLoadFile(h),T.apply(null,arguments)}});function O(N,T,F,L,R){var B=N.node.contents;if(R>=B.length)return 0;var P=Math.min(B.length-R,L);if(B.slice)for(var M=0;M<P;M++)T[F+M]=B[R+M];else for(var M=0;M<P;M++)T[F+M]=B.get(R+M);return P}return w.read=(N,T,F,L,R)=>(i.forceLoadFile(h),O(N,T,F,L,R)),w.mmap=(N,T,F,L,R)=>{i.forceLoadFile(h);var B=Ir(T);if(!B)throw new i.ErrnoError(48);return O(N,ee,B,T,F),{ptr:B,allocated:!0}},h.stream_ops=w,h},createPreloadedFile:(n,r,e,o,t,a,s,l,h,w)=>{var S=r?Q.resolve(Y.join2(n,r)):n,O="cp "+S;function N(T){function F(L){w&&w(),l||i.createDataFile(n,r,L,o,t,h),a&&a(),Je(O)}Browser.handledByPreloadPlugin(T,S,F,()=>{s&&s(),Je(O)})||F(T)}dr(O),typeof e=="string"?Ct(e,T=>N(T),s):N(e)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(n,r,e)=>{r=r||(()=>{}),e=e||(()=>{});var o=i.indexedDB();try{var t=o.open(i.DB_NAME(),i.DB_VERSION)}catch(a){return e(a)}t.onupgradeneeded=()=>{er("creating db");var a=t.result;a.createObjectStore(i.DB_STORE_NAME)},t.onsuccess=()=>{var a=t.result,s=a.transaction([i.DB_STORE_NAME],"readwrite"),l=s.objectStore(i.DB_STORE_NAME),h=0,w=0,S=n.length;function O(){w==0?r():e()}n.forEach(N=>{var T=l.put(i.analyzePath(N).object.contents,N);T.onsuccess=()=>{h++,h+w==S&&O()},T.onerror=()=>{w++,h+w==S&&O()}}),s.onerror=e},t.onerror=e},loadFilesFromDB:(n,r,e)=>{r=r||(()=>{}),e=e||(()=>{});var o=i.indexedDB();try{var t=o.open(i.DB_NAME(),i.DB_VERSION)}catch(a){return e(a)}t.onupgradeneeded=e,t.onsuccess=()=>{var a=t.result;try{var s=a.transaction([i.DB_STORE_NAME],"readonly")}catch(N){e(N);return}var l=s.objectStore(i.DB_STORE_NAME),h=0,w=0,S=n.length;function O(){w==0?r():e()}n.forEach(N=>{var T=l.get(N);T.onsuccess=()=>{i.analyzePath(N).exists&&i.unlink(N),i.createDataFile(Y.dirname(N),Y.basename(N),T.result,!0,!0,!0),h++,h+w==S&&O()},T.onerror=()=>{w++,h+w==S&&O()}}),s.onerror=e},t.onerror=e}},C={DEFAULT_POLLMASK:5,calculateAt:function(n,r,e){if(Y.isAbs(r))return r;var o;if(n===-100)o=i.cwd();else{var t=C.getStreamFromFD(n);o=t.path}if(r.length==0){if(!e)throw new i.ErrnoError(44);return o}return Y.join2(o,r)},doStat:function(n,r,e){try{var o=n(r)}catch(t){if(t&&t.node&&Y.normalize(r)!==Y.normalize(i.getPath(t.node)))return-54;throw t}return E[e>>2]=o.dev,E[e+8>>2]=o.ino,E[e+12>>2]=o.mode,j[e+16>>2]=o.nlink,E[e+20>>2]=o.uid,E[e+24>>2]=o.gid,E[e+28>>2]=o.rdev,Z=[o.size>>>0,(U=o.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+40>>2]=Z[0],E[e+44>>2]=Z[1],E[e+48>>2]=4096,E[e+52>>2]=o.blocks,Z=[Math.floor(o.atime.getTime()/1e3)>>>0,(U=Math.floor(o.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+56>>2]=Z[0],E[e+60>>2]=Z[1],j[e+64>>2]=0,Z=[Math.floor(o.mtime.getTime()/1e3)>>>0,(U=Math.floor(o.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+72>>2]=Z[0],E[e+76>>2]=Z[1],j[e+80>>2]=0,Z=[Math.floor(o.ctime.getTime()/1e3)>>>0,(U=Math.floor(o.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+88>>2]=Z[0],E[e+92>>2]=Z[1],j[e+96>>2]=0,Z=[o.ino>>>0,(U=o.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+104>>2]=Z[0],E[e+108>>2]=Z[1],0},doMsync:function(n,r,e,o,t){if(!i.isFile(r.node.mode))throw new i.ErrnoError(43);if(o&2)return 0;var a=le.slice(n,n+e);i.msync(r,a,t,e,o)},varargs:void 0,get:function(){C.varargs+=4;var n=E[C.varargs-4>>2];return n},getStr:function(n){var r=ne(n);return r},getStreamFromFD:function(n){var r=i.getStream(n);if(!r)throw new i.ErrnoError(8);return r}};function v(n,r,e,o,t){try{for(var a=0,s=r?E[r>>2]:0,l=r?E[r+4>>2]:0,h=e?E[e>>2]:0,w=e?E[e+4>>2]:0,S=o?E[o>>2]:0,O=o?E[o+4>>2]:0,N=0,T=0,F=0,L=0,R=0,B=0,P=(r?E[r>>2]:0)|(e?E[e>>2]:0)|(o?E[o>>2]:0),M=(r?E[r+4>>2]:0)|(e?E[e+4>>2]:0)|(o?E[o+4>>2]:0),z=function(se,Oe,Ae,Qe){return se<32?Oe&Qe:Ae&Qe},q=0;q<n;q++){var W=1<<q%32;if(z(q,P,M,W)){var X=C.getStreamFromFD(q),oe=C.DEFAULT_POLLMASK;X.stream_ops?.poll&&(oe=X.stream_ops.poll(X)),oe&1&&z(q,s,l,W)&&(q<32?N=N|W:T=T|W,a++),oe&4&&z(q,h,w,W)&&(q<32?F=F|W:L=L|W,a++),oe&2&&z(q,S,O,W)&&(q<32?R=R|W:B=B|W,a++)}}return r&&(E[r>>2]=N,E[r+4>>2]=T),e&&(E[e>>2]=F,E[e+4>>2]=L),o&&(E[o>>2]=R,E[o+4>>2]=B),a}catch(se){if(typeof i>"u"||!(se instanceof i.ErrnoError))throw se;return-se.errno}}var H={mount:function(n){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(r,e){return typeof e=="function"&&(this._callbacks[r]=e),this},f.websocket.emit=function(r,e){typeof this._callbacks[r]=="function"&&this._callbacks[r].call(this,e)},i.createNode(null,"/",16895,0)},createSocket:function(n,r,e){r&=-526337;var o=r==1;if(o&&e&&e!=6)throw new i.ErrnoError(66);var t={family:n,type:r,protocol:e,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:H.websocket_sock_ops},a=H.nextname(),s=i.createNode(H.root,a,49152,0);s.sock=t;var l=i.createStream({path:a,node:s,flags:2,seekable:!1,stream_ops:H.stream_ops});return t.stream=l,t},getSocket:function(n){var r=i.getStream(n);return!r||!i.isSocket(r.node.mode)?null:r.node.sock},stream_ops:{poll:function(n){var r=n.node.sock;return r.sock_ops.poll(r)},ioctl:function(n,r,e){var o=n.node.sock;return o.sock_ops.ioctl(o,r,e)},read:function(n,r,e,o,t){var a=n.node.sock,s=a.sock_ops.recvmsg(a,o);return s?(r.set(s.buffer,e),s.buffer.length):0},write:function(n,r,e,o,t){var a=n.node.sock;return a.sock_ops.sendmsg(a,r,e,o)},close:function(n){var r=n.node.sock;r.sock_ops.close(r)}},nextname:function(){return H.nextname.current||(H.nextname.current=0),"socket["+H.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(n,r,e){var o;if(typeof r=="object"&&(o=r,r=null,e=null),o)if(o._socket)r=o._socket.remoteAddress,e=o._socket.remotePort;else{var t=/ws[s]?:\/\/([^:]+):(\d+)/.exec(o.url);if(!t)throw new Error("WebSocket URL must be in the format ws(s)://address:port");r=t[1],e=parseInt(t[2],10)}else try{var a=f.websocket&&typeof f.websocket=="object",s="ws:#".replace("#","//");if(a&&(typeof f.websocket.url=="function"?s=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(s=f.websocket.url)),s==="ws://"||s==="wss://"){var l=r.split("/");s=s+l[0]+":"+e+"/"+l.slice(1).join("/")}var h="binary";a&&typeof f.websocket.subprotocol=="string"&&(h=f.websocket.subprotocol);var w=void 0;h!=="null"&&(h=h.replace(/^ +| +$/g,"").split(/ *, */),w=h),a&&f.websocket.subprotocol===null&&(h="null",w=void 0);var S;te?S=An():S=WebSocket,f.websocket.decorator&&(S=f.websocket.decorator(S)),o=new S(s,w),o.binaryType="arraybuffer"}catch{throw new i.ErrnoError(23)}var O={addr:r,port:e,socket:o,dgram_send_queue:[]};return H.websocket_sock_ops.addPeer(n,O),H.websocket_sock_ops.handlePeerEvents(n,O),n.type===2&&typeof n.sport<"u"&&O.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(n.sport&65280)>>8,n.sport&255])),O},getPeer:function(n,r,e){return n.peers[r+":"+e]},addPeer:function(n,r){n.peers[r.addr+":"+r.port]=r},removePeer:function(n,r){delete n.peers[r.addr+":"+r.port]},handlePeerEvents:function(n,r){var e=!0,o=function(){f.websocket.emit("open",n.stream.fd);try{for(var a=r.dgram_send_queue.shift();a;)r.socket.send(a),a=r.dgram_send_queue.shift()}catch{r.socket.close()}};function t(a){if(typeof a=="string"){var s=new TextEncoder;a=s.encode(a)}else{if(Le(a.byteLength!==void 0),a.byteLength==0)return;a=new Uint8Array(a)}var l=e;if(e=!1,l&&a.length===10&&a[0]===255&&a[1]===255&&a[2]===255&&a[3]===255&&a[4]==="p".charCodeAt(0)&&a[5]==="o".charCodeAt(0)&&a[6]==="r".charCodeAt(0)&&a[7]==="t".charCodeAt(0)){var h=a[8]<<8|a[9];H.websocket_sock_ops.removePeer(n,r),r.port=h,H.websocket_sock_ops.addPeer(n,r);return}n.recv_queue.push({addr:r.addr,port:r.port,data:a}),f.websocket.emit("message",n.stream.fd)}te?(r.socket.on("open",o),r.socket.on("message",function(a,s){s&&t(new Uint8Array(a).buffer)}),r.socket.on("close",function(){f.websocket.emit("close",n.stream.fd)}),r.socket.on("error",function(a){n.error=14,f.websocket.emit("error",[n.stream.fd,n.error,"ECONNREFUSED: Connection refused"])})):(r.socket.onopen=o,r.socket.onclose=function(){f.websocket.emit("close",n.stream.fd)},r.socket.onmessage=function(s){t(s.data)},r.socket.onerror=function(a){n.error=14,f.websocket.emit("error",[n.stream.fd,n.error,"ECONNREFUSED: Connection refused"])})},poll:function(n){if(n.type===1&&n.server)return n.pending.length?65:0;var r=0,e=n.type===1?H.websocket_sock_ops.getPeer(n,n.daddr,n.dport):null;return(n.recv_queue.length||!e||e&&e.socket.readyState===e.socket.CLOSING||e&&e.socket.readyState===e.socket.CLOSED)&&(r|=65),(!e||e&&e.socket.readyState===e.socket.OPEN)&&(r|=4),(e&&e.socket.readyState===e.socket.CLOSING||e&&e.socket.readyState===e.socket.CLOSED)&&(r|=16),r},ioctl:function(n,r,e){switch(r){case 21531:var o=0;return n.recv_queue.length&&(o=n.recv_queue[0].data.length),E[e>>2]=o,0;default:return 28}},close:function(n){if(n.server){try{n.server.close()}catch{}n.server=null}for(var r=Object.keys(n.peers),e=0;e<r.length;e++){var o=n.peers[r[e]];try{o.socket.close()}catch{}H.websocket_sock_ops.removePeer(n,o)}return 0},bind:function(n,r,e){if(typeof n.saddr<"u"||typeof n.sport<"u")throw new i.ErrnoError(28);if(n.saddr=r,n.sport=e,n.type===2){n.server&&(n.server.close(),n.server=null);try{n.sock_ops.listen(n,0)}catch(o){if(!(o instanceof i.ErrnoError)||o.errno!==138)throw o}}},connect:function(n,r,e){if(n.server)throw new i.ErrnoError(138);if(typeof n.daddr<"u"&&typeof n.dport<"u"){var o=H.websocket_sock_ops.getPeer(n,n.daddr,n.dport);if(o)throw o.socket.readyState===o.socket.CONNECTING?new i.ErrnoError(7):new i.ErrnoError(30)}var t=H.websocket_sock_ops.createPeer(n,r,e);throw n.daddr=t.addr,n.dport=t.port,new i.ErrnoError(26)},listen:function(n,r){if(!te)throw new i.ErrnoError(138);if(n.server)throw new i.ErrnoError(28);var e=An().Server,o=n.saddr;n.server=new e({host:o,port:n.sport}),f.websocket.emit("listen",n.stream.fd),n.server.on("connection",function(t){if(n.type===1){var a=H.createSocket(n.family,n.type,n.protocol),s=H.websocket_sock_ops.createPeer(a,t);a.daddr=s.addr,a.dport=s.port,n.pending.push(a),f.websocket.emit("connection",a.stream.fd)}else H.websocket_sock_ops.createPeer(n,t),f.websocket.emit("connection",n.stream.fd)}),n.server.on("close",function(){f.websocket.emit("close",n.stream.fd),n.server=null}),n.server.on("error",function(t){n.error=23,f.websocket.emit("error",[n.stream.fd,n.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(n){if(!n.server||!n.pending.length)throw new i.ErrnoError(28);var r=n.pending.shift();return r.stream.flags=n.stream.flags,r},getname:function(n,r){var e,o;if(r){if(n.daddr===void 0||n.dport===void 0)throw new i.ErrnoError(53);e=n.daddr,o=n.dport}else e=n.saddr||0,o=n.sport||0;return{addr:e,port:o}},sendmsg:function(n,r,e,o,t,a){if(n.type===2){if((t===void 0||a===void 0)&&(t=n.daddr,a=n.dport),t===void 0||a===void 0)throw new i.ErrnoError(17)}else t=n.daddr,a=n.dport;var s=H.websocket_sock_ops.getPeer(n,t,a);if(n.type===1){if(!s||s.socket.readyState===s.socket.CLOSING||s.socket.readyState===s.socket.CLOSED)throw new i.ErrnoError(53);if(s.socket.readyState===s.socket.CONNECTING)throw new i.ErrnoError(6)}ArrayBuffer.isView(r)&&(e+=r.byteOffset,r=r.buffer);var l;if(l=r.slice(e,e+o),n.type===2&&(!s||s.socket.readyState!==s.socket.OPEN))return(!s||s.socket.readyState===s.socket.CLOSING||s.socket.readyState===s.socket.CLOSED)&&(s=H.websocket_sock_ops.createPeer(n,t,a)),s.dgram_send_queue.push(l),o;try{return s.socket.send(l),o}catch{throw new i.ErrnoError(28)}},recvmsg:function(n,r){if(n.type===1&&n.server)throw new i.ErrnoError(53);var e=n.recv_queue.shift();if(!e){if(n.type===1){var o=H.websocket_sock_ops.getPeer(n,n.daddr,n.dport);if(!o)throw new i.ErrnoError(53);if(o.socket.readyState===o.socket.CLOSING||o.socket.readyState===o.socket.CLOSED)return null;throw new i.ErrnoError(6)}throw new i.ErrnoError(6)}var t=e.data.byteLength||e.data.length,a=e.data.byteOffset||0,s=e.data.buffer||e.data,l=Math.min(r,t),h={buffer:new Uint8Array(s,a,l),addr:e.addr,port:e.port};if(n.type===1&&l<t){var w=t-l;e.data=new Uint8Array(s,a+l,w),n.recv_queue.unshift(e)}return h}}};function ke(n){var r=H.getSocket(n);if(!r)throw new i.ErrnoError(8);return r}function he(n){return E[Qt()>>2]=n,n}function Ie(n){for(var r=n.split("."),e=0;e<4;e++){var o=Number(r[e]);if(isNaN(o))return null;r[e]=o}return(r[0]|r[1]<<8|r[2]<<16|r[3]<<24)>>>0}function ce(n){return parseInt(n)}function Ar(n){var r,e,o,t,a=/^((?=.*::)(?!.*::.+::)(::)?([\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(!a.test(n))return null;if(n==="::")return[0,0,0,0,0,0,0,0];for(n.startsWith("::")?n=n.replace("::","Z:"):n=n.replace("::",":Z:"),n.indexOf(".")>0?(n=n.replace(new RegExp("[.]","g"),":"),r=n.split(":"),r[r.length-4]=ce(r[r.length-4])+ce(r[r.length-3])*256,r[r.length-3]=ce(r[r.length-2])+ce(r[r.length-1])*256,r=r.slice(0,r.length-2)):r=n.split(":"),o=0,t=0,e=0;e<r.length;e++)if(typeof r[e]=="string")if(r[e]==="Z"){for(t=0;t<8-r.length+1;t++)s[e+t]=0;o=t-1}else s[e+o]=Dr(parseInt(r[e],16));else s[e+o]=r[e];return[s[1]<<16|s[0],s[3]<<16|s[2],s[5]<<16|s[4],s[7]<<16|s[6]]}function be(n,r,e,o,t){switch(r){case 2:e=Ie(e),wr(n,16),t&&(E[t>>2]=16),we[n>>1]=r,E[n+4>>2]=e,we[n+2>>1]=Dr(o);break;case 10:e=Ar(e),wr(n,28),t&&(E[t>>2]=28),E[n>>2]=r,E[n+8>>2]=e[0],E[n+12>>2]=e[1],E[n+16>>2]=e[2],E[n+20>>2]=e[3],we[n+2>>1]=Dr(o);break;default:return 5}return 0}var ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(n){var r=Ie(n);if(r!==null||(r=Ar(n),r!==null))return n;var e;if(ue.address_map.addrs[n])e=ue.address_map.addrs[n];else{var o=ue.address_map.id++;Le(o<65535,"exceeded max address mappings of 65535"),e="172.29."+(o&255)+"."+(o&65280),ue.address_map.names[e]=n,ue.address_map.addrs[n]=e}return e},lookup_addr:function(n){return ue.address_map.names[n]?ue.address_map.names[n]:null}};function Zr(n,r,e,o){try{var t=ke(n),a=t.sock_ops.accept(t);if(r)var s=be(r,a.family,ue.lookup_name(a.daddr),a.dport,e);return a.stream.fd}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Ne(n){return(n&255)+"."+(n>>8&255)+"."+(n>>16&255)+"."+(n>>24&255)}function kn(n){var r="",e=0,o=0,t=0,a=0,s=0,l=0,h=[n[0]&65535,n[0]>>16,n[1]&65535,n[1]>>16,n[2]&65535,n[2]>>16,n[3]&65535,n[3]>>16],w=!0,S="";for(l=0;l<5;l++)if(h[l]!==0){w=!1;break}if(w){if(S=Ne(h[6]|h[7]<<16),h[5]===-1)return r="::ffff:",r+=S,r;if(h[5]===0)return r="::",S==="0.0.0.0"&&(S=""),S==="0.0.0.1"&&(S="1"),r+=S,r}for(e=0;e<8;e++)h[e]===0&&(e-t>1&&(s=0),t=e,s++),s>o&&(o=s,a=e-o+1);for(e=0;e<8;e++){if(o>1&&h[e]===0&&e>=a&&e<a+o){e===a&&(r+=":",a===0&&(r+=":"));continue}r+=Number(Nt(h[e]&65535)).toString(16),r+=e<7?":":""}return r}function Gr(n,r){var e=we[n>>1],o=Nt(lt[n+2>>1]),t;switch(e){case 2:if(r!==16)return{errno:28};t=E[n+4>>2],t=Ne(t);break;case 10:if(r!==28)return{errno:28};t=[E[n+8>>2],E[n+12>>2],E[n+16>>2],E[n+20>>2]],t=kn(t);break;default:return{errno:5}}return{family:e,addr:t,port:o}}function Yr(n,r,e){if(e&&n===0)return null;var o=Gr(n,r);if(o.errno)throw new i.ErrnoError(o.errno);return o.addr=ue.lookup_addr(o.addr)||o.addr,o}function dn(n,r,e){try{var o=ke(n),t=Yr(r,e);return o.sock_ops.bind(o,t.addr,t.port),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function Pt(n){try{return n=C.getStr(n),i.chdir(n),0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function oo(n,r){try{return n=C.getStr(n),i.chmod(n,r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function io(n,r,e){try{var o=ke(n),t=Yr(r,e);return o.sock_ops.connect(o,t.addr,t.port),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function ao(n){try{var r=C.getStreamFromFD(n);return i.createStream(r,0).fd}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function so(n,r,e){try{var o=C.getStreamFromFD(n);if(o.fd===r)return-28;var t=i.getStream(r);return t&&i.close(t),i.createStream(o,r,r+1).fd}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function uo(n,r,e,o){try{if(r=C.getStr(r),r=C.calculateAt(n,r),e&-8)return-28;var t=i.lookupPath(r,{follow:!0}),a=t.node;if(!a)return-44;var s="";return e&4&&(s+="r"),e&2&&(s+="w"),e&1&&(s+="x"),s&&i.nodePermissions(a,s)?-2:0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function _n(n,r){try{return i.fchmod(n,r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function fo(n,r,e){try{return i.fchown(n,r,e),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function gt(n,r,e,o,t){try{r=C.getStr(r);var a=t&256;return t=t&-257,r=C.calculateAt(n,r),(a?i.lchown:i.chown)(r,e,o),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function co(n,r,e){C.varargs=e;try{var o=C.getStreamFromFD(n);switch(r){case 0:{var t=C.get();if(t<0)return-28;var a;return a=i.createStream(o,t),a.fd}case 1:case 2:return 0;case 3:return o.flags;case 4:{var t=C.get();return o.flags|=t,0}case 5:{var t=C.get(),s=0;return we[t+s>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return he(28),-1;default:return-28}}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function lo(n,r){try{var e=C.getStreamFromFD(n);return C.doStat(i.stat,e.path,r)}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function qt(n,r){return r+2097152>>>0<4194305-!!n?(n>>>0)+r*4294967296:NaN}function _o(n,r,e){try{var o=qt(r,e);return isNaN(o)?-61:(i.ftruncate(n,o),0)}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function mo(n,r){try{if(r===0)return-28;var e=i.cwd(),o=Ce(e)+1;return r<o?-68:(Fe(e,n,r),o)}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function vo(n,r,e){try{var o=C.getStreamFromFD(n);o.getdents||(o.getdents=i.readdir(o.path));for(var t=280,a=0,s=i.llseek(o,0,1),l=Math.floor(s/t);l<o.getdents.length&&a+t<=e;){var h,w,S=o.getdents[l];if(S===".")h=o.node.id,w=4;else if(S===".."){var O=i.lookupPath(o.path,{parent:!0});h=O.node.id,w=4}else{var N=i.lookupNode(o.node,S);h=N.id,w=i.isChrdev(N.mode)?2:i.isDir(N.mode)?4:i.isLink(N.mode)?10:8}Z=[h>>>0,(U=h,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[r+a>>2]=Z[0],E[r+a+4>>2]=Z[1],Z=[(l+1)*t>>>0,(U=(l+1)*t,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[r+a+8>>2]=Z[0],E[r+a+12>>2]=Z[1],we[r+a+16>>1]=280,ee[r+a+18>>0]=w,Fe(S,r+a+19,256),a+=t,l+=1}return i.llseek(o,l*t,0),a}catch(T){if(typeof i>"u"||!(T instanceof i.ErrnoError))throw T;return-T.errno}}function po(n,r,e){try{var o=ke(n);if(!o.daddr)return-53;var t=be(r,o.family,ue.lookup_name(o.daddr),o.dport,e);return 0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function ho(n,r,e){try{fe("__syscall_getsockname "+n);var o=ke(n),t=be(r,o.family,ue.lookup_name(o.saddr||"0.0.0.0"),o.sport,e);return 0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function yo(n,r,e,o,t){try{var a=ke(n);return r===1&&e===4?(E[o>>2]=a.error,E[t>>2]=4,a.error=null,0):-50}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function Eo(n,r,e){C.varargs=e;try{var o=C.getStreamFromFD(n);switch(r){case 21509:case 21505:return o.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return o.tty?0:-59;case 21519:{if(!o.tty)return-59;var t=C.get();return E[t>>2]=0,0}case 21520:return o.tty?-28:-59;case 21531:{var t=C.get();return i.ioctl(o,r,t)}case 21523:return o.tty?0:-59;case 21524:return o.tty?0:-59;default:return-28}}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function wo(n,r){try{var e=ke(n);return e.sock_ops.listen(e,r),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function go(n,r){try{return n=C.getStr(n),C.doStat(i.lstat,n,r)}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function So(n,r,e){try{return r=C.getStr(r),r=C.calculateAt(n,r),r=Y.normalize(r),r[r.length-1]==="/"&&(r=r.substr(0,r.length-1)),i.mkdir(r,e,0),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function bo(n,r,e,o){try{r=C.getStr(r);var t=o&256,a=o&4096;return o=o&-4353,r=C.calculateAt(n,r,a),C.doStat(t?i.lstat:i.stat,r,e)}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function ko(n,r,e,o){C.varargs=o;try{r=C.getStr(r),r=C.calculateAt(n,r);var t=o?C.get():0;return i.open(r,e,t).fd}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}var ae={BUCKET_BUFFER_SIZE:8192,mount:function(n){return i.createNode(null,"/",16895,0)},createPipe:function(){var n={buckets:[],refcnt:2};n.buckets.push({buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var r=ae.nextname(),e=ae.nextname(),o=i.createNode(ae.root,r,4096,0),t=i.createNode(ae.root,e,4096,0);o.pipe=n,t.pipe=n;var a=i.createStream({path:r,node:o,flags:0,seekable:!1,stream_ops:ae.stream_ops});o.stream=a;var s=i.createStream({path:e,node:t,flags:1,seekable:!1,stream_ops:ae.stream_ops});return t.stream=s,{readable_fd:a.fd,writable_fd:s.fd}},stream_ops:{poll:function(n){var r=n.node.pipe;if((n.flags&2097155)===1)return 260;if(r.buckets.length>0)for(var e=0;e<r.buckets.length;e++){var o=r.buckets[e];if(o.offset-o.roffset>0)return 65}return 0},ioctl:function(n,r,e){return 28},fsync:function(n){return 28},read:function(n,r,e,o,t){for(var a=n.node.pipe,s=0,l=0;l<a.buckets.length;l++){var h=a.buckets[l];s+=h.offset-h.roffset}Le(r instanceof ArrayBuffer||ArrayBuffer.isView(r));var w=r.subarray(e,e+o);if(o<=0)return 0;if(s==0)throw new i.ErrnoError(6);for(var S=Math.min(s,o),O=S,N=0,l=0;l<a.buckets.length;l++){var T=a.buckets[l],F=T.offset-T.roffset;if(S<=F){var L=T.buffer.subarray(T.roffset,T.offset);S<F?(L=L.subarray(0,S),T.roffset+=S):N++,w.set(L);break}else{var L=T.buffer.subarray(T.roffset,T.offset);w.set(L),w=w.subarray(L.byteLength),S-=L.byteLength,N++}}return N&&N==a.buckets.length&&(N--,a.buckets[N].offset=0,a.buckets[N].roffset=0),a.buckets.splice(0,N),O},write:function(n,r,e,o,t){var a=n.node.pipe;Le(r instanceof ArrayBuffer||ArrayBuffer.isView(r));var s=r.subarray(e,e+o),l=s.byteLength;if(l<=0)return 0;var h=null;a.buckets.length==0?(h={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0},a.buckets.push(h)):h=a.buckets[a.buckets.length-1],Le(h.offset<=ae.BUCKET_BUFFER_SIZE);var w=ae.BUCKET_BUFFER_SIZE-h.offset;if(w>=l)return h.buffer.set(s,h.offset),h.offset+=l,l;w>0&&(h.buffer.set(s.subarray(0,w),h.offset),h.offset+=w,s=s.subarray(w,s.byteLength));for(var S=s.byteLength/ae.BUCKET_BUFFER_SIZE|0,O=s.byteLength%ae.BUCKET_BUFFER_SIZE,N=0;N<S;N++){var T={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:ae.BUCKET_BUFFER_SIZE,roffset:0};a.buckets.push(T),T.buffer.set(s.subarray(0,ae.BUCKET_BUFFER_SIZE)),s=s.subarray(ae.BUCKET_BUFFER_SIZE,s.byteLength)}if(O>0){var T={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:s.byteLength,roffset:0};a.buckets.push(T),T.buffer.set(s)}return l},close:function(n){var r=n.node.pipe;r.refcnt--,r.refcnt===0&&(r.buckets=null)}},nextname:function(){return ae.nextname.current||(ae.nextname.current=0),"pipe["+ae.nextname.current+++"]"}};function Oo(n){try{if(n==0)throw new i.ErrnoError(21);var r=ae.createPipe();return E[n>>2]=r.readable_fd,E[n+4>>2]=r.writable_fd,0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function kr(n,r,e){try{for(var o=0,t=0;t<r;t++){var a=n+8*t,s=E[a>>2],l=we[a+4>>1],h=32,w=i.getStream(s);w&&(h=C.DEFAULT_POLLMASK,w.stream_ops?.poll&&(h=w.stream_ops.poll(w))),h&=l|8|16,h&&o++,we[a+6>>1]=h}return o}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function Do(n,r,e,o){try{if(r=C.getStr(r),r=C.calculateAt(n,r),o<=0)return-28;var t=i.readlink(r),a=Math.min(o,Ce(t)),s=ee[e+a];return Fe(t,e,o+1),ee[e+a]=s,a}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Se(n,r,e,o,t,a){try{var s=ke(n),l=s.sock_ops.recvmsg(s,e);if(!l)return 0;if(t)var h=be(t,s.family,ue.lookup_name(l.addr),l.port,a);return le.set(l.buffer,r),l.buffer.byteLength}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function No(n,r,e,o){try{return r=C.getStr(r),o=C.getStr(o),r=C.calculateAt(n,r),o=C.calculateAt(e,o),i.rename(r,o),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function To(n){try{return n=C.getStr(n),i.rmdir(n),0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function Ao(n,r,e,o,t,a){try{var s=ke(n),l=Yr(t,a,!0);return l?s.sock_ops.sendmsg(s,ee,r,e,l.addr,l.port):i.write(s.stream,ee,r,e)}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Fo(n,r,e){try{var o=H.createSocket(n,r,e);return o.stream.fd}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function Co(n,r){try{return n=C.getStr(n),C.doStat(i.stat,n,r)}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function Po(n,r,e){try{return n=C.getStr(n),E[e+4>>2]=4096,E[e+40>>2]=4096,E[e+8>>2]=1e6,E[e+12>>2]=5e5,E[e+16>>2]=5e5,E[e+20>>2]=i.nextInode,E[e+24>>2]=1e6,E[e+28>>2]=42,E[e+44>>2]=2,E[e+36>>2]=255,0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function Ro(n,r){try{return n=C.getStr(n),r=C.getStr(r),i.symlink(n,r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function Mo(n,r,e){try{return r=C.getStr(r),r=C.calculateAt(n,r),e===0?i.unlink(r):e===512?i.rmdir(r):me("Invalid flags passed to unlinkat"),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function jr(n){return j[n>>2]+E[n+4>>2]*4294967296}function Lo(n,r,e,o){try{if(r=C.getStr(r),r=C.calculateAt(n,r,!0),e){var s=jr(e),l=E[e+8>>2];t=s*1e3+l/(1e3*1e3),e+=16,s=jr(e),l=E[e+8>>2],a=s*1e3+l/(1e3*1e3)}else var t=Date.now(),a=t;return i.utime(r,t,a),0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function mn(n){}var Vt="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function St(n,r){me(Vt)}function Fn(n,r){me(Vt)}var Uo=!0;function vn(){return Uo}function Io(){throw 1/0}function Bo(n,r){var e=new Date(jr(n)*1e3);E[r>>2]=e.getUTCSeconds(),E[r+4>>2]=e.getUTCMinutes(),E[r+8>>2]=e.getUTCHours(),E[r+12>>2]=e.getUTCDate(),E[r+16>>2]=e.getUTCMonth(),E[r+20>>2]=e.getUTCFullYear()-1900,E[r+24>>2]=e.getUTCDay();var o=Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0),t=(e.getTime()-o)/(1e3*60*60*24)|0;E[r+28>>2]=t}function xo(n,r){var e=new Date(jr(n)*1e3);E[r>>2]=e.getSeconds(),E[r+4>>2]=e.getMinutes(),E[r+8>>2]=e.getHours(),E[r+12>>2]=e.getDate(),E[r+16>>2]=e.getMonth(),E[r+20>>2]=e.getFullYear()-1900,E[r+24>>2]=e.getDay();var o=new Date(e.getFullYear(),0,1),t=(e.getTime()-o.getTime())/(1e3*60*60*24)|0;E[r+28>>2]=t,E[r+36>>2]=-(e.getTimezoneOffset()*60);var a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),l=(a!=s&&e.getTimezoneOffset()==Math.min(s,a))|0;E[r+32>>2]=l}function zo(n){var r=new Date(E[n+20>>2]+1900,E[n+16>>2],E[n+12>>2],E[n+8>>2],E[n+4>>2],E[n>>2],0),e=E[n+32>>2],o=r.getTimezoneOffset(),t=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),s=t.getTimezoneOffset(),l=Math.min(s,a);if(e<0)E[n+32>>2]=+(a!=s&&l==o);else if(e>0!=(l==o)){var h=Math.max(s,a),w=e>0?l:h;r.setTime(r.getTime()+(w-o)*6e4)}E[n+24>>2]=r.getDay();var S=(r.getTime()-t.getTime())/(1e3*60*60*24)|0;return E[n+28>>2]=S,E[n>>2]=r.getSeconds(),E[n+4>>2]=r.getMinutes(),E[n+8>>2]=r.getHours(),E[n+12>>2]=r.getDate(),E[n+16>>2]=r.getMonth(),E[n+20>>2]=r.getYear(),r.getTime()/1e3|0}function Ho(n,r,e,o,t,a){try{var s=C.getStreamFromFD(o),l=i.mmap(s,n,t,r,e),h=l.ptr;return E[a>>2]=l.allocated,h}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function Wo(n,r,e,o,t,a){try{var s=C.getStreamFromFD(t);e&2&&C.doMsync(n,s,r,o,a),i.munmap(s)}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Gt(n){var r=Ce(n)+1,e=mr(r);return e&&Ze(n,ee,e,r),e}function Yo(n,r,e){var o=new Date().getFullYear(),t=new Date(o,0,1),a=new Date(o,6,1),s=t.getTimezoneOffset(),l=a.getTimezoneOffset(),h=Math.max(s,l);E[n>>2]=h*60,E[r>>2]=+(s!=l);function w(F){var L=F.toTimeString().match(/\(([A-Za-z ]+)\)$/);return L?L[1]:"GMT"}var S=w(t),O=w(a),N=Gt(S),T=Gt(O);l<s?(j[e>>2]=N,j[e+4>>2]=T):(j[e>>2]=T,j[e+4>>2]=N)}function rt(n,r,e){rt.called||(rt.called=!0,Yo(n,r,e))}function jo(){me("")}function Kt(){return Date.now()}function Xt(){return 2147483648}function Rt(){return Xt()}var tt;te?tt=()=>{var n=process.hrtime();return n[0]*1e3+n[1]/1e6}:tt=()=>performance.now();function qo(n,r,e){le.copyWithin(n,r,r+e)}function Zt(n){try{return ir.grow(n-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function Vo(n){var r=le.length;n=n>>>0;var e=Xt();if(n>e)return!1;let o=(h,w)=>h+(w-h%w)%w;for(var t=1;t<=4;t*=2){var a=r*(1+.2/t);a=Math.min(a,n+100663296);var s=Math.min(e,o(Math.max(n,a),65536)),l=Zt(s);if(l)return!0}return!1}function Mt(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var it=A.ENV||{};function Go(){return ie||"./this.program"}function Or(){if(!Or.strings){var n=(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:n,_:Go()};for(var e in it)it[e]===void 0?delete r[e]:r[e]=it[e];var o=[];for(var e in r)o.push(e+"="+r[e]);Or.strings=o}return Or.strings}function at(n,r,e){for(var o=0;o<n.length;++o)ee[r++>>0]=n.charCodeAt(o);e||(ee[r>>0]=0)}function st(n,r){var e=0;return Or().forEach(function(o,t){var a=r+e;j[n+t*4>>2]=a,at(o,a),e+=o.length+1}),0}function On(n,r){var e=Or();j[n>>2]=e.length;var o=0;return e.forEach(function(t){o+=t.length+1}),j[r>>2]=o,0}function qr(n){Pr=n,Mr()||(f.onExit&&f.onExit(n),Tr=!0),_e(n,new Ur(n))}function Lt(n,r){Pr=n,Mr()||Kn(),qr(n)}var Cn=Lt;function Ko(n){try{var r=C.getStreamFromFD(n);return i.close(r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return e.errno}}function pn(n,r){try{var e=C.getStreamFromFD(n),o=e.tty?2:i.isDir(e.mode)?3:i.isLink(e.mode)?7:4;return ee[r>>0]=o,0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return t.errno}}function Xo(n,r,e,o){for(var t=0,a=0;a<e;a++){var s=j[r>>2],l=j[r+4>>2];r+=8;var h=i.read(n,ee,s,l,o);if(h<0)return-1;if(t+=h,h<l)break}return t}function Zo(n,r,e,o){try{var t=C.getStreamFromFD(n),a=Xo(t,r,e);return j[o>>2]=a,0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return s.errno}}function $o(n,r,e,o,t){try{var a=qt(r,e);if(isNaN(a))return 61;var s=C.getStreamFromFD(n);return i.llseek(s,a,o),Z=[s.position>>>0,(U=s.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[t>>2]=Z[0],E[t+4>>2]=Z[1],s.getdents&&a===0&&o===0&&(s.getdents=null),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return l.errno}}function Jo(n){try{var r=C.getStreamFromFD(n);return r.stream_ops&&r.stream_ops.fsync?r.stream_ops.fsync(r):0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return e.errno}}function Qo(n,r,e,o){for(var t=0,a=0;a<e;a++){var s=j[r>>2],l=j[r+4>>2];r+=8;var h=i.write(n,ee,s,l,o);if(h<0)return-1;t+=h}return t}function ei(n,r,e,o){try{var t=C.getStreamFromFD(n),a=Qo(t,r,e);return j[o>>2]=a,0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return s.errno}}function nn(n){var r=mr(20),e=mr(n.length+1);Fe(n,e,n.length+1),j[r>>2]=e;var o=mr(4);j[o>>2]=0,j[r+4>>2]=o;var t=2;E[r+8>>2]=t,E[r+12>>2]=4;var a=mr(12);return j[a>>2]=a+8,j[a+4>>2]=0,E[a+8>>2]=Ie(ue.lookup_name(n)),j[r+16>>2]=a,r}function Pn(n,r,e){if(e!==2)return he(5),null;n=E[n>>2];var o=Ne(n),t=ue.lookup_addr(o);return t&&(o=t),nn(o)}function Rn(n){return nn(ne(n))}function ri(n,r,e,o,t,a){var s=Rn(n);return It(r,s,20),zr(s),E[a>>2]=0,j[t>>2]=r,0}function Mn(n,r){for(var e=Math.min(r,3),o=8,t=0;t<e;t++)dt[n+t*o>>3]=.1;return e}function hn(n,r,e,o,t,a,s){var l=Gr(n,r);if(l.errno)return-6;var h=l.port,w=l.addr,S=!1;if(e&&o){var O;if(s&1||!(O=ue.lookup_addr(w))){if(s&8)return-2}else w=O;var N=Fe(w,e,o);N+1>=o&&(S=!0)}if(t&&a){h=""+h;var N=Fe(h,t,a);N+1>=a&&(S=!0)}return S?-12:0}var nt={list:[],map:{}};function bt(n){function r(a,s,l){var h=mr(a.length+1);at(a,h);for(var w=0,S=l.length,O=mr((S+1)*4),N=0;N<S;N++,w+=4){var T=l[N],F=mr(T.length+1);at(T,F),j[O+w>>2]=F}j[O+w>>2]=0;var L=mr(12);return j[L>>2]=h,j[L+4>>2]=O,E[L+8>>2]=s,L}var e=nt.list,o=nt.map;if(e.length===0){var t=r("tcp",6,["TCP"]);e.push(t),o.tcp=o[6]=t,t=r("udp",17,["UDP"]),e.push(t),o.udp=o[17]=t}bt.index=0}function $t(n){n=ne(n),bt(!0);var r=nt.map[n];return r}function yn(n){bt(!0);var r=nt.map[n];return r}function Fr(n){var r=Ce(n)+1,e=sr(r);return Ze(n,ee,e,r),e}var Ue={getAllWebSockets:function(n){let r=new Set;n.server&&n.server.clients.forEach(e=>{r.add(e)});for(let e of Ue.getAllPeers(n))r.add(e.socket);return Array.from(r)},getAllPeers:function(n){let r=new Set;if(n.server&&n.pending.filter(e=>e.peers).forEach(e=>{for(let o of Object.values(e.peers))r.add(o)}),n.peers)for(let e of Object.values(n.peers))r.add(e);return Array.from(r)},awaitData:function(n){return Ue.awaitWsEvent(n,"message")},awaitConnection:function(n){return n.OPEN===n.readyState?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(n,"open")},awaitClose:function(n){return[n.CLOSING,n.CLOSED].includes(n.readyState)?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(n,"close")},awaitError:function(n){return[n.CLOSING,n.CLOSED].includes(n.readyState)?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(n,"error")},awaitWsEvent:function(n,r){let e,o=()=>{e()};return[new Promise(function(s){e=s,n.once(r,o)}),()=>{n.removeListener(r,o),setTimeout(e)}]},noop:function(){},shutdownSocket:function(n,r){let e=ke(n),o=Object.values(e.peers)[0];if(!o)return-1;try{return o.socket.close(),H.websocket_sock_ops.removePeer(e,o),0}catch(t){return console.log("Socket shutdown error",t),-1}}};function hr(n,r,e){if(!n)return 1;let o=ne(n);if(!o.length)return 0;let t=ne(r);if(!t.length)return 0;if(f.popen_to_file){let{path:a,exitCode:s}=f.popen_to_file(o,t);return le[e]=s,Fr(a)}if(te){let a=require("os").tmpdir(),s="php-process-stream",l=a+"/"+s,h=require("child_process"),w;if(t==="r")w=h.spawnSync(o,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[e]=w.status,require("fs").writeFileSync(l,w.stdout,{encoding:"utf8",flag:"w+"});else return t==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+t+" (should be r or w)"),_W_EXITCODE(0,2));return Fr(l)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function tr(n){return n%4===0&&(n%100!==0||n%400===0)}function Hr(n,r){for(var e=0,o=0;o<=r;e+=n[o++]);return e}var Ge=[31,29,31,30,31,30,31,31,30,31,30,31],Xe=[31,28,31,30,31,30,31,31,30,31,30,31];function Ve(n,r){for(var e=new Date(n.getTime());r>0;){var o=tr(e.getFullYear()),t=e.getMonth(),a=(o?Ge:Xe)[t];if(r>a-e.getDate())r-=a-e.getDate()+1,e.setDate(1),t<11?e.setMonth(t+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1));else return e.setDate(e.getDate()+r),e}return e}function ut(n,r,e,o){var t=E[o+40>>2],a={tm_sec:E[o>>2],tm_min:E[o+4>>2],tm_hour:E[o+8>>2],tm_mday:E[o+12>>2],tm_mon:E[o+16>>2],tm_year:E[o+20>>2],tm_wday:E[o+24>>2],tm_yday:E[o+28>>2],tm_isdst:E[o+32>>2],tm_gmtoff:E[o+36>>2],tm_zone:t?ne(t):""},s=ne(e),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var h in l)s=s.replace(new RegExp(h,"g"),l[h]);var w=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],S=["January","February","March","April","May","June","July","August","September","October","November","December"];function O(P,M,z){for(var q=typeof P=="number"?P.toString():P||"";q.length<M;)q=z[0]+q;return q}function N(P,M){return O(P,M,"0")}function T(P,M){function z(W){return W<0?-1:W>0?1:0}var q;return(q=z(P.getFullYear()-M.getFullYear()))===0&&(q=z(P.getMonth()-M.getMonth()))===0&&(q=z(P.getDate()-M.getDate())),q}function F(P){switch(P.getDay()){case 0:return new Date(P.getFullYear()-1,11,29);case 1:return P;case 2:return new Date(P.getFullYear(),0,3);case 3:return new Date(P.getFullYear(),0,2);case 4:return new Date(P.getFullYear(),0,1);case 5:return new Date(P.getFullYear()-1,11,31);case 6:return new Date(P.getFullYear()-1,11,30)}}function L(P){var M=Ve(new Date(P.tm_year+1900,0,1),P.tm_yday),z=new Date(M.getFullYear(),0,4),q=new Date(M.getFullYear()+1,0,4),W=F(z),X=F(q);return T(W,M)<=0?T(X,M)<=0?M.getFullYear()+1:M.getFullYear():M.getFullYear()-1}var R={"%a":function(P){return w[P.tm_wday].substring(0,3)},"%A":function(P){return w[P.tm_wday]},"%b":function(P){return S[P.tm_mon].substring(0,3)},"%B":function(P){return S[P.tm_mon]},"%C":function(P){var M=P.tm_year+1900;return N(M/100|0,2)},"%d":function(P){return N(P.tm_mday,2)},"%e":function(P){return O(P.tm_mday,2," ")},"%g":function(P){return L(P).toString().substring(2)},"%G":function(P){return L(P)},"%H":function(P){return N(P.tm_hour,2)},"%I":function(P){var M=P.tm_hour;return M==0?M=12:M>12&&(M-=12),N(M,2)},"%j":function(P){return N(P.tm_mday+Hr(tr(P.tm_year+1900)?Ge:Xe,P.tm_mon-1),3)},"%m":function(P){return N(P.tm_mon+1,2)},"%M":function(P){return N(P.tm_min,2)},"%n":function(){return`
25
+ `},"%p":function(P){return P.tm_hour>=0&&P.tm_hour<12?"AM":"PM"},"%S":function(P){return N(P.tm_sec,2)},"%t":function(){return" "},"%u":function(P){return P.tm_wday||7},"%U":function(P){var M=P.tm_yday+7-P.tm_wday;return N(Math.floor(M/7),2)},"%V":function(P){var M=Math.floor((P.tm_yday+7-(P.tm_wday+6)%7)/7);if((P.tm_wday+371-P.tm_yday-2)%7<=2&&M++,M){if(M==53){var q=(P.tm_wday+371-P.tm_yday)%7;q!=4&&(q!=3||!tr(P.tm_year))&&(M=1)}}else{M=52;var z=(P.tm_wday+7-P.tm_yday-1)%7;(z==4||z==5&&tr(P.tm_year%400-1))&&M++}return N(M,2)},"%w":function(P){return P.tm_wday},"%W":function(P){var M=P.tm_yday+7-(P.tm_wday+6)%7;return N(Math.floor(M/7),2)},"%y":function(P){return(P.tm_year+1900).toString().substring(2)},"%Y":function(P){return P.tm_year+1900},"%z":function(P){var M=P.tm_gmtoff,z=M>=0;return M=Math.abs(M)/60,M=M/60*100+M%60,(z?"+":"-")+("0000"+M).slice(-4)},"%Z":function(P){return P.tm_zone},"%%":function(){return"%"}};s=s.replace(/%%/g,"\0\0");for(var h in R)s.includes(h)&&(s=s.replace(new RegExp(h,"g"),R[h](a)));s=s.replace(/\0\0/g,"%");var B=Er(s,!1);return B.length>r?0:(Et(B,n),B.length-1)}function Kr(n,r,e){for(var o=ne(r),t="\\!@#$^&*()+=-[]/{}|:<>?,.",a=0,s=t.length;a<s;++a)o=o.replace(new RegExp("\\"+t[a],"g"),"\\"+t[a]);var l={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var h in l)o=o.replace(h,l[h]);var w={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},S={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},O={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},N={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var T in w)o=o.replace(T,"("+T+w[T]+")");for(var F=[],a=o.indexOf("%");a>=0;a=o.indexOf("%"))F.push(o[a+1]),o=o.replace(new RegExp("\\%"+o[a+1],"g"),"");var L=new RegExp("^"+o,"i").exec(ne(n));function R(){function nr(or,xr,et){return typeof or!="number"||isNaN(or)?xr:or>=xr?or<=et?or:et:xr}return{year:nr(E[e+20>>2]+1900,1970,9999),month:nr(E[e+16>>2],0,11),day:nr(E[e+12>>2],1,31),hour:nr(E[e+8>>2],0,23),min:nr(E[e+4>>2],0,59),sec:nr(E[e>>2],0,59)}}if(L){var B=R(),P,M=nr=>{var or=F.indexOf(nr);if(or>=0)return L[or+1]};if((P=M("S"))&&(B.sec=ce(P)),(P=M("M"))&&(B.min=ce(P)),P=M("H"))B.hour=ce(P);else if(P=M("I")){var z=ce(P);(P=M("p"))&&(z+=P.toUpperCase()[0]==="P"?12:0),B.hour=z}if(P=M("Y"))B.year=ce(P);else if(P=M("y")){var q=ce(P);(P=M("C"))?q+=ce(P)*100:q+=q<69?2e3:1900,B.year=q}if((P=M("m"))?B.month=ce(P)-1:(P=M("b"))&&(B.month=S[P.substring(0,3).toUpperCase()]||0),P=M("d"))B.day=ce(P);else if(P=M("j"))for(var W=ce(P),X=tr(B.year),oe=0;oe<12;++oe){var se=Hr(X?Ge:Xe,oe-1);W<=se+(X?Ge:Xe)[oe]&&(B.day=W-se)}else if(P=M("a")){var Oe=P.substring(0,3).toUpperCase();if(P=M("U")){var Ae=O[Oe],Qe=ce(P),Ke=new Date(B.year,0,1),rr;Ke.getDay()===0?rr=Ve(Ke,Ae+7*(Qe-1)):rr=Ve(Ke,7-Ke.getDay()+Ae+7*(Qe-1)),B.day=rr.getDate(),B.month=rr.getMonth()}else if(P=M("W")){var Ae=N[Oe],Qe=ce(P),Ke=new Date(B.year,0,1),rr;Ke.getDay()===1?rr=Ve(Ke,Ae+7*(Qe-1)):rr=Ve(Ke,7-Ke.getDay()+1+Ae+7*(Qe-1)),B.day=rr.getDate(),B.month=rr.getMonth()}}var je=new Date(B.year,B.month,B.day,B.hour,B.min,B.sec,0);return E[e>>2]=je.getSeconds(),E[e+4>>2]=je.getMinutes(),E[e+8>>2]=je.getHours(),E[e+12>>2]=je.getDate(),E[e+16>>2]=je.getMonth(),E[e+20>>2]=je.getFullYear()-1900,E[e+24>>2]=je.getDay(),E[e+28>>2]=Hr(tr(je.getFullYear())?Ge:Xe,je.getMonth()-1)+je.getDate()-1,E[e+32>>2]=0,n+Er(L[0]).length-1}return 0}function ot(n){return Ue.shutdownSocket(n,2)}function ft(n,r,e){if(typeof Asyncify>"u")return 0;let o=1,t=2,a=4,s=8,l=16,h=32;return Asyncify.handleSleep(w=>{let S=ke(n);if(!S){w(0);return}let O=[],N=new Set;if(r&o||r&t){if(S.server){for(let P of S.pending)if((P.recv_queue||[]).length>0){w(1);return}}else if((S.recv_queue||[]).length>0){w(1);return}}let T=Ue.getAllWebSockets(S);if(!T.length){w(0);return}for(let P of T)(r&o||r&t)&&(O.push(Ue.awaitData(P)),N.add("POLLIN")),r&a&&(O.push(Ue.awaitConnection(P)),N.add("POLLOUT")),r&l&&(O.push(Ue.awaitClose(P)),N.add("POLLHUP")),(r&s||r&h)&&(O.push(Ue.awaitError(P)),N.add("POLLERR"));if(O.length===0){console.warn("Unsupported poll event "+r+", defaulting to setTimeout()."),setTimeout(function(){w(0)},e);return}let F=O.map(([P])=>P),L=()=>O.forEach(([,P])=>P()),R=!1;Promise.race(F).then(function(P){R||(R=!0,w(1),clearTimeout(B),L())});let B=setTimeout(function(){R||(R=!0,w(0),L())},e)})}function Ot(n,r,e,o,t){let a=le[o];if(!(r===1&&e===9||r===6&&e===1))return console.warn(`Unsupported socket option: ${r}, ${e}, ${a}`),-1;let O=Ue.getAllWebSockets(n)[0];return O?(O.setSocketOpt(r,e,o),0):-1}function Dt(n){var r=f["_"+n];return r}function Jt(n,r,e,o,t){var a={string:F=>{var L=0;if(F!=null&&F!==0){var R=(F.length<<2)+1;L=sr(R),Fe(F,L,R)}return L},array:F=>{var L=sr(F.length);return Et(F,L),L}};function s(F){return r==="string"?ne(F):r==="boolean"?!!F:F}var l=Dt(n),h=[],w=0;if(o)for(var S=0;S<o.length;S++){var O=a[e[S]];O?(w===0&&(w=De()),h[S]=O(o[S])):h[S]=o[S]}var N=l.apply(null,h);function T(F){return w!==0&&ye(w),s(F)}return N=T(N),N}var Ut=function(n,r,e,o){n||(n=this),this.parent=n,this.mount=n.mount,this.mounted=null,this.id=i.nextInode++,this.name=r,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=o},Xr=365,$r=146;Object.defineProperties(Ut.prototype,{read:{get:function(){return(this.mode&Xr)===Xr},set:function(n){n?this.mode|=Xr:this.mode&=~Xr}},write:{get:function(){return(this.mode&$r)===$r},set:function(n){n?this.mode|=$r:this.mode&=~$r}},isFolder:{get:function(){return i.isDir(this.mode)}},isDevice:{get:function(){return i.isChrdev(this.mode)}}}),i.FSNode=Ut,i.staticInit(),f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_unlink=i.unlink,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,te&&(yr(),V.staticInit()),re={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};var En={j:to,Sa:wt,Ra:v,Qa:Zr,Pa:dn,Oa:Pt,O:oo,Na:io,Ma:ao,La:so,Ka:uo,Ja:_n,Ia:fo,N:gt,m:co,Ha:lo,R:_o,Ga:mo,Fa:vo,Ea:po,Da:ho,Ca:yo,M:Eo,Ba:wo,Aa:go,za:So,ya:bo,w:ko,xa:Oo,wa:kr,va:Do,ua:Se,ta:No,L:To,sa:Ao,K:Fo,ra:Co,qa:Po,pa:Ro,D:Mo,oa:Lo,ja:mn,ia:St,ha:Fn,ga:vn,fa:Io,ea:Bo,da:xo,ca:zo,ba:Ho,aa:Wo,$:rt,o:jo,B:Kt,_:Rt,H:tt,Z:qo,Y:Vo,X:Mt,na:st,ma:On,p:Cn,t:Ko,J:pn,I:Zo,Q:$o,la:Jo,C:ei,G:Pn,F:ri,W:Mn,V:hn,U:$t,T:yn,h:Bn,d:_i,b:bn,f:k,g,u:m,s:Nn,v:b,A:c,e:li,a:Tn,c:In,z:u,l:di,k:xn,n:_,i:D,y,S:hr,ka:qr,E:ut,P:Kr,r:ot,x:ft,q:Ot},ti=ro(),wn=f.___wasm_call_ctors=function(){return(wn=f.___wasm_call_ctors=f.asm.Ua).apply(null,arguments)},on=f._wasm_popen=function(){return(on=f._wasm_popen=f.asm.Va).apply(null,arguments)},Qt=f.___errno_location=function(){return(Qt=f.___errno_location=f.asm.Wa).apply(null,arguments)},Dn=f._wasm_pclose=function(){return(Dn=f._wasm_pclose=f.asm.Xa).apply(null,arguments)},gn=f._php_pollfd_for=function(){return(gn=f._php_pollfd_for=f.asm.Ya).apply(null,arguments)},Tt=f._wasm_select=function(){return(Tt=f._wasm_select=f.asm.Za).apply(null,arguments)},Jr=f._wasm_add_cli_arg=function(){return(Jr=f._wasm_add_cli_arg=f.asm._a).apply(null,arguments)},mr=f._malloc=function(){return(mr=f._malloc=f.asm.$a).apply(null,arguments)},Qr=f._run_cli=function(){return(Qr=f._run_cli=f.asm.ab).apply(null,arguments)},It=f._memcpy=function(){return(It=f._memcpy=f.asm.bb).apply(null,arguments)},zr=f._free=function(){return(zr=f._free=f.asm.cb).apply(null,arguments)},Nt=f._ntohs=function(){return(Nt=f._ntohs=f.asm.eb).apply(null,arguments)},Dr=f._htons=function(){return(Dr=f._htons=f.asm.fb).apply(null,arguments)},At=f._fflush=function(){return(At=f._fflush=f.asm.gb).apply(null,arguments)},an=f._wasm_set_phpini_path=function(){return(an=f._wasm_set_phpini_path=f.asm.hb).apply(null,arguments)},Br=f._wasm_set_phpini_entries=function(){return(Br=f._wasm_set_phpini_entries=f.asm.ib).apply(null,arguments)},Vr=f._wasm_add_SERVER_entry=function(){return(Vr=f._wasm_add_SERVER_entry=f.asm.jb).apply(null,arguments)},Ft=f._wasm_add_uploaded_file=function(){return(Ft=f._wasm_add_uploaded_file=f.asm.kb).apply(null,arguments)},sn=f._wasm_set_query_string=function(){return(sn=f._wasm_set_query_string=f.asm.lb).apply(null,arguments)},en=f._wasm_set_path_translated=function(){return(en=f._wasm_set_path_translated=f.asm.mb).apply(null,arguments)},un=f._wasm_set_skip_shebang=function(){return(un=f._wasm_set_skip_shebang=f.asm.nb).apply(null,arguments)},rn=f._wasm_set_request_uri=function(){return(rn=f._wasm_set_request_uri=f.asm.ob).apply(null,arguments)},tn=f._wasm_set_request_method=function(){return(tn=f._wasm_set_request_method=f.asm.pb).apply(null,arguments)},Sn=f._wasm_set_request_host=function(){return(Sn=f._wasm_set_request_host=f.asm.qb).apply(null,arguments)},ni=f._wasm_set_content_type=function(){return(ni=f._wasm_set_content_type=f.asm.rb).apply(null,arguments)},oi=f._wasm_set_request_body=function(){return(oi=f._wasm_set_request_body=f.asm.sb).apply(null,arguments)},ii=f._wasm_set_content_length=function(){return(ii=f._wasm_set_content_length=f.asm.tb).apply(null,arguments)},ai=f._wasm_set_cookies=function(){return(ai=f._wasm_set_cookies=f.asm.ub).apply(null,arguments)},si=f._wasm_set_php_code=function(){return(si=f._wasm_set_php_code=f.asm.vb).apply(null,arguments)},ui=f._wasm_set_request_port=function(){return(ui=f._wasm_set_request_port=f.asm.wb).apply(null,arguments)},fi=f._phpwasm_init_uploaded_files_hash=function(){return(fi=f._phpwasm_init_uploaded_files_hash=f.asm.xb).apply(null,arguments)},ci=f._phpwasm_register_uploaded_file=function(){return(ci=f._phpwasm_register_uploaded_file=f.asm.yb).apply(null,arguments)},Ln=f._phpwasm_destroy_uploaded_files_hash=function(){return(Ln=f._phpwasm_destroy_uploaded_files_hash=f.asm.zb).apply(null,arguments)},Un=f._wasm_sapi_handle_request=function(){return(Un=f._wasm_sapi_handle_request=f.asm.Ab).apply(null,arguments)},Cr=f._php_wasm_init=function(){return(Cr=f._php_wasm_init=f.asm.Bb).apply(null,arguments)},Sr=f.___funcs_on_exit=function(){return(Sr=f.___funcs_on_exit=f.asm.Cb).apply(null,arguments)},br=f._emscripten_builtin_memalign=function(){return(br=f._emscripten_builtin_memalign=f.asm.Db).apply(null,arguments)},Te=f._setThrew=function(){return(Te=f._setThrew=f.asm.Eb).apply(null,arguments)},De=f.stackSave=function(){return(De=f.stackSave=f.asm.Fb).apply(null,arguments)},ye=f.stackRestore=function(){return(ye=f.stackRestore=f.asm.Gb).apply(null,arguments)},sr=f.stackAlloc=function(){return(sr=f.stackAlloc=f.asm.Hb).apply(null,arguments)},Ye=f.dynCall_vi=function(){return(Ye=f.dynCall_vi=f.asm.Ib).apply(null,arguments)},vr=f.dynCall_iiii=function(){return(vr=f.dynCall_iiii=f.asm.Jb).apply(null,arguments)},Be=f.dynCall_ii=function(){return(Be=f.dynCall_ii=f.asm.Kb).apply(null,arguments)},ur=f.dynCall_vii=function(){return(ur=f.dynCall_vii=f.asm.Lb).apply(null,arguments)},fr=f.dynCall_viiiii=function(){return(fr=f.dynCall_viiiii=f.asm.Mb).apply(null,arguments)},cr=f.dynCall_iii=function(){return(cr=f.dynCall_iii=f.asm.Nb).apply(null,arguments)},He=f.dynCall_iiiii=function(){return(He=f.dynCall_iiiii=f.asm.Ob).apply(null,arguments)},xe=f.dynCall_iiiiiii=function(){return(xe=f.dynCall_iiiiiii=f.asm.Pb).apply(null,arguments)},lr=f.dynCall_iiiiii=function(){return(lr=f.dynCall_iiiiii=f.asm.Qb).apply(null,arguments)},kt=f.dynCall_i=function(){return(kt=f.dynCall_i=f.asm.Rb).apply(null,arguments)},Bt=f.dynCall_viii=function(){return(Bt=f.dynCall_viii=f.asm.Sb).apply(null,arguments)},xt=f.dynCall_viiii=function(){return(xt=f.dynCall_viiii=f.asm.Tb).apply(null,arguments)},zt=f.dynCall_v=function(){return(zt=f.dynCall_v=f.asm.Ub).apply(null,arguments)},Ht=f.dynCall_iiiiiiiiii=function(){return(Ht=f.dynCall_iiiiiiiiii=f.asm.Vb).apply(null,arguments)},Wt=f.dynCall_viiiiiiiii=function(){return(Wt=f.dynCall_viiiiiiiii=f.asm.Wb).apply(null,arguments)},Yt=f.dynCall_viiiiii=function(){return(Yt=f.dynCall_viiiiii=f.asm.Xb).apply(null,arguments)},jt=f.dynCall_iiiiiiii=function(){return(jt=f.dynCall_iiiiiiii=f.asm.Yb).apply(null,arguments)},fn=f.dynCall_viidii=function(){return(fn=f.dynCall_viidii=f.asm.Zb).apply(null,arguments)};function Nn(n,r,e,o,t,a,s){var l=De();try{return xe(n,r,e,o,t,a,s)}catch(h){if(ye(l),h!==h+0)throw h;Te(1,0)}}function Tn(n,r){var e=De();try{Ye(n,r)}catch(o){if(ye(e),o!==o+0)throw o;Te(1,0)}}function In(n,r,e){var o=De();try{ur(n,r,e)}catch(t){if(ye(o),t!==t+0)throw t;Te(1,0)}}function Bn(n){var r=De();try{return kt(n)}catch(e){if(ye(r),e!==e+0)throw e;Te(1,0)}}function li(n){var r=De();try{zt(n)}catch(e){if(ye(r),e!==e+0)throw e;Te(1,0)}}function di(n,r,e,o){var t=De();try{Bt(n,r,e,o)}catch(a){if(ye(t),a!==a+0)throw a;Te(1,0)}}function _i(n,r){var e=De();try{return Be(n,r)}catch(o){if(ye(e),o!==o+0)throw o;Te(1,0)}}function bn(n,r,e){var o=De();try{return cr(n,r,e)}catch(t){if(ye(o),t!==t+0)throw t;Te(1,0)}}function xn(n,r,e,o,t){var a=De();try{xt(n,r,e,o,t)}catch(s){if(ye(a),s!==s+0)throw s;Te(1,0)}}function g(n,r,e,o,t){var a=De();try{return He(n,r,e,o,t)}catch(s){if(ye(a),s!==s+0)throw s;Te(1,0)}}function k(n,r,e,o){var t=De();try{return vr(n,r,e,o)}catch(a){if(ye(t),a!==a+0)throw a;Te(1,0)}}function D(n,r,e,o,t,a,s){var l=De();try{Yt(n,r,e,o,t,a,s)}catch(h){if(ye(l),h!==h+0)throw h;Te(1,0)}}function _(n,r,e,o,t,a){var s=De();try{fr(n,r,e,o,t,a)}catch(l){if(ye(s),l!==l+0)throw l;Te(1,0)}}function u(n,r,e,o,t,a){var s=De();try{fn(n,r,e,o,t,a)}catch(l){if(ye(s),l!==l+0)throw l;Te(1,0)}}function c(n,r,e,o,t,a,s,l,h,w){var S=De();try{return Ht(n,r,e,o,t,a,s,l,h,w)}catch(O){if(ye(S),O!==O+0)throw O;Te(1,0)}}function m(n,r,e,o,t,a){var s=De();try{return lr(n,r,e,o,t,a)}catch(l){if(ye(s),l!==l+0)throw l;Te(1,0)}}function y(n,r,e,o,t,a,s,l,h,w){var S=De();try{Wt(n,r,e,o,t,a,s,l,h,w)}catch(O){if(ye(S),O!==O+0)throw O;Te(1,0)}}function b(n,r,e,o,t,a,s,l){var h=De();try{return jt(n,r,e,o,t,a,s,l)}catch(w){if(ye(h),w!==w+0)throw w;Te(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,f.FS_unlink=i.unlink,f.ccall=Jt,f.FS=i;var d;$e=function n(){d||p(),d||($e=n)};function p(n){if(n=n||$,Pe>0||(Vn(),Pe>0))return;function r(){d||(d=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),r()},1)):r()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return p(),A}var Wf,iu,su=Oi(()=>{"use strict";Wf=10646604,iu=__dirname+"/php_7_2.wasm"});var fu={};gi(fu,{default:()=>qf,dependenciesTotalSize:()=>jf,dependencyFilename:()=>uu});function qf(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(d,p)=>{throw p},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(d){return f.locateFile?f.locateFile(d,ve):ve+d}var We,ar,Re;function Wr(d){if(d instanceof Ur)return;fe("exiting due to exception: "+d)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(d,p)=>(yr(),d=Me.normalize(d),J.readFileSync(d,p?void 0:"utf8")),Re=d=>{var p=We(d,!0);return p.buffer||(p=new Uint8Array(p)),p},ar=(d,p,n)=>{yr(),d=Me.normalize(d),J.readFile(d,function(r,e){r?n(r):p(e.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(d){if(!(d instanceof Ur))throw d}),process.on("unhandledRejection",function(d){throw d}),_e=(d,p)=>{if(Mr())throw process.exitCode=d,p;Wr(p),process.exit(d)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(d,p){d||me(p)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(d,p,n){for(var r=p+n,e=p;d[e]&&!(e>=r);)++e;if(e-p>16&&d.buffer&&ct)return ct.decode(d.subarray(p,e));for(var o="";p<e;){var t=d[p++];if(!(t&128)){o+=String.fromCharCode(t);continue}var a=d[p++]&63;if((t&224)==192){o+=String.fromCharCode((t&31)<<6|a);continue}var s=d[p++]&63;if((t&240)==224?t=(t&15)<<12|a<<6|s:t=(t&7)<<18|a<<12|s<<6|d[p++]&63,t<65536)o+=String.fromCharCode(t);else{var l=t-65536;o+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return o}function ne(d,p){return d?ze(le,d,p):""}function Ze(d,p,n,r){if(!(r>0))return 0;for(var e=n,o=n+r-1,t=0;t<d.length;++t){var a=d.charCodeAt(t);if(a>=55296&&a<=57343){var s=d.charCodeAt(++t);a=65536+((a&1023)<<10)|s&1023}if(a<=127){if(n>=o)break;p[n++]=a}else if(a<=2047){if(n+1>=o)break;p[n++]=192|a>>6,p[n++]=128|a&63}else if(a<=65535){if(n+2>=o)break;p[n++]=224|a>>12,p[n++]=128|a>>6&63,p[n++]=128|a&63}else{if(n+3>=o)break;p[n++]=240|a>>18,p[n++]=128|a>>12&63,p[n++]=128|a>>6&63,p[n++]=128|a&63}}return p[n]=0,n-e}function Fe(d,p,n){return Ze(d,le,p,n)}function Ce(d){for(var p=0,n=0;n<d.length;++n){var r=d.charCodeAt(n);r<=127?p++:r<=2047?p+=2:r>=55296&&r<=57343?(p+=4,++n):p+=3}return p}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(d){Rr=d,f.HEAP8=ee=new Int8Array(d),f.HEAP16=we=new Int16Array(d),f.HEAP32=E=new Int32Array(d),f.HEAPU8=le=new Uint8Array(d),f.HEAPU16=lt=new Uint16Array(d),f.HEAPU32=j=new Uint32Array(d),f.HEAPF32=Hn=new Float32Array(d),f.HEAPF64=dt=new Float64Array(d)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!i.init.initialized&&i.init(),i.ignorePermissions=!1,ge.init(),H.root=i.mount(H,{},null),ae.root=i.mount(ae,{},null),_r(vt)}function Kn(){Sr(),_r(Wn),i.quit(),ge.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(d){mt.unshift(d)}function $n(d){vt.unshift(d)}function Jn(d){pt.unshift(d)}var Pe=0,Lr=null,$e=null;function Ci(d){return d}function dr(d){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(d){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var p=$e;$e=null,p()}}function me(d){f.onAbort&&f.onAbort(d),d="Aborted("+d+")",fe(d),Tr=!0,Pr=1,d+=". Build with -sASSERTIONS for more info.";var p=new WebAssembly.RuntimeError(d);throw p}var Qn="data:application/octet-stream;base64,";function ht(d){return d.startsWith(Qn)}var de;de=uu,ht(de)||(de=Nr(de));function yt(d){try{if(d==de&&qe)return new Uint8Array(qe);if(Re)return Re(d);throw"both async and sync fetching of the wasm failed"}catch(p){me(p)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(d){if(!d.ok)throw"failed to load wasm binary file at '"+de+"'";return d.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var d={a:En};function p(t,a){var s=t.exports;f.asm=s,ir=f.asm.Sa,_t(ir.buffer),ln=f.asm.cb,$n(f.asm.Ta),Je("wasm-instantiate")}dr("wasm-instantiate");function n(t){p(t.instance)}function r(t){return eo().then(function(a){return WebAssembly.instantiate(a,d)}).then(function(a){return a}).then(t,function(a){fe("failed to asynchronously prepare wasm: "+a),me(a)})}function e(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(t){var a=WebAssembly.instantiateStreaming(t,d);return a.then(n,function(s){return fe("wasm streaming compile failed: "+s),fe("falling back to ArrayBuffer instantiation"),r(n)})}):r(n)}if(f.instantiateWasm)try{var o=f.instantiateWasm(d,p);return o}catch(t){return fe("Module.instantiateWasm callback failed with error: "+t),!1}return e(),{}}var U,Z;function Ur(d){this.name="ExitStatus",this.message="Program terminated with exit("+d+")",this.status=d}function _r(d){for(;d.length>0;)d.shift()(f)}function Et(d,p){ee.set(d,p)}function to(d,p,n,r){me("Assertion failed: "+ne(d)+", at: "+[p?ne(p):"unknown filename",n,r?ne(r):"unknown function"])}function wt(d,p){(function(n){Be.apply(null,[d,n])})(p)}var Y={isAbs:d=>d.charAt(0)==="/",splitPath:d=>{var p=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return p.exec(d).slice(1)},normalizeArray:(d,p)=>{for(var n=0,r=d.length-1;r>=0;r--){var e=d[r];e==="."?d.splice(r,1):e===".."?(d.splice(r,1),n++):n&&(d.splice(r,1),n--)}if(p)for(;n;n--)d.unshift("..");return d},normalize:d=>{var p=Y.isAbs(d),n=d.substr(-1)==="/";return d=Y.normalizeArray(d.split("/").filter(r=>!!r),!p).join("/"),!d&&!p&&(d="."),d&&n&&(d+="/"),(p?"/":"")+d},dirname:d=>{var p=Y.splitPath(d),n=p[0],r=p[1];return!n&&!r?".":(r&&(r=r.substr(0,r.length-1)),n+r)},basename:d=>{if(d==="/")return"/";d=Y.normalize(d),d=d.replace(/\/$/,"");var p=d.lastIndexOf("/");return p===-1?d:d.substr(p+1)},join:function(){var d=Array.prototype.slice.call(arguments);return Y.normalize(d.join("/"))},join2:(d,p)=>Y.normalize(d+"/"+p)};function no(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var d=new Uint8Array(1);return()=>(crypto.getRandomValues(d),d[0])}else if(te)try{var p=require("crypto");return()=>p.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var Q={resolve:function(){for(var d="",p=!1,n=arguments.length-1;n>=-1&&!p;n--){var r=n>=0?arguments[n]:i.cwd();if(typeof r!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";d=r+"/"+d,p=Y.isAbs(r)}return d=Y.normalizeArray(d.split("/").filter(e=>!!e),!p).join("/"),(p?"/":"")+d||"."},relative:(d,p)=>{d=Q.resolve(d).substr(1),p=Q.resolve(p).substr(1);function n(l){for(var h=0;h<l.length&&l[h]==="";h++);for(var w=l.length-1;w>=0&&l[w]==="";w--);return h>w?[]:l.slice(h,w-h+1)}for(var r=n(d.split("/")),e=n(p.split("/")),o=Math.min(r.length,e.length),t=o,a=0;a<o;a++)if(r[a]!==e[a]){t=a;break}for(var s=[],a=t;a<r.length;a++)s.push("..");return s=s.concat(e.slice(t)),s.join("/")}};function Er(d,p,n){var r=n>0?n:Ce(d)+1,e=new Array(r),o=Ze(d,e,0,e.length);return p&&(e.length=o),e}var ge={ttys:[],init:function(){},shutdown:function(){},register:function(d,p){ge.ttys[d]={input:[],output:[],ops:p},i.registerDevice(d,ge.stream_ops)},stream_ops:{open:function(d){var p=ge.ttys[d.node.rdev];if(!p)throw new i.ErrnoError(43);d.tty=p,d.seekable=!1},close:function(d){d.tty.ops.fsync(d.tty)},fsync:function(d){d.tty.ops.fsync(d.tty)},read:function(d,p,n,r,e){if(!d.tty||!d.tty.ops.get_char)throw new i.ErrnoError(60);for(var o=0,t=0;t<r;t++){var a;try{a=d.tty.ops.get_char(d.tty)}catch{throw new i.ErrnoError(29)}if(a===void 0&&o===0)throw new i.ErrnoError(6);if(a==null)break;o++,p[n+t]=a}return o&&(d.node.timestamp=Date.now()),o},write:function(d,p,n,r,e){if(!d.tty||!d.tty.ops.put_char)throw new i.ErrnoError(60);try{for(var o=0;o<r;o++)d.tty.ops.put_char(d.tty,p[n+o])}catch{throw new i.ErrnoError(29)}return r&&(d.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:function(d){if(!d.input.length){var p=null;if(te){var n=256,r=Buffer.alloc(n),e=0;try{e=J.readSync(process.stdin.fd,r,0,n,-1)}catch(o){if(o.toString().includes("EOF"))e=0;else throw o}e>0?p=r.slice(0,e).toString("utf-8"):p=null}else typeof window<"u"&&typeof window.prompt=="function"?(p=window.prompt("Input: "),p!==null&&(p+=`
26
+ `)):typeof readline=="function"&&(p=readline(),p!==null&&(p+=`
27
+ `));if(!p)return null;d.input=Er(p,!0)}return d.input.shift()},put_char:function(d,p){p===null||p===10?(er(ze(d.output,0)),d.output=[]):p!=0&&d.output.push(p)},fsync:function(d){d.output&&d.output.length>0&&(er(ze(d.output,0)),d.output=[])}},default_tty1_ops:{put_char:function(d,p){p===null||p===10?(fe(ze(d.output,0)),d.output=[]):p!=0&&d.output.push(p)},fsync:function(d){d.output&&d.output.length>0&&(fe(ze(d.output,0)),d.output=[])}}};function wr(d,p){return le.fill(0,d,d+p),d}function gr(d,p){return Math.ceil(d/p)*p}function Ir(d){d=gr(d,65536);var p=br(65536,d);return p?wr(p,d):0}var G={ops_table:null,mount:function(d){return G.createNode(null,"/",16895,0)},createNode:function(d,p,n,r){if(i.isBlkdev(n)||i.isFIFO(n))throw new i.ErrnoError(63);G.ops_table||(G.ops_table={dir:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,lookup:G.node_ops.lookup,mknod:G.node_ops.mknod,rename:G.node_ops.rename,unlink:G.node_ops.unlink,rmdir:G.node_ops.rmdir,readdir:G.node_ops.readdir,symlink:G.node_ops.symlink},stream:{llseek:G.stream_ops.llseek}},file:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:{llseek:G.stream_ops.llseek,read:G.stream_ops.read,write:G.stream_ops.write,allocate:G.stream_ops.allocate,mmap:G.stream_ops.mmap,msync:G.stream_ops.msync}},link:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,readlink:G.node_ops.readlink},stream:{}},chrdev:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:i.chrdev_stream_ops}});var e=i.createNode(d,p,n,r);return i.isDir(e.mode)?(e.node_ops=G.ops_table.dir.node,e.stream_ops=G.ops_table.dir.stream,e.contents={}):i.isFile(e.mode)?(e.node_ops=G.ops_table.file.node,e.stream_ops=G.ops_table.file.stream,e.usedBytes=0,e.contents=null):i.isLink(e.mode)?(e.node_ops=G.ops_table.link.node,e.stream_ops=G.ops_table.link.stream):i.isChrdev(e.mode)&&(e.node_ops=G.ops_table.chrdev.node,e.stream_ops=G.ops_table.chrdev.stream),e.timestamp=Date.now(),d&&(d.contents[p]=e,d.timestamp=e.timestamp),e},getFileDataAsTypedArray:function(d){return d.contents?d.contents.subarray?d.contents.subarray(0,d.usedBytes):new Uint8Array(d.contents):new Uint8Array(0)},expandFileStorage:function(d,p){var n=d.contents?d.contents.length:0;if(!(n>=p)){var r=1024*1024;p=Math.max(p,n*(n<r?2:1.125)>>>0),n!=0&&(p=Math.max(p,256));var e=d.contents;d.contents=new Uint8Array(p),d.usedBytes>0&&d.contents.set(e.subarray(0,d.usedBytes),0)}},resizeFileStorage:function(d,p){if(d.usedBytes!=p)if(p==0)d.contents=null,d.usedBytes=0;else{var n=d.contents;d.contents=new Uint8Array(p),n&&d.contents.set(n.subarray(0,Math.min(p,d.usedBytes))),d.usedBytes=p}},node_ops:{getattr:function(d){var p={};return p.dev=i.isChrdev(d.mode)?d.id:1,p.ino=d.id,p.mode=d.mode,p.nlink=1,p.uid=0,p.gid=0,p.rdev=d.rdev,i.isDir(d.mode)?p.size=4096:i.isFile(d.mode)?p.size=d.usedBytes:i.isLink(d.mode)?p.size=d.link.length:p.size=0,p.atime=new Date(d.timestamp),p.mtime=new Date(d.timestamp),p.ctime=new Date(d.timestamp),p.blksize=4096,p.blocks=Math.ceil(p.size/p.blksize),p},setattr:function(d,p){p.mode!==void 0&&(d.mode=p.mode),p.timestamp!==void 0&&(d.timestamp=p.timestamp),p.size!==void 0&&G.resizeFileStorage(d,p.size)},lookup:function(d,p){throw i.genericErrors[44]},mknod:function(d,p,n,r){return G.createNode(d,p,n,r)},rename:function(d,p,n){if(i.isDir(d.mode)){var r;try{r=i.lookupNode(p,n)}catch{}if(r)for(var e in r.contents)throw new i.ErrnoError(55)}delete d.parent.contents[d.name],d.parent.timestamp=Date.now(),d.name=n,p.contents[n]=d,p.timestamp=d.parent.timestamp,d.parent=p},unlink:function(d,p){delete d.contents[p],d.timestamp=Date.now()},rmdir:function(d,p){var n=i.lookupNode(d,p);for(var r in n.contents)throw new i.ErrnoError(55);delete d.contents[p],d.timestamp=Date.now()},readdir:function(d){var p=[".",".."];for(var n in d.contents)d.contents.hasOwnProperty(n)&&p.push(n);return p},symlink:function(d,p,n){var r=G.createNode(d,p,41471,0);return r.link=n,r},readlink:function(d){if(!i.isLink(d.mode))throw new i.ErrnoError(28);return d.link}},stream_ops:{read:function(d,p,n,r,e){var o=d.node.contents;if(e>=d.node.usedBytes)return 0;var t=Math.min(d.node.usedBytes-e,r);if(t>8&&o.subarray)p.set(o.subarray(e,e+t),n);else for(var a=0;a<t;a++)p[n+a]=o[e+a];return t},write:function(d,p,n,r,e,o){if(p.buffer===ee.buffer&&(o=!1),!r)return 0;var t=d.node;if(t.timestamp=Date.now(),p.subarray&&(!t.contents||t.contents.subarray)){if(o)return t.contents=p.subarray(n,n+r),t.usedBytes=r,r;if(t.usedBytes===0&&e===0)return t.contents=p.slice(n,n+r),t.usedBytes=r,r;if(e+r<=t.usedBytes)return t.contents.set(p.subarray(n,n+r),e),r}if(G.expandFileStorage(t,e+r),t.contents.subarray&&p.subarray)t.contents.set(p.subarray(n,n+r),e);else for(var a=0;a<r;a++)t.contents[e+a]=p[n+a];return t.usedBytes=Math.max(t.usedBytes,e+r),r},llseek:function(d,p,n){var r=p;if(n===1?r+=d.position:n===2&&i.isFile(d.node.mode)&&(r+=d.node.usedBytes),r<0)throw new i.ErrnoError(28);return r},allocate:function(d,p,n){G.expandFileStorage(d.node,p+n),d.node.usedBytes=Math.max(d.node.usedBytes,p+n)},mmap:function(d,p,n,r,e){if(!i.isFile(d.node.mode))throw new i.ErrnoError(43);var o,t,a=d.node.contents;if(!(e&2)&&a.buffer===Rr)t=!1,o=a.byteOffset;else{if((n>0||n+p<a.length)&&(a.subarray?a=a.subarray(n,n+p):a=Array.prototype.slice.call(a,n,n+p)),t=!0,o=Ir(p),!o)throw new i.ErrnoError(48);ee.set(a,o)}return{ptr:o,allocated:t}},msync:function(d,p,n,r,e){return G.stream_ops.write(d,p,0,r,n,!1),0}}};function Ct(d,p,n,r){var e=r?"":"al "+d;ar(d,o=>{Le(o,'Loading data file "'+d+'" failed (no arrayBuffer).'),p(new Uint8Array(o)),e&&Je(e)},o=>{if(n)n();else throw'Loading data file "'+d+'" failed.'}),e&&dr(e)}var re={},V={isWindows:!1,staticInit:()=>{V.isWindows=!!process.platform.match(/^win/);var d=process.binding("constants");d.fs&&(d=d.fs),V.flagsForNodeMap={1024:d.O_APPEND,64:d.O_CREAT,128:d.O_EXCL,256:d.O_NOCTTY,0:d.O_RDONLY,2:d.O_RDWR,4096:d.O_SYNC,512:d.O_TRUNC,1:d.O_WRONLY,131072:d.O_NOFOLLOW}},convertNodeCode:d=>{var p=d.code;return re[p]},mount:d=>V.createNode(null,"/",V.getMode(d.opts.root),0),createNode:(d,p,n,r)=>{if(!i.isDir(n)&&!i.isFile(n)&&!i.isLink(n))throw new i.ErrnoError(28);var e=i.createNode(d,p,n);return e.node_ops=V.node_ops,e.stream_ops=V.stream_ops,e},getMode:d=>{var p;try{p=J.lstatSync(d),V.isWindows&&(p.mode=p.mode|(p.mode&292)>>2)}catch(n){throw n.code?new i.ErrnoError(V.convertNodeCode(n)):n}return p.mode},realPath:d=>{for(var p=[];d.parent!==d;)p.push(d.name),d=d.parent;return p.push(d.mount.opts.root),p.reverse(),Y.join.apply(null,p)},flagsForNode:d=>{d&=-2097153,d&=-2049,d&=-32769,d&=-524289,d&=-65537;var p=0;for(var n in V.flagsForNodeMap)d&n&&(p|=V.flagsForNodeMap[n],d^=n);if(d)throw new i.ErrnoError(28);return p},node_ops:{getattr:d=>{var p=V.realPath(d),n;try{n=J.lstatSync(p)}catch(r){throw r.code?new i.ErrnoError(V.convertNodeCode(r)):r}return V.isWindows&&!n.blksize&&(n.blksize=4096),V.isWindows&&!n.blocks&&(n.blocks=(n.size+n.blksize-1)/n.blksize|0),{dev:n.dev,ino:n.ino,mode:n.mode,nlink:n.nlink,uid:n.uid,gid:n.gid,rdev:n.rdev,size:n.size,atime:n.atime,mtime:n.mtime,ctime:n.ctime,blksize:n.blksize,blocks:n.blocks}},setattr:(d,p)=>{var n=V.realPath(d);try{if(p.mode!==void 0&&(J.chmodSync(n,p.mode),d.mode=p.mode),p.timestamp!==void 0){var r=new Date(p.timestamp);J.utimesSync(n,r,r)}p.size!==void 0&&J.truncateSync(n,p.size)}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}},lookup:(d,p)=>{var n=Y.join2(V.realPath(d),p),r=V.getMode(n);return V.createNode(d,p,r)},mknod:(d,p,n,r)=>{var e=V.createNode(d,p,n,r),o=V.realPath(e);try{i.isDir(e.mode)?J.mkdirSync(o,e.mode):J.writeFileSync(o,"",{mode:e.mode})}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}return e},rename:(d,p,n)=>{var r=V.realPath(d),e=Y.join2(V.realPath(p),n);try{J.renameSync(r,e)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}d.name=n},unlink:(d,p)=>{var n=Y.join2(V.realPath(d),p);try{J.unlinkSync(n)}catch(r){throw r.code?new i.ErrnoError(V.convertNodeCode(r)):r}},rmdir:(d,p)=>{var n=Y.join2(V.realPath(d),p);try{J.rmdirSync(n)}catch(r){throw r.code?new i.ErrnoError(V.convertNodeCode(r)):r}},readdir:d=>{var p=V.realPath(d);try{return J.readdirSync(p)}catch(n){throw n.code?new i.ErrnoError(V.convertNodeCode(n)):n}},symlink:(d,p,n)=>{var r=Y.join2(V.realPath(d),p);try{J.symlinkSync(n,r)}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}},readlink:d=>{var p=V.realPath(d);try{return p=J.readlinkSync(p),p=Me.relative(Me.resolve(d.mount.opts.root),p),p}catch(n){throw n.code?n.code==="UNKNOWN"?new i.ErrnoError(28):new i.ErrnoError(V.convertNodeCode(n)):n}}},stream_ops:{open:d=>{var p=V.realPath(d.node);try{i.isFile(d.node.mode)&&(d.nfd=J.openSync(p,V.flagsForNode(d.flags)))}catch(n){throw n.code?new i.ErrnoError(V.convertNodeCode(n)):n}},close:d=>{try{i.isFile(d.node.mode)&&d.nfd&&J.closeSync(d.nfd)}catch(p){throw p.code?new i.ErrnoError(V.convertNodeCode(p)):p}},read:(d,p,n,r,e)=>{if(r===0)return 0;try{return J.readSync(d.nfd,Buffer.from(p.buffer),n,r,e)}catch(o){throw new i.ErrnoError(V.convertNodeCode(o))}},write:(d,p,n,r,e)=>{try{return J.writeSync(d.nfd,Buffer.from(p.buffer),n,r,e)}catch(o){throw new i.ErrnoError(V.convertNodeCode(o))}},llseek:(d,p,n)=>{var r=p;if(n===1)r+=d.position;else if(n===2&&i.isFile(d.node.mode))try{var e=J.fstatSync(d.nfd);r+=e.size}catch(o){throw new i.ErrnoError(V.convertNodeCode(o))}if(r<0)throw new i.ErrnoError(28);return r},mmap:(d,p,n,r,e)=>{if(!i.isFile(d.node.mode))throw new i.ErrnoError(43);var o=Ir(p);return V.stream_ops.read(d,ee,o,p,n),{ptr:o,allocated:!0}},msync:(d,p,n,r,e)=>(V.stream_ops.write(d,p,0,r,n,!1),0)}},i={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(d,p={})=>{if(d=Q.resolve(i.cwd(),d),!d)return{path:"",node:null};var n={follow_mount:!0,recurse_count:0};if(p=Object.assign(n,p),p.recurse_count>8)throw new i.ErrnoError(32);for(var r=Y.normalizeArray(d.split("/").filter(w=>!!w),!1),e=i.root,o="/",t=0;t<r.length;t++){var a=t===r.length-1;if(a&&p.parent)break;if(e=i.lookupNode(e,r[t]),o=Y.join2(o,r[t]),i.isMountpoint(e)&&(!a||a&&p.follow_mount)&&(e=e.mounted.root),!a||p.follow)for(var s=0;i.isLink(e.mode);){var l=i.readlink(o);o=Q.resolve(Y.dirname(o),l);var h=i.lookupPath(o,{recurse_count:p.recurse_count+1});if(e=h.node,s++>40)throw new i.ErrnoError(32)}}return{path:o,node:e}},getPath:d=>{for(var p;;){if(i.isRoot(d)){var n=d.mount.mountpoint;return p?n[n.length-1]!=="/"?n+"/"+p:n+p:n}p=p?d.name+"/"+p:d.name,d=d.parent}},hashName:(d,p)=>{for(var n=0,r=0;r<p.length;r++)n=(n<<5)-n+p.charCodeAt(r)|0;return(d+n>>>0)%i.nameTable.length},hashAddNode:d=>{var p=i.hashName(d.parent.id,d.name);d.name_next=i.nameTable[p],i.nameTable[p]=d},hashRemoveNode:d=>{var p=i.hashName(d.parent.id,d.name);if(i.nameTable[p]===d)i.nameTable[p]=d.name_next;else for(var n=i.nameTable[p];n;){if(n.name_next===d){n.name_next=d.name_next;break}n=n.name_next}},lookupNode:(d,p)=>{var n=i.mayLookup(d);if(n)throw new i.ErrnoError(n,d);for(var r=i.hashName(d.id,p),e=i.nameTable[r];e;e=e.name_next){var o=e.name;if(e.parent.id===d.id&&o===p)return e}return i.lookup(d,p)},createNode:(d,p,n,r)=>{var e=new i.FSNode(d,p,n,r);return i.hashAddNode(e),e},destroyNode:d=>{i.hashRemoveNode(d)},isRoot:d=>d===d.parent,isMountpoint:d=>!!d.mounted,isFile:d=>(d&61440)===32768,isDir:d=>(d&61440)===16384,isLink:d=>(d&61440)===40960,isChrdev:d=>(d&61440)===8192,isBlkdev:d=>(d&61440)===24576,isFIFO:d=>(d&61440)===4096,isSocket:d=>(d&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:d=>{var p=i.flagModes[d];if(typeof p>"u")throw new Error("Unknown file open mode: "+d);return p},flagsToPermissionString:d=>{var p=["r","w","rw"][d&3];return d&512&&(p+="w"),p},nodePermissions:(d,p)=>i.ignorePermissions?0:p.includes("r")&&!(d.mode&292)||p.includes("w")&&!(d.mode&146)||p.includes("x")&&!(d.mode&73)?2:0,mayLookup:d=>{var p=i.nodePermissions(d,"x");return p||(d.node_ops.lookup?0:2)},mayCreate:(d,p)=>{try{var n=i.lookupNode(d,p);return 20}catch{}return i.nodePermissions(d,"wx")},mayDelete:(d,p,n)=>{var r;try{r=i.lookupNode(d,p)}catch(o){return o.errno}var e=i.nodePermissions(d,"wx");if(e)return e;if(n){if(!i.isDir(r.mode))return 54;if(i.isRoot(r)||i.getPath(r)===i.cwd())return 10}else if(i.isDir(r.mode))return 31;return 0},mayOpen:(d,p)=>d?i.isLink(d.mode)?32:i.isDir(d.mode)&&(i.flagsToPermissionString(p)!=="r"||p&512)?31:i.nodePermissions(d,i.flagsToPermissionString(p)):44,MAX_OPEN_FDS:4096,nextfd:(d=0,p=i.MAX_OPEN_FDS)=>{for(var n=d;n<=p;n++)if(!i.streams[n])return n;throw new i.ErrnoError(33)},getStream:d=>i.streams[d],createStream:(d,p,n)=>{i.FSStream||(i.FSStream=function(){this.shared={}},i.FSStream.prototype={},Object.defineProperties(i.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),d=Object.assign(new i.FSStream,d);var r=i.nextfd(p,n);return d.fd=r,i.streams[r]=d,d},closeStream:d=>{i.streams[d]=null},chrdev_stream_ops:{open:d=>{var p=i.getDevice(d.node.rdev);d.stream_ops=p.stream_ops,d.stream_ops.open&&d.stream_ops.open(d)},llseek:()=>{throw new i.ErrnoError(70)}},major:d=>d>>8,minor:d=>d&255,makedev:(d,p)=>d<<8|p,registerDevice:(d,p)=>{i.devices[d]={stream_ops:p}},getDevice:d=>i.devices[d],getMounts:d=>{for(var p=[],n=[d];n.length;){var r=n.pop();p.push(r),n.push.apply(n,r.mounts)}return p},syncfs:(d,p)=>{typeof d=="function"&&(p=d,d=!1),i.syncFSRequests++,i.syncFSRequests>1&&fe("warning: "+i.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=i.getMounts(i.root.mount),r=0;function e(t){return i.syncFSRequests--,p(t)}function o(t){if(t)return o.errored?void 0:(o.errored=!0,e(t));++r>=n.length&&e(null)}n.forEach(t=>{if(!t.type.syncfs)return o(null);t.type.syncfs(t,d,o)})},mount:(d,p,n)=>{var r=n==="/",e=!n,o;if(r&&i.root)throw new i.ErrnoError(10);if(!r&&!e){var t=i.lookupPath(n,{follow_mount:!1});if(n=t.path,o=t.node,i.isMountpoint(o))throw new i.ErrnoError(10);if(!i.isDir(o.mode))throw new i.ErrnoError(54)}var a={type:d,opts:p,mountpoint:n,mounts:[]},s=d.mount(a);return s.mount=a,a.root=s,r?i.root=s:o&&(o.mounted=a,o.mount&&o.mount.mounts.push(a)),s},unmount:d=>{var p=i.lookupPath(d,{follow_mount:!1});if(!i.isMountpoint(p.node))throw new i.ErrnoError(28);var n=p.node,r=n.mounted,e=i.getMounts(r);Object.keys(i.nameTable).forEach(t=>{for(var a=i.nameTable[t];a;){var s=a.name_next;e.includes(a.mount)&&i.destroyNode(a),a=s}}),n.mounted=null;var o=n.mount.mounts.indexOf(r);n.mount.mounts.splice(o,1)},lookup:(d,p)=>d.node_ops.lookup(d,p),mknod:(d,p,n)=>{var r=i.lookupPath(d,{parent:!0}),e=r.node,o=Y.basename(d);if(!o||o==="."||o==="..")throw new i.ErrnoError(28);var t=i.mayCreate(e,o);if(t)throw new i.ErrnoError(t);if(!e.node_ops.mknod)throw new i.ErrnoError(63);return e.node_ops.mknod(e,o,p,n)},create:(d,p)=>(p=p!==void 0?p:438,p&=4095,p|=32768,i.mknod(d,p,0)),mkdir:(d,p)=>(p=p!==void 0?p:511,p&=1023,p|=16384,i.mknod(d,p,0)),mkdirTree:(d,p)=>{for(var n=d.split("/"),r="",e=0;e<n.length;++e)if(n[e]){r+="/"+n[e];try{i.mkdir(r,p)}catch(o){if(o.errno!=20)throw o}}},mkdev:(d,p,n)=>(typeof n>"u"&&(n=p,p=438),p|=8192,i.mknod(d,p,n)),symlink:(d,p)=>{if(!Q.resolve(d))throw new i.ErrnoError(44);var n=i.lookupPath(p,{parent:!0}),r=n.node;if(!r)throw new i.ErrnoError(44);var e=Y.basename(p),o=i.mayCreate(r,e);if(o)throw new i.ErrnoError(o);if(!r.node_ops.symlink)throw new i.ErrnoError(63);return r.node_ops.symlink(r,e,d)},rename:(d,p)=>{var n=Y.dirname(d),r=Y.dirname(p),e=Y.basename(d),o=Y.basename(p),t,a,s;if(t=i.lookupPath(d,{parent:!0}),a=t.node,t=i.lookupPath(p,{parent:!0}),s=t.node,!a||!s)throw new i.ErrnoError(44);if(a.mount!==s.mount)throw new i.ErrnoError(75);var l=i.lookupNode(a,e),h=Q.relative(d,r);if(h.charAt(0)!==".")throw new i.ErrnoError(28);if(h=Q.relative(p,n),h.charAt(0)!==".")throw new i.ErrnoError(55);var w;try{w=i.lookupNode(s,o)}catch{}if(l!==w){var S=i.isDir(l.mode),O=i.mayDelete(a,e,S);if(O)throw new i.ErrnoError(O);if(O=w?i.mayDelete(s,o,S):i.mayCreate(s,o),O)throw new i.ErrnoError(O);if(!a.node_ops.rename)throw new i.ErrnoError(63);if(i.isMountpoint(l)||w&&i.isMountpoint(w))throw new i.ErrnoError(10);if(s!==a&&(O=i.nodePermissions(a,"w"),O))throw new i.ErrnoError(O);i.hashRemoveNode(l);try{a.node_ops.rename(l,s,o)}catch(N){throw N}finally{i.hashAddNode(l)}}},rmdir:d=>{var p=i.lookupPath(d,{parent:!0}),n=p.node,r=Y.basename(d),e=i.lookupNode(n,r),o=i.mayDelete(n,r,!0);if(o)throw new i.ErrnoError(o);if(!n.node_ops.rmdir)throw new i.ErrnoError(63);if(i.isMountpoint(e))throw new i.ErrnoError(10);n.node_ops.rmdir(n,r),i.destroyNode(e)},readdir:d=>{var p=i.lookupPath(d,{follow:!0}),n=p.node;if(!n.node_ops.readdir)throw new i.ErrnoError(54);return n.node_ops.readdir(n)},unlink:d=>{var p=i.lookupPath(d,{parent:!0}),n=p.node;if(!n)throw new i.ErrnoError(44);var r=Y.basename(d),e=i.lookupNode(n,r),o=i.mayDelete(n,r,!1);if(o)throw new i.ErrnoError(o);if(!n.node_ops.unlink)throw new i.ErrnoError(63);if(i.isMountpoint(e))throw new i.ErrnoError(10);n.node_ops.unlink(n,r),i.destroyNode(e)},readlink:d=>{var p=i.lookupPath(d),n=p.node;if(!n)throw new i.ErrnoError(44);if(!n.node_ops.readlink)throw new i.ErrnoError(28);return Q.resolve(i.getPath(n.parent),n.node_ops.readlink(n))},stat:(d,p)=>{var n=i.lookupPath(d,{follow:!p}),r=n.node;if(!r)throw new i.ErrnoError(44);if(!r.node_ops.getattr)throw new i.ErrnoError(63);return r.node_ops.getattr(r)},lstat:d=>i.stat(d,!0),chmod:(d,p,n)=>{var r;if(typeof d=="string"){var e=i.lookupPath(d,{follow:!n});r=e.node}else r=d;if(!r.node_ops.setattr)throw new i.ErrnoError(63);r.node_ops.setattr(r,{mode:p&4095|r.mode&-4096,timestamp:Date.now()})},lchmod:(d,p)=>{i.chmod(d,p,!0)},fchmod:(d,p)=>{var n=i.getStream(d);if(!n)throw new i.ErrnoError(8);i.chmod(n.node,p)},chown:(d,p,n,r)=>{var e;if(typeof d=="string"){var o=i.lookupPath(d,{follow:!r});e=o.node}else e=d;if(!e.node_ops.setattr)throw new i.ErrnoError(63);e.node_ops.setattr(e,{timestamp:Date.now()})},lchown:(d,p,n)=>{i.chown(d,p,n,!0)},fchown:(d,p,n)=>{var r=i.getStream(d);if(!r)throw new i.ErrnoError(8);i.chown(r.node,p,n)},truncate:(d,p)=>{if(p<0)throw new i.ErrnoError(28);var n;if(typeof d=="string"){var r=i.lookupPath(d,{follow:!0});n=r.node}else n=d;if(!n.node_ops.setattr)throw new i.ErrnoError(63);if(i.isDir(n.mode))throw new i.ErrnoError(31);if(!i.isFile(n.mode))throw new i.ErrnoError(28);var e=i.nodePermissions(n,"w");if(e)throw new i.ErrnoError(e);n.node_ops.setattr(n,{size:p,timestamp:Date.now()})},ftruncate:(d,p)=>{var n=i.getStream(d);if(!n)throw new i.ErrnoError(8);if(!(n.flags&2097155))throw new i.ErrnoError(28);i.truncate(n.node,p)},utime:(d,p,n)=>{var r=i.lookupPath(d,{follow:!0}),e=r.node;e.node_ops.setattr(e,{timestamp:Math.max(p,n)})},open:(d,p,n)=>{if(d==="")throw new i.ErrnoError(44);p=typeof p=="string"?i.modeStringToFlags(p):p,n=typeof n>"u"?438:n,p&64?n=n&4095|32768:n=0;var r;if(typeof d=="object")r=d;else{d=Y.normalize(d);try{var e=i.lookupPath(d,{follow:!(p&131072)});r=e.node}catch{}}var o=!1;if(p&64)if(r){if(p&128)throw new i.ErrnoError(20)}else r=i.mknod(d,n,0),o=!0;if(!r)throw new i.ErrnoError(44);if(i.isChrdev(r.mode)&&(p&=-513),p&65536&&!i.isDir(r.mode))throw new i.ErrnoError(54);if(!o){var t=i.mayOpen(r,p);if(t)throw new i.ErrnoError(t)}p&512&&!o&&i.truncate(r,0),p&=-131713;var a=i.createStream({node:r,path:i.getPath(r),flags:p,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),f.logReadFiles&&!(p&1)&&(i.readFiles||(i.readFiles={}),d in i.readFiles||(i.readFiles[d]=1)),a},close:d=>{if(i.isClosed(d))throw new i.ErrnoError(8);d.getdents&&(d.getdents=null);try{d.stream_ops.close&&d.stream_ops.close(d)}catch(p){throw p}finally{i.closeStream(d.fd)}d.fd=null},isClosed:d=>d.fd===null,llseek:(d,p,n)=>{if(i.isClosed(d))throw new i.ErrnoError(8);if(!d.seekable||!d.stream_ops.llseek)throw new i.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new i.ErrnoError(28);return d.position=d.stream_ops.llseek(d,p,n),d.ungotten=[],d.position},read:(d,p,n,r,e)=>{if(r<0||e<0)throw new i.ErrnoError(28);if(i.isClosed(d))throw new i.ErrnoError(8);if((d.flags&2097155)===1)throw new i.ErrnoError(8);if(i.isDir(d.node.mode))throw new i.ErrnoError(31);if(!d.stream_ops.read)throw new i.ErrnoError(28);var o=typeof e<"u";if(!o)e=d.position;else if(!d.seekable)throw new i.ErrnoError(70);var t=d.stream_ops.read(d,p,n,r,e);return o||(d.position+=t),t},write:(d,p,n,r,e,o)=>{if(r<0||e<0)throw new i.ErrnoError(28);if(i.isClosed(d))throw new i.ErrnoError(8);if(!(d.flags&2097155))throw new i.ErrnoError(8);if(i.isDir(d.node.mode))throw new i.ErrnoError(31);if(!d.stream_ops.write)throw new i.ErrnoError(28);d.seekable&&d.flags&1024&&i.llseek(d,0,2);var t=typeof e<"u";if(!t)e=d.position;else if(!d.seekable)throw new i.ErrnoError(70);var a=d.stream_ops.write(d,p,n,r,e,o);return t||(d.position+=a),a},allocate:(d,p,n)=>{if(i.isClosed(d))throw new i.ErrnoError(8);if(p<0||n<=0)throw new i.ErrnoError(28);if(!(d.flags&2097155))throw new i.ErrnoError(8);if(!i.isFile(d.node.mode)&&!i.isDir(d.node.mode))throw new i.ErrnoError(43);if(!d.stream_ops.allocate)throw new i.ErrnoError(138);d.stream_ops.allocate(d,p,n)},mmap:(d,p,n,r,e)=>{if(r&2&&!(e&2)&&(d.flags&2097155)!==2)throw new i.ErrnoError(2);if((d.flags&2097155)===1)throw new i.ErrnoError(2);if(!d.stream_ops.mmap)throw new i.ErrnoError(43);return d.stream_ops.mmap(d,p,n,r,e)},msync:(d,p,n,r,e)=>d.stream_ops.msync?d.stream_ops.msync(d,p,n,r,e):0,munmap:d=>0,ioctl:(d,p,n)=>{if(!d.stream_ops.ioctl)throw new i.ErrnoError(59);return d.stream_ops.ioctl(d,p,n)},readFile:(d,p={})=>{if(p.flags=p.flags||0,p.encoding=p.encoding||"binary",p.encoding!=="utf8"&&p.encoding!=="binary")throw new Error('Invalid encoding type "'+p.encoding+'"');var n,r=i.open(d,p.flags),e=i.stat(d),o=e.size,t=new Uint8Array(o);return i.read(r,t,0,o,0),p.encoding==="utf8"?n=ze(t,0):p.encoding==="binary"&&(n=t),i.close(r),n},writeFile:(d,p,n={})=>{n.flags=n.flags||577;var r=i.open(d,n.flags,n.mode);if(typeof p=="string"){var e=new Uint8Array(Ce(p)+1),o=Ze(p,e,0,e.length);i.write(r,e,0,o,void 0,n.canOwn)}else if(ArrayBuffer.isView(p))i.write(r,p,0,p.byteLength,void 0,n.canOwn);else throw new Error("Unsupported data type");i.close(r)},cwd:()=>i.currentPath,chdir:d=>{var p=i.lookupPath(d,{follow:!0});if(p.node===null)throw new i.ErrnoError(44);if(!i.isDir(p.node.mode))throw new i.ErrnoError(54);var n=i.nodePermissions(p.node,"x");if(n)throw new i.ErrnoError(n);i.currentPath=p.path},createDefaultDirectories:()=>{i.mkdir("/tmp"),i.mkdir("/home"),i.mkdir("/home/web_user")},createDefaultDevices:()=>{i.mkdir("/dev"),i.registerDevice(i.makedev(1,3),{read:()=>0,write:(p,n,r,e,o)=>e}),i.mkdev("/dev/null",i.makedev(1,3)),ge.register(i.makedev(5,0),ge.default_tty_ops),ge.register(i.makedev(6,0),ge.default_tty1_ops),i.mkdev("/dev/tty",i.makedev(5,0)),i.mkdev("/dev/tty1",i.makedev(6,0));var d=no();i.createDevice("/dev","random",d),i.createDevice("/dev","urandom",d),i.mkdir("/dev/shm"),i.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{i.mkdir("/proc");var d=i.mkdir("/proc/self");i.mkdir("/proc/self/fd"),i.mount({mount:()=>{var p=i.createNode(d,"fd",16895,73);return p.node_ops={lookup:(n,r)=>{var e=+r,o=i.getStream(e);if(!o)throw new i.ErrnoError(8);var t={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return t.parent=t,t}},p}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?i.createDevice("/dev","stdin",f.stdin):i.symlink("/dev/tty","/dev/stdin"),f.stdout?i.createDevice("/dev","stdout",null,f.stdout):i.symlink("/dev/tty","/dev/stdout"),f.stderr?i.createDevice("/dev","stderr",null,f.stderr):i.symlink("/dev/tty1","/dev/stderr");var d=i.open("/dev/stdin",0),p=i.open("/dev/stdout",1),n=i.open("/dev/stderr",1)},ensureErrnoError:()=>{i.ErrnoError||(i.ErrnoError=function(p,n){this.node=n,this.setErrno=function(r){this.errno=r},this.setErrno(p),this.message="FS error"},i.ErrnoError.prototype=new Error,i.ErrnoError.prototype.constructor=i.ErrnoError,[44].forEach(d=>{i.genericErrors[d]=new i.ErrnoError(d),i.genericErrors[d].stack="<generic error, no stack>"}))},staticInit:()=>{i.ensureErrnoError(),i.nameTable=new Array(4096),i.mount(G,{},"/"),i.createDefaultDirectories(),i.createDefaultDevices(),i.createSpecialDirectories(),i.filesystems={MEMFS:G,NODEFS:V}},init:(d,p,n)=>{i.init.initialized=!0,i.ensureErrnoError(),f.stdin=d||f.stdin,f.stdout=p||f.stdout,f.stderr=n||f.stderr,i.createStandardStreams()},quit:()=>{i.init.initialized=!1,At(0);for(var d=0;d<i.streams.length;d++){var p=i.streams[d];p&&i.close(p)}},getMode:(d,p)=>{var n=0;return d&&(n|=365),p&&(n|=146),n},findObject:(d,p)=>{var n=i.analyzePath(d,p);return n.exists?n.object:null},analyzePath:(d,p)=>{try{var n=i.lookupPath(d,{follow:!p});d=n.path}catch{}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=i.lookupPath(d,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=Y.basename(d),n=i.lookupPath(d,{follow:!p}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot=n.path==="/"}catch(e){r.error=e.errno}return r},createPath:(d,p,n,r)=>{d=typeof d=="string"?d:i.getPath(d);for(var e=p.split("/").reverse();e.length;){var o=e.pop();if(o){var t=Y.join2(d,o);try{i.mkdir(t)}catch{}d=t}}return t},createFile:(d,p,n,r,e)=>{var o=Y.join2(typeof d=="string"?d:i.getPath(d),p),t=i.getMode(r,e);return i.create(o,t)},createDataFile:(d,p,n,r,e,o)=>{var t=p;d&&(d=typeof d=="string"?d:i.getPath(d),t=p?Y.join2(d,p):d);var a=i.getMode(r,e),s=i.create(t,a);if(n){if(typeof n=="string"){for(var l=new Array(n.length),h=0,w=n.length;h<w;++h)l[h]=n.charCodeAt(h);n=l}i.chmod(s,a|146);var S=i.open(s,577);i.write(S,n,0,n.length,0,o),i.close(S),i.chmod(s,a)}return s},createDevice:(d,p,n,r)=>{var e=Y.join2(typeof d=="string"?d:i.getPath(d),p),o=i.getMode(!!n,!!r);i.createDevice.major||(i.createDevice.major=64);var t=i.makedev(i.createDevice.major++,0);return i.registerDevice(t,{open:a=>{a.seekable=!1},close:a=>{r&&r.buffer&&r.buffer.length&&r(10)},read:(a,s,l,h,w)=>{for(var S=0,O=0;O<h;O++){var N;try{N=n()}catch{throw new i.ErrnoError(29)}if(N===void 0&&S===0)throw new i.ErrnoError(6);if(N==null)break;S++,s[l+O]=N}return S&&(a.node.timestamp=Date.now()),S},write:(a,s,l,h,w)=>{for(var S=0;S<h;S++)try{r(s[l+S])}catch{throw new i.ErrnoError(29)}return h&&(a.node.timestamp=Date.now()),S}}),i.mkdev(e,o,t)},forceLoadFile:d=>{if(d.isDevice||d.isFolder||d.link||d.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{d.contents=Er(We(d.url),!0),d.usedBytes=d.contents.length}catch{throw new i.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(d,p,n,r,e)=>{function o(){this.lengthKnown=!1,this.chunks=[]}if(o.prototype.get=function(O){if(!(O>this.length-1||O<0)){var N=O%this.chunkSize,T=O/this.chunkSize|0;return this.getter(T)[N]}},o.prototype.setDataGetter=function(O){this.getter=O},o.prototype.cacheLength=function(){var O=new XMLHttpRequest;if(O.open("HEAD",n,!1),O.send(null),!(O.status>=200&&O.status<300||O.status===304))throw new Error("Couldn't load "+n+". Status: "+O.status);var N=Number(O.getResponseHeader("Content-length")),T,F=(T=O.getResponseHeader("Accept-Ranges"))&&T==="bytes",L=(T=O.getResponseHeader("Content-Encoding"))&&T==="gzip",R=1024*1024;F||(R=N);var B=(M,z)=>{if(M>z)throw new Error("invalid range ("+M+", "+z+") or no bytes requested!");if(z>N-1)throw new Error("only "+N+" bytes available! programmer error!");var q=new XMLHttpRequest;if(q.open("GET",n,!1),N!==R&&q.setRequestHeader("Range","bytes="+M+"-"+z),q.responseType="arraybuffer",q.overrideMimeType&&q.overrideMimeType("text/plain; charset=x-user-defined"),q.send(null),!(q.status>=200&&q.status<300||q.status===304))throw new Error("Couldn't load "+n+". Status: "+q.status);return q.response!==void 0?new Uint8Array(q.response||[]):Er(q.responseText||"",!0)},P=this;P.setDataGetter(M=>{var z=M*R,q=(M+1)*R-1;if(q=Math.min(q,N-1),typeof P.chunks[M]>"u"&&(P.chunks[M]=B(z,q)),typeof P.chunks[M]>"u")throw new Error("doXHR failed!");return P.chunks[M]}),(L||!N)&&(R=N=1,N=this.getter(0).length,R=N,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=N,this._chunkSize=R,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var t=new o;Object.defineProperties(t,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:t}}else var a={isDevice:!1,url:n};var s=i.createFile(d,p,a,r,e);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var l={},h=Object.keys(s.stream_ops);h.forEach(S=>{var O=s.stream_ops[S];l[S]=function(){return i.forceLoadFile(s),O.apply(null,arguments)}});function w(S,O,N,T,F){var L=S.node.contents;if(F>=L.length)return 0;var R=Math.min(L.length-F,T);if(L.slice)for(var B=0;B<R;B++)O[N+B]=L[F+B];else for(var B=0;B<R;B++)O[N+B]=L.get(F+B);return R}return l.read=(S,O,N,T,F)=>(i.forceLoadFile(s),w(S,O,N,T,F)),l.mmap=(S,O,N,T,F)=>{i.forceLoadFile(s);var L=Ir(O);if(!L)throw new i.ErrnoError(48);return w(S,ee,L,O,N),{ptr:L,allocated:!0}},s.stream_ops=l,s},createPreloadedFile:(d,p,n,r,e,o,t,a,s,l)=>{var h=p?Q.resolve(Y.join2(d,p)):d,w="cp "+h;function S(O){function N(T){l&&l(),a||i.createDataFile(d,p,T,r,e,s),o&&o(),Je(w)}Browser.handledByPreloadPlugin(O,h,N,()=>{t&&t(),Je(w)})||N(O)}dr(w),typeof n=="string"?Ct(n,O=>S(O),t):S(n)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(d,p,n)=>{p=p||(()=>{}),n=n||(()=>{});var r=i.indexedDB();try{var e=r.open(i.DB_NAME(),i.DB_VERSION)}catch(o){return n(o)}e.onupgradeneeded=()=>{er("creating db");var o=e.result;o.createObjectStore(i.DB_STORE_NAME)},e.onsuccess=()=>{var o=e.result,t=o.transaction([i.DB_STORE_NAME],"readwrite"),a=t.objectStore(i.DB_STORE_NAME),s=0,l=0,h=d.length;function w(){l==0?p():n()}d.forEach(S=>{var O=a.put(i.analyzePath(S).object.contents,S);O.onsuccess=()=>{s++,s+l==h&&w()},O.onerror=()=>{l++,s+l==h&&w()}}),t.onerror=n},e.onerror=n},loadFilesFromDB:(d,p,n)=>{p=p||(()=>{}),n=n||(()=>{});var r=i.indexedDB();try{var e=r.open(i.DB_NAME(),i.DB_VERSION)}catch(o){return n(o)}e.onupgradeneeded=n,e.onsuccess=()=>{var o=e.result;try{var t=o.transaction([i.DB_STORE_NAME],"readonly")}catch(S){n(S);return}var a=t.objectStore(i.DB_STORE_NAME),s=0,l=0,h=d.length;function w(){l==0?p():n()}d.forEach(S=>{var O=a.get(S);O.onsuccess=()=>{i.analyzePath(S).exists&&i.unlink(S),i.createDataFile(Y.dirname(S),Y.basename(S),O.result,!0,!0,!0),s++,s+l==h&&w()},O.onerror=()=>{l++,s+l==h&&w()}}),t.onerror=n},e.onerror=n}},C={DEFAULT_POLLMASK:5,calculateAt:function(d,p,n){if(Y.isAbs(p))return p;var r;if(d===-100)r=i.cwd();else{var e=C.getStreamFromFD(d);r=e.path}if(p.length==0){if(!n)throw new i.ErrnoError(44);return r}return Y.join2(r,p)},doStat:function(d,p,n){try{var r=d(p)}catch(e){if(e&&e.node&&Y.normalize(p)!==Y.normalize(i.getPath(e.node)))return-54;throw e}return E[n>>2]=r.dev,E[n+8>>2]=r.ino,E[n+12>>2]=r.mode,j[n+16>>2]=r.nlink,E[n+20>>2]=r.uid,E[n+24>>2]=r.gid,E[n+28>>2]=r.rdev,Z=[r.size>>>0,(U=r.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[n+40>>2]=Z[0],E[n+44>>2]=Z[1],E[n+48>>2]=4096,E[n+52>>2]=r.blocks,Z=[Math.floor(r.atime.getTime()/1e3)>>>0,(U=Math.floor(r.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[n+56>>2]=Z[0],E[n+60>>2]=Z[1],j[n+64>>2]=0,Z=[Math.floor(r.mtime.getTime()/1e3)>>>0,(U=Math.floor(r.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[n+72>>2]=Z[0],E[n+76>>2]=Z[1],j[n+80>>2]=0,Z=[Math.floor(r.ctime.getTime()/1e3)>>>0,(U=Math.floor(r.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[n+88>>2]=Z[0],E[n+92>>2]=Z[1],j[n+96>>2]=0,Z=[r.ino>>>0,(U=r.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[n+104>>2]=Z[0],E[n+108>>2]=Z[1],0},doMsync:function(d,p,n,r,e){if(!i.isFile(p.node.mode))throw new i.ErrnoError(43);if(r&2)return 0;var o=le.slice(d,d+n);i.msync(p,o,e,n,r)},varargs:void 0,get:function(){C.varargs+=4;var d=E[C.varargs-4>>2];return d},getStr:function(d){var p=ne(d);return p},getStreamFromFD:function(d){var p=i.getStream(d);if(!p)throw new i.ErrnoError(8);return p}};function v(d,p,n,r,e){try{for(var o=0,t=p?E[p>>2]:0,a=p?E[p+4>>2]:0,s=n?E[n>>2]:0,l=n?E[n+4>>2]:0,h=r?E[r>>2]:0,w=r?E[r+4>>2]:0,S=0,O=0,N=0,T=0,F=0,L=0,R=(p?E[p>>2]:0)|(n?E[n>>2]:0)|(r?E[r>>2]:0),B=(p?E[p+4>>2]:0)|(n?E[n+4>>2]:0)|(r?E[r+4>>2]:0),P=function(X,oe,se,Oe){return X<32?oe&Oe:se&Oe},M=0;M<d;M++){var z=1<<M%32;if(P(M,R,B,z)){var q=C.getStreamFromFD(M),W=C.DEFAULT_POLLMASK;q.stream_ops?.poll&&(W=q.stream_ops.poll(q)),W&1&&P(M,t,a,z)&&(M<32?S=S|z:O=O|z,o++),W&4&&P(M,s,l,z)&&(M<32?N=N|z:T=T|z,o++),W&2&&P(M,h,w,z)&&(M<32?F=F|z:L=L|z,o++)}}return p&&(E[p>>2]=S,E[p+4>>2]=O),n&&(E[n>>2]=N,E[n+4>>2]=T),r&&(E[r>>2]=F,E[r+4>>2]=L),o}catch(X){if(typeof i>"u"||!(X instanceof i.ErrnoError))throw X;return-X.errno}}var H={mount:function(d){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(p,n){return typeof n=="function"&&(this._callbacks[p]=n),this},f.websocket.emit=function(p,n){typeof this._callbacks[p]=="function"&&this._callbacks[p].call(this,n)},i.createNode(null,"/",16895,0)},createSocket:function(d,p,n){p&=-526337;var r=p==1;if(r&&n&&n!=6)throw new i.ErrnoError(66);var e={family:d,type:p,protocol:n,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:H.websocket_sock_ops},o=H.nextname(),t=i.createNode(H.root,o,49152,0);t.sock=e;var a=i.createStream({path:o,node:t,flags:2,seekable:!1,stream_ops:H.stream_ops});return e.stream=a,e},getSocket:function(d){var p=i.getStream(d);return!p||!i.isSocket(p.node.mode)?null:p.node.sock},stream_ops:{poll:function(d){var p=d.node.sock;return p.sock_ops.poll(p)},ioctl:function(d,p,n){var r=d.node.sock;return r.sock_ops.ioctl(r,p,n)},read:function(d,p,n,r,e){var o=d.node.sock,t=o.sock_ops.recvmsg(o,r);return t?(p.set(t.buffer,n),t.buffer.length):0},write:function(d,p,n,r,e){var o=d.node.sock;return o.sock_ops.sendmsg(o,p,n,r)},close:function(d){var p=d.node.sock;p.sock_ops.close(p)}},nextname:function(){return H.nextname.current||(H.nextname.current=0),"socket["+H.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(d,p,n){var r;if(typeof p=="object"&&(r=p,p=null,n=null),r)if(r._socket)p=r._socket.remoteAddress,n=r._socket.remotePort;else{var e=/ws[s]?:\/\/([^:]+):(\d+)/.exec(r.url);if(!e)throw new Error("WebSocket URL must be in the format ws(s)://address:port");p=e[1],n=parseInt(e[2],10)}else try{var o=f.websocket&&typeof f.websocket=="object",t="ws:#".replace("#","//");if(o&&(typeof f.websocket.url=="function"?t=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(t=f.websocket.url)),t==="ws://"||t==="wss://"){var a=p.split("/");t=t+a[0]+":"+n+"/"+a.slice(1).join("/")}var s="binary";o&&typeof f.websocket.subprotocol=="string"&&(s=f.websocket.subprotocol);var l=void 0;s!=="null"&&(s=s.replace(/^ +| +$/g,"").split(/ *, */),l=s),o&&f.websocket.subprotocol===null&&(s="null",l=void 0);var h;te?h=An():h=WebSocket,f.websocket.decorator&&(h=f.websocket.decorator(h)),r=new h(t,l),r.binaryType="arraybuffer"}catch{throw new i.ErrnoError(23)}var w={addr:p,port:n,socket:r,dgram_send_queue:[]};return H.websocket_sock_ops.addPeer(d,w),H.websocket_sock_ops.handlePeerEvents(d,w),d.type===2&&typeof d.sport<"u"&&w.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(d.sport&65280)>>8,d.sport&255])),w},getPeer:function(d,p,n){return d.peers[p+":"+n]},addPeer:function(d,p){d.peers[p.addr+":"+p.port]=p},removePeer:function(d,p){delete d.peers[p.addr+":"+p.port]},handlePeerEvents:function(d,p){var n=!0,r=function(){f.websocket.emit("open",d.stream.fd);try{for(var o=p.dgram_send_queue.shift();o;)p.socket.send(o),o=p.dgram_send_queue.shift()}catch{p.socket.close()}};function e(o){if(typeof o=="string"){var t=new TextEncoder;o=t.encode(o)}else{if(Le(o.byteLength!==void 0),o.byteLength==0)return;o=new Uint8Array(o)}var a=n;if(n=!1,a&&o.length===10&&o[0]===255&&o[1]===255&&o[2]===255&&o[3]===255&&o[4]==="p".charCodeAt(0)&&o[5]==="o".charCodeAt(0)&&o[6]==="r".charCodeAt(0)&&o[7]==="t".charCodeAt(0)){var s=o[8]<<8|o[9];H.websocket_sock_ops.removePeer(d,p),p.port=s,H.websocket_sock_ops.addPeer(d,p);return}d.recv_queue.push({addr:p.addr,port:p.port,data:o}),f.websocket.emit("message",d.stream.fd)}te?(p.socket.on("open",r),p.socket.on("message",function(o,t){t&&e(new Uint8Array(o).buffer)}),p.socket.on("close",function(){f.websocket.emit("close",d.stream.fd)}),p.socket.on("error",function(o){d.error=14,f.websocket.emit("error",[d.stream.fd,d.error,"ECONNREFUSED: Connection refused"])})):(p.socket.onopen=r,p.socket.onclose=function(){f.websocket.emit("close",d.stream.fd)},p.socket.onmessage=function(t){e(t.data)},p.socket.onerror=function(o){d.error=14,f.websocket.emit("error",[d.stream.fd,d.error,"ECONNREFUSED: Connection refused"])})},poll:function(d){if(d.type===1&&d.server)return d.pending.length?65:0;var p=0,n=d.type===1?H.websocket_sock_ops.getPeer(d,d.daddr,d.dport):null;return(d.recv_queue.length||!n||n&&n.socket.readyState===n.socket.CLOSING||n&&n.socket.readyState===n.socket.CLOSED)&&(p|=65),(!n||n&&n.socket.readyState===n.socket.OPEN)&&(p|=4),(n&&n.socket.readyState===n.socket.CLOSING||n&&n.socket.readyState===n.socket.CLOSED)&&(p|=16),p},ioctl:function(d,p,n){switch(p){case 21531:var r=0;return d.recv_queue.length&&(r=d.recv_queue[0].data.length),E[n>>2]=r,0;default:return 28}},close:function(d){if(d.server){try{d.server.close()}catch{}d.server=null}for(var p=Object.keys(d.peers),n=0;n<p.length;n++){var r=d.peers[p[n]];try{r.socket.close()}catch{}H.websocket_sock_ops.removePeer(d,r)}return 0},bind:function(d,p,n){if(typeof d.saddr<"u"||typeof d.sport<"u")throw new i.ErrnoError(28);if(d.saddr=p,d.sport=n,d.type===2){d.server&&(d.server.close(),d.server=null);try{d.sock_ops.listen(d,0)}catch(r){if(!(r instanceof i.ErrnoError)||r.errno!==138)throw r}}},connect:function(d,p,n){if(d.server)throw new i.ErrnoError(138);if(typeof d.daddr<"u"&&typeof d.dport<"u"){var r=H.websocket_sock_ops.getPeer(d,d.daddr,d.dport);if(r)throw r.socket.readyState===r.socket.CONNECTING?new i.ErrnoError(7):new i.ErrnoError(30)}var e=H.websocket_sock_ops.createPeer(d,p,n);throw d.daddr=e.addr,d.dport=e.port,new i.ErrnoError(26)},listen:function(d,p){if(!te)throw new i.ErrnoError(138);if(d.server)throw new i.ErrnoError(28);var n=An().Server,r=d.saddr;d.server=new n({host:r,port:d.sport}),f.websocket.emit("listen",d.stream.fd),d.server.on("connection",function(e){if(d.type===1){var o=H.createSocket(d.family,d.type,d.protocol),t=H.websocket_sock_ops.createPeer(o,e);o.daddr=t.addr,o.dport=t.port,d.pending.push(o),f.websocket.emit("connection",o.stream.fd)}else H.websocket_sock_ops.createPeer(d,e),f.websocket.emit("connection",d.stream.fd)}),d.server.on("close",function(){f.websocket.emit("close",d.stream.fd),d.server=null}),d.server.on("error",function(e){d.error=23,f.websocket.emit("error",[d.stream.fd,d.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(d){if(!d.server||!d.pending.length)throw new i.ErrnoError(28);var p=d.pending.shift();return p.stream.flags=d.stream.flags,p},getname:function(d,p){var n,r;if(p){if(d.daddr===void 0||d.dport===void 0)throw new i.ErrnoError(53);n=d.daddr,r=d.dport}else n=d.saddr||0,r=d.sport||0;return{addr:n,port:r}},sendmsg:function(d,p,n,r,e,o){if(d.type===2){if((e===void 0||o===void 0)&&(e=d.daddr,o=d.dport),e===void 0||o===void 0)throw new i.ErrnoError(17)}else e=d.daddr,o=d.dport;var t=H.websocket_sock_ops.getPeer(d,e,o);if(d.type===1){if(!t||t.socket.readyState===t.socket.CLOSING||t.socket.readyState===t.socket.CLOSED)throw new i.ErrnoError(53);if(t.socket.readyState===t.socket.CONNECTING)throw new i.ErrnoError(6)}ArrayBuffer.isView(p)&&(n+=p.byteOffset,p=p.buffer);var a;if(a=p.slice(n,n+r),d.type===2&&(!t||t.socket.readyState!==t.socket.OPEN))return(!t||t.socket.readyState===t.socket.CLOSING||t.socket.readyState===t.socket.CLOSED)&&(t=H.websocket_sock_ops.createPeer(d,e,o)),t.dgram_send_queue.push(a),r;try{return t.socket.send(a),r}catch{throw new i.ErrnoError(28)}},recvmsg:function(d,p){if(d.type===1&&d.server)throw new i.ErrnoError(53);var n=d.recv_queue.shift();if(!n){if(d.type===1){var r=H.websocket_sock_ops.getPeer(d,d.daddr,d.dport);if(!r)throw new i.ErrnoError(53);if(r.socket.readyState===r.socket.CLOSING||r.socket.readyState===r.socket.CLOSED)return null;throw new i.ErrnoError(6)}throw new i.ErrnoError(6)}var e=n.data.byteLength||n.data.length,o=n.data.byteOffset||0,t=n.data.buffer||n.data,a=Math.min(p,e),s={buffer:new Uint8Array(t,o,a),addr:n.addr,port:n.port};if(d.type===1&&a<e){var l=e-a;n.data=new Uint8Array(t,o+a,l),d.recv_queue.unshift(n)}return s}}};function ke(d){var p=H.getSocket(d);if(!p)throw new i.ErrnoError(8);return p}function he(d){return E[Qt()>>2]=d,d}function Ie(d){for(var p=d.split("."),n=0;n<4;n++){var r=Number(p[n]);if(isNaN(r))return null;p[n]=r}return(p[0]|p[1]<<8|p[2]<<16|p[3]<<24)>>>0}function ce(d){return parseInt(d)}function Ar(d){var p,n,r,e,o=/^((?=.*::)(?!.*::.+::)(::)?([\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,t=[];if(!o.test(d))return null;if(d==="::")return[0,0,0,0,0,0,0,0];for(d.startsWith("::")?d=d.replace("::","Z:"):d=d.replace("::",":Z:"),d.indexOf(".")>0?(d=d.replace(new RegExp("[.]","g"),":"),p=d.split(":"),p[p.length-4]=ce(p[p.length-4])+ce(p[p.length-3])*256,p[p.length-3]=ce(p[p.length-2])+ce(p[p.length-1])*256,p=p.slice(0,p.length-2)):p=d.split(":"),r=0,e=0,n=0;n<p.length;n++)if(typeof p[n]=="string")if(p[n]==="Z"){for(e=0;e<8-p.length+1;e++)t[n+e]=0;r=e-1}else t[n+r]=Dr(parseInt(p[n],16));else t[n+r]=p[n];return[t[1]<<16|t[0],t[3]<<16|t[2],t[5]<<16|t[4],t[7]<<16|t[6]]}function be(d,p,n,r,e){switch(p){case 2:n=Ie(n),wr(d,16),e&&(E[e>>2]=16),we[d>>1]=p,E[d+4>>2]=n,we[d+2>>1]=Dr(r);break;case 10:n=Ar(n),wr(d,28),e&&(E[e>>2]=28),E[d>>2]=p,E[d+8>>2]=n[0],E[d+12>>2]=n[1],E[d+16>>2]=n[2],E[d+20>>2]=n[3],we[d+2>>1]=Dr(r);break;default:return 5}return 0}var ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(d){var p=Ie(d);if(p!==null||(p=Ar(d),p!==null))return d;var n;if(ue.address_map.addrs[d])n=ue.address_map.addrs[d];else{var r=ue.address_map.id++;Le(r<65535,"exceeded max address mappings of 65535"),n="172.29."+(r&255)+"."+(r&65280),ue.address_map.names[n]=d,ue.address_map.addrs[d]=n}return n},lookup_addr:function(d){return ue.address_map.names[d]?ue.address_map.names[d]:null}};function Zr(d,p,n,r){try{var e=ke(d),o=e.sock_ops.accept(e);if(p)var t=be(p,o.family,ue.lookup_name(o.daddr),o.dport,n);return o.stream.fd}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function Ne(d){return(d&255)+"."+(d>>8&255)+"."+(d>>16&255)+"."+(d>>24&255)}function kn(d){var p="",n=0,r=0,e=0,o=0,t=0,a=0,s=[d[0]&65535,d[0]>>16,d[1]&65535,d[1]>>16,d[2]&65535,d[2]>>16,d[3]&65535,d[3]>>16],l=!0,h="";for(a=0;a<5;a++)if(s[a]!==0){l=!1;break}if(l){if(h=Ne(s[6]|s[7]<<16),s[5]===-1)return p="::ffff:",p+=h,p;if(s[5]===0)return p="::",h==="0.0.0.0"&&(h=""),h==="0.0.0.1"&&(h="1"),p+=h,p}for(n=0;n<8;n++)s[n]===0&&(n-e>1&&(t=0),e=n,t++),t>r&&(r=t,o=n-r+1);for(n=0;n<8;n++){if(r>1&&s[n]===0&&n>=o&&n<o+r){n===o&&(p+=":",o===0&&(p+=":"));continue}p+=Number(Nt(s[n]&65535)).toString(16),p+=n<7?":":""}return p}function Gr(d,p){var n=we[d>>1],r=Nt(lt[d+2>>1]),e;switch(n){case 2:if(p!==16)return{errno:28};e=E[d+4>>2],e=Ne(e);break;case 10:if(p!==28)return{errno:28};e=[E[d+8>>2],E[d+12>>2],E[d+16>>2],E[d+20>>2]],e=kn(e);break;default:return{errno:5}}return{family:n,addr:e,port:r}}function Yr(d,p,n){if(n&&d===0)return null;var r=Gr(d,p);if(r.errno)throw new i.ErrnoError(r.errno);return r.addr=ue.lookup_addr(r.addr)||r.addr,r}function dn(d,p,n){try{var r=ke(d),e=Yr(p,n);return r.sock_ops.bind(r,e.addr,e.port),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function Pt(d){try{return d=C.getStr(d),i.chdir(d),0}catch(p){if(typeof i>"u"||!(p instanceof i.ErrnoError))throw p;return-p.errno}}function oo(d,p){try{return d=C.getStr(d),i.chmod(d,p),0}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return-n.errno}}function io(d,p,n){try{var r=ke(d),e=Yr(p,n);return r.sock_ops.connect(r,e.addr,e.port),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function ao(d){try{var p=C.getStreamFromFD(d);return i.createStream(p,0).fd}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return-n.errno}}function so(d,p,n){try{var r=C.getStreamFromFD(d);if(r.fd===p)return-28;var e=i.getStream(p);return e&&i.close(e),i.createStream(r,p,p+1).fd}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function uo(d,p,n,r){try{if(p=C.getStr(p),p=C.calculateAt(d,p),n&-8)return-28;var e=i.lookupPath(p,{follow:!0}),o=e.node;if(!o)return-44;var t="";return n&4&&(t+="r"),n&2&&(t+="w"),n&1&&(t+="x"),t&&i.nodePermissions(o,t)?-2:0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function _n(d,p){try{return i.fchmod(d,p),0}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return-n.errno}}function fo(d,p,n){try{return i.fchown(d,p,n),0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function gt(d,p,n,r,e){try{p=C.getStr(p);var o=e&256;return e=e&-257,p=C.calculateAt(d,p),(o?i.lchown:i.chown)(p,n,r),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function co(d,p,n){C.varargs=n;try{var r=C.getStreamFromFD(d);switch(p){case 0:{var e=C.get();if(e<0)return-28;var o;return o=i.createStream(r,e),o.fd}case 1:case 2:return 0;case 3:return r.flags;case 4:{var e=C.get();return r.flags|=e,0}case 5:{var e=C.get(),t=0;return we[e+t>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return he(28),-1;default:return-28}}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function lo(d,p){try{var n=C.getStreamFromFD(d);return C.doStat(i.stat,n.path,p)}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function qt(d,p){return p+2097152>>>0<4194305-!!d?(d>>>0)+p*4294967296:NaN}function _o(d,p,n){try{var r=qt(p,n);return isNaN(r)?-61:(i.ftruncate(d,r),0)}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function mo(d,p){try{if(p===0)return-28;var n=i.cwd(),r=Ce(n)+1;return p<r?-68:(Fe(n,d,p),r)}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function vo(d,p,n){try{var r=C.getStreamFromFD(d);r.getdents||(r.getdents=i.readdir(r.path));for(var e=280,o=0,t=i.llseek(r,0,1),a=Math.floor(t/e);a<r.getdents.length&&o+e<=n;){var s,l,h=r.getdents[a];if(h===".")s=r.node.id,l=4;else if(h===".."){var w=i.lookupPath(r.path,{parent:!0});s=w.node.id,l=4}else{var S=i.lookupNode(r.node,h);s=S.id,l=i.isChrdev(S.mode)?2:i.isDir(S.mode)?4:i.isLink(S.mode)?10:8}Z=[s>>>0,(U=s,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[p+o>>2]=Z[0],E[p+o+4>>2]=Z[1],Z=[(a+1)*e>>>0,(U=(a+1)*e,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[p+o+8>>2]=Z[0],E[p+o+12>>2]=Z[1],we[p+o+16>>1]=280,ee[p+o+18>>0]=l,Fe(h,p+o+19,256),o+=e,a+=1}return i.llseek(r,a*e,0),o}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function po(d,p,n){try{var r=ke(d);if(!r.daddr)return-53;var e=be(p,r.family,ue.lookup_name(r.daddr),r.dport,n);return 0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function ho(d,p,n){try{fe("__syscall_getsockname "+d);var r=ke(d),e=be(p,r.family,ue.lookup_name(r.saddr||"0.0.0.0"),r.sport,n);return 0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function yo(d,p,n,r,e){try{var o=ke(d);return p===1&&n===4?(E[r>>2]=o.error,E[e>>2]=4,o.error=null,0):-50}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function Eo(d,p,n){C.varargs=n;try{var r=C.getStreamFromFD(d);switch(p){case 21509:case 21505:return r.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return r.tty?0:-59;case 21519:{if(!r.tty)return-59;var e=C.get();return E[e>>2]=0,0}case 21520:return r.tty?-28:-59;case 21531:{var e=C.get();return i.ioctl(r,p,e)}case 21523:return r.tty?0:-59;case 21524:return r.tty?0:-59;default:return-28}}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function wo(d,p){try{var n=ke(d);return n.sock_ops.listen(n,p),0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function go(d,p){try{return d=C.getStr(d),C.doStat(i.lstat,d,p)}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return-n.errno}}function So(d,p,n){try{return p=C.getStr(p),p=C.calculateAt(d,p),p=Y.normalize(p),p[p.length-1]==="/"&&(p=p.substr(0,p.length-1)),i.mkdir(p,n,0),0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function bo(d,p,n,r){try{p=C.getStr(p);var e=r&256,o=r&4096;return r=r&-4353,p=C.calculateAt(d,p,o),C.doStat(e?i.lstat:i.stat,p,n)}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function ko(d,p,n,r){C.varargs=r;try{p=C.getStr(p),p=C.calculateAt(d,p);var e=r?C.get():0;return i.open(p,n,e).fd}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}var ae={BUCKET_BUFFER_SIZE:8192,mount:function(d){return i.createNode(null,"/",16895,0)},createPipe:function(){var d={buckets:[],refcnt:2};d.buckets.push({buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var p=ae.nextname(),n=ae.nextname(),r=i.createNode(ae.root,p,4096,0),e=i.createNode(ae.root,n,4096,0);r.pipe=d,e.pipe=d;var o=i.createStream({path:p,node:r,flags:0,seekable:!1,stream_ops:ae.stream_ops});r.stream=o;var t=i.createStream({path:n,node:e,flags:1,seekable:!1,stream_ops:ae.stream_ops});return e.stream=t,{readable_fd:o.fd,writable_fd:t.fd}},stream_ops:{poll:function(d){var p=d.node.pipe;if((d.flags&2097155)===1)return 260;if(p.buckets.length>0)for(var n=0;n<p.buckets.length;n++){var r=p.buckets[n];if(r.offset-r.roffset>0)return 65}return 0},ioctl:function(d,p,n){return 28},fsync:function(d){return 28},read:function(d,p,n,r,e){for(var o=d.node.pipe,t=0,a=0;a<o.buckets.length;a++){var s=o.buckets[a];t+=s.offset-s.roffset}Le(p instanceof ArrayBuffer||ArrayBuffer.isView(p));var l=p.subarray(n,n+r);if(r<=0)return 0;if(t==0)throw new i.ErrnoError(6);for(var h=Math.min(t,r),w=h,S=0,a=0;a<o.buckets.length;a++){var O=o.buckets[a],N=O.offset-O.roffset;if(h<=N){var T=O.buffer.subarray(O.roffset,O.offset);h<N?(T=T.subarray(0,h),O.roffset+=h):S++,l.set(T);break}else{var T=O.buffer.subarray(O.roffset,O.offset);l.set(T),l=l.subarray(T.byteLength),h-=T.byteLength,S++}}return S&&S==o.buckets.length&&(S--,o.buckets[S].offset=0,o.buckets[S].roffset=0),o.buckets.splice(0,S),w},write:function(d,p,n,r,e){var o=d.node.pipe;Le(p instanceof ArrayBuffer||ArrayBuffer.isView(p));var t=p.subarray(n,n+r),a=t.byteLength;if(a<=0)return 0;var s=null;o.buckets.length==0?(s={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0},o.buckets.push(s)):s=o.buckets[o.buckets.length-1],Le(s.offset<=ae.BUCKET_BUFFER_SIZE);var l=ae.BUCKET_BUFFER_SIZE-s.offset;if(l>=a)return s.buffer.set(t,s.offset),s.offset+=a,a;l>0&&(s.buffer.set(t.subarray(0,l),s.offset),s.offset+=l,t=t.subarray(l,t.byteLength));for(var h=t.byteLength/ae.BUCKET_BUFFER_SIZE|0,w=t.byteLength%ae.BUCKET_BUFFER_SIZE,S=0;S<h;S++){var O={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:ae.BUCKET_BUFFER_SIZE,roffset:0};o.buckets.push(O),O.buffer.set(t.subarray(0,ae.BUCKET_BUFFER_SIZE)),t=t.subarray(ae.BUCKET_BUFFER_SIZE,t.byteLength)}if(w>0){var O={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:t.byteLength,roffset:0};o.buckets.push(O),O.buffer.set(t)}return a},close:function(d){var p=d.node.pipe;p.refcnt--,p.refcnt===0&&(p.buckets=null)}},nextname:function(){return ae.nextname.current||(ae.nextname.current=0),"pipe["+ae.nextname.current+++"]"}};function Oo(d){try{if(d==0)throw new i.ErrnoError(21);var p=ae.createPipe();return E[d>>2]=p.readable_fd,E[d+4>>2]=p.writable_fd,0}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return-n.errno}}function kr(d,p,n){try{for(var r=0,e=0;e<p;e++){var o=d+8*e,t=E[o>>2],a=we[o+4>>1],s=32,l=i.getStream(t);l&&(s=C.DEFAULT_POLLMASK,l.stream_ops?.poll&&(s=l.stream_ops.poll(l))),s&=a|8|16,s&&r++,we[o+6>>1]=s}return r}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Do(d,p,n,r){try{if(p=C.getStr(p),p=C.calculateAt(d,p),r<=0)return-28;var e=i.readlink(p),o=Math.min(r,Ce(e)),t=ee[n+o];return Fe(e,n,r+1),ee[n+o]=t,o}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function Se(d,p,n,r,e,o){try{var t=ke(d),a=t.sock_ops.recvmsg(t,n);if(!a)return 0;if(e)var s=be(e,t.family,ue.lookup_name(a.addr),a.port,o);return le.set(a.buffer,p),a.buffer.byteLength}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function No(d,p,n,r){try{return p=C.getStr(p),r=C.getStr(r),p=C.calculateAt(d,p),r=C.calculateAt(n,r),i.rename(p,r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function To(d){try{return d=C.getStr(d),i.rmdir(d),0}catch(p){if(typeof i>"u"||!(p instanceof i.ErrnoError))throw p;return-p.errno}}function Ao(d,p,n,r,e,o){try{var t=ke(d),a=Yr(e,o,!0);return a?t.sock_ops.sendmsg(t,ee,p,n,a.addr,a.port):i.write(t.stream,ee,p,n)}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function Fo(d,p,n){try{var r=H.createSocket(d,p,n);return r.stream.fd}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function Co(d,p){try{return d=C.getStr(d),C.doStat(i.stat,d,p)}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return-n.errno}}function Po(d,p,n){try{return d=C.getStr(d),E[n+4>>2]=4096,E[n+40>>2]=4096,E[n+8>>2]=1e6,E[n+12>>2]=5e5,E[n+16>>2]=5e5,E[n+20>>2]=i.nextInode,E[n+24>>2]=1e6,E[n+28>>2]=42,E[n+44>>2]=2,E[n+36>>2]=255,0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function Ro(d,p){try{return d=C.getStr(d),p=C.getStr(p),i.symlink(d,p),0}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return-n.errno}}function Mo(d,p,n){try{return p=C.getStr(p),p=C.calculateAt(d,p),n===0?i.unlink(p):n===512?i.rmdir(p):me("Invalid flags passed to unlinkat"),0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function jr(d){return j[d>>2]+E[d+4>>2]*4294967296}function Lo(d,p,n,r){try{if(p=C.getStr(p),p=C.calculateAt(d,p,!0),n){var t=jr(n),a=E[n+8>>2];e=t*1e3+a/(1e3*1e3),n+=16,t=jr(n),a=E[n+8>>2],o=t*1e3+a/(1e3*1e3)}else var e=Date.now(),o=e;return i.utime(p,e,o),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function mn(d){}var Vt="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function St(d,p){me(Vt)}function Fn(d,p){me(Vt)}var Uo=!0;function vn(){return Uo}function Io(){throw 1/0}function Bo(d,p){var n=new Date(jr(d)*1e3);E[p>>2]=n.getUTCSeconds(),E[p+4>>2]=n.getUTCMinutes(),E[p+8>>2]=n.getUTCHours(),E[p+12>>2]=n.getUTCDate(),E[p+16>>2]=n.getUTCMonth(),E[p+20>>2]=n.getUTCFullYear()-1900,E[p+24>>2]=n.getUTCDay();var r=Date.UTC(n.getUTCFullYear(),0,1,0,0,0,0),e=(n.getTime()-r)/(1e3*60*60*24)|0;E[p+28>>2]=e}function xo(d,p){var n=new Date(jr(d)*1e3);E[p>>2]=n.getSeconds(),E[p+4>>2]=n.getMinutes(),E[p+8>>2]=n.getHours(),E[p+12>>2]=n.getDate(),E[p+16>>2]=n.getMonth(),E[p+20>>2]=n.getFullYear()-1900,E[p+24>>2]=n.getDay();var r=new Date(n.getFullYear(),0,1),e=(n.getTime()-r.getTime())/(1e3*60*60*24)|0;E[p+28>>2]=e,E[p+36>>2]=-(n.getTimezoneOffset()*60);var o=new Date(n.getFullYear(),6,1).getTimezoneOffset(),t=r.getTimezoneOffset(),a=(o!=t&&n.getTimezoneOffset()==Math.min(t,o))|0;E[p+32>>2]=a}function zo(d){var p=new Date(E[d+20>>2]+1900,E[d+16>>2],E[d+12>>2],E[d+8>>2],E[d+4>>2],E[d>>2],0),n=E[d+32>>2],r=p.getTimezoneOffset(),e=new Date(p.getFullYear(),0,1),o=new Date(p.getFullYear(),6,1).getTimezoneOffset(),t=e.getTimezoneOffset(),a=Math.min(t,o);if(n<0)E[d+32>>2]=+(o!=t&&a==r);else if(n>0!=(a==r)){var s=Math.max(t,o),l=n>0?a:s;p.setTime(p.getTime()+(l-r)*6e4)}E[d+24>>2]=p.getDay();var h=(p.getTime()-e.getTime())/(1e3*60*60*24)|0;return E[d+28>>2]=h,E[d>>2]=p.getSeconds(),E[d+4>>2]=p.getMinutes(),E[d+8>>2]=p.getHours(),E[d+12>>2]=p.getDate(),E[d+16>>2]=p.getMonth(),E[d+20>>2]=p.getYear(),p.getTime()/1e3|0}function Ho(d,p,n,r,e,o){try{var t=C.getStreamFromFD(r),a=i.mmap(t,d,e,p,n),s=a.ptr;return E[o>>2]=a.allocated,s}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Wo(d,p,n,r,e,o){try{var t=C.getStreamFromFD(e);n&2&&C.doMsync(d,t,p,r,o),i.munmap(t)}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function Gt(d){var p=Ce(d)+1,n=mr(p);return n&&Ze(d,ee,n,p),n}function Yo(d,p,n){var r=new Date().getFullYear(),e=new Date(r,0,1),o=new Date(r,6,1),t=e.getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.max(t,a);E[d>>2]=s*60,E[p>>2]=+(t!=a);function l(N){var T=N.toTimeString().match(/\(([A-Za-z ]+)\)$/);return T?T[1]:"GMT"}var h=l(e),w=l(o),S=Gt(h),O=Gt(w);a<t?(j[n>>2]=S,j[n+4>>2]=O):(j[n>>2]=O,j[n+4>>2]=S)}function rt(d,p,n){rt.called||(rt.called=!0,Yo(d,p,n))}function jo(){me("")}function Kt(){return Date.now()}function Xt(){return 2147483648}function Rt(){return Xt()}var tt;te?tt=()=>{var d=process.hrtime();return d[0]*1e3+d[1]/1e6}:tt=()=>performance.now();function qo(d,p,n){le.copyWithin(d,p,p+n)}function Zt(d){try{return ir.grow(d-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function Vo(d){var p=le.length;d=d>>>0;var n=Xt();if(d>n)return!1;let r=(s,l)=>s+(l-s%l)%l;for(var e=1;e<=4;e*=2){var o=p*(1+.2/e);o=Math.min(o,d+100663296);var t=Math.min(n,r(Math.max(d,o),65536)),a=Zt(t);if(a)return!0}return!1}function Mt(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var it=A.ENV||{};function Go(){return ie||"./this.program"}function Or(){if(!Or.strings){var d=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",p={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:d,_:Go()};for(var n in it)it[n]===void 0?delete p[n]:p[n]=it[n];var r=[];for(var n in p)r.push(n+"="+p[n]);Or.strings=r}return Or.strings}function at(d,p,n){for(var r=0;r<d.length;++r)ee[p++>>0]=d.charCodeAt(r);n||(ee[p>>0]=0)}function st(d,p){var n=0;return Or().forEach(function(r,e){var o=p+n;j[d+e*4>>2]=o,at(r,o),n+=r.length+1}),0}function On(d,p){var n=Or();j[d>>2]=n.length;var r=0;return n.forEach(function(e){r+=e.length+1}),j[p>>2]=r,0}function qr(d){Pr=d,Mr()||(f.onExit&&f.onExit(d),Tr=!0),_e(d,new Ur(d))}function Lt(d,p){Pr=d,Mr()||Kn(),qr(d)}var Cn=Lt;function Ko(d){try{var p=C.getStreamFromFD(d);return i.close(p),0}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return n.errno}}function pn(d,p){try{var n=C.getStreamFromFD(d),r=n.tty?2:i.isDir(n.mode)?3:i.isLink(n.mode)?7:4;return ee[p>>0]=r,0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return e.errno}}function Xo(d,p,n,r){for(var e=0,o=0;o<n;o++){var t=j[p>>2],a=j[p+4>>2];p+=8;var s=i.read(d,ee,t,a,r);if(s<0)return-1;if(e+=s,s<a)break}return e}function Zo(d,p,n,r){try{var e=C.getStreamFromFD(d),o=Xo(e,p,n);return j[r>>2]=o,0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return t.errno}}function $o(d,p,n,r,e){try{var o=qt(p,n);if(isNaN(o))return 61;var t=C.getStreamFromFD(d);return i.llseek(t,o,r),Z=[t.position>>>0,(U=t.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e>>2]=Z[0],E[e+4>>2]=Z[1],t.getdents&&o===0&&r===0&&(t.getdents=null),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return a.errno}}function Jo(d){try{var p=C.getStreamFromFD(d);return p.stream_ops&&p.stream_ops.fsync?p.stream_ops.fsync(p):0}catch(n){if(typeof i>"u"||!(n instanceof i.ErrnoError))throw n;return n.errno}}function Qo(d,p,n,r){for(var e=0,o=0;o<n;o++){var t=j[p>>2],a=j[p+4>>2];p+=8;var s=i.write(d,ee,t,a,r);if(s<0)return-1;e+=s}return e}function ei(d,p,n,r){try{var e=C.getStreamFromFD(d),o=Qo(e,p,n);return j[r>>2]=o,0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return t.errno}}function nn(d){var p=mr(20),n=mr(d.length+1);Fe(d,n,d.length+1),j[p>>2]=n;var r=mr(4);j[r>>2]=0,j[p+4>>2]=r;var e=2;E[p+8>>2]=e,E[p+12>>2]=4;var o=mr(12);return j[o>>2]=o+8,j[o+4>>2]=0,E[o+8>>2]=Ie(ue.lookup_name(d)),j[p+16>>2]=o,p}function Pn(d,p,n){if(n!==2)return he(5),null;d=E[d>>2];var r=Ne(d),e=ue.lookup_addr(r);return e&&(r=e),nn(r)}function Rn(d){return nn(ne(d))}function ri(d,p,n,r,e,o){var t=Rn(d);return It(p,t,20),zr(t),E[o>>2]=0,j[e>>2]=p,0}function Mn(d,p){for(var n=Math.min(p,3),r=8,e=0;e<n;e++)dt[d+e*r>>3]=.1;return n}function hn(d,p,n,r,e,o,t){var a=Gr(d,p);if(a.errno)return-6;var s=a.port,l=a.addr,h=!1;if(n&&r){var w;if(t&1||!(w=ue.lookup_addr(l))){if(t&8)return-2}else l=w;var S=Fe(l,n,r);S+1>=r&&(h=!0)}if(e&&o){s=""+s;var S=Fe(s,e,o);S+1>=o&&(h=!0)}return h?-12:0}var nt={list:[],map:{}};function bt(d){function p(o,t,a){var s=mr(o.length+1);at(o,s);for(var l=0,h=a.length,w=mr((h+1)*4),S=0;S<h;S++,l+=4){var O=a[S],N=mr(O.length+1);at(O,N),j[w+l>>2]=N}j[w+l>>2]=0;var T=mr(12);return j[T>>2]=s,j[T+4>>2]=w,E[T+8>>2]=t,T}var n=nt.list,r=nt.map;if(n.length===0){var e=p("tcp",6,["TCP"]);n.push(e),r.tcp=r[6]=e,e=p("udp",17,["UDP"]),n.push(e),r.udp=r[17]=e}bt.index=0}function $t(d){d=ne(d),bt(!0);var p=nt.map[d];return p}function yn(d){bt(!0);var p=nt.map[d];return p}function Fr(d){var p=Ce(d)+1,n=sr(p);return Ze(d,ee,n,p),n}var Ue={getAllWebSockets:function(d){let p=new Set;d.server&&d.server.clients.forEach(n=>{p.add(n)});for(let n of Ue.getAllPeers(d))p.add(n.socket);return Array.from(p)},getAllPeers:function(d){let p=new Set;if(d.server&&d.pending.filter(n=>n.peers).forEach(n=>{for(let r of Object.values(n.peers))p.add(r)}),d.peers)for(let n of Object.values(d.peers))p.add(n);return Array.from(p)},awaitData:function(d){return Ue.awaitWsEvent(d,"message")},awaitConnection:function(d){return d.OPEN===d.readyState?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(d,"open")},awaitClose:function(d){return[d.CLOSING,d.CLOSED].includes(d.readyState)?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(d,"close")},awaitError:function(d){return[d.CLOSING,d.CLOSED].includes(d.readyState)?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(d,"error")},awaitWsEvent:function(d,p){let n,r=()=>{n()};return[new Promise(function(t){n=t,d.once(p,r)}),()=>{d.removeListener(p,r),setTimeout(n)}]},noop:function(){},shutdownSocket:function(d,p){let n=ke(d),r=Object.values(n.peers)[0];if(!r)return-1;try{return r.socket.close(),H.websocket_sock_ops.removePeer(n,r),0}catch(e){return console.log("Socket shutdown error",e),-1}}};function hr(d,p,n){if(!d)return 1;let r=ne(d);if(!r.length)return 0;let e=ne(p);if(!e.length)return 0;if(f.popen_to_file){let{path:o,exitCode:t}=f.popen_to_file(r,e);return le[n]=t,Fr(o)}if(te){let o=require("os").tmpdir(),t="php-process-stream",a=o+"/"+t,s=require("child_process"),l;if(e==="r")l=s.spawnSync(r,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[n]=l.status,require("fs").writeFileSync(a,l.stdout,{encoding:"utf8",flag:"w+"});else return e==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+e+" (should be r or w)"),_W_EXITCODE(0,2));return Fr(a)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function tr(d){return d%4===0&&(d%100!==0||d%400===0)}function Hr(d,p){for(var n=0,r=0;r<=p;n+=d[r++]);return n}var Ge=[31,29,31,30,31,30,31,31,30,31,30,31],Xe=[31,28,31,30,31,30,31,31,30,31,30,31];function Ve(d,p){for(var n=new Date(d.getTime());p>0;){var r=tr(n.getFullYear()),e=n.getMonth(),o=(r?Ge:Xe)[e];if(p>o-n.getDate())p-=o-n.getDate()+1,n.setDate(1),e<11?n.setMonth(e+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1));else return n.setDate(n.getDate()+p),n}return n}function ut(d,p,n,r){var e=E[r+40>>2],o={tm_sec:E[r>>2],tm_min:E[r+4>>2],tm_hour:E[r+8>>2],tm_mday:E[r+12>>2],tm_mon:E[r+16>>2],tm_year:E[r+20>>2],tm_wday:E[r+24>>2],tm_yday:E[r+28>>2],tm_isdst:E[r+32>>2],tm_gmtoff:E[r+36>>2],tm_zone:e?ne(e):""},t=ne(n),a={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var s in a)t=t.replace(new RegExp(s,"g"),a[s]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function w(R,B,P){for(var M=typeof R=="number"?R.toString():R||"";M.length<B;)M=P[0]+M;return M}function S(R,B){return w(R,B,"0")}function O(R,B){function P(z){return z<0?-1:z>0?1:0}var M;return(M=P(R.getFullYear()-B.getFullYear()))===0&&(M=P(R.getMonth()-B.getMonth()))===0&&(M=P(R.getDate()-B.getDate())),M}function N(R){switch(R.getDay()){case 0:return new Date(R.getFullYear()-1,11,29);case 1:return R;case 2:return new Date(R.getFullYear(),0,3);case 3:return new Date(R.getFullYear(),0,2);case 4:return new Date(R.getFullYear(),0,1);case 5:return new Date(R.getFullYear()-1,11,31);case 6:return new Date(R.getFullYear()-1,11,30)}}function T(R){var B=Ve(new Date(R.tm_year+1900,0,1),R.tm_yday),P=new Date(B.getFullYear(),0,4),M=new Date(B.getFullYear()+1,0,4),z=N(P),q=N(M);return O(z,B)<=0?O(q,B)<=0?B.getFullYear()+1:B.getFullYear():B.getFullYear()-1}var F={"%a":function(R){return l[R.tm_wday].substring(0,3)},"%A":function(R){return l[R.tm_wday]},"%b":function(R){return h[R.tm_mon].substring(0,3)},"%B":function(R){return h[R.tm_mon]},"%C":function(R){var B=R.tm_year+1900;return S(B/100|0,2)},"%d":function(R){return S(R.tm_mday,2)},"%e":function(R){return w(R.tm_mday,2," ")},"%g":function(R){return T(R).toString().substring(2)},"%G":function(R){return T(R)},"%H":function(R){return S(R.tm_hour,2)},"%I":function(R){var B=R.tm_hour;return B==0?B=12:B>12&&(B-=12),S(B,2)},"%j":function(R){return S(R.tm_mday+Hr(tr(R.tm_year+1900)?Ge:Xe,R.tm_mon-1),3)},"%m":function(R){return S(R.tm_mon+1,2)},"%M":function(R){return S(R.tm_min,2)},"%n":function(){return`
28
+ `},"%p":function(R){return R.tm_hour>=0&&R.tm_hour<12?"AM":"PM"},"%S":function(R){return S(R.tm_sec,2)},"%t":function(){return" "},"%u":function(R){return R.tm_wday||7},"%U":function(R){var B=R.tm_yday+7-R.tm_wday;return S(Math.floor(B/7),2)},"%V":function(R){var B=Math.floor((R.tm_yday+7-(R.tm_wday+6)%7)/7);if((R.tm_wday+371-R.tm_yday-2)%7<=2&&B++,B){if(B==53){var M=(R.tm_wday+371-R.tm_yday)%7;M!=4&&(M!=3||!tr(R.tm_year))&&(B=1)}}else{B=52;var P=(R.tm_wday+7-R.tm_yday-1)%7;(P==4||P==5&&tr(R.tm_year%400-1))&&B++}return S(B,2)},"%w":function(R){return R.tm_wday},"%W":function(R){var B=R.tm_yday+7-(R.tm_wday+6)%7;return S(Math.floor(B/7),2)},"%y":function(R){return(R.tm_year+1900).toString().substring(2)},"%Y":function(R){return R.tm_year+1900},"%z":function(R){var B=R.tm_gmtoff,P=B>=0;return B=Math.abs(B)/60,B=B/60*100+B%60,(P?"+":"-")+("0000"+B).slice(-4)},"%Z":function(R){return R.tm_zone},"%%":function(){return"%"}};t=t.replace(/%%/g,"\0\0");for(var s in F)t.includes(s)&&(t=t.replace(new RegExp(s,"g"),F[s](o)));t=t.replace(/\0\0/g,"%");var L=Er(t,!1);return L.length>p?0:(Et(L,d),L.length-1)}function Kr(d,p,n){for(var r=ne(p),e="\\!@#$^&*()+=-[]/{}|:<>?,.",o=0,t=e.length;o<t;++o)r=r.replace(new RegExp("\\"+e[o],"g"),"\\"+e[o]);var a={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var s in a)r=r.replace(s,a[s]);var l={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},h={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},w={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},S={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var O in l)r=r.replace(O,"("+O+l[O]+")");for(var N=[],o=r.indexOf("%");o>=0;o=r.indexOf("%"))N.push(r[o+1]),r=r.replace(new RegExp("\\%"+r[o+1],"g"),"");var T=new RegExp("^"+r,"i").exec(ne(d));function F(){function rr(je,nr,or){return typeof je!="number"||isNaN(je)?nr:je>=nr?je<=or?je:or:nr}return{year:rr(E[n+20>>2]+1900,1970,9999),month:rr(E[n+16>>2],0,11),day:rr(E[n+12>>2],1,31),hour:rr(E[n+8>>2],0,23),min:rr(E[n+4>>2],0,59),sec:rr(E[n>>2],0,59)}}if(T){var L=F(),R,B=rr=>{var je=N.indexOf(rr);if(je>=0)return T[je+1]};if((R=B("S"))&&(L.sec=ce(R)),(R=B("M"))&&(L.min=ce(R)),R=B("H"))L.hour=ce(R);else if(R=B("I")){var P=ce(R);(R=B("p"))&&(P+=R.toUpperCase()[0]==="P"?12:0),L.hour=P}if(R=B("Y"))L.year=ce(R);else if(R=B("y")){var M=ce(R);(R=B("C"))?M+=ce(R)*100:M+=M<69?2e3:1900,L.year=M}if((R=B("m"))?L.month=ce(R)-1:(R=B("b"))&&(L.month=h[R.substring(0,3).toUpperCase()]||0),R=B("d"))L.day=ce(R);else if(R=B("j"))for(var z=ce(R),q=tr(L.year),W=0;W<12;++W){var X=Hr(q?Ge:Xe,W-1);z<=X+(q?Ge:Xe)[W]&&(L.day=z-X)}else if(R=B("a")){var oe=R.substring(0,3).toUpperCase();if(R=B("U")){var se=w[oe],Oe=ce(R),Ae=new Date(L.year,0,1),Qe;Ae.getDay()===0?Qe=Ve(Ae,se+7*(Oe-1)):Qe=Ve(Ae,7-Ae.getDay()+se+7*(Oe-1)),L.day=Qe.getDate(),L.month=Qe.getMonth()}else if(R=B("W")){var se=S[oe],Oe=ce(R),Ae=new Date(L.year,0,1),Qe;Ae.getDay()===1?Qe=Ve(Ae,se+7*(Oe-1)):Qe=Ve(Ae,7-Ae.getDay()+1+se+7*(Oe-1)),L.day=Qe.getDate(),L.month=Qe.getMonth()}}var Ke=new Date(L.year,L.month,L.day,L.hour,L.min,L.sec,0);return E[n>>2]=Ke.getSeconds(),E[n+4>>2]=Ke.getMinutes(),E[n+8>>2]=Ke.getHours(),E[n+12>>2]=Ke.getDate(),E[n+16>>2]=Ke.getMonth(),E[n+20>>2]=Ke.getFullYear()-1900,E[n+24>>2]=Ke.getDay(),E[n+28>>2]=Hr(tr(Ke.getFullYear())?Ge:Xe,Ke.getMonth()-1)+Ke.getDate()-1,E[n+32>>2]=0,d+Er(T[0]).length-1}return 0}function ot(d){return Ue.shutdownSocket(d,2)}function ft(d,p,n){if(typeof Asyncify>"u")return 0;let r=1,e=2,o=4,t=8,a=16,s=32;return Asyncify.handleSleep(l=>{let h=ke(d);if(!h){l(0);return}let w=[],S=new Set;if(p&r||p&e){if(h.server){for(let R of h.pending)if((R.recv_queue||[]).length>0){l(1);return}}else if((h.recv_queue||[]).length>0){l(1);return}}let O=Ue.getAllWebSockets(h);if(!O.length){l(0);return}for(let R of O)(p&r||p&e)&&(w.push(Ue.awaitData(R)),S.add("POLLIN")),p&o&&(w.push(Ue.awaitConnection(R)),S.add("POLLOUT")),p&a&&(w.push(Ue.awaitClose(R)),S.add("POLLHUP")),(p&t||p&s)&&(w.push(Ue.awaitError(R)),S.add("POLLERR"));if(w.length===0){console.warn("Unsupported poll event "+p+", defaulting to setTimeout()."),setTimeout(function(){l(0)},n);return}let N=w.map(([R])=>R),T=()=>w.forEach(([,R])=>R()),F=!1;Promise.race(N).then(function(R){F||(F=!0,l(1),clearTimeout(L),T())});let L=setTimeout(function(){F||(F=!0,l(0),T())},n)})}function Ot(d,p,n,r,e){let o=le[r];if(!(p===1&&n===9||p===6&&n===1))return console.warn(`Unsupported socket option: ${p}, ${n}, ${o}`),-1;let w=Ue.getAllWebSockets(d)[0];return w?(w.setSocketOpt(p,n,r),0):-1}function Dt(d){var p=f["_"+d];return p}function Jt(d,p,n,r,e){var o={string:N=>{var T=0;if(N!=null&&N!==0){var F=(N.length<<2)+1;T=sr(F),Fe(N,T,F)}return T},array:N=>{var T=sr(N.length);return Et(N,T),T}};function t(N){return p==="string"?ne(N):p==="boolean"?!!N:N}var a=Dt(d),s=[],l=0;if(r)for(var h=0;h<r.length;h++){var w=o[n[h]];w?(l===0&&(l=De()),s[h]=w(r[h])):s[h]=r[h]}var S=a.apply(null,s);function O(N){return l!==0&&ye(l),t(N)}return S=O(S),S}var Ut=function(d,p,n,r){d||(d=this),this.parent=d,this.mount=d.mount,this.mounted=null,this.id=i.nextInode++,this.name=p,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r},Xr=365,$r=146;Object.defineProperties(Ut.prototype,{read:{get:function(){return(this.mode&Xr)===Xr},set:function(d){d?this.mode|=Xr:this.mode&=~Xr}},write:{get:function(){return(this.mode&$r)===$r},set:function(d){d?this.mode|=$r:this.mode&=~$r}},isFolder:{get:function(){return i.isDir(this.mode)}},isDevice:{get:function(){return i.isChrdev(this.mode)}}}),i.FSNode=Ut,i.staticInit(),f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_unlink=i.unlink,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,te&&(yr(),V.staticInit()),re={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};var En={j:to,Ra:wt,Qa:v,Pa:Zr,Oa:dn,Na:Pt,N:oo,Ma:io,La:ao,Ka:so,Ja:uo,Ia:_n,Ha:fo,M:gt,m:co,Ga:lo,Q:_o,Fa:mo,Ea:vo,Da:po,Ca:ho,Ba:yo,L:Eo,Aa:wo,za:go,ya:So,xa:bo,B:ko,wa:Oo,va:kr,ua:Do,ta:Se,sa:No,K:To,ra:Ao,J:Fo,qa:Co,pa:Po,oa:Ro,I:Mo,na:Lo,ia:mn,ha:St,ga:Fn,fa:vn,ea:Io,da:Bo,ca:xo,ba:zo,aa:Ho,$:Wo,_:rt,n:jo,z:Kt,Z:Rt,F:tt,Y:qo,X:Vo,W:Mt,ma:st,la:On,p:Cn,t:Ko,H:pn,G:Zo,P:$o,ka:Jo,A:ei,E:Pn,D:ri,V:Mn,U:hn,T:$t,S:yn,h:_i,d:li,b:di,f:g,g:xn,v:u,s:In,u:m,y:_,e:Bn,a:Tn,c:Nn,l:fn,k:bn,o:D,i:k,x:c,R:hr,ja:qr,C:ut,O:Kr,r:ot,w:ft,q:Ot},ti=ro(),wn=f.___wasm_call_ctors=function(){return(wn=f.___wasm_call_ctors=f.asm.Ta).apply(null,arguments)},on=f._wasm_popen=function(){return(on=f._wasm_popen=f.asm.Ua).apply(null,arguments)},Qt=f.___errno_location=function(){return(Qt=f.___errno_location=f.asm.Va).apply(null,arguments)},Dn=f._wasm_pclose=function(){return(Dn=f._wasm_pclose=f.asm.Wa).apply(null,arguments)},gn=f._php_pollfd_for=function(){return(gn=f._php_pollfd_for=f.asm.Xa).apply(null,arguments)},Tt=f._wasm_select=function(){return(Tt=f._wasm_select=f.asm.Ya).apply(null,arguments)},Jr=f._wasm_add_cli_arg=function(){return(Jr=f._wasm_add_cli_arg=f.asm.Za).apply(null,arguments)},mr=f._malloc=function(){return(mr=f._malloc=f.asm._a).apply(null,arguments)},Qr=f._run_cli=function(){return(Qr=f._run_cli=f.asm.$a).apply(null,arguments)},It=f._memcpy=function(){return(It=f._memcpy=f.asm.ab).apply(null,arguments)},zr=f._free=function(){return(zr=f._free=f.asm.bb).apply(null,arguments)},Nt=f._ntohs=function(){return(Nt=f._ntohs=f.asm.db).apply(null,arguments)},Dr=f._htons=function(){return(Dr=f._htons=f.asm.eb).apply(null,arguments)},At=f._fflush=function(){return(At=f._fflush=f.asm.fb).apply(null,arguments)},an=f._wasm_set_phpini_path=function(){return(an=f._wasm_set_phpini_path=f.asm.gb).apply(null,arguments)},Br=f._wasm_set_phpini_entries=function(){return(Br=f._wasm_set_phpini_entries=f.asm.hb).apply(null,arguments)},Vr=f._wasm_add_SERVER_entry=function(){return(Vr=f._wasm_add_SERVER_entry=f.asm.ib).apply(null,arguments)},Ft=f._wasm_add_uploaded_file=function(){return(Ft=f._wasm_add_uploaded_file=f.asm.jb).apply(null,arguments)},sn=f._wasm_set_query_string=function(){return(sn=f._wasm_set_query_string=f.asm.kb).apply(null,arguments)},en=f._wasm_set_path_translated=function(){return(en=f._wasm_set_path_translated=f.asm.lb).apply(null,arguments)},un=f._wasm_set_skip_shebang=function(){return(un=f._wasm_set_skip_shebang=f.asm.mb).apply(null,arguments)},rn=f._wasm_set_request_uri=function(){return(rn=f._wasm_set_request_uri=f.asm.nb).apply(null,arguments)},tn=f._wasm_set_request_method=function(){return(tn=f._wasm_set_request_method=f.asm.ob).apply(null,arguments)},Sn=f._wasm_set_request_host=function(){return(Sn=f._wasm_set_request_host=f.asm.pb).apply(null,arguments)},ni=f._wasm_set_content_type=function(){return(ni=f._wasm_set_content_type=f.asm.qb).apply(null,arguments)},oi=f._wasm_set_request_body=function(){return(oi=f._wasm_set_request_body=f.asm.rb).apply(null,arguments)},ii=f._wasm_set_content_length=function(){return(ii=f._wasm_set_content_length=f.asm.sb).apply(null,arguments)},ai=f._wasm_set_cookies=function(){return(ai=f._wasm_set_cookies=f.asm.tb).apply(null,arguments)},si=f._wasm_set_php_code=function(){return(si=f._wasm_set_php_code=f.asm.ub).apply(null,arguments)},ui=f._wasm_set_request_port=function(){return(ui=f._wasm_set_request_port=f.asm.vb).apply(null,arguments)},fi=f._phpwasm_init_uploaded_files_hash=function(){return(fi=f._phpwasm_init_uploaded_files_hash=f.asm.wb).apply(null,arguments)},ci=f._phpwasm_register_uploaded_file=function(){return(ci=f._phpwasm_register_uploaded_file=f.asm.xb).apply(null,arguments)},Ln=f._phpwasm_destroy_uploaded_files_hash=function(){return(Ln=f._phpwasm_destroy_uploaded_files_hash=f.asm.yb).apply(null,arguments)},Un=f._wasm_sapi_handle_request=function(){return(Un=f._wasm_sapi_handle_request=f.asm.zb).apply(null,arguments)},Cr=f._php_wasm_init=function(){return(Cr=f._php_wasm_init=f.asm.Ab).apply(null,arguments)},Sr=f.___funcs_on_exit=function(){return(Sr=f.___funcs_on_exit=f.asm.Bb).apply(null,arguments)},br=f._emscripten_builtin_memalign=function(){return(br=f._emscripten_builtin_memalign=f.asm.Cb).apply(null,arguments)},Te=f._setThrew=function(){return(Te=f._setThrew=f.asm.Db).apply(null,arguments)},De=f.stackSave=function(){return(De=f.stackSave=f.asm.Eb).apply(null,arguments)},ye=f.stackRestore=function(){return(ye=f.stackRestore=f.asm.Fb).apply(null,arguments)},sr=f.stackAlloc=function(){return(sr=f.stackAlloc=f.asm.Gb).apply(null,arguments)},Ye=f.dynCall_viii=function(){return(Ye=f.dynCall_viii=f.asm.Hb).apply(null,arguments)},vr=f.dynCall_vii=function(){return(vr=f.dynCall_vii=f.asm.Ib).apply(null,arguments)},Be=f.dynCall_vi=function(){return(Be=f.dynCall_vi=f.asm.Jb).apply(null,arguments)},ur=f.dynCall_iii=function(){return(ur=f.dynCall_iii=f.asm.Kb).apply(null,arguments)},fr=f.dynCall_ii=function(){return(fr=f.dynCall_ii=f.asm.Lb).apply(null,arguments)},cr=f.dynCall_v=function(){return(cr=f.dynCall_v=f.asm.Mb).apply(null,arguments)},He=f.dynCall_iiii=function(){return(He=f.dynCall_iiii=f.asm.Nb).apply(null,arguments)},xe=f.dynCall_viiiii=function(){return(xe=f.dynCall_viiiii=f.asm.Ob).apply(null,arguments)},lr=f.dynCall_iiiii=function(){return(lr=f.dynCall_iiiii=f.asm.Pb).apply(null,arguments)},kt=f.dynCall_iiiiiii=function(){return(kt=f.dynCall_iiiiiii=f.asm.Qb).apply(null,arguments)},Bt=f.dynCall_iiiiii=function(){return(Bt=f.dynCall_iiiiii=f.asm.Rb).apply(null,arguments)},xt=f.dynCall_i=function(){return(xt=f.dynCall_i=f.asm.Sb).apply(null,arguments)},zt=f.dynCall_viiii=function(){return(zt=f.dynCall_viiii=f.asm.Tb).apply(null,arguments)},Ht=f.dynCall_iiiiiiiiii=function(){return(Ht=f.dynCall_iiiiiiiiii=f.asm.Ub).apply(null,arguments)},Wt=f.dynCall_viiiiiiiii=function(){return(Wt=f.dynCall_viiiiiiiii=f.asm.Vb).apply(null,arguments)},Yt=f.dynCall_viiiiii=function(){return(Yt=f.dynCall_viiiiii=f.asm.Wb).apply(null,arguments)},jt=f.dynCall_iiiiiiii=function(){return(jt=f.dynCall_iiiiiiii=f.asm.Xb).apply(null,arguments)};function fn(d,p,n,r){var e=De();try{Ye(d,p,n,r)}catch(o){if(ye(e),o!==o+0)throw o;Te(1,0)}}function Nn(d,p,n){var r=De();try{vr(d,p,n)}catch(e){if(ye(r),e!==e+0)throw e;Te(1,0)}}function Tn(d,p){var n=De();try{Be(d,p)}catch(r){if(ye(n),r!==r+0)throw r;Te(1,0)}}function In(d,p,n,r,e,o,t){var a=De();try{return kt(d,p,n,r,e,o,t)}catch(s){if(ye(a),s!==s+0)throw s;Te(1,0)}}function Bn(d){var p=De();try{cr(d)}catch(n){if(ye(p),n!==n+0)throw n;Te(1,0)}}function li(d,p){var n=De();try{return fr(d,p)}catch(r){if(ye(n),r!==r+0)throw r;Te(1,0)}}function di(d,p,n){var r=De();try{return ur(d,p,n)}catch(e){if(ye(r),e!==e+0)throw e;Te(1,0)}}function _i(d){var p=De();try{return xt(d)}catch(n){if(ye(p),n!==n+0)throw n;Te(1,0)}}function bn(d,p,n,r,e){var o=De();try{zt(d,p,n,r,e)}catch(t){if(ye(o),t!==t+0)throw t;Te(1,0)}}function xn(d,p,n,r,e){var o=De();try{return lr(d,p,n,r,e)}catch(t){if(ye(o),t!==t+0)throw t;Te(1,0)}}function g(d,p,n,r){var e=De();try{return He(d,p,n,r)}catch(o){if(ye(e),o!==o+0)throw o;Te(1,0)}}function k(d,p,n,r,e,o,t){var a=De();try{Yt(d,p,n,r,e,o,t)}catch(s){if(ye(a),s!==s+0)throw s;Te(1,0)}}function D(d,p,n,r,e,o){var t=De();try{xe(d,p,n,r,e,o)}catch(a){if(ye(t),a!==a+0)throw a;Te(1,0)}}function _(d,p,n,r,e,o,t,a,s,l){var h=De();try{return Ht(d,p,n,r,e,o,t,a,s,l)}catch(w){if(ye(h),w!==w+0)throw w;Te(1,0)}}function u(d,p,n,r,e,o){var t=De();try{return Bt(d,p,n,r,e,o)}catch(a){if(ye(t),a!==a+0)throw a;Te(1,0)}}function c(d,p,n,r,e,o,t,a,s,l){var h=De();try{Wt(d,p,n,r,e,o,t,a,s,l)}catch(w){if(ye(h),w!==w+0)throw w;Te(1,0)}}function m(d,p,n,r,e,o,t,a){var s=De();try{return jt(d,p,n,r,e,o,t,a)}catch(l){if(ye(s),l!==l+0)throw l;Te(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,f.FS_unlink=i.unlink,f.ccall=Jt,f.FS=i;var y;$e=function d(){y||b(),y||($e=d)};function b(d){if(d=d||$,Pe>0||(Vn(),Pe>0))return;function p(){y||(y=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),p()},1)):p()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return b(),A}var jf,uu,cu=Oi(()=>{"use strict";jf=10246953,uu=__dirname+"/php_7_1.wasm"});var du={};gi(du,{default:()=>Gf,dependenciesTotalSize:()=>Vf,dependencyFilename:()=>lu});function Gf(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(n,r)=>{throw r},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(n){return f.locateFile?f.locateFile(n,ve):ve+n}var We,ar,Re;function Wr(n){if(n instanceof Ur)return;fe("exiting due to exception: "+n)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(n,r)=>(yr(),n=Me.normalize(n),J.readFileSync(n,r?void 0:"utf8")),Re=n=>{var r=We(n,!0);return r.buffer||(r=new Uint8Array(r)),r},ar=(n,r,e)=>{yr(),n=Me.normalize(n),J.readFile(n,function(o,t){o?e(o):r(t.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(n){if(!(n instanceof Ur))throw n}),process.on("unhandledRejection",function(n){throw n}),_e=(n,r)=>{if(Mr())throw process.exitCode=n,r;Wr(r),process.exit(n)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(n,r){n||me(r)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(n,r,e){for(var o=r+e,t=r;n[t]&&!(t>=o);)++t;if(t-r>16&&n.buffer&&ct)return ct.decode(n.subarray(r,t));for(var a="";r<t;){var s=n[r++];if(!(s&128)){a+=String.fromCharCode(s);continue}var l=n[r++]&63;if((s&224)==192){a+=String.fromCharCode((s&31)<<6|l);continue}var h=n[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|h:s=(s&7)<<18|l<<12|h<<6|n[r++]&63,s<65536)a+=String.fromCharCode(s);else{var w=s-65536;a+=String.fromCharCode(55296|w>>10,56320|w&1023)}}return a}function ne(n,r){return n?ze(le,n,r):""}function Ze(n,r,e,o){if(!(o>0))return 0;for(var t=e,a=e+o-1,s=0;s<n.length;++s){var l=n.charCodeAt(s);if(l>=55296&&l<=57343){var h=n.charCodeAt(++s);l=65536+((l&1023)<<10)|h&1023}if(l<=127){if(e>=a)break;r[e++]=l}else if(l<=2047){if(e+1>=a)break;r[e++]=192|l>>6,r[e++]=128|l&63}else if(l<=65535){if(e+2>=a)break;r[e++]=224|l>>12,r[e++]=128|l>>6&63,r[e++]=128|l&63}else{if(e+3>=a)break;r[e++]=240|l>>18,r[e++]=128|l>>12&63,r[e++]=128|l>>6&63,r[e++]=128|l&63}}return r[e]=0,e-t}function Fe(n,r,e){return Ze(n,le,r,e)}function Ce(n){for(var r=0,e=0;e<n.length;++e){var o=n.charCodeAt(e);o<=127?r++:o<=2047?r+=2:o>=55296&&o<=57343?(r+=4,++e):r+=3}return r}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(n){Rr=n,f.HEAP8=ee=new Int8Array(n),f.HEAP16=we=new Int16Array(n),f.HEAP32=E=new Int32Array(n),f.HEAPU8=le=new Uint8Array(n),f.HEAPU16=lt=new Uint16Array(n),f.HEAPU32=j=new Uint32Array(n),f.HEAPF32=Hn=new Float32Array(n),f.HEAPF64=dt=new Float64Array(n)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!i.init.initialized&&i.init(),i.ignorePermissions=!1,ge.init(),H.root=i.mount(H,{},null),ae.root=i.mount(ae,{},null),_r(vt)}function Kn(){Sr(),_r(Wn),i.quit(),ge.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(n){mt.unshift(n)}function $n(n){vt.unshift(n)}function Jn(n){pt.unshift(n)}var Pe=0,Lr=null,$e=null;function Ci(n){return n}function dr(n){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(n){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var r=$e;$e=null,r()}}function me(n){f.onAbort&&f.onAbort(n),n="Aborted("+n+")",fe(n),Tr=!0,Pr=1,n+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(n);throw r}var Qn="data:application/octet-stream;base64,";function ht(n){return n.startsWith(Qn)}var de;de=lu,ht(de)||(de=Nr(de));function yt(n){try{if(n==de&&qe)return new Uint8Array(qe);if(Re)return Re(n);throw"both async and sync fetching of the wasm failed"}catch(r){me(r)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+de+"'";return n.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var n={a:En};function r(s,l){var h=s.exports;f.asm=h,ir=f.asm.Sa,_t(ir.buffer),ln=f.asm.cb,$n(f.asm.Ta),Je("wasm-instantiate")}dr("wasm-instantiate");function e(s){r(s.instance)}function o(s){return eo().then(function(l){return WebAssembly.instantiate(l,n)}).then(function(l){return l}).then(s,function(l){fe("failed to asynchronously prepare wasm: "+l),me(l)})}function t(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(s){var l=WebAssembly.instantiateStreaming(s,n);return l.then(e,function(h){return fe("wasm streaming compile failed: "+h),fe("falling back to ArrayBuffer instantiation"),o(e)})}):o(e)}if(f.instantiateWasm)try{var a=f.instantiateWasm(n,r);return a}catch(s){return fe("Module.instantiateWasm callback failed with error: "+s),!1}return t(),{}}var U,Z;function Ur(n){this.name="ExitStatus",this.message="Program terminated with exit("+n+")",this.status=n}function _r(n){for(;n.length>0;)n.shift()(f)}function Et(n,r){ee.set(n,r)}function to(n,r,e,o){me("Assertion failed: "+ne(n)+", at: "+[r?ne(r):"unknown filename",e,o?ne(o):"unknown function"])}function wt(n,r){(function(e){Be.apply(null,[n,e])})(r)}var Y={isAbs:n=>n.charAt(0)==="/",splitPath:n=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(n).slice(1)},normalizeArray:(n,r)=>{for(var e=0,o=n.length-1;o>=0;o--){var t=n[o];t==="."?n.splice(o,1):t===".."?(n.splice(o,1),e++):e&&(n.splice(o,1),e--)}if(r)for(;e;e--)n.unshift("..");return n},normalize:n=>{var r=Y.isAbs(n),e=n.substr(-1)==="/";return n=Y.normalizeArray(n.split("/").filter(o=>!!o),!r).join("/"),!n&&!r&&(n="."),n&&e&&(n+="/"),(r?"/":"")+n},dirname:n=>{var r=Y.splitPath(n),e=r[0],o=r[1];return!e&&!o?".":(o&&(o=o.substr(0,o.length-1)),e+o)},basename:n=>{if(n==="/")return"/";n=Y.normalize(n),n=n.replace(/\/$/,"");var r=n.lastIndexOf("/");return r===-1?n:n.substr(r+1)},join:function(){var n=Array.prototype.slice.call(arguments);return Y.normalize(n.join("/"))},join2:(n,r)=>Y.normalize(n+"/"+r)};function no(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var n=new Uint8Array(1);return()=>(crypto.getRandomValues(n),n[0])}else if(te)try{var r=require("crypto");return()=>r.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var Q={resolve:function(){for(var n="",r=!1,e=arguments.length-1;e>=-1&&!r;e--){var o=e>=0?arguments[e]:i.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";n=o+"/"+n,r=Y.isAbs(o)}return n=Y.normalizeArray(n.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+n||"."},relative:(n,r)=>{n=Q.resolve(n).substr(1),r=Q.resolve(r).substr(1);function e(w){for(var S=0;S<w.length&&w[S]==="";S++);for(var O=w.length-1;O>=0&&w[O]==="";O--);return S>O?[]:w.slice(S,O-S+1)}for(var o=e(n.split("/")),t=e(r.split("/")),a=Math.min(o.length,t.length),s=a,l=0;l<a;l++)if(o[l]!==t[l]){s=l;break}for(var h=[],l=s;l<o.length;l++)h.push("..");return h=h.concat(t.slice(s)),h.join("/")}};function Er(n,r,e){var o=e>0?e:Ce(n)+1,t=new Array(o),a=Ze(n,t,0,t.length);return r&&(t.length=a),t}var ge={ttys:[],init:function(){},shutdown:function(){},register:function(n,r){ge.ttys[n]={input:[],output:[],ops:r},i.registerDevice(n,ge.stream_ops)},stream_ops:{open:function(n){var r=ge.ttys[n.node.rdev];if(!r)throw new i.ErrnoError(43);n.tty=r,n.seekable=!1},close:function(n){n.tty.ops.fsync(n.tty)},fsync:function(n){n.tty.ops.fsync(n.tty)},read:function(n,r,e,o,t){if(!n.tty||!n.tty.ops.get_char)throw new i.ErrnoError(60);for(var a=0,s=0;s<o;s++){var l;try{l=n.tty.ops.get_char(n.tty)}catch{throw new i.ErrnoError(29)}if(l===void 0&&a===0)throw new i.ErrnoError(6);if(l==null)break;a++,r[e+s]=l}return a&&(n.node.timestamp=Date.now()),a},write:function(n,r,e,o,t){if(!n.tty||!n.tty.ops.put_char)throw new i.ErrnoError(60);try{for(var a=0;a<o;a++)n.tty.ops.put_char(n.tty,r[e+a])}catch{throw new i.ErrnoError(29)}return o&&(n.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(n){if(!n.input.length){var r=null;if(te){var e=256,o=Buffer.alloc(e),t=0;try{t=J.readSync(process.stdin.fd,o,0,e,-1)}catch(a){if(a.toString().includes("EOF"))t=0;else throw a}t>0?r=o.slice(0,t).toString("utf-8"):r=null}else typeof window<"u"&&typeof window.prompt=="function"?(r=window.prompt("Input: "),r!==null&&(r+=`
29
+ `)):typeof readline=="function"&&(r=readline(),r!==null&&(r+=`
30
+ `));if(!r)return null;n.input=Er(r,!0)}return n.input.shift()},put_char:function(n,r){r===null||r===10?(er(ze(n.output,0)),n.output=[]):r!=0&&n.output.push(r)},fsync:function(n){n.output&&n.output.length>0&&(er(ze(n.output,0)),n.output=[])}},default_tty1_ops:{put_char:function(n,r){r===null||r===10?(fe(ze(n.output,0)),n.output=[]):r!=0&&n.output.push(r)},fsync:function(n){n.output&&n.output.length>0&&(fe(ze(n.output,0)),n.output=[])}}};function wr(n,r){return le.fill(0,n,n+r),n}function gr(n,r){return Math.ceil(n/r)*r}function Ir(n){n=gr(n,65536);var r=br(65536,n);return r?wr(r,n):0}var G={ops_table:null,mount:function(n){return G.createNode(null,"/",16895,0)},createNode:function(n,r,e,o){if(i.isBlkdev(e)||i.isFIFO(e))throw new i.ErrnoError(63);G.ops_table||(G.ops_table={dir:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,lookup:G.node_ops.lookup,mknod:G.node_ops.mknod,rename:G.node_ops.rename,unlink:G.node_ops.unlink,rmdir:G.node_ops.rmdir,readdir:G.node_ops.readdir,symlink:G.node_ops.symlink},stream:{llseek:G.stream_ops.llseek}},file:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:{llseek:G.stream_ops.llseek,read:G.stream_ops.read,write:G.stream_ops.write,allocate:G.stream_ops.allocate,mmap:G.stream_ops.mmap,msync:G.stream_ops.msync}},link:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,readlink:G.node_ops.readlink},stream:{}},chrdev:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:i.chrdev_stream_ops}});var t=i.createNode(n,r,e,o);return i.isDir(t.mode)?(t.node_ops=G.ops_table.dir.node,t.stream_ops=G.ops_table.dir.stream,t.contents={}):i.isFile(t.mode)?(t.node_ops=G.ops_table.file.node,t.stream_ops=G.ops_table.file.stream,t.usedBytes=0,t.contents=null):i.isLink(t.mode)?(t.node_ops=G.ops_table.link.node,t.stream_ops=G.ops_table.link.stream):i.isChrdev(t.mode)&&(t.node_ops=G.ops_table.chrdev.node,t.stream_ops=G.ops_table.chrdev.stream),t.timestamp=Date.now(),n&&(n.contents[r]=t,n.timestamp=t.timestamp),t},getFileDataAsTypedArray:function(n){return n.contents?n.contents.subarray?n.contents.subarray(0,n.usedBytes):new Uint8Array(n.contents):new Uint8Array(0)},expandFileStorage:function(n,r){var e=n.contents?n.contents.length:0;if(!(e>=r)){var o=1024*1024;r=Math.max(r,e*(e<o?2:1.125)>>>0),e!=0&&(r=Math.max(r,256));var t=n.contents;n.contents=new Uint8Array(r),n.usedBytes>0&&n.contents.set(t.subarray(0,n.usedBytes),0)}},resizeFileStorage:function(n,r){if(n.usedBytes!=r)if(r==0)n.contents=null,n.usedBytes=0;else{var e=n.contents;n.contents=new Uint8Array(r),e&&n.contents.set(e.subarray(0,Math.min(r,n.usedBytes))),n.usedBytes=r}},node_ops:{getattr:function(n){var r={};return r.dev=i.isChrdev(n.mode)?n.id:1,r.ino=n.id,r.mode=n.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=n.rdev,i.isDir(n.mode)?r.size=4096:i.isFile(n.mode)?r.size=n.usedBytes:i.isLink(n.mode)?r.size=n.link.length:r.size=0,r.atime=new Date(n.timestamp),r.mtime=new Date(n.timestamp),r.ctime=new Date(n.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(n,r){r.mode!==void 0&&(n.mode=r.mode),r.timestamp!==void 0&&(n.timestamp=r.timestamp),r.size!==void 0&&G.resizeFileStorage(n,r.size)},lookup:function(n,r){throw i.genericErrors[44]},mknod:function(n,r,e,o){return G.createNode(n,r,e,o)},rename:function(n,r,e){if(i.isDir(n.mode)){var o;try{o=i.lookupNode(r,e)}catch{}if(o)for(var t in o.contents)throw new i.ErrnoError(55)}delete n.parent.contents[n.name],n.parent.timestamp=Date.now(),n.name=e,r.contents[e]=n,r.timestamp=n.parent.timestamp,n.parent=r},unlink:function(n,r){delete n.contents[r],n.timestamp=Date.now()},rmdir:function(n,r){var e=i.lookupNode(n,r);for(var o in e.contents)throw new i.ErrnoError(55);delete n.contents[r],n.timestamp=Date.now()},readdir:function(n){var r=[".",".."];for(var e in n.contents)n.contents.hasOwnProperty(e)&&r.push(e);return r},symlink:function(n,r,e){var o=G.createNode(n,r,41471,0);return o.link=e,o},readlink:function(n){if(!i.isLink(n.mode))throw new i.ErrnoError(28);return n.link}},stream_ops:{read:function(n,r,e,o,t){var a=n.node.contents;if(t>=n.node.usedBytes)return 0;var s=Math.min(n.node.usedBytes-t,o);if(s>8&&a.subarray)r.set(a.subarray(t,t+s),e);else for(var l=0;l<s;l++)r[e+l]=a[t+l];return s},write:function(n,r,e,o,t,a){if(r.buffer===ee.buffer&&(a=!1),!o)return 0;var s=n.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(a)return s.contents=r.subarray(e,e+o),s.usedBytes=o,o;if(s.usedBytes===0&&t===0)return s.contents=r.slice(e,e+o),s.usedBytes=o,o;if(t+o<=s.usedBytes)return s.contents.set(r.subarray(e,e+o),t),o}if(G.expandFileStorage(s,t+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(e,e+o),t);else for(var l=0;l<o;l++)s.contents[t+l]=r[e+l];return s.usedBytes=Math.max(s.usedBytes,t+o),o},llseek:function(n,r,e){var o=r;if(e===1?o+=n.position:e===2&&i.isFile(n.node.mode)&&(o+=n.node.usedBytes),o<0)throw new i.ErrnoError(28);return o},allocate:function(n,r,e){G.expandFileStorage(n.node,r+e),n.node.usedBytes=Math.max(n.node.usedBytes,r+e)},mmap:function(n,r,e,o,t){if(!i.isFile(n.node.mode))throw new i.ErrnoError(43);var a,s,l=n.node.contents;if(!(t&2)&&l.buffer===Rr)s=!1,a=l.byteOffset;else{if((e>0||e+r<l.length)&&(l.subarray?l=l.subarray(e,e+r):l=Array.prototype.slice.call(l,e,e+r)),s=!0,a=Ir(r),!a)throw new i.ErrnoError(48);ee.set(l,a)}return{ptr:a,allocated:s}},msync:function(n,r,e,o,t){return G.stream_ops.write(n,r,0,o,e,!1),0}}};function Ct(n,r,e,o){var t=o?"":"al "+n;ar(n,a=>{Le(a,'Loading data file "'+n+'" failed (no arrayBuffer).'),r(new Uint8Array(a)),t&&Je(t)},a=>{if(e)e();else throw'Loading data file "'+n+'" failed.'}),t&&dr(t)}var re={},V={isWindows:!1,staticInit:()=>{V.isWindows=!!process.platform.match(/^win/);var n=process.binding("constants");n.fs&&(n=n.fs),V.flagsForNodeMap={1024:n.O_APPEND,64:n.O_CREAT,128:n.O_EXCL,256:n.O_NOCTTY,0:n.O_RDONLY,2:n.O_RDWR,4096:n.O_SYNC,512:n.O_TRUNC,1:n.O_WRONLY,131072:n.O_NOFOLLOW}},convertNodeCode:n=>{var r=n.code;return re[r]},mount:n=>V.createNode(null,"/",V.getMode(n.opts.root),0),createNode:(n,r,e,o)=>{if(!i.isDir(e)&&!i.isFile(e)&&!i.isLink(e))throw new i.ErrnoError(28);var t=i.createNode(n,r,e);return t.node_ops=V.node_ops,t.stream_ops=V.stream_ops,t},getMode:n=>{var r;try{r=J.lstatSync(n),V.isWindows&&(r.mode=r.mode|(r.mode&292)>>2)}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}return r.mode},realPath:n=>{for(var r=[];n.parent!==n;)r.push(n.name),n=n.parent;return r.push(n.mount.opts.root),r.reverse(),Y.join.apply(null,r)},flagsForNode:n=>{n&=-2097153,n&=-2049,n&=-32769,n&=-524289,n&=-65537;var r=0;for(var e in V.flagsForNodeMap)n&e&&(r|=V.flagsForNodeMap[e],n^=e);if(n)throw new i.ErrnoError(28);return r},node_ops:{getattr:n=>{var r=V.realPath(n),e;try{e=J.lstatSync(r)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}return V.isWindows&&!e.blksize&&(e.blksize=4096),V.isWindows&&!e.blocks&&(e.blocks=(e.size+e.blksize-1)/e.blksize|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},setattr:(n,r)=>{var e=V.realPath(n);try{if(r.mode!==void 0&&(J.chmodSync(e,r.mode),n.mode=r.mode),r.timestamp!==void 0){var o=new Date(r.timestamp);J.utimesSync(e,o,o)}r.size!==void 0&&J.truncateSync(e,r.size)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}},lookup:(n,r)=>{var e=Y.join2(V.realPath(n),r),o=V.getMode(e);return V.createNode(n,r,o)},mknod:(n,r,e,o)=>{var t=V.createNode(n,r,e,o),a=V.realPath(t);try{i.isDir(t.mode)?J.mkdirSync(a,t.mode):J.writeFileSync(a,"",{mode:t.mode})}catch(s){throw s.code?new i.ErrnoError(V.convertNodeCode(s)):s}return t},rename:(n,r,e)=>{var o=V.realPath(n),t=Y.join2(V.realPath(r),e);try{J.renameSync(o,t)}catch(a){throw a.code?new i.ErrnoError(V.convertNodeCode(a)):a}n.name=e},unlink:(n,r)=>{var e=Y.join2(V.realPath(n),r);try{J.unlinkSync(e)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}},rmdir:(n,r)=>{var e=Y.join2(V.realPath(n),r);try{J.rmdirSync(e)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}},readdir:n=>{var r=V.realPath(n);try{return J.readdirSync(r)}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}},symlink:(n,r,e)=>{var o=Y.join2(V.realPath(n),r);try{J.symlinkSync(e,o)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}},readlink:n=>{var r=V.realPath(n);try{return r=J.readlinkSync(r),r=Me.relative(Me.resolve(n.mount.opts.root),r),r}catch(e){throw e.code?e.code==="UNKNOWN"?new i.ErrnoError(28):new i.ErrnoError(V.convertNodeCode(e)):e}}},stream_ops:{open:n=>{var r=V.realPath(n.node);try{i.isFile(n.node.mode)&&(n.nfd=J.openSync(r,V.flagsForNode(n.flags)))}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}},close:n=>{try{i.isFile(n.node.mode)&&n.nfd&&J.closeSync(n.nfd)}catch(r){throw r.code?new i.ErrnoError(V.convertNodeCode(r)):r}},read:(n,r,e,o,t)=>{if(o===0)return 0;try{return J.readSync(n.nfd,Buffer.from(r.buffer),e,o,t)}catch(a){throw new i.ErrnoError(V.convertNodeCode(a))}},write:(n,r,e,o,t)=>{try{return J.writeSync(n.nfd,Buffer.from(r.buffer),e,o,t)}catch(a){throw new i.ErrnoError(V.convertNodeCode(a))}},llseek:(n,r,e)=>{var o=r;if(e===1)o+=n.position;else if(e===2&&i.isFile(n.node.mode))try{var t=J.fstatSync(n.nfd);o+=t.size}catch(a){throw new i.ErrnoError(V.convertNodeCode(a))}if(o<0)throw new i.ErrnoError(28);return o},mmap:(n,r,e,o,t)=>{if(!i.isFile(n.node.mode))throw new i.ErrnoError(43);var a=Ir(r);return V.stream_ops.read(n,ee,a,r,e),{ptr:a,allocated:!0}},msync:(n,r,e,o,t)=>(V.stream_ops.write(n,r,0,o,e,!1),0)}},i={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(n,r={})=>{if(n=Q.resolve(i.cwd(),n),!n)return{path:"",node:null};var e={follow_mount:!0,recurse_count:0};if(r=Object.assign(e,r),r.recurse_count>8)throw new i.ErrnoError(32);for(var o=Y.normalizeArray(n.split("/").filter(O=>!!O),!1),t=i.root,a="/",s=0;s<o.length;s++){var l=s===o.length-1;if(l&&r.parent)break;if(t=i.lookupNode(t,o[s]),a=Y.join2(a,o[s]),i.isMountpoint(t)&&(!l||l&&r.follow_mount)&&(t=t.mounted.root),!l||r.follow)for(var h=0;i.isLink(t.mode);){var w=i.readlink(a);a=Q.resolve(Y.dirname(a),w);var S=i.lookupPath(a,{recurse_count:r.recurse_count+1});if(t=S.node,h++>40)throw new i.ErrnoError(32)}}return{path:a,node:t}},getPath:n=>{for(var r;;){if(i.isRoot(n)){var e=n.mount.mountpoint;return r?e[e.length-1]!=="/"?e+"/"+r:e+r:e}r=r?n.name+"/"+r:n.name,n=n.parent}},hashName:(n,r)=>{for(var e=0,o=0;o<r.length;o++)e=(e<<5)-e+r.charCodeAt(o)|0;return(n+e>>>0)%i.nameTable.length},hashAddNode:n=>{var r=i.hashName(n.parent.id,n.name);n.name_next=i.nameTable[r],i.nameTable[r]=n},hashRemoveNode:n=>{var r=i.hashName(n.parent.id,n.name);if(i.nameTable[r]===n)i.nameTable[r]=n.name_next;else for(var e=i.nameTable[r];e;){if(e.name_next===n){e.name_next=n.name_next;break}e=e.name_next}},lookupNode:(n,r)=>{var e=i.mayLookup(n);if(e)throw new i.ErrnoError(e,n);for(var o=i.hashName(n.id,r),t=i.nameTable[o];t;t=t.name_next){var a=t.name;if(t.parent.id===n.id&&a===r)return t}return i.lookup(n,r)},createNode:(n,r,e,o)=>{var t=new i.FSNode(n,r,e,o);return i.hashAddNode(t),t},destroyNode:n=>{i.hashRemoveNode(n)},isRoot:n=>n===n.parent,isMountpoint:n=>!!n.mounted,isFile:n=>(n&61440)===32768,isDir:n=>(n&61440)===16384,isLink:n=>(n&61440)===40960,isChrdev:n=>(n&61440)===8192,isBlkdev:n=>(n&61440)===24576,isFIFO:n=>(n&61440)===4096,isSocket:n=>(n&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:n=>{var r=i.flagModes[n];if(typeof r>"u")throw new Error("Unknown file open mode: "+n);return r},flagsToPermissionString:n=>{var r=["r","w","rw"][n&3];return n&512&&(r+="w"),r},nodePermissions:(n,r)=>i.ignorePermissions?0:r.includes("r")&&!(n.mode&292)||r.includes("w")&&!(n.mode&146)||r.includes("x")&&!(n.mode&73)?2:0,mayLookup:n=>{var r=i.nodePermissions(n,"x");return r||(n.node_ops.lookup?0:2)},mayCreate:(n,r)=>{try{var e=i.lookupNode(n,r);return 20}catch{}return i.nodePermissions(n,"wx")},mayDelete:(n,r,e)=>{var o;try{o=i.lookupNode(n,r)}catch(a){return a.errno}var t=i.nodePermissions(n,"wx");if(t)return t;if(e){if(!i.isDir(o.mode))return 54;if(i.isRoot(o)||i.getPath(o)===i.cwd())return 10}else if(i.isDir(o.mode))return 31;return 0},mayOpen:(n,r)=>n?i.isLink(n.mode)?32:i.isDir(n.mode)&&(i.flagsToPermissionString(r)!=="r"||r&512)?31:i.nodePermissions(n,i.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(n=0,r=i.MAX_OPEN_FDS)=>{for(var e=n;e<=r;e++)if(!i.streams[e])return e;throw new i.ErrnoError(33)},getStream:n=>i.streams[n],createStream:(n,r,e)=>{i.FSStream||(i.FSStream=function(){this.shared={}},i.FSStream.prototype={},Object.defineProperties(i.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),n=Object.assign(new i.FSStream,n);var o=i.nextfd(r,e);return n.fd=o,i.streams[o]=n,n},closeStream:n=>{i.streams[n]=null},chrdev_stream_ops:{open:n=>{var r=i.getDevice(n.node.rdev);n.stream_ops=r.stream_ops,n.stream_ops.open&&n.stream_ops.open(n)},llseek:()=>{throw new i.ErrnoError(70)}},major:n=>n>>8,minor:n=>n&255,makedev:(n,r)=>n<<8|r,registerDevice:(n,r)=>{i.devices[n]={stream_ops:r}},getDevice:n=>i.devices[n],getMounts:n=>{for(var r=[],e=[n];e.length;){var o=e.pop();r.push(o),e.push.apply(e,o.mounts)}return r},syncfs:(n,r)=>{typeof n=="function"&&(r=n,n=!1),i.syncFSRequests++,i.syncFSRequests>1&&fe("warning: "+i.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=i.getMounts(i.root.mount),o=0;function t(s){return i.syncFSRequests--,r(s)}function a(s){if(s)return a.errored?void 0:(a.errored=!0,t(s));++o>=e.length&&t(null)}e.forEach(s=>{if(!s.type.syncfs)return a(null);s.type.syncfs(s,n,a)})},mount:(n,r,e)=>{var o=e==="/",t=!e,a;if(o&&i.root)throw new i.ErrnoError(10);if(!o&&!t){var s=i.lookupPath(e,{follow_mount:!1});if(e=s.path,a=s.node,i.isMountpoint(a))throw new i.ErrnoError(10);if(!i.isDir(a.mode))throw new i.ErrnoError(54)}var l={type:n,opts:r,mountpoint:e,mounts:[]},h=n.mount(l);return h.mount=l,l.root=h,o?i.root=h:a&&(a.mounted=l,a.mount&&a.mount.mounts.push(l)),h},unmount:n=>{var r=i.lookupPath(n,{follow_mount:!1});if(!i.isMountpoint(r.node))throw new i.ErrnoError(28);var e=r.node,o=e.mounted,t=i.getMounts(o);Object.keys(i.nameTable).forEach(s=>{for(var l=i.nameTable[s];l;){var h=l.name_next;t.includes(l.mount)&&i.destroyNode(l),l=h}}),e.mounted=null;var a=e.mount.mounts.indexOf(o);e.mount.mounts.splice(a,1)},lookup:(n,r)=>n.node_ops.lookup(n,r),mknod:(n,r,e)=>{var o=i.lookupPath(n,{parent:!0}),t=o.node,a=Y.basename(n);if(!a||a==="."||a==="..")throw new i.ErrnoError(28);var s=i.mayCreate(t,a);if(s)throw new i.ErrnoError(s);if(!t.node_ops.mknod)throw new i.ErrnoError(63);return t.node_ops.mknod(t,a,r,e)},create:(n,r)=>(r=r!==void 0?r:438,r&=4095,r|=32768,i.mknod(n,r,0)),mkdir:(n,r)=>(r=r!==void 0?r:511,r&=1023,r|=16384,i.mknod(n,r,0)),mkdirTree:(n,r)=>{for(var e=n.split("/"),o="",t=0;t<e.length;++t)if(e[t]){o+="/"+e[t];try{i.mkdir(o,r)}catch(a){if(a.errno!=20)throw a}}},mkdev:(n,r,e)=>(typeof e>"u"&&(e=r,r=438),r|=8192,i.mknod(n,r,e)),symlink:(n,r)=>{if(!Q.resolve(n))throw new i.ErrnoError(44);var e=i.lookupPath(r,{parent:!0}),o=e.node;if(!o)throw new i.ErrnoError(44);var t=Y.basename(r),a=i.mayCreate(o,t);if(a)throw new i.ErrnoError(a);if(!o.node_ops.symlink)throw new i.ErrnoError(63);return o.node_ops.symlink(o,t,n)},rename:(n,r)=>{var e=Y.dirname(n),o=Y.dirname(r),t=Y.basename(n),a=Y.basename(r),s,l,h;if(s=i.lookupPath(n,{parent:!0}),l=s.node,s=i.lookupPath(r,{parent:!0}),h=s.node,!l||!h)throw new i.ErrnoError(44);if(l.mount!==h.mount)throw new i.ErrnoError(75);var w=i.lookupNode(l,t),S=Q.relative(n,o);if(S.charAt(0)!==".")throw new i.ErrnoError(28);if(S=Q.relative(r,e),S.charAt(0)!==".")throw new i.ErrnoError(55);var O;try{O=i.lookupNode(h,a)}catch{}if(w!==O){var N=i.isDir(w.mode),T=i.mayDelete(l,t,N);if(T)throw new i.ErrnoError(T);if(T=O?i.mayDelete(h,a,N):i.mayCreate(h,a),T)throw new i.ErrnoError(T);if(!l.node_ops.rename)throw new i.ErrnoError(63);if(i.isMountpoint(w)||O&&i.isMountpoint(O))throw new i.ErrnoError(10);if(h!==l&&(T=i.nodePermissions(l,"w"),T))throw new i.ErrnoError(T);i.hashRemoveNode(w);try{l.node_ops.rename(w,h,a)}catch(F){throw F}finally{i.hashAddNode(w)}}},rmdir:n=>{var r=i.lookupPath(n,{parent:!0}),e=r.node,o=Y.basename(n),t=i.lookupNode(e,o),a=i.mayDelete(e,o,!0);if(a)throw new i.ErrnoError(a);if(!e.node_ops.rmdir)throw new i.ErrnoError(63);if(i.isMountpoint(t))throw new i.ErrnoError(10);e.node_ops.rmdir(e,o),i.destroyNode(t)},readdir:n=>{var r=i.lookupPath(n,{follow:!0}),e=r.node;if(!e.node_ops.readdir)throw new i.ErrnoError(54);return e.node_ops.readdir(e)},unlink:n=>{var r=i.lookupPath(n,{parent:!0}),e=r.node;if(!e)throw new i.ErrnoError(44);var o=Y.basename(n),t=i.lookupNode(e,o),a=i.mayDelete(e,o,!1);if(a)throw new i.ErrnoError(a);if(!e.node_ops.unlink)throw new i.ErrnoError(63);if(i.isMountpoint(t))throw new i.ErrnoError(10);e.node_ops.unlink(e,o),i.destroyNode(t)},readlink:n=>{var r=i.lookupPath(n),e=r.node;if(!e)throw new i.ErrnoError(44);if(!e.node_ops.readlink)throw new i.ErrnoError(28);return Q.resolve(i.getPath(e.parent),e.node_ops.readlink(e))},stat:(n,r)=>{var e=i.lookupPath(n,{follow:!r}),o=e.node;if(!o)throw new i.ErrnoError(44);if(!o.node_ops.getattr)throw new i.ErrnoError(63);return o.node_ops.getattr(o)},lstat:n=>i.stat(n,!0),chmod:(n,r,e)=>{var o;if(typeof n=="string"){var t=i.lookupPath(n,{follow:!e});o=t.node}else o=n;if(!o.node_ops.setattr)throw new i.ErrnoError(63);o.node_ops.setattr(o,{mode:r&4095|o.mode&-4096,timestamp:Date.now()})},lchmod:(n,r)=>{i.chmod(n,r,!0)},fchmod:(n,r)=>{var e=i.getStream(n);if(!e)throw new i.ErrnoError(8);i.chmod(e.node,r)},chown:(n,r,e,o)=>{var t;if(typeof n=="string"){var a=i.lookupPath(n,{follow:!o});t=a.node}else t=n;if(!t.node_ops.setattr)throw new i.ErrnoError(63);t.node_ops.setattr(t,{timestamp:Date.now()})},lchown:(n,r,e)=>{i.chown(n,r,e,!0)},fchown:(n,r,e)=>{var o=i.getStream(n);if(!o)throw new i.ErrnoError(8);i.chown(o.node,r,e)},truncate:(n,r)=>{if(r<0)throw new i.ErrnoError(28);var e;if(typeof n=="string"){var o=i.lookupPath(n,{follow:!0});e=o.node}else e=n;if(!e.node_ops.setattr)throw new i.ErrnoError(63);if(i.isDir(e.mode))throw new i.ErrnoError(31);if(!i.isFile(e.mode))throw new i.ErrnoError(28);var t=i.nodePermissions(e,"w");if(t)throw new i.ErrnoError(t);e.node_ops.setattr(e,{size:r,timestamp:Date.now()})},ftruncate:(n,r)=>{var e=i.getStream(n);if(!e)throw new i.ErrnoError(8);if(!(e.flags&2097155))throw new i.ErrnoError(28);i.truncate(e.node,r)},utime:(n,r,e)=>{var o=i.lookupPath(n,{follow:!0}),t=o.node;t.node_ops.setattr(t,{timestamp:Math.max(r,e)})},open:(n,r,e)=>{if(n==="")throw new i.ErrnoError(44);r=typeof r=="string"?i.modeStringToFlags(r):r,e=typeof e>"u"?438:e,r&64?e=e&4095|32768:e=0;var o;if(typeof n=="object")o=n;else{n=Y.normalize(n);try{var t=i.lookupPath(n,{follow:!(r&131072)});o=t.node}catch{}}var a=!1;if(r&64)if(o){if(r&128)throw new i.ErrnoError(20)}else o=i.mknod(n,e,0),a=!0;if(!o)throw new i.ErrnoError(44);if(i.isChrdev(o.mode)&&(r&=-513),r&65536&&!i.isDir(o.mode))throw new i.ErrnoError(54);if(!a){var s=i.mayOpen(o,r);if(s)throw new i.ErrnoError(s)}r&512&&!a&&i.truncate(o,0),r&=-131713;var l=i.createStream({node:o,path:i.getPath(o),flags:r,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),f.logReadFiles&&!(r&1)&&(i.readFiles||(i.readFiles={}),n in i.readFiles||(i.readFiles[n]=1)),l},close:n=>{if(i.isClosed(n))throw new i.ErrnoError(8);n.getdents&&(n.getdents=null);try{n.stream_ops.close&&n.stream_ops.close(n)}catch(r){throw r}finally{i.closeStream(n.fd)}n.fd=null},isClosed:n=>n.fd===null,llseek:(n,r,e)=>{if(i.isClosed(n))throw new i.ErrnoError(8);if(!n.seekable||!n.stream_ops.llseek)throw new i.ErrnoError(70);if(e!=0&&e!=1&&e!=2)throw new i.ErrnoError(28);return n.position=n.stream_ops.llseek(n,r,e),n.ungotten=[],n.position},read:(n,r,e,o,t)=>{if(o<0||t<0)throw new i.ErrnoError(28);if(i.isClosed(n))throw new i.ErrnoError(8);if((n.flags&2097155)===1)throw new i.ErrnoError(8);if(i.isDir(n.node.mode))throw new i.ErrnoError(31);if(!n.stream_ops.read)throw new i.ErrnoError(28);var a=typeof t<"u";if(!a)t=n.position;else if(!n.seekable)throw new i.ErrnoError(70);var s=n.stream_ops.read(n,r,e,o,t);return a||(n.position+=s),s},write:(n,r,e,o,t,a)=>{if(o<0||t<0)throw new i.ErrnoError(28);if(i.isClosed(n))throw new i.ErrnoError(8);if(!(n.flags&2097155))throw new i.ErrnoError(8);if(i.isDir(n.node.mode))throw new i.ErrnoError(31);if(!n.stream_ops.write)throw new i.ErrnoError(28);n.seekable&&n.flags&1024&&i.llseek(n,0,2);var s=typeof t<"u";if(!s)t=n.position;else if(!n.seekable)throw new i.ErrnoError(70);var l=n.stream_ops.write(n,r,e,o,t,a);return s||(n.position+=l),l},allocate:(n,r,e)=>{if(i.isClosed(n))throw new i.ErrnoError(8);if(r<0||e<=0)throw new i.ErrnoError(28);if(!(n.flags&2097155))throw new i.ErrnoError(8);if(!i.isFile(n.node.mode)&&!i.isDir(n.node.mode))throw new i.ErrnoError(43);if(!n.stream_ops.allocate)throw new i.ErrnoError(138);n.stream_ops.allocate(n,r,e)},mmap:(n,r,e,o,t)=>{if(o&2&&!(t&2)&&(n.flags&2097155)!==2)throw new i.ErrnoError(2);if((n.flags&2097155)===1)throw new i.ErrnoError(2);if(!n.stream_ops.mmap)throw new i.ErrnoError(43);return n.stream_ops.mmap(n,r,e,o,t)},msync:(n,r,e,o,t)=>n.stream_ops.msync?n.stream_ops.msync(n,r,e,o,t):0,munmap:n=>0,ioctl:(n,r,e)=>{if(!n.stream_ops.ioctl)throw new i.ErrnoError(59);return n.stream_ops.ioctl(n,r,e)},readFile:(n,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 e,o=i.open(n,r.flags),t=i.stat(n),a=t.size,s=new Uint8Array(a);return i.read(o,s,0,a,0),r.encoding==="utf8"?e=ze(s,0):r.encoding==="binary"&&(e=s),i.close(o),e},writeFile:(n,r,e={})=>{e.flags=e.flags||577;var o=i.open(n,e.flags,e.mode);if(typeof r=="string"){var t=new Uint8Array(Ce(r)+1),a=Ze(r,t,0,t.length);i.write(o,t,0,a,void 0,e.canOwn)}else if(ArrayBuffer.isView(r))i.write(o,r,0,r.byteLength,void 0,e.canOwn);else throw new Error("Unsupported data type");i.close(o)},cwd:()=>i.currentPath,chdir:n=>{var r=i.lookupPath(n,{follow:!0});if(r.node===null)throw new i.ErrnoError(44);if(!i.isDir(r.node.mode))throw new i.ErrnoError(54);var e=i.nodePermissions(r.node,"x");if(e)throw new i.ErrnoError(e);i.currentPath=r.path},createDefaultDirectories:()=>{i.mkdir("/tmp"),i.mkdir("/home"),i.mkdir("/home/web_user")},createDefaultDevices:()=>{i.mkdir("/dev"),i.registerDevice(i.makedev(1,3),{read:()=>0,write:(r,e,o,t,a)=>t}),i.mkdev("/dev/null",i.makedev(1,3)),ge.register(i.makedev(5,0),ge.default_tty_ops),ge.register(i.makedev(6,0),ge.default_tty1_ops),i.mkdev("/dev/tty",i.makedev(5,0)),i.mkdev("/dev/tty1",i.makedev(6,0));var n=no();i.createDevice("/dev","random",n),i.createDevice("/dev","urandom",n),i.mkdir("/dev/shm"),i.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{i.mkdir("/proc");var n=i.mkdir("/proc/self");i.mkdir("/proc/self/fd"),i.mount({mount:()=>{var r=i.createNode(n,"fd",16895,73);return r.node_ops={lookup:(e,o)=>{var t=+o,a=i.getStream(t);if(!a)throw new i.ErrnoError(8);var s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?i.createDevice("/dev","stdin",f.stdin):i.symlink("/dev/tty","/dev/stdin"),f.stdout?i.createDevice("/dev","stdout",null,f.stdout):i.symlink("/dev/tty","/dev/stdout"),f.stderr?i.createDevice("/dev","stderr",null,f.stderr):i.symlink("/dev/tty1","/dev/stderr");var n=i.open("/dev/stdin",0),r=i.open("/dev/stdout",1),e=i.open("/dev/stderr",1)},ensureErrnoError:()=>{i.ErrnoError||(i.ErrnoError=function(r,e){this.node=e,this.setErrno=function(o){this.errno=o},this.setErrno(r),this.message="FS error"},i.ErrnoError.prototype=new Error,i.ErrnoError.prototype.constructor=i.ErrnoError,[44].forEach(n=>{i.genericErrors[n]=new i.ErrnoError(n),i.genericErrors[n].stack="<generic error, no stack>"}))},staticInit:()=>{i.ensureErrnoError(),i.nameTable=new Array(4096),i.mount(G,{},"/"),i.createDefaultDirectories(),i.createDefaultDevices(),i.createSpecialDirectories(),i.filesystems={MEMFS:G,NODEFS:V}},init:(n,r,e)=>{i.init.initialized=!0,i.ensureErrnoError(),f.stdin=n||f.stdin,f.stdout=r||f.stdout,f.stderr=e||f.stderr,i.createStandardStreams()},quit:()=>{i.init.initialized=!1,At(0);for(var n=0;n<i.streams.length;n++){var r=i.streams[n];r&&i.close(r)}},getMode:(n,r)=>{var e=0;return n&&(e|=365),r&&(e|=146),e},findObject:(n,r)=>{var e=i.analyzePath(n,r);return e.exists?e.object:null},analyzePath:(n,r)=>{try{var e=i.lookupPath(n,{follow:!r});n=e.path}catch{}var o={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var e=i.lookupPath(n,{parent:!0});o.parentExists=!0,o.parentPath=e.path,o.parentObject=e.node,o.name=Y.basename(n),e=i.lookupPath(n,{follow:!r}),o.exists=!0,o.path=e.path,o.object=e.node,o.name=e.node.name,o.isRoot=e.path==="/"}catch(t){o.error=t.errno}return o},createPath:(n,r,e,o)=>{n=typeof n=="string"?n:i.getPath(n);for(var t=r.split("/").reverse();t.length;){var a=t.pop();if(a){var s=Y.join2(n,a);try{i.mkdir(s)}catch{}n=s}}return s},createFile:(n,r,e,o,t)=>{var a=Y.join2(typeof n=="string"?n:i.getPath(n),r),s=i.getMode(o,t);return i.create(a,s)},createDataFile:(n,r,e,o,t,a)=>{var s=r;n&&(n=typeof n=="string"?n:i.getPath(n),s=r?Y.join2(n,r):n);var l=i.getMode(o,t),h=i.create(s,l);if(e){if(typeof e=="string"){for(var w=new Array(e.length),S=0,O=e.length;S<O;++S)w[S]=e.charCodeAt(S);e=w}i.chmod(h,l|146);var N=i.open(h,577);i.write(N,e,0,e.length,0,a),i.close(N),i.chmod(h,l)}return h},createDevice:(n,r,e,o)=>{var t=Y.join2(typeof n=="string"?n:i.getPath(n),r),a=i.getMode(!!e,!!o);i.createDevice.major||(i.createDevice.major=64);var s=i.makedev(i.createDevice.major++,0);return i.registerDevice(s,{open:l=>{l.seekable=!1},close:l=>{o&&o.buffer&&o.buffer.length&&o(10)},read:(l,h,w,S,O)=>{for(var N=0,T=0;T<S;T++){var F;try{F=e()}catch{throw new i.ErrnoError(29)}if(F===void 0&&N===0)throw new i.ErrnoError(6);if(F==null)break;N++,h[w+T]=F}return N&&(l.node.timestamp=Date.now()),N},write:(l,h,w,S,O)=>{for(var N=0;N<S;N++)try{o(h[w+N])}catch{throw new i.ErrnoError(29)}return S&&(l.node.timestamp=Date.now()),N}}),i.mkdev(t,a,s)},forceLoadFile:n=>{if(n.isDevice||n.isFolder||n.link||n.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{n.contents=Er(We(n.url),!0),n.usedBytes=n.contents.length}catch{throw new i.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(n,r,e,o,t)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(T){if(!(T>this.length-1||T<0)){var F=T%this.chunkSize,L=T/this.chunkSize|0;return this.getter(L)[F]}},a.prototype.setDataGetter=function(T){this.getter=T},a.prototype.cacheLength=function(){var T=new XMLHttpRequest;if(T.open("HEAD",e,!1),T.send(null),!(T.status>=200&&T.status<300||T.status===304))throw new Error("Couldn't load "+e+". Status: "+T.status);var F=Number(T.getResponseHeader("Content-length")),L,R=(L=T.getResponseHeader("Accept-Ranges"))&&L==="bytes",B=(L=T.getResponseHeader("Content-Encoding"))&&L==="gzip",P=1024*1024;R||(P=F);var M=(q,W)=>{if(q>W)throw new Error("invalid range ("+q+", "+W+") or no bytes requested!");if(W>F-1)throw new Error("only "+F+" bytes available! programmer error!");var X=new XMLHttpRequest;if(X.open("GET",e,!1),F!==P&&X.setRequestHeader("Range","bytes="+q+"-"+W),X.responseType="arraybuffer",X.overrideMimeType&&X.overrideMimeType("text/plain; charset=x-user-defined"),X.send(null),!(X.status>=200&&X.status<300||X.status===304))throw new Error("Couldn't load "+e+". Status: "+X.status);return X.response!==void 0?new Uint8Array(X.response||[]):Er(X.responseText||"",!0)},z=this;z.setDataGetter(q=>{var W=q*P,X=(q+1)*P-1;if(X=Math.min(X,F-1),typeof z.chunks[q]>"u"&&(z.chunks[q]=M(W,X)),typeof z.chunks[q]>"u")throw new Error("doXHR failed!");return z.chunks[q]}),(B||!F)&&(P=F=1,F=this.getter(0).length,P=F,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=F,this._chunkSize=P,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new a;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:e};var h=i.createFile(n,r,l,o,t);l.contents?h.contents=l.contents:l.url&&(h.contents=null,h.url=l.url),Object.defineProperties(h,{usedBytes:{get:function(){return this.contents.length}}});var w={},S=Object.keys(h.stream_ops);S.forEach(N=>{var T=h.stream_ops[N];w[N]=function(){return i.forceLoadFile(h),T.apply(null,arguments)}});function O(N,T,F,L,R){var B=N.node.contents;if(R>=B.length)return 0;var P=Math.min(B.length-R,L);if(B.slice)for(var M=0;M<P;M++)T[F+M]=B[R+M];else for(var M=0;M<P;M++)T[F+M]=B.get(R+M);return P}return w.read=(N,T,F,L,R)=>(i.forceLoadFile(h),O(N,T,F,L,R)),w.mmap=(N,T,F,L,R)=>{i.forceLoadFile(h);var B=Ir(T);if(!B)throw new i.ErrnoError(48);return O(N,ee,B,T,F),{ptr:B,allocated:!0}},h.stream_ops=w,h},createPreloadedFile:(n,r,e,o,t,a,s,l,h,w)=>{var S=r?Q.resolve(Y.join2(n,r)):n,O="cp "+S;function N(T){function F(L){w&&w(),l||i.createDataFile(n,r,L,o,t,h),a&&a(),Je(O)}Browser.handledByPreloadPlugin(T,S,F,()=>{s&&s(),Je(O)})||F(T)}dr(O),typeof e=="string"?Ct(e,T=>N(T),s):N(e)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(n,r,e)=>{r=r||(()=>{}),e=e||(()=>{});var o=i.indexedDB();try{var t=o.open(i.DB_NAME(),i.DB_VERSION)}catch(a){return e(a)}t.onupgradeneeded=()=>{er("creating db");var a=t.result;a.createObjectStore(i.DB_STORE_NAME)},t.onsuccess=()=>{var a=t.result,s=a.transaction([i.DB_STORE_NAME],"readwrite"),l=s.objectStore(i.DB_STORE_NAME),h=0,w=0,S=n.length;function O(){w==0?r():e()}n.forEach(N=>{var T=l.put(i.analyzePath(N).object.contents,N);T.onsuccess=()=>{h++,h+w==S&&O()},T.onerror=()=>{w++,h+w==S&&O()}}),s.onerror=e},t.onerror=e},loadFilesFromDB:(n,r,e)=>{r=r||(()=>{}),e=e||(()=>{});var o=i.indexedDB();try{var t=o.open(i.DB_NAME(),i.DB_VERSION)}catch(a){return e(a)}t.onupgradeneeded=e,t.onsuccess=()=>{var a=t.result;try{var s=a.transaction([i.DB_STORE_NAME],"readonly")}catch(N){e(N);return}var l=s.objectStore(i.DB_STORE_NAME),h=0,w=0,S=n.length;function O(){w==0?r():e()}n.forEach(N=>{var T=l.get(N);T.onsuccess=()=>{i.analyzePath(N).exists&&i.unlink(N),i.createDataFile(Y.dirname(N),Y.basename(N),T.result,!0,!0,!0),h++,h+w==S&&O()},T.onerror=()=>{w++,h+w==S&&O()}}),s.onerror=e},t.onerror=e}},C={DEFAULT_POLLMASK:5,calculateAt:function(n,r,e){if(Y.isAbs(r))return r;var o;if(n===-100)o=i.cwd();else{var t=C.getStreamFromFD(n);o=t.path}if(r.length==0){if(!e)throw new i.ErrnoError(44);return o}return Y.join2(o,r)},doStat:function(n,r,e){try{var o=n(r)}catch(t){if(t&&t.node&&Y.normalize(r)!==Y.normalize(i.getPath(t.node)))return-54;throw t}return E[e>>2]=o.dev,E[e+8>>2]=o.ino,E[e+12>>2]=o.mode,j[e+16>>2]=o.nlink,E[e+20>>2]=o.uid,E[e+24>>2]=o.gid,E[e+28>>2]=o.rdev,Z=[o.size>>>0,(U=o.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+40>>2]=Z[0],E[e+44>>2]=Z[1],E[e+48>>2]=4096,E[e+52>>2]=o.blocks,Z=[Math.floor(o.atime.getTime()/1e3)>>>0,(U=Math.floor(o.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+56>>2]=Z[0],E[e+60>>2]=Z[1],j[e+64>>2]=0,Z=[Math.floor(o.mtime.getTime()/1e3)>>>0,(U=Math.floor(o.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+72>>2]=Z[0],E[e+76>>2]=Z[1],j[e+80>>2]=0,Z=[Math.floor(o.ctime.getTime()/1e3)>>>0,(U=Math.floor(o.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+88>>2]=Z[0],E[e+92>>2]=Z[1],j[e+96>>2]=0,Z=[o.ino>>>0,(U=o.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+104>>2]=Z[0],E[e+108>>2]=Z[1],0},doMsync:function(n,r,e,o,t){if(!i.isFile(r.node.mode))throw new i.ErrnoError(43);if(o&2)return 0;var a=le.slice(n,n+e);i.msync(r,a,t,e,o)},varargs:void 0,get:function(){C.varargs+=4;var n=E[C.varargs-4>>2];return n},getStr:function(n){var r=ne(n);return r},getStreamFromFD:function(n){var r=i.getStream(n);if(!r)throw new i.ErrnoError(8);return r}};function v(n,r,e,o,t){try{for(var a=0,s=r?E[r>>2]:0,l=r?E[r+4>>2]:0,h=e?E[e>>2]:0,w=e?E[e+4>>2]:0,S=o?E[o>>2]:0,O=o?E[o+4>>2]:0,N=0,T=0,F=0,L=0,R=0,B=0,P=(r?E[r>>2]:0)|(e?E[e>>2]:0)|(o?E[o>>2]:0),M=(r?E[r+4>>2]:0)|(e?E[e+4>>2]:0)|(o?E[o+4>>2]:0),z=function(se,Oe,Ae,Qe){return se<32?Oe&Qe:Ae&Qe},q=0;q<n;q++){var W=1<<q%32;if(z(q,P,M,W)){var X=C.getStreamFromFD(q),oe=C.DEFAULT_POLLMASK;X.stream_ops?.poll&&(oe=X.stream_ops.poll(X)),oe&1&&z(q,s,l,W)&&(q<32?N=N|W:T=T|W,a++),oe&4&&z(q,h,w,W)&&(q<32?F=F|W:L=L|W,a++),oe&2&&z(q,S,O,W)&&(q<32?R=R|W:B=B|W,a++)}}return r&&(E[r>>2]=N,E[r+4>>2]=T),e&&(E[e>>2]=F,E[e+4>>2]=L),o&&(E[o>>2]=R,E[o+4>>2]=B),a}catch(se){if(typeof i>"u"||!(se instanceof i.ErrnoError))throw se;return-se.errno}}var H={mount:function(n){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(r,e){return typeof e=="function"&&(this._callbacks[r]=e),this},f.websocket.emit=function(r,e){typeof this._callbacks[r]=="function"&&this._callbacks[r].call(this,e)},i.createNode(null,"/",16895,0)},createSocket:function(n,r,e){r&=-526337;var o=r==1;if(o&&e&&e!=6)throw new i.ErrnoError(66);var t={family:n,type:r,protocol:e,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:H.websocket_sock_ops},a=H.nextname(),s=i.createNode(H.root,a,49152,0);s.sock=t;var l=i.createStream({path:a,node:s,flags:2,seekable:!1,stream_ops:H.stream_ops});return t.stream=l,t},getSocket:function(n){var r=i.getStream(n);return!r||!i.isSocket(r.node.mode)?null:r.node.sock},stream_ops:{poll:function(n){var r=n.node.sock;return r.sock_ops.poll(r)},ioctl:function(n,r,e){var o=n.node.sock;return o.sock_ops.ioctl(o,r,e)},read:function(n,r,e,o,t){var a=n.node.sock,s=a.sock_ops.recvmsg(a,o);return s?(r.set(s.buffer,e),s.buffer.length):0},write:function(n,r,e,o,t){var a=n.node.sock;return a.sock_ops.sendmsg(a,r,e,o)},close:function(n){var r=n.node.sock;r.sock_ops.close(r)}},nextname:function(){return H.nextname.current||(H.nextname.current=0),"socket["+H.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(n,r,e){var o;if(typeof r=="object"&&(o=r,r=null,e=null),o)if(o._socket)r=o._socket.remoteAddress,e=o._socket.remotePort;else{var t=/ws[s]?:\/\/([^:]+):(\d+)/.exec(o.url);if(!t)throw new Error("WebSocket URL must be in the format ws(s)://address:port");r=t[1],e=parseInt(t[2],10)}else try{var a=f.websocket&&typeof f.websocket=="object",s="ws:#".replace("#","//");if(a&&(typeof f.websocket.url=="function"?s=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(s=f.websocket.url)),s==="ws://"||s==="wss://"){var l=r.split("/");s=s+l[0]+":"+e+"/"+l.slice(1).join("/")}var h="binary";a&&typeof f.websocket.subprotocol=="string"&&(h=f.websocket.subprotocol);var w=void 0;h!=="null"&&(h=h.replace(/^ +| +$/g,"").split(/ *, */),w=h),a&&f.websocket.subprotocol===null&&(h="null",w=void 0);var S;te?S=An():S=WebSocket,f.websocket.decorator&&(S=f.websocket.decorator(S)),o=new S(s,w),o.binaryType="arraybuffer"}catch{throw new i.ErrnoError(23)}var O={addr:r,port:e,socket:o,dgram_send_queue:[]};return H.websocket_sock_ops.addPeer(n,O),H.websocket_sock_ops.handlePeerEvents(n,O),n.type===2&&typeof n.sport<"u"&&O.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(n.sport&65280)>>8,n.sport&255])),O},getPeer:function(n,r,e){return n.peers[r+":"+e]},addPeer:function(n,r){n.peers[r.addr+":"+r.port]=r},removePeer:function(n,r){delete n.peers[r.addr+":"+r.port]},handlePeerEvents:function(n,r){var e=!0,o=function(){f.websocket.emit("open",n.stream.fd);try{for(var a=r.dgram_send_queue.shift();a;)r.socket.send(a),a=r.dgram_send_queue.shift()}catch{r.socket.close()}};function t(a){if(typeof a=="string"){var s=new TextEncoder;a=s.encode(a)}else{if(Le(a.byteLength!==void 0),a.byteLength==0)return;a=new Uint8Array(a)}var l=e;if(e=!1,l&&a.length===10&&a[0]===255&&a[1]===255&&a[2]===255&&a[3]===255&&a[4]==="p".charCodeAt(0)&&a[5]==="o".charCodeAt(0)&&a[6]==="r".charCodeAt(0)&&a[7]==="t".charCodeAt(0)){var h=a[8]<<8|a[9];H.websocket_sock_ops.removePeer(n,r),r.port=h,H.websocket_sock_ops.addPeer(n,r);return}n.recv_queue.push({addr:r.addr,port:r.port,data:a}),f.websocket.emit("message",n.stream.fd)}te?(r.socket.on("open",o),r.socket.on("message",function(a,s){s&&t(new Uint8Array(a).buffer)}),r.socket.on("close",function(){f.websocket.emit("close",n.stream.fd)}),r.socket.on("error",function(a){n.error=14,f.websocket.emit("error",[n.stream.fd,n.error,"ECONNREFUSED: Connection refused"])})):(r.socket.onopen=o,r.socket.onclose=function(){f.websocket.emit("close",n.stream.fd)},r.socket.onmessage=function(s){t(s.data)},r.socket.onerror=function(a){n.error=14,f.websocket.emit("error",[n.stream.fd,n.error,"ECONNREFUSED: Connection refused"])})},poll:function(n){if(n.type===1&&n.server)return n.pending.length?65:0;var r=0,e=n.type===1?H.websocket_sock_ops.getPeer(n,n.daddr,n.dport):null;return(n.recv_queue.length||!e||e&&e.socket.readyState===e.socket.CLOSING||e&&e.socket.readyState===e.socket.CLOSED)&&(r|=65),(!e||e&&e.socket.readyState===e.socket.OPEN)&&(r|=4),(e&&e.socket.readyState===e.socket.CLOSING||e&&e.socket.readyState===e.socket.CLOSED)&&(r|=16),r},ioctl:function(n,r,e){switch(r){case 21531:var o=0;return n.recv_queue.length&&(o=n.recv_queue[0].data.length),E[e>>2]=o,0;default:return 28}},close:function(n){if(n.server){try{n.server.close()}catch{}n.server=null}for(var r=Object.keys(n.peers),e=0;e<r.length;e++){var o=n.peers[r[e]];try{o.socket.close()}catch{}H.websocket_sock_ops.removePeer(n,o)}return 0},bind:function(n,r,e){if(typeof n.saddr<"u"||typeof n.sport<"u")throw new i.ErrnoError(28);if(n.saddr=r,n.sport=e,n.type===2){n.server&&(n.server.close(),n.server=null);try{n.sock_ops.listen(n,0)}catch(o){if(!(o instanceof i.ErrnoError)||o.errno!==138)throw o}}},connect:function(n,r,e){if(n.server)throw new i.ErrnoError(138);if(typeof n.daddr<"u"&&typeof n.dport<"u"){var o=H.websocket_sock_ops.getPeer(n,n.daddr,n.dport);if(o)throw o.socket.readyState===o.socket.CONNECTING?new i.ErrnoError(7):new i.ErrnoError(30)}var t=H.websocket_sock_ops.createPeer(n,r,e);throw n.daddr=t.addr,n.dport=t.port,new i.ErrnoError(26)},listen:function(n,r){if(!te)throw new i.ErrnoError(138);if(n.server)throw new i.ErrnoError(28);var e=An().Server,o=n.saddr;n.server=new e({host:o,port:n.sport}),f.websocket.emit("listen",n.stream.fd),n.server.on("connection",function(t){if(n.type===1){var a=H.createSocket(n.family,n.type,n.protocol),s=H.websocket_sock_ops.createPeer(a,t);a.daddr=s.addr,a.dport=s.port,n.pending.push(a),f.websocket.emit("connection",a.stream.fd)}else H.websocket_sock_ops.createPeer(n,t),f.websocket.emit("connection",n.stream.fd)}),n.server.on("close",function(){f.websocket.emit("close",n.stream.fd),n.server=null}),n.server.on("error",function(t){n.error=23,f.websocket.emit("error",[n.stream.fd,n.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(n){if(!n.server||!n.pending.length)throw new i.ErrnoError(28);var r=n.pending.shift();return r.stream.flags=n.stream.flags,r},getname:function(n,r){var e,o;if(r){if(n.daddr===void 0||n.dport===void 0)throw new i.ErrnoError(53);e=n.daddr,o=n.dport}else e=n.saddr||0,o=n.sport||0;return{addr:e,port:o}},sendmsg:function(n,r,e,o,t,a){if(n.type===2){if((t===void 0||a===void 0)&&(t=n.daddr,a=n.dport),t===void 0||a===void 0)throw new i.ErrnoError(17)}else t=n.daddr,a=n.dport;var s=H.websocket_sock_ops.getPeer(n,t,a);if(n.type===1){if(!s||s.socket.readyState===s.socket.CLOSING||s.socket.readyState===s.socket.CLOSED)throw new i.ErrnoError(53);if(s.socket.readyState===s.socket.CONNECTING)throw new i.ErrnoError(6)}ArrayBuffer.isView(r)&&(e+=r.byteOffset,r=r.buffer);var l;if(l=r.slice(e,e+o),n.type===2&&(!s||s.socket.readyState!==s.socket.OPEN))return(!s||s.socket.readyState===s.socket.CLOSING||s.socket.readyState===s.socket.CLOSED)&&(s=H.websocket_sock_ops.createPeer(n,t,a)),s.dgram_send_queue.push(l),o;try{return s.socket.send(l),o}catch{throw new i.ErrnoError(28)}},recvmsg:function(n,r){if(n.type===1&&n.server)throw new i.ErrnoError(53);var e=n.recv_queue.shift();if(!e){if(n.type===1){var o=H.websocket_sock_ops.getPeer(n,n.daddr,n.dport);if(!o)throw new i.ErrnoError(53);if(o.socket.readyState===o.socket.CLOSING||o.socket.readyState===o.socket.CLOSED)return null;throw new i.ErrnoError(6)}throw new i.ErrnoError(6)}var t=e.data.byteLength||e.data.length,a=e.data.byteOffset||0,s=e.data.buffer||e.data,l=Math.min(r,t),h={buffer:new Uint8Array(s,a,l),addr:e.addr,port:e.port};if(n.type===1&&l<t){var w=t-l;e.data=new Uint8Array(s,a+l,w),n.recv_queue.unshift(e)}return h}}};function ke(n){var r=H.getSocket(n);if(!r)throw new i.ErrnoError(8);return r}function he(n){return E[Qt()>>2]=n,n}function Ie(n){for(var r=n.split("."),e=0;e<4;e++){var o=Number(r[e]);if(isNaN(o))return null;r[e]=o}return(r[0]|r[1]<<8|r[2]<<16|r[3]<<24)>>>0}function ce(n){return parseInt(n)}function Ar(n){var r,e,o,t,a=/^((?=.*::)(?!.*::.+::)(::)?([\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(!a.test(n))return null;if(n==="::")return[0,0,0,0,0,0,0,0];for(n.startsWith("::")?n=n.replace("::","Z:"):n=n.replace("::",":Z:"),n.indexOf(".")>0?(n=n.replace(new RegExp("[.]","g"),":"),r=n.split(":"),r[r.length-4]=ce(r[r.length-4])+ce(r[r.length-3])*256,r[r.length-3]=ce(r[r.length-2])+ce(r[r.length-1])*256,r=r.slice(0,r.length-2)):r=n.split(":"),o=0,t=0,e=0;e<r.length;e++)if(typeof r[e]=="string")if(r[e]==="Z"){for(t=0;t<8-r.length+1;t++)s[e+t]=0;o=t-1}else s[e+o]=Dr(parseInt(r[e],16));else s[e+o]=r[e];return[s[1]<<16|s[0],s[3]<<16|s[2],s[5]<<16|s[4],s[7]<<16|s[6]]}function be(n,r,e,o,t){switch(r){case 2:e=Ie(e),wr(n,16),t&&(E[t>>2]=16),we[n>>1]=r,E[n+4>>2]=e,we[n+2>>1]=Dr(o);break;case 10:e=Ar(e),wr(n,28),t&&(E[t>>2]=28),E[n>>2]=r,E[n+8>>2]=e[0],E[n+12>>2]=e[1],E[n+16>>2]=e[2],E[n+20>>2]=e[3],we[n+2>>1]=Dr(o);break;default:return 5}return 0}var ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(n){var r=Ie(n);if(r!==null||(r=Ar(n),r!==null))return n;var e;if(ue.address_map.addrs[n])e=ue.address_map.addrs[n];else{var o=ue.address_map.id++;Le(o<65535,"exceeded max address mappings of 65535"),e="172.29."+(o&255)+"."+(o&65280),ue.address_map.names[e]=n,ue.address_map.addrs[n]=e}return e},lookup_addr:function(n){return ue.address_map.names[n]?ue.address_map.names[n]:null}};function Zr(n,r,e,o){try{var t=ke(n),a=t.sock_ops.accept(t);if(r)var s=be(r,a.family,ue.lookup_name(a.daddr),a.dport,e);return a.stream.fd}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Ne(n){return(n&255)+"."+(n>>8&255)+"."+(n>>16&255)+"."+(n>>24&255)}function kn(n){var r="",e=0,o=0,t=0,a=0,s=0,l=0,h=[n[0]&65535,n[0]>>16,n[1]&65535,n[1]>>16,n[2]&65535,n[2]>>16,n[3]&65535,n[3]>>16],w=!0,S="";for(l=0;l<5;l++)if(h[l]!==0){w=!1;break}if(w){if(S=Ne(h[6]|h[7]<<16),h[5]===-1)return r="::ffff:",r+=S,r;if(h[5]===0)return r="::",S==="0.0.0.0"&&(S=""),S==="0.0.0.1"&&(S="1"),r+=S,r}for(e=0;e<8;e++)h[e]===0&&(e-t>1&&(s=0),t=e,s++),s>o&&(o=s,a=e-o+1);for(e=0;e<8;e++){if(o>1&&h[e]===0&&e>=a&&e<a+o){e===a&&(r+=":",a===0&&(r+=":"));continue}r+=Number(Nt(h[e]&65535)).toString(16),r+=e<7?":":""}return r}function Gr(n,r){var e=we[n>>1],o=Nt(lt[n+2>>1]),t;switch(e){case 2:if(r!==16)return{errno:28};t=E[n+4>>2],t=Ne(t);break;case 10:if(r!==28)return{errno:28};t=[E[n+8>>2],E[n+12>>2],E[n+16>>2],E[n+20>>2]],t=kn(t);break;default:return{errno:5}}return{family:e,addr:t,port:o}}function Yr(n,r,e){if(e&&n===0)return null;var o=Gr(n,r);if(o.errno)throw new i.ErrnoError(o.errno);return o.addr=ue.lookup_addr(o.addr)||o.addr,o}function dn(n,r,e){try{var o=ke(n),t=Yr(r,e);return o.sock_ops.bind(o,t.addr,t.port),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function Pt(n){try{return n=C.getStr(n),i.chdir(n),0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function oo(n,r){try{return n=C.getStr(n),i.chmod(n,r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function io(n,r,e){try{var o=ke(n),t=Yr(r,e);return o.sock_ops.connect(o,t.addr,t.port),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function ao(n){try{var r=C.getStreamFromFD(n);return i.createStream(r,0).fd}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function so(n,r,e){try{var o=C.getStreamFromFD(n);if(o.fd===r)return-28;var t=i.getStream(r);return t&&i.close(t),i.createStream(o,r,r+1).fd}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function uo(n,r,e,o){try{if(r=C.getStr(r),r=C.calculateAt(n,r),e&-8)return-28;var t=i.lookupPath(r,{follow:!0}),a=t.node;if(!a)return-44;var s="";return e&4&&(s+="r"),e&2&&(s+="w"),e&1&&(s+="x"),s&&i.nodePermissions(a,s)?-2:0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function _n(n,r){try{return i.fchmod(n,r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function fo(n,r,e){try{return i.fchown(n,r,e),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function gt(n,r,e,o,t){try{r=C.getStr(r);var a=t&256;return t=t&-257,r=C.calculateAt(n,r),(a?i.lchown:i.chown)(r,e,o),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function co(n,r,e){C.varargs=e;try{var o=C.getStreamFromFD(n);switch(r){case 0:{var t=C.get();if(t<0)return-28;var a;return a=i.createStream(o,t),a.fd}case 1:case 2:return 0;case 3:return o.flags;case 4:{var t=C.get();return o.flags|=t,0}case 5:{var t=C.get(),s=0;return we[t+s>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return he(28),-1;default:return-28}}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function lo(n,r){try{var e=C.getStreamFromFD(n);return C.doStat(i.stat,e.path,r)}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function qt(n,r){return r+2097152>>>0<4194305-!!n?(n>>>0)+r*4294967296:NaN}function _o(n,r,e){try{var o=qt(r,e);return isNaN(o)?-61:(i.ftruncate(n,o),0)}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function mo(n,r){try{if(r===0)return-28;var e=i.cwd(),o=Ce(e)+1;return r<o?-68:(Fe(e,n,r),o)}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function vo(n,r,e){try{var o=C.getStreamFromFD(n);o.getdents||(o.getdents=i.readdir(o.path));for(var t=280,a=0,s=i.llseek(o,0,1),l=Math.floor(s/t);l<o.getdents.length&&a+t<=e;){var h,w,S=o.getdents[l];if(S===".")h=o.node.id,w=4;else if(S===".."){var O=i.lookupPath(o.path,{parent:!0});h=O.node.id,w=4}else{var N=i.lookupNode(o.node,S);h=N.id,w=i.isChrdev(N.mode)?2:i.isDir(N.mode)?4:i.isLink(N.mode)?10:8}Z=[h>>>0,(U=h,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[r+a>>2]=Z[0],E[r+a+4>>2]=Z[1],Z=[(l+1)*t>>>0,(U=(l+1)*t,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[r+a+8>>2]=Z[0],E[r+a+12>>2]=Z[1],we[r+a+16>>1]=280,ee[r+a+18>>0]=w,Fe(S,r+a+19,256),a+=t,l+=1}return i.llseek(o,l*t,0),a}catch(T){if(typeof i>"u"||!(T instanceof i.ErrnoError))throw T;return-T.errno}}function po(n,r,e){try{var o=ke(n);if(!o.daddr)return-53;var t=be(r,o.family,ue.lookup_name(o.daddr),o.dport,e);return 0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function ho(n,r,e){try{fe("__syscall_getsockname "+n);var o=ke(n),t=be(r,o.family,ue.lookup_name(o.saddr||"0.0.0.0"),o.sport,e);return 0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function yo(n,r,e,o,t){try{var a=ke(n);return r===1&&e===4?(E[o>>2]=a.error,E[t>>2]=4,a.error=null,0):-50}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function Eo(n,r,e){C.varargs=e;try{var o=C.getStreamFromFD(n);switch(r){case 21509:case 21505:return o.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return o.tty?0:-59;case 21519:{if(!o.tty)return-59;var t=C.get();return E[t>>2]=0,0}case 21520:return o.tty?-28:-59;case 21531:{var t=C.get();return i.ioctl(o,r,t)}case 21523:return o.tty?0:-59;case 21524:return o.tty?0:-59;default:return-28}}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function wo(n,r){try{var e=ke(n);return e.sock_ops.listen(e,r),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function go(n,r){try{return n=C.getStr(n),C.doStat(i.lstat,n,r)}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function So(n,r,e){try{return r=C.getStr(r),r=C.calculateAt(n,r),r=Y.normalize(r),r[r.length-1]==="/"&&(r=r.substr(0,r.length-1)),i.mkdir(r,e,0),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function bo(n,r,e,o){try{r=C.getStr(r);var t=o&256,a=o&4096;return o=o&-4353,r=C.calculateAt(n,r,a),C.doStat(t?i.lstat:i.stat,r,e)}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function ko(n,r,e,o){C.varargs=o;try{r=C.getStr(r),r=C.calculateAt(n,r);var t=o?C.get():0;return i.open(r,e,t).fd}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}var ae={BUCKET_BUFFER_SIZE:8192,mount:function(n){return i.createNode(null,"/",16895,0)},createPipe:function(){var n={buckets:[],refcnt:2};n.buckets.push({buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var r=ae.nextname(),e=ae.nextname(),o=i.createNode(ae.root,r,4096,0),t=i.createNode(ae.root,e,4096,0);o.pipe=n,t.pipe=n;var a=i.createStream({path:r,node:o,flags:0,seekable:!1,stream_ops:ae.stream_ops});o.stream=a;var s=i.createStream({path:e,node:t,flags:1,seekable:!1,stream_ops:ae.stream_ops});return t.stream=s,{readable_fd:a.fd,writable_fd:s.fd}},stream_ops:{poll:function(n){var r=n.node.pipe;if((n.flags&2097155)===1)return 260;if(r.buckets.length>0)for(var e=0;e<r.buckets.length;e++){var o=r.buckets[e];if(o.offset-o.roffset>0)return 65}return 0},ioctl:function(n,r,e){return 28},fsync:function(n){return 28},read:function(n,r,e,o,t){for(var a=n.node.pipe,s=0,l=0;l<a.buckets.length;l++){var h=a.buckets[l];s+=h.offset-h.roffset}Le(r instanceof ArrayBuffer||ArrayBuffer.isView(r));var w=r.subarray(e,e+o);if(o<=0)return 0;if(s==0)throw new i.ErrnoError(6);for(var S=Math.min(s,o),O=S,N=0,l=0;l<a.buckets.length;l++){var T=a.buckets[l],F=T.offset-T.roffset;if(S<=F){var L=T.buffer.subarray(T.roffset,T.offset);S<F?(L=L.subarray(0,S),T.roffset+=S):N++,w.set(L);break}else{var L=T.buffer.subarray(T.roffset,T.offset);w.set(L),w=w.subarray(L.byteLength),S-=L.byteLength,N++}}return N&&N==a.buckets.length&&(N--,a.buckets[N].offset=0,a.buckets[N].roffset=0),a.buckets.splice(0,N),O},write:function(n,r,e,o,t){var a=n.node.pipe;Le(r instanceof ArrayBuffer||ArrayBuffer.isView(r));var s=r.subarray(e,e+o),l=s.byteLength;if(l<=0)return 0;var h=null;a.buckets.length==0?(h={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0},a.buckets.push(h)):h=a.buckets[a.buckets.length-1],Le(h.offset<=ae.BUCKET_BUFFER_SIZE);var w=ae.BUCKET_BUFFER_SIZE-h.offset;if(w>=l)return h.buffer.set(s,h.offset),h.offset+=l,l;w>0&&(h.buffer.set(s.subarray(0,w),h.offset),h.offset+=w,s=s.subarray(w,s.byteLength));for(var S=s.byteLength/ae.BUCKET_BUFFER_SIZE|0,O=s.byteLength%ae.BUCKET_BUFFER_SIZE,N=0;N<S;N++){var T={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:ae.BUCKET_BUFFER_SIZE,roffset:0};a.buckets.push(T),T.buffer.set(s.subarray(0,ae.BUCKET_BUFFER_SIZE)),s=s.subarray(ae.BUCKET_BUFFER_SIZE,s.byteLength)}if(O>0){var T={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:s.byteLength,roffset:0};a.buckets.push(T),T.buffer.set(s)}return l},close:function(n){var r=n.node.pipe;r.refcnt--,r.refcnt===0&&(r.buckets=null)}},nextname:function(){return ae.nextname.current||(ae.nextname.current=0),"pipe["+ae.nextname.current+++"]"}};function Oo(n){try{if(n==0)throw new i.ErrnoError(21);var r=ae.createPipe();return E[n>>2]=r.readable_fd,E[n+4>>2]=r.writable_fd,0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function kr(n,r,e){try{for(var o=0,t=0;t<r;t++){var a=n+8*t,s=E[a>>2],l=we[a+4>>1],h=32,w=i.getStream(s);w&&(h=C.DEFAULT_POLLMASK,w.stream_ops?.poll&&(h=w.stream_ops.poll(w))),h&=l|8|16,h&&o++,we[a+6>>1]=h}return o}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function Do(n,r,e,o){try{if(r=C.getStr(r),r=C.calculateAt(n,r),o<=0)return-28;var t=i.readlink(r),a=Math.min(o,Ce(t)),s=ee[e+a];return Fe(t,e,o+1),ee[e+a]=s,a}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Se(n,r,e,o,t,a){try{var s=ke(n),l=s.sock_ops.recvmsg(s,e);if(!l)return 0;if(t)var h=be(t,s.family,ue.lookup_name(l.addr),l.port,a);return le.set(l.buffer,r),l.buffer.byteLength}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function No(n,r,e,o){try{return r=C.getStr(r),o=C.getStr(o),r=C.calculateAt(n,r),o=C.calculateAt(e,o),i.rename(r,o),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function To(n){try{return n=C.getStr(n),i.rmdir(n),0}catch(r){if(typeof i>"u"||!(r instanceof i.ErrnoError))throw r;return-r.errno}}function Ao(n,r,e,o,t,a){try{var s=ke(n),l=Yr(t,a,!0);return l?s.sock_ops.sendmsg(s,ee,r,e,l.addr,l.port):i.write(s.stream,ee,r,e)}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Fo(n,r,e){try{var o=H.createSocket(n,r,e);return o.stream.fd}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function Co(n,r){try{return n=C.getStr(n),C.doStat(i.stat,n,r)}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function Po(n,r,e){try{return n=C.getStr(n),E[e+4>>2]=4096,E[e+40>>2]=4096,E[e+8>>2]=1e6,E[e+12>>2]=5e5,E[e+16>>2]=5e5,E[e+20>>2]=i.nextInode,E[e+24>>2]=1e6,E[e+28>>2]=42,E[e+44>>2]=2,E[e+36>>2]=255,0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function Ro(n,r){try{return n=C.getStr(n),r=C.getStr(r),i.symlink(n,r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function Mo(n,r,e){try{return r=C.getStr(r),r=C.calculateAt(n,r),e===0?i.unlink(r):e===512?i.rmdir(r):me("Invalid flags passed to unlinkat"),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function jr(n){return j[n>>2]+E[n+4>>2]*4294967296}function Lo(n,r,e,o){try{if(r=C.getStr(r),r=C.calculateAt(n,r,!0),e){var s=jr(e),l=E[e+8>>2];t=s*1e3+l/(1e3*1e3),e+=16,s=jr(e),l=E[e+8>>2],a=s*1e3+l/(1e3*1e3)}else var t=Date.now(),a=t;return i.utime(r,t,a),0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function mn(n){}var Vt="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function St(n,r){me(Vt)}function Fn(n,r){me(Vt)}var Uo=!0;function vn(){return Uo}function Io(){throw 1/0}function Bo(n,r){var e=new Date(jr(n)*1e3);E[r>>2]=e.getUTCSeconds(),E[r+4>>2]=e.getUTCMinutes(),E[r+8>>2]=e.getUTCHours(),E[r+12>>2]=e.getUTCDate(),E[r+16>>2]=e.getUTCMonth(),E[r+20>>2]=e.getUTCFullYear()-1900,E[r+24>>2]=e.getUTCDay();var o=Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0),t=(e.getTime()-o)/(1e3*60*60*24)|0;E[r+28>>2]=t}function xo(n,r){var e=new Date(jr(n)*1e3);E[r>>2]=e.getSeconds(),E[r+4>>2]=e.getMinutes(),E[r+8>>2]=e.getHours(),E[r+12>>2]=e.getDate(),E[r+16>>2]=e.getMonth(),E[r+20>>2]=e.getFullYear()-1900,E[r+24>>2]=e.getDay();var o=new Date(e.getFullYear(),0,1),t=(e.getTime()-o.getTime())/(1e3*60*60*24)|0;E[r+28>>2]=t,E[r+36>>2]=-(e.getTimezoneOffset()*60);var a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),l=(a!=s&&e.getTimezoneOffset()==Math.min(s,a))|0;E[r+32>>2]=l}function zo(n){var r=new Date(E[n+20>>2]+1900,E[n+16>>2],E[n+12>>2],E[n+8>>2],E[n+4>>2],E[n>>2],0),e=E[n+32>>2],o=r.getTimezoneOffset(),t=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),s=t.getTimezoneOffset(),l=Math.min(s,a);if(e<0)E[n+32>>2]=+(a!=s&&l==o);else if(e>0!=(l==o)){var h=Math.max(s,a),w=e>0?l:h;r.setTime(r.getTime()+(w-o)*6e4)}E[n+24>>2]=r.getDay();var S=(r.getTime()-t.getTime())/(1e3*60*60*24)|0;return E[n+28>>2]=S,E[n>>2]=r.getSeconds(),E[n+4>>2]=r.getMinutes(),E[n+8>>2]=r.getHours(),E[n+12>>2]=r.getDate(),E[n+16>>2]=r.getMonth(),E[n+20>>2]=r.getYear(),r.getTime()/1e3|0}function Ho(n,r,e,o,t,a){try{var s=C.getStreamFromFD(o),l=i.mmap(s,n,t,r,e),h=l.ptr;return E[a>>2]=l.allocated,h}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function Wo(n,r,e,o,t,a){try{var s=C.getStreamFromFD(t);e&2&&C.doMsync(n,s,r,o,a),i.munmap(s)}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Gt(n){var r=Ce(n)+1,e=mr(r);return e&&Ze(n,ee,e,r),e}function Yo(n,r,e){var o=new Date().getFullYear(),t=new Date(o,0,1),a=new Date(o,6,1),s=t.getTimezoneOffset(),l=a.getTimezoneOffset(),h=Math.max(s,l);E[n>>2]=h*60,E[r>>2]=+(s!=l);function w(F){var L=F.toTimeString().match(/\(([A-Za-z ]+)\)$/);return L?L[1]:"GMT"}var S=w(t),O=w(a),N=Gt(S),T=Gt(O);l<s?(j[e>>2]=N,j[e+4>>2]=T):(j[e>>2]=T,j[e+4>>2]=N)}function rt(n,r,e){rt.called||(rt.called=!0,Yo(n,r,e))}function jo(){me("")}function Kt(){return Date.now()}function Xt(){return 2147483648}function Rt(){return Xt()}var tt;te?tt=()=>{var n=process.hrtime();return n[0]*1e3+n[1]/1e6}:tt=()=>performance.now();function qo(n,r,e){le.copyWithin(n,r,r+e)}function Zt(n){try{return ir.grow(n-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function Vo(n){var r=le.length;n=n>>>0;var e=Xt();if(n>e)return!1;let o=(h,w)=>h+(w-h%w)%w;for(var t=1;t<=4;t*=2){var a=r*(1+.2/t);a=Math.min(a,n+100663296);var s=Math.min(e,o(Math.max(n,a),65536)),l=Zt(s);if(l)return!0}return!1}function Mt(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var it=A.ENV||{};function Go(){return ie||"./this.program"}function Or(){if(!Or.strings){var n=(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:n,_:Go()};for(var e in it)it[e]===void 0?delete r[e]:r[e]=it[e];var o=[];for(var e in r)o.push(e+"="+r[e]);Or.strings=o}return Or.strings}function at(n,r,e){for(var o=0;o<n.length;++o)ee[r++>>0]=n.charCodeAt(o);e||(ee[r>>0]=0)}function st(n,r){var e=0;return Or().forEach(function(o,t){var a=r+e;j[n+t*4>>2]=a,at(o,a),e+=o.length+1}),0}function On(n,r){var e=Or();j[n>>2]=e.length;var o=0;return e.forEach(function(t){o+=t.length+1}),j[r>>2]=o,0}function qr(n){Pr=n,Mr()||(f.onExit&&f.onExit(n),Tr=!0),_e(n,new Ur(n))}function Lt(n,r){Pr=n,Mr()||Kn(),qr(n)}var Cn=Lt;function Ko(n){try{var r=C.getStreamFromFD(n);return i.close(r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return e.errno}}function pn(n,r){try{var e=C.getStreamFromFD(n),o=e.tty?2:i.isDir(e.mode)?3:i.isLink(e.mode)?7:4;return ee[r>>0]=o,0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return t.errno}}function Xo(n,r,e,o){for(var t=0,a=0;a<e;a++){var s=j[r>>2],l=j[r+4>>2];r+=8;var h=i.read(n,ee,s,l,o);if(h<0)return-1;if(t+=h,h<l)break}return t}function Zo(n,r,e,o){try{var t=C.getStreamFromFD(n),a=Xo(t,r,e);return j[o>>2]=a,0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return s.errno}}function $o(n,r,e,o,t){try{var a=qt(r,e);if(isNaN(a))return 61;var s=C.getStreamFromFD(n);return i.llseek(s,a,o),Z=[s.position>>>0,(U=s.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[t>>2]=Z[0],E[t+4>>2]=Z[1],s.getdents&&a===0&&o===0&&(s.getdents=null),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return l.errno}}function Jo(n){try{var r=C.getStreamFromFD(n);return r.stream_ops&&r.stream_ops.fsync?r.stream_ops.fsync(r):0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return e.errno}}function Qo(n,r,e,o){for(var t=0,a=0;a<e;a++){var s=j[r>>2],l=j[r+4>>2];r+=8;var h=i.write(n,ee,s,l,o);if(h<0)return-1;t+=h}return t}function ei(n,r,e,o){try{var t=C.getStreamFromFD(n),a=Qo(t,r,e);return j[o>>2]=a,0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return s.errno}}function nn(n){var r=mr(20),e=mr(n.length+1);Fe(n,e,n.length+1),j[r>>2]=e;var o=mr(4);j[o>>2]=0,j[r+4>>2]=o;var t=2;E[r+8>>2]=t,E[r+12>>2]=4;var a=mr(12);return j[a>>2]=a+8,j[a+4>>2]=0,E[a+8>>2]=Ie(ue.lookup_name(n)),j[r+16>>2]=a,r}function Pn(n,r,e){if(e!==2)return he(5),null;n=E[n>>2];var o=Ne(n),t=ue.lookup_addr(o);return t&&(o=t),nn(o)}function Rn(n){return nn(ne(n))}function ri(n,r,e,o,t,a){var s=Rn(n);return It(r,s,20),zr(s),E[a>>2]=0,j[t>>2]=r,0}function Mn(n,r){for(var e=Math.min(r,3),o=8,t=0;t<e;t++)dt[n+t*o>>3]=.1;return e}function hn(n,r,e,o,t,a,s){var l=Gr(n,r);if(l.errno)return-6;var h=l.port,w=l.addr,S=!1;if(e&&o){var O;if(s&1||!(O=ue.lookup_addr(w))){if(s&8)return-2}else w=O;var N=Fe(w,e,o);N+1>=o&&(S=!0)}if(t&&a){h=""+h;var N=Fe(h,t,a);N+1>=a&&(S=!0)}return S?-12:0}var nt={list:[],map:{}};function bt(n){function r(a,s,l){var h=mr(a.length+1);at(a,h);for(var w=0,S=l.length,O=mr((S+1)*4),N=0;N<S;N++,w+=4){var T=l[N],F=mr(T.length+1);at(T,F),j[O+w>>2]=F}j[O+w>>2]=0;var L=mr(12);return j[L>>2]=h,j[L+4>>2]=O,E[L+8>>2]=s,L}var e=nt.list,o=nt.map;if(e.length===0){var t=r("tcp",6,["TCP"]);e.push(t),o.tcp=o[6]=t,t=r("udp",17,["UDP"]),e.push(t),o.udp=o[17]=t}bt.index=0}function $t(n){n=ne(n),bt(!0);var r=nt.map[n];return r}function yn(n){bt(!0);var r=nt.map[n];return r}function Fr(n){var r=Ce(n)+1,e=sr(r);return Ze(n,ee,e,r),e}var Ue={getAllWebSockets:function(n){let r=new Set;n.server&&n.server.clients.forEach(e=>{r.add(e)});for(let e of Ue.getAllPeers(n))r.add(e.socket);return Array.from(r)},getAllPeers:function(n){let r=new Set;if(n.server&&n.pending.filter(e=>e.peers).forEach(e=>{for(let o of Object.values(e.peers))r.add(o)}),n.peers)for(let e of Object.values(n.peers))r.add(e);return Array.from(r)},awaitData:function(n){return Ue.awaitWsEvent(n,"message")},awaitConnection:function(n){return n.OPEN===n.readyState?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(n,"open")},awaitClose:function(n){return[n.CLOSING,n.CLOSED].includes(n.readyState)?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(n,"close")},awaitError:function(n){return[n.CLOSING,n.CLOSED].includes(n.readyState)?[Promise.resolve(),Ue.noop]:Ue.awaitWsEvent(n,"error")},awaitWsEvent:function(n,r){let e,o=()=>{e()};return[new Promise(function(s){e=s,n.once(r,o)}),()=>{n.removeListener(r,o),setTimeout(e)}]},noop:function(){},shutdownSocket:function(n,r){let e=ke(n),o=Object.values(e.peers)[0];if(!o)return-1;try{return o.socket.close(),H.websocket_sock_ops.removePeer(e,o),0}catch(t){return console.log("Socket shutdown error",t),-1}}};function hr(n,r,e){if(!n)return 1;let o=ne(n);if(!o.length)return 0;let t=ne(r);if(!t.length)return 0;if(f.popen_to_file){let{path:a,exitCode:s}=f.popen_to_file(o,t);return le[e]=s,Fr(a)}if(te){let a=require("os").tmpdir(),s="php-process-stream",l=a+"/"+s,h=require("child_process"),w;if(t==="r")w=h.spawnSync(o,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[e]=w.status,require("fs").writeFileSync(l,w.stdout,{encoding:"utf8",flag:"w+"});else return t==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+t+" (should be r or w)"),_W_EXITCODE(0,2));return Fr(l)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function tr(n){return n%4===0&&(n%100!==0||n%400===0)}function Hr(n,r){for(var e=0,o=0;o<=r;e+=n[o++]);return e}var Ge=[31,29,31,30,31,30,31,31,30,31,30,31],Xe=[31,28,31,30,31,30,31,31,30,31,30,31];function Ve(n,r){for(var e=new Date(n.getTime());r>0;){var o=tr(e.getFullYear()),t=e.getMonth(),a=(o?Ge:Xe)[t];if(r>a-e.getDate())r-=a-e.getDate()+1,e.setDate(1),t<11?e.setMonth(t+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1));else return e.setDate(e.getDate()+r),e}return e}function ut(n,r,e,o){var t=E[o+40>>2],a={tm_sec:E[o>>2],tm_min:E[o+4>>2],tm_hour:E[o+8>>2],tm_mday:E[o+12>>2],tm_mon:E[o+16>>2],tm_year:E[o+20>>2],tm_wday:E[o+24>>2],tm_yday:E[o+28>>2],tm_isdst:E[o+32>>2],tm_gmtoff:E[o+36>>2],tm_zone:t?ne(t):""},s=ne(e),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var h in l)s=s.replace(new RegExp(h,"g"),l[h]);var w=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],S=["January","February","March","April","May","June","July","August","September","October","November","December"];function O(P,M,z){for(var q=typeof P=="number"?P.toString():P||"";q.length<M;)q=z[0]+q;return q}function N(P,M){return O(P,M,"0")}function T(P,M){function z(W){return W<0?-1:W>0?1:0}var q;return(q=z(P.getFullYear()-M.getFullYear()))===0&&(q=z(P.getMonth()-M.getMonth()))===0&&(q=z(P.getDate()-M.getDate())),q}function F(P){switch(P.getDay()){case 0:return new Date(P.getFullYear()-1,11,29);case 1:return P;case 2:return new Date(P.getFullYear(),0,3);case 3:return new Date(P.getFullYear(),0,2);case 4:return new Date(P.getFullYear(),0,1);case 5:return new Date(P.getFullYear()-1,11,31);case 6:return new Date(P.getFullYear()-1,11,30)}}function L(P){var M=Ve(new Date(P.tm_year+1900,0,1),P.tm_yday),z=new Date(M.getFullYear(),0,4),q=new Date(M.getFullYear()+1,0,4),W=F(z),X=F(q);return T(W,M)<=0?T(X,M)<=0?M.getFullYear()+1:M.getFullYear():M.getFullYear()-1}var R={"%a":function(P){return w[P.tm_wday].substring(0,3)},"%A":function(P){return w[P.tm_wday]},"%b":function(P){return S[P.tm_mon].substring(0,3)},"%B":function(P){return S[P.tm_mon]},"%C":function(P){var M=P.tm_year+1900;return N(M/100|0,2)},"%d":function(P){return N(P.tm_mday,2)},"%e":function(P){return O(P.tm_mday,2," ")},"%g":function(P){return L(P).toString().substring(2)},"%G":function(P){return L(P)},"%H":function(P){return N(P.tm_hour,2)},"%I":function(P){var M=P.tm_hour;return M==0?M=12:M>12&&(M-=12),N(M,2)},"%j":function(P){return N(P.tm_mday+Hr(tr(P.tm_year+1900)?Ge:Xe,P.tm_mon-1),3)},"%m":function(P){return N(P.tm_mon+1,2)},"%M":function(P){return N(P.tm_min,2)},"%n":function(){return`
31
+ `},"%p":function(P){return P.tm_hour>=0&&P.tm_hour<12?"AM":"PM"},"%S":function(P){return N(P.tm_sec,2)},"%t":function(){return" "},"%u":function(P){return P.tm_wday||7},"%U":function(P){var M=P.tm_yday+7-P.tm_wday;return N(Math.floor(M/7),2)},"%V":function(P){var M=Math.floor((P.tm_yday+7-(P.tm_wday+6)%7)/7);if((P.tm_wday+371-P.tm_yday-2)%7<=2&&M++,M){if(M==53){var q=(P.tm_wday+371-P.tm_yday)%7;q!=4&&(q!=3||!tr(P.tm_year))&&(M=1)}}else{M=52;var z=(P.tm_wday+7-P.tm_yday-1)%7;(z==4||z==5&&tr(P.tm_year%400-1))&&M++}return N(M,2)},"%w":function(P){return P.tm_wday},"%W":function(P){var M=P.tm_yday+7-(P.tm_wday+6)%7;return N(Math.floor(M/7),2)},"%y":function(P){return(P.tm_year+1900).toString().substring(2)},"%Y":function(P){return P.tm_year+1900},"%z":function(P){var M=P.tm_gmtoff,z=M>=0;return M=Math.abs(M)/60,M=M/60*100+M%60,(z?"+":"-")+("0000"+M).slice(-4)},"%Z":function(P){return P.tm_zone},"%%":function(){return"%"}};s=s.replace(/%%/g,"\0\0");for(var h in R)s.includes(h)&&(s=s.replace(new RegExp(h,"g"),R[h](a)));s=s.replace(/\0\0/g,"%");var B=Er(s,!1);return B.length>r?0:(Et(B,n),B.length-1)}function Kr(n,r,e){for(var o=ne(r),t="\\!@#$^&*()+=-[]/{}|:<>?,.",a=0,s=t.length;a<s;++a)o=o.replace(new RegExp("\\"+t[a],"g"),"\\"+t[a]);var l={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var h in l)o=o.replace(h,l[h]);var w={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},S={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},O={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},N={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var T in w)o=o.replace(T,"("+T+w[T]+")");for(var F=[],a=o.indexOf("%");a>=0;a=o.indexOf("%"))F.push(o[a+1]),o=o.replace(new RegExp("\\%"+o[a+1],"g"),"");var L=new RegExp("^"+o,"i").exec(ne(n));function R(){function nr(or,xr,et){return typeof or!="number"||isNaN(or)?xr:or>=xr?or<=et?or:et:xr}return{year:nr(E[e+20>>2]+1900,1970,9999),month:nr(E[e+16>>2],0,11),day:nr(E[e+12>>2],1,31),hour:nr(E[e+8>>2],0,23),min:nr(E[e+4>>2],0,59),sec:nr(E[e>>2],0,59)}}if(L){var B=R(),P,M=nr=>{var or=F.indexOf(nr);if(or>=0)return L[or+1]};if((P=M("S"))&&(B.sec=ce(P)),(P=M("M"))&&(B.min=ce(P)),P=M("H"))B.hour=ce(P);else if(P=M("I")){var z=ce(P);(P=M("p"))&&(z+=P.toUpperCase()[0]==="P"?12:0),B.hour=z}if(P=M("Y"))B.year=ce(P);else if(P=M("y")){var q=ce(P);(P=M("C"))?q+=ce(P)*100:q+=q<69?2e3:1900,B.year=q}if((P=M("m"))?B.month=ce(P)-1:(P=M("b"))&&(B.month=S[P.substring(0,3).toUpperCase()]||0),P=M("d"))B.day=ce(P);else if(P=M("j"))for(var W=ce(P),X=tr(B.year),oe=0;oe<12;++oe){var se=Hr(X?Ge:Xe,oe-1);W<=se+(X?Ge:Xe)[oe]&&(B.day=W-se)}else if(P=M("a")){var Oe=P.substring(0,3).toUpperCase();if(P=M("U")){var Ae=O[Oe],Qe=ce(P),Ke=new Date(B.year,0,1),rr;Ke.getDay()===0?rr=Ve(Ke,Ae+7*(Qe-1)):rr=Ve(Ke,7-Ke.getDay()+Ae+7*(Qe-1)),B.day=rr.getDate(),B.month=rr.getMonth()}else if(P=M("W")){var Ae=N[Oe],Qe=ce(P),Ke=new Date(B.year,0,1),rr;Ke.getDay()===1?rr=Ve(Ke,Ae+7*(Qe-1)):rr=Ve(Ke,7-Ke.getDay()+1+Ae+7*(Qe-1)),B.day=rr.getDate(),B.month=rr.getMonth()}}var je=new Date(B.year,B.month,B.day,B.hour,B.min,B.sec,0);return E[e>>2]=je.getSeconds(),E[e+4>>2]=je.getMinutes(),E[e+8>>2]=je.getHours(),E[e+12>>2]=je.getDate(),E[e+16>>2]=je.getMonth(),E[e+20>>2]=je.getFullYear()-1900,E[e+24>>2]=je.getDay(),E[e+28>>2]=Hr(tr(je.getFullYear())?Ge:Xe,je.getMonth()-1)+je.getDate()-1,E[e+32>>2]=0,n+Er(L[0]).length-1}return 0}function ot(n){return Ue.shutdownSocket(n,2)}function ft(n,r,e){if(typeof Asyncify>"u")return 0;let o=1,t=2,a=4,s=8,l=16,h=32;return Asyncify.handleSleep(w=>{let S=ke(n);if(!S){w(0);return}let O=[],N=new Set;if(r&o||r&t){if(S.server){for(let P of S.pending)if((P.recv_queue||[]).length>0){w(1);return}}else if((S.recv_queue||[]).length>0){w(1);return}}let T=Ue.getAllWebSockets(S);if(!T.length){w(0);return}for(let P of T)(r&o||r&t)&&(O.push(Ue.awaitData(P)),N.add("POLLIN")),r&a&&(O.push(Ue.awaitConnection(P)),N.add("POLLOUT")),r&l&&(O.push(Ue.awaitClose(P)),N.add("POLLHUP")),(r&s||r&h)&&(O.push(Ue.awaitError(P)),N.add("POLLERR"));if(O.length===0){console.warn("Unsupported poll event "+r+", defaulting to setTimeout()."),setTimeout(function(){w(0)},e);return}let F=O.map(([P])=>P),L=()=>O.forEach(([,P])=>P()),R=!1;Promise.race(F).then(function(P){R||(R=!0,w(1),clearTimeout(B),L())});let B=setTimeout(function(){R||(R=!0,w(0),L())},e)})}function Ot(n,r,e,o,t){let a=le[o];if(!(r===1&&e===9||r===6&&e===1))return console.warn(`Unsupported socket option: ${r}, ${e}, ${a}`),-1;let O=Ue.getAllWebSockets(n)[0];return O?(O.setSocketOpt(r,e,o),0):-1}function Dt(n){var r=f["_"+n];return r}function Jt(n,r,e,o,t){var a={string:F=>{var L=0;if(F!=null&&F!==0){var R=(F.length<<2)+1;L=sr(R),Fe(F,L,R)}return L},array:F=>{var L=sr(F.length);return Et(F,L),L}};function s(F){return r==="string"?ne(F):r==="boolean"?!!F:F}var l=Dt(n),h=[],w=0;if(o)for(var S=0;S<o.length;S++){var O=a[e[S]];O?(w===0&&(w=De()),h[S]=O(o[S])):h[S]=o[S]}var N=l.apply(null,h);function T(F){return w!==0&&ye(w),s(F)}return N=T(N),N}var Ut=function(n,r,e,o){n||(n=this),this.parent=n,this.mount=n.mount,this.mounted=null,this.id=i.nextInode++,this.name=r,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=o},Xr=365,$r=146;Object.defineProperties(Ut.prototype,{read:{get:function(){return(this.mode&Xr)===Xr},set:function(n){n?this.mode|=Xr:this.mode&=~Xr}},write:{get:function(){return(this.mode&$r)===$r},set:function(n){n?this.mode|=$r:this.mode&=~$r}},isFolder:{get:function(){return i.isDir(this.mode)}},isDevice:{get:function(){return i.isChrdev(this.mode)}}}),i.FSNode=Ut,i.staticInit(),f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_unlink=i.unlink,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,te&&(yr(),V.staticInit()),re={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};var En={j:to,Ra:wt,Qa:v,Pa:Zr,Oa:dn,Na:Pt,N:oo,Ma:io,La:ao,Ka:so,Ja:uo,Ia:_n,Ha:fo,M:gt,l:co,Ga:lo,Q:_o,Fa:mo,Ea:vo,Da:po,Ca:ho,Ba:yo,L:Eo,Aa:wo,za:go,ya:So,xa:bo,B:ko,wa:Oo,va:kr,ua:Do,ta:Se,sa:No,K:To,ra:Ao,J:Fo,qa:Co,pa:Po,oa:Ro,I:Mo,na:Lo,ja:mn,ia:St,ha:Fn,ga:vn,fa:Io,ea:Bo,da:xo,ca:zo,ba:Ho,aa:Wo,$:rt,m:jo,z:Kt,_:Rt,F:tt,Z:qo,Y:Vo,X:Mt,ma:st,la:On,o:Cn,s:Ko,H:pn,G:Zo,P:$o,ka:Jo,A:ei,E:Pn,D:ri,W:Mn,V:hn,U:$t,T:yn,h:bn,d:di,b:_i,f:D,g:k,v:m,u:Bn,t:b,S:g,y:c,e:li,a:In,c:Tn,k:Nn,q:xn,n:u,i:_,x:y,R:hr,C:ut,O:Kr,p:ot,w:ft,r:Ot},ti=ro(),wn=f.___wasm_call_ctors=function(){return(wn=f.___wasm_call_ctors=f.asm.Ta).apply(null,arguments)},on=f._wasm_popen=function(){return(on=f._wasm_popen=f.asm.Ua).apply(null,arguments)},Qt=f.___errno_location=function(){return(Qt=f.___errno_location=f.asm.Va).apply(null,arguments)},Dn=f._wasm_pclose=function(){return(Dn=f._wasm_pclose=f.asm.Wa).apply(null,arguments)},gn=f._php_pollfd_for=function(){return(gn=f._php_pollfd_for=f.asm.Xa).apply(null,arguments)},Tt=f._wasm_select=function(){return(Tt=f._wasm_select=f.asm.Ya).apply(null,arguments)},Jr=f._wasm_add_cli_arg=function(){return(Jr=f._wasm_add_cli_arg=f.asm.Za).apply(null,arguments)},mr=f._malloc=function(){return(mr=f._malloc=f.asm._a).apply(null,arguments)},Qr=f._run_cli=function(){return(Qr=f._run_cli=f.asm.$a).apply(null,arguments)},It=f._memcpy=function(){return(It=f._memcpy=f.asm.ab).apply(null,arguments)},zr=f._free=function(){return(zr=f._free=f.asm.bb).apply(null,arguments)},Nt=f._ntohs=function(){return(Nt=f._ntohs=f.asm.db).apply(null,arguments)},Dr=f._htons=function(){return(Dr=f._htons=f.asm.eb).apply(null,arguments)},At=f._fflush=function(){return(At=f._fflush=f.asm.fb).apply(null,arguments)},an=f._wasm_set_phpini_path=function(){return(an=f._wasm_set_phpini_path=f.asm.gb).apply(null,arguments)},Br=f._wasm_set_phpini_entries=function(){return(Br=f._wasm_set_phpini_entries=f.asm.hb).apply(null,arguments)},Vr=f._wasm_add_SERVER_entry=function(){return(Vr=f._wasm_add_SERVER_entry=f.asm.ib).apply(null,arguments)},Ft=f._wasm_add_uploaded_file=function(){return(Ft=f._wasm_add_uploaded_file=f.asm.jb).apply(null,arguments)},sn=f._wasm_set_query_string=function(){return(sn=f._wasm_set_query_string=f.asm.kb).apply(null,arguments)},en=f._wasm_set_path_translated=function(){return(en=f._wasm_set_path_translated=f.asm.lb).apply(null,arguments)},un=f._wasm_set_skip_shebang=function(){return(un=f._wasm_set_skip_shebang=f.asm.mb).apply(null,arguments)},rn=f._wasm_set_request_uri=function(){return(rn=f._wasm_set_request_uri=f.asm.nb).apply(null,arguments)},tn=f._wasm_set_request_method=function(){return(tn=f._wasm_set_request_method=f.asm.ob).apply(null,arguments)},Sn=f._wasm_set_request_host=function(){return(Sn=f._wasm_set_request_host=f.asm.pb).apply(null,arguments)},ni=f._wasm_set_content_type=function(){return(ni=f._wasm_set_content_type=f.asm.qb).apply(null,arguments)},oi=f._wasm_set_request_body=function(){return(oi=f._wasm_set_request_body=f.asm.rb).apply(null,arguments)},ii=f._wasm_set_content_length=function(){return(ii=f._wasm_set_content_length=f.asm.sb).apply(null,arguments)},ai=f._wasm_set_cookies=function(){return(ai=f._wasm_set_cookies=f.asm.tb).apply(null,arguments)},si=f._wasm_set_php_code=function(){return(si=f._wasm_set_php_code=f.asm.ub).apply(null,arguments)},ui=f._wasm_set_request_port=function(){return(ui=f._wasm_set_request_port=f.asm.vb).apply(null,arguments)},fi=f._phpwasm_init_uploaded_files_hash=function(){return(fi=f._phpwasm_init_uploaded_files_hash=f.asm.wb).apply(null,arguments)},ci=f._phpwasm_register_uploaded_file=function(){return(ci=f._phpwasm_register_uploaded_file=f.asm.xb).apply(null,arguments)},Ln=f._phpwasm_destroy_uploaded_files_hash=function(){return(Ln=f._phpwasm_destroy_uploaded_files_hash=f.asm.yb).apply(null,arguments)},Un=f._wasm_sapi_handle_request=function(){return(Un=f._wasm_sapi_handle_request=f.asm.zb).apply(null,arguments)},Cr=f._php_wasm_init=function(){return(Cr=f._php_wasm_init=f.asm.Ab).apply(null,arguments)},Sr=f.___funcs_on_exit=function(){return(Sr=f.___funcs_on_exit=f.asm.Bb).apply(null,arguments)},br=f._emscripten_builtin_memalign=function(){return(br=f._emscripten_builtin_memalign=f.asm.Cb).apply(null,arguments)},Te=f._setThrew=function(){return(Te=f._setThrew=f.asm.Db).apply(null,arguments)},De=f.stackSave=function(){return(De=f.stackSave=f.asm.Eb).apply(null,arguments)},ye=f.stackRestore=function(){return(ye=f.stackRestore=f.asm.Fb).apply(null,arguments)},sr=f.stackAlloc=function(){return(sr=f.stackAlloc=f.asm.Gb).apply(null,arguments)},Ye=f.dynCall_viii=function(){return(Ye=f.dynCall_viii=f.asm.Hb).apply(null,arguments)},vr=f.dynCall_vii=function(){return(vr=f.dynCall_vii=f.asm.Ib).apply(null,arguments)},Be=f.dynCall_vi=function(){return(Be=f.dynCall_vi=f.asm.Jb).apply(null,arguments)},ur=f.dynCall_iii=function(){return(ur=f.dynCall_iii=f.asm.Kb).apply(null,arguments)},fr=f.dynCall_ii=function(){return(fr=f.dynCall_ii=f.asm.Lb).apply(null,arguments)},cr=f.dynCall_v=function(){return(cr=f.dynCall_v=f.asm.Mb).apply(null,arguments)},He=f.dynCall_iiii=function(){return(He=f.dynCall_iiii=f.asm.Nb).apply(null,arguments)},xe=f.dynCall_viiiii=function(){return(xe=f.dynCall_viiiii=f.asm.Ob).apply(null,arguments)},lr=f.dynCall_iiiii=function(){return(lr=f.dynCall_iiiii=f.asm.Pb).apply(null,arguments)},kt=f.dynCall_iiiiiii=function(){return(kt=f.dynCall_iiiiiii=f.asm.Qb).apply(null,arguments)},Bt=f.dynCall_iiiiii=function(){return(Bt=f.dynCall_iiiiii=f.asm.Rb).apply(null,arguments)},xt=f.dynCall_i=function(){return(xt=f.dynCall_i=f.asm.Sb).apply(null,arguments)},zt=f.dynCall_viiii=function(){return(zt=f.dynCall_viiii=f.asm.Tb).apply(null,arguments)},Ht=f.dynCall_iiiiiiiii=function(){return(Ht=f.dynCall_iiiiiiiii=f.asm.Ub).apply(null,arguments)},Wt=f.dynCall_iiiiiiiiii=function(){return(Wt=f.dynCall_iiiiiiiiii=f.asm.Vb).apply(null,arguments)},Yt=f.dynCall_viiiiiiiii=function(){return(Yt=f.dynCall_viiiiiiiii=f.asm.Wb).apply(null,arguments)},jt=f.dynCall_viiiiii=function(){return(jt=f.dynCall_viiiiii=f.asm.Xb).apply(null,arguments)},fn=f.dynCall_iiiiiiii=function(){return(fn=f.dynCall_iiiiiiii=f.asm.Yb).apply(null,arguments)};function Nn(n,r,e,o){var t=De();try{Ye(n,r,e,o)}catch(a){if(ye(t),a!==a+0)throw a;Te(1,0)}}function Tn(n,r,e){var o=De();try{vr(n,r,e)}catch(t){if(ye(o),t!==t+0)throw t;Te(1,0)}}function In(n,r){var e=De();try{Be(n,r)}catch(o){if(ye(e),o!==o+0)throw o;Te(1,0)}}function Bn(n,r,e,o,t,a,s){var l=De();try{return kt(n,r,e,o,t,a,s)}catch(h){if(ye(l),h!==h+0)throw h;Te(1,0)}}function li(n){var r=De();try{cr(n)}catch(e){if(ye(r),e!==e+0)throw e;Te(1,0)}}function di(n,r){var e=De();try{return fr(n,r)}catch(o){if(ye(e),o!==o+0)throw o;Te(1,0)}}function _i(n,r,e){var o=De();try{return ur(n,r,e)}catch(t){if(ye(o),t!==t+0)throw t;Te(1,0)}}function bn(n){var r=De();try{return xt(n)}catch(e){if(ye(r),e!==e+0)throw e;Te(1,0)}}function xn(n,r,e,o,t){var a=De();try{zt(n,r,e,o,t)}catch(s){if(ye(a),s!==s+0)throw s;Te(1,0)}}function g(n,r,e,o,t,a,s,l,h){var w=De();try{return Ht(n,r,e,o,t,a,s,l,h)}catch(S){if(ye(w),S!==S+0)throw S;Te(1,0)}}function k(n,r,e,o,t){var a=De();try{return lr(n,r,e,o,t)}catch(s){if(ye(a),s!==s+0)throw s;Te(1,0)}}function D(n,r,e,o){var t=De();try{return He(n,r,e,o)}catch(a){if(ye(t),a!==a+0)throw a;Te(1,0)}}function _(n,r,e,o,t,a,s){var l=De();try{jt(n,r,e,o,t,a,s)}catch(h){if(ye(l),h!==h+0)throw h;Te(1,0)}}function u(n,r,e,o,t,a){var s=De();try{xe(n,r,e,o,t,a)}catch(l){if(ye(s),l!==l+0)throw l;Te(1,0)}}function c(n,r,e,o,t,a,s,l,h,w){var S=De();try{return Wt(n,r,e,o,t,a,s,l,h,w)}catch(O){if(ye(S),O!==O+0)throw O;Te(1,0)}}function m(n,r,e,o,t,a){var s=De();try{return Bt(n,r,e,o,t,a)}catch(l){if(ye(s),l!==l+0)throw l;Te(1,0)}}function y(n,r,e,o,t,a,s,l,h,w){var S=De();try{Yt(n,r,e,o,t,a,s,l,h,w)}catch(O){if(ye(S),O!==O+0)throw O;Te(1,0)}}function b(n,r,e,o,t,a,s,l){var h=De();try{return fn(n,r,e,o,t,a,s,l)}catch(w){if(ye(h),w!==w+0)throw w;Te(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,f.FS_unlink=i.unlink,f.ccall=Jt,f.FS=i;var d;$e=function n(){d||p(),d||($e=n)};function p(n){if(n=n||$,Pe>0||(Vn(),Pe>0))return;function r(){d||(d=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),r()},1)):r()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return p(),A}var Vf,lu,_u=Oi(()=>{"use strict";Vf=10061416,lu=__dirname+"/php_7_0.wasm"});var vu={};gi(vu,{default:()=>Xf,dependenciesTotalSize:()=>Kf,dependencyFilename:()=>mu});function Xf(x,A,I){var f=typeof A<"u"?A:{},K=Object.assign({},f),$=[],ie="./this.program",_e=(r,e)=>{throw e},Ee=x==="WEB",pe=x==="WORKER",te=x==="NODE",ve="";function Nr(r){return f.locateFile?f.locateFile(r,ve):ve+r}var We,ar,Re;function Wr(r){if(r instanceof Ur)return;fe("exiting due to exception: "+r)}if(te){pe?ve=require("path").dirname(ve)+"/":ve=__dirname+"/";var J,Me,yr=()=>{Me||(J=require("fs"),Me=require("path"))};We=(r,e)=>(yr(),r=Me.normalize(r),J.readFileSync(r,e?void 0:"utf8")),Re=r=>{var e=We(r,!0);return e.buffer||(e=new Uint8Array(e)),e},ar=(r,e,o)=>{yr(),r=Me.normalize(r),J.readFile(r,function(t,a){t?o(t):e(a.buffer)})},process.argv.length>1&&(ie=process.argv[1].replace(/\\/g,"/")),$=process.argv.slice(2),typeof module<"u"&&(module.exports=f),process.on("uncaughtException",function(r){if(!(r instanceof Ur))throw r}),process.on("unhandledRejection",function(r){throw r}),_e=(r,e)=>{if(Mr())throw process.exitCode=r,e;Wr(e),process.exit(r)},f.inspect=function(){return"[Emscripten Module object]"}}var er=f.print||console.log.bind(console),fe=f.printErr||console.warn.bind(console);Object.assign(f,K),K=null,f.arguments&&($=f.arguments),f.thisProgram&&(ie=f.thisProgram),f.quit&&(_e=f.quit);var qe;f.wasmBinary&&(qe=f.wasmBinary);var cn=f.noExitRuntime||!1;typeof WebAssembly!="object"&&me("no native wasm support detected");var ir,Tr=!1,Pr;function Le(r,e){r||me(e)}var ct=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(r,e,o){for(var t=e+o,a=e;r[a]&&!(a>=t);)++a;if(a-e>16&&r.buffer&&ct)return ct.decode(r.subarray(e,a));for(var s="";e<a;){var l=r[e++];if(!(l&128)){s+=String.fromCharCode(l);continue}var h=r[e++]&63;if((l&224)==192){s+=String.fromCharCode((l&31)<<6|h);continue}var w=r[e++]&63;if((l&240)==224?l=(l&15)<<12|h<<6|w:l=(l&7)<<18|h<<12|w<<6|r[e++]&63,l<65536)s+=String.fromCharCode(l);else{var S=l-65536;s+=String.fromCharCode(55296|S>>10,56320|S&1023)}}return s}function ne(r,e){return r?ze(le,r,e):""}function Ze(r,e,o,t){if(!(t>0))return 0;for(var a=o,s=o+t-1,l=0;l<r.length;++l){var h=r.charCodeAt(l);if(h>=55296&&h<=57343){var w=r.charCodeAt(++l);h=65536+((h&1023)<<10)|w&1023}if(h<=127){if(o>=s)break;e[o++]=h}else if(h<=2047){if(o+1>=s)break;e[o++]=192|h>>6,e[o++]=128|h&63}else if(h<=65535){if(o+2>=s)break;e[o++]=224|h>>12,e[o++]=128|h>>6&63,e[o++]=128|h&63}else{if(o+3>=s)break;e[o++]=240|h>>18,e[o++]=128|h>>12&63,e[o++]=128|h>>6&63,e[o++]=128|h&63}}return e[o]=0,o-a}function Fe(r,e,o){return Ze(r,le,e,o)}function Ce(r){for(var e=0,o=0;o<r.length;++o){var t=r.charCodeAt(o);t<=127?e++:t<=2047?e+=2:t>=55296&&t<=57343?(e+=4,++o):e+=3}return e}var Rr,ee,le,we,lt,E,j,Hn,dt;function _t(r){Rr=r,f.HEAP8=ee=new Int8Array(r),f.HEAP16=we=new Int16Array(r),f.HEAP32=E=new Int32Array(r),f.HEAPU8=le=new Uint8Array(r),f.HEAPU16=lt=new Uint16Array(r),f.HEAPU32=j=new Uint32Array(r),f.HEAPF32=Hn=new Float32Array(r),f.HEAPF64=dt=new Float64Array(r)}var Fi=f.INITIAL_MEMORY||1073741824,ln,mt=[],vt=[],Wn=[],pt=[],Yn=!1,jn=!1,qn=0;function Mr(){return cn||qn>0}function Vn(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Zn(f.preRun.shift());_r(mt)}function Gn(){Yn=!0,!f.noFSInit&&!i.init.initialized&&i.init(),i.ignorePermissions=!1,ge.init(),H.root=i.mount(H,{},null),ae.root=i.mount(ae,{},null),_r(vt)}function Kn(){Ln(),_r(Wn),i.quit(),ge.shutdown(),jn=!0}function Xn(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Jn(f.postRun.shift());_r(pt)}function Zn(r){mt.unshift(r)}function $n(r){vt.unshift(r)}function Jn(r){pt.unshift(r)}var Pe=0,Lr=null,$e=null;function Ci(r){return r}function dr(r){Pe++,f.monitorRunDependencies&&f.monitorRunDependencies(Pe)}function Je(r){if(Pe--,f.monitorRunDependencies&&f.monitorRunDependencies(Pe),Pe==0&&(Lr!==null&&(clearInterval(Lr),Lr=null),$e)){var e=$e;$e=null,e()}}function me(r){f.onAbort&&f.onAbort(r),r="Aborted("+r+")",fe(r),Tr=!0,Pr=1,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw e}var Qn="data:application/octet-stream;base64,";function ht(r){return r.startsWith(Qn)}var de;de=mu,ht(de)||(de=Nr(de));function yt(r){try{if(r==de&&qe)return new Uint8Array(qe);if(Re)return Re(r);throw"both async and sync fetching of the wasm failed"}catch(e){me(e)}}function eo(){return!qe&&(Ee||pe)&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+de+"'";return r.arrayBuffer()}).catch(function(){return yt(de)}):Promise.resolve().then(function(){return yt(de)})}function ro(){var r={a:$r};function e(l,h){var w=l.exports;f.asm=w,ir=f.asm.Ua,_t(ir.buffer),ln=f.asm.cb,$n(f.asm.Va),Je("wasm-instantiate")}dr("wasm-instantiate");function o(l){e(l.instance)}function t(l){return eo().then(function(h){return WebAssembly.instantiate(h,r)}).then(function(h){return h}).then(l,function(h){fe("failed to asynchronously prepare wasm: "+h),me(h)})}function a(){return!qe&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(de)&&!te&&typeof fetch=="function"?fetch(de,{credentials:"same-origin"}).then(function(l){var h=WebAssembly.instantiateStreaming(l,r);return h.then(o,function(w){return fe("wasm streaming compile failed: "+w),fe("falling back to ArrayBuffer instantiation"),t(o)})}):t(o)}if(f.instantiateWasm)try{var s=f.instantiateWasm(r,e);return s}catch(l){return fe("Module.instantiateWasm callback failed with error: "+l),!1}return a(),{}}var U,Z;function Ur(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function _r(r){for(;r.length>0;)r.shift()(f)}function Et(r,e){ee.set(r,e)}function to(r,e,o,t){me("Assertion failed: "+ne(r)+", at: "+[e?ne(e):"unknown filename",o,t?ne(t):"unknown function"])}function wt(r,e){(function(o){ye.apply(null,[r,o])})(e)}var Y={isAbs:r=>r.charAt(0)==="/",splitPath:r=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return e.exec(r).slice(1)},normalizeArray:(r,e)=>{for(var o=0,t=r.length-1;t>=0;t--){var a=r[t];a==="."?r.splice(t,1):a===".."?(r.splice(t,1),o++):o&&(r.splice(t,1),o--)}if(e)for(;o;o--)r.unshift("..");return r},normalize:r=>{var e=Y.isAbs(r),o=r.substr(-1)==="/";return r=Y.normalizeArray(r.split("/").filter(t=>!!t),!e).join("/"),!r&&!e&&(r="."),r&&o&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=Y.splitPath(r),o=e[0],t=e[1];return!o&&!t?".":(t&&(t=t.substr(0,t.length-1)),o+t)},basename:r=>{if(r==="/")return"/";r=Y.normalize(r),r=r.replace(/\/$/,"");var e=r.lastIndexOf("/");return e===-1?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments);return Y.normalize(r.join("/"))},join2:(r,e)=>Y.normalize(r+"/"+e)};function no(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var r=new Uint8Array(1);return()=>(crypto.getRandomValues(r),r[0])}else if(te)try{var e=require("crypto");return()=>e.randomBytes(1)[0]}catch{}return()=>me("randomDevice")}var Q={resolve:function(){for(var r="",e=!1,o=arguments.length-1;o>=-1&&!e;o--){var t=o>=0?arguments[o]:i.cwd();if(typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,e=Y.isAbs(t)}return r=Y.normalizeArray(r.split("/").filter(a=>!!a),!e).join("/"),(e?"/":"")+r||"."},relative:(r,e)=>{r=Q.resolve(r).substr(1),e=Q.resolve(e).substr(1);function o(S){for(var O=0;O<S.length&&S[O]==="";O++);for(var N=S.length-1;N>=0&&S[N]==="";N--);return O>N?[]:S.slice(O,N-O+1)}for(var t=o(r.split("/")),a=o(e.split("/")),s=Math.min(t.length,a.length),l=s,h=0;h<s;h++)if(t[h]!==a[h]){l=h;break}for(var w=[],h=l;h<t.length;h++)w.push("..");return w=w.concat(a.slice(l)),w.join("/")}};function Er(r,e,o){var t=o>0?o:Ce(r)+1,a=new Array(t),s=Ze(r,a,0,a.length);return e&&(a.length=s),a}var ge={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){ge.ttys[r]={input:[],output:[],ops:e},i.registerDevice(r,ge.stream_ops)},stream_ops:{open:function(r){var e=ge.ttys[r.node.rdev];if(!e)throw new i.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.fsync(r.tty)},fsync:function(r){r.tty.ops.fsync(r.tty)},read:function(r,e,o,t,a){if(!r.tty||!r.tty.ops.get_char)throw new i.ErrnoError(60);for(var s=0,l=0;l<t;l++){var h;try{h=r.tty.ops.get_char(r.tty)}catch{throw new i.ErrnoError(29)}if(h===void 0&&s===0)throw new i.ErrnoError(6);if(h==null)break;s++,e[o+l]=h}return s&&(r.node.timestamp=Date.now()),s},write:function(r,e,o,t,a){if(!r.tty||!r.tty.ops.put_char)throw new i.ErrnoError(60);try{for(var s=0;s<t;s++)r.tty.ops.put_char(r.tty,e[o+s])}catch{throw new i.ErrnoError(29)}return t&&(r.node.timestamp=Date.now()),s}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if(te){var o=256,t=Buffer.alloc(o),a=0;try{a=J.readSync(process.stdin.fd,t,0,o,-1)}catch(s){if(s.toString().includes("EOF"))a=0;else throw s}a>0?e=t.slice(0,a).toString("utf-8"):e=null}else typeof window<"u"&&typeof window.prompt=="function"?(e=window.prompt("Input: "),e!==null&&(e+=`
32
+ `)):typeof readline=="function"&&(e=readline(),e!==null&&(e+=`
33
+ `));if(!e)return null;r.input=Er(e,!0)}return r.input.shift()},put_char:function(r,e){e===null||e===10?(er(ze(r.output,0)),r.output=[]):e!=0&&r.output.push(e)},fsync:function(r){r.output&&r.output.length>0&&(er(ze(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){e===null||e===10?(fe(ze(r.output,0)),r.output=[]):e!=0&&r.output.push(e)},fsync:function(r){r.output&&r.output.length>0&&(fe(ze(r.output,0)),r.output=[])}}};function wr(r,e){return le.fill(0,r,r+e),r}function gr(r,e){return Math.ceil(r/e)*e}function Ir(r){r=gr(r,65536);var e=Un(65536,r);return e?wr(e,r):0}var G={ops_table:null,mount:function(r){return G.createNode(null,"/",16895,0)},createNode:function(r,e,o,t){if(i.isBlkdev(o)||i.isFIFO(o))throw new i.ErrnoError(63);G.ops_table||(G.ops_table={dir:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,lookup:G.node_ops.lookup,mknod:G.node_ops.mknod,rename:G.node_ops.rename,unlink:G.node_ops.unlink,rmdir:G.node_ops.rmdir,readdir:G.node_ops.readdir,symlink:G.node_ops.symlink},stream:{llseek:G.stream_ops.llseek}},file:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:{llseek:G.stream_ops.llseek,read:G.stream_ops.read,write:G.stream_ops.write,allocate:G.stream_ops.allocate,mmap:G.stream_ops.mmap,msync:G.stream_ops.msync}},link:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,readlink:G.node_ops.readlink},stream:{}},chrdev:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:i.chrdev_stream_ops}});var a=i.createNode(r,e,o,t);return i.isDir(a.mode)?(a.node_ops=G.ops_table.dir.node,a.stream_ops=G.ops_table.dir.stream,a.contents={}):i.isFile(a.mode)?(a.node_ops=G.ops_table.file.node,a.stream_ops=G.ops_table.file.stream,a.usedBytes=0,a.contents=null):i.isLink(a.mode)?(a.node_ops=G.ops_table.link.node,a.stream_ops=G.ops_table.link.stream):i.isChrdev(a.mode)&&(a.node_ops=G.ops_table.chrdev.node,a.stream_ops=G.ops_table.chrdev.stream),a.timestamp=Date.now(),r&&(r.contents[e]=a,r.timestamp=a.timestamp),a},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var o=r.contents?r.contents.length:0;if(!(o>=e)){var t=1024*1024;e=Math.max(e,o*(o<t?2:1.125)>>>0),o!=0&&(e=Math.max(e,256));var a=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(a.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(e==0)r.contents=null,r.usedBytes=0;else{var o=r.contents;r.contents=new Uint8Array(e),o&&r.contents.set(o.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=i.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,i.isDir(r.mode)?e.size=4096:i.isFile(r.mode)?e.size=r.usedBytes:i.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){e.mode!==void 0&&(r.mode=e.mode),e.timestamp!==void 0&&(r.timestamp=e.timestamp),e.size!==void 0&&G.resizeFileStorage(r,e.size)},lookup:function(r,e){throw i.genericErrors[44]},mknod:function(r,e,o,t){return G.createNode(r,e,o,t)},rename:function(r,e,o){if(i.isDir(r.mode)){var t;try{t=i.lookupNode(e,o)}catch{}if(t)for(var a in t.contents)throw new i.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=o,e.contents[o]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var o=i.lookupNode(r,e);for(var t in o.contents)throw new i.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var o in r.contents)r.contents.hasOwnProperty(o)&&e.push(o);return e},symlink:function(r,e,o){var t=G.createNode(r,e,41471,0);return t.link=o,t},readlink:function(r){if(!i.isLink(r.mode))throw new i.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,o,t,a){var s=r.node.contents;if(a>=r.node.usedBytes)return 0;var l=Math.min(r.node.usedBytes-a,t);if(l>8&&s.subarray)e.set(s.subarray(a,a+l),o);else for(var h=0;h<l;h++)e[o+h]=s[a+h];return l},write:function(r,e,o,t,a,s){if(e.buffer===ee.buffer&&(s=!1),!t)return 0;var l=r.node;if(l.timestamp=Date.now(),e.subarray&&(!l.contents||l.contents.subarray)){if(s)return l.contents=e.subarray(o,o+t),l.usedBytes=t,t;if(l.usedBytes===0&&a===0)return l.contents=e.slice(o,o+t),l.usedBytes=t,t;if(a+t<=l.usedBytes)return l.contents.set(e.subarray(o,o+t),a),t}if(G.expandFileStorage(l,a+t),l.contents.subarray&&e.subarray)l.contents.set(e.subarray(o,o+t),a);else for(var h=0;h<t;h++)l.contents[a+h]=e[o+h];return l.usedBytes=Math.max(l.usedBytes,a+t),t},llseek:function(r,e,o){var t=e;if(o===1?t+=r.position:o===2&&i.isFile(r.node.mode)&&(t+=r.node.usedBytes),t<0)throw new i.ErrnoError(28);return t},allocate:function(r,e,o){G.expandFileStorage(r.node,e+o),r.node.usedBytes=Math.max(r.node.usedBytes,e+o)},mmap:function(r,e,o,t,a){if(!i.isFile(r.node.mode))throw new i.ErrnoError(43);var s,l,h=r.node.contents;if(!(a&2)&&h.buffer===Rr)l=!1,s=h.byteOffset;else{if((o>0||o+e<h.length)&&(h.subarray?h=h.subarray(o,o+e):h=Array.prototype.slice.call(h,o,o+e)),l=!0,s=Ir(e),!s)throw new i.ErrnoError(48);ee.set(h,s)}return{ptr:s,allocated:l}},msync:function(r,e,o,t,a){return G.stream_ops.write(r,e,0,t,o,!1),0}}};function Ct(r,e,o,t){var a=t?"":"al "+r;ar(r,s=>{Le(s,'Loading data file "'+r+'" failed (no arrayBuffer).'),e(new Uint8Array(s)),a&&Je(a)},s=>{if(o)o();else throw'Loading data file "'+r+'" failed.'}),a&&dr(a)}var re={},V={isWindows:!1,staticInit:()=>{V.isWindows=!!process.platform.match(/^win/);var r=process.binding("constants");r.fs&&(r=r.fs),V.flagsForNodeMap={1024:r.O_APPEND,64:r.O_CREAT,128:r.O_EXCL,256:r.O_NOCTTY,0:r.O_RDONLY,2:r.O_RDWR,4096:r.O_SYNC,512:r.O_TRUNC,1:r.O_WRONLY,131072:r.O_NOFOLLOW}},convertNodeCode:r=>{var e=r.code;return re[e]},mount:r=>V.createNode(null,"/",V.getMode(r.opts.root),0),createNode:(r,e,o,t)=>{if(!i.isDir(o)&&!i.isFile(o)&&!i.isLink(o))throw new i.ErrnoError(28);var a=i.createNode(r,e,o);return a.node_ops=V.node_ops,a.stream_ops=V.stream_ops,a},getMode:r=>{var e;try{e=J.lstatSync(r),V.isWindows&&(e.mode=e.mode|(e.mode&292)>>2)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}return e.mode},realPath:r=>{for(var e=[];r.parent!==r;)e.push(r.name),r=r.parent;return e.push(r.mount.opts.root),e.reverse(),Y.join.apply(null,e)},flagsForNode:r=>{r&=-2097153,r&=-2049,r&=-32769,r&=-524289,r&=-65537;var e=0;for(var o in V.flagsForNodeMap)r&o&&(e|=V.flagsForNodeMap[o],r^=o);if(r)throw new i.ErrnoError(28);return e},node_ops:{getattr:r=>{var e=V.realPath(r),o;try{o=J.lstatSync(e)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}return V.isWindows&&!o.blksize&&(o.blksize=4096),V.isWindows&&!o.blocks&&(o.blocks=(o.size+o.blksize-1)/o.blksize|0),{dev:o.dev,ino:o.ino,mode:o.mode,nlink:o.nlink,uid:o.uid,gid:o.gid,rdev:o.rdev,size:o.size,atime:o.atime,mtime:o.mtime,ctime:o.ctime,blksize:o.blksize,blocks:o.blocks}},setattr:(r,e)=>{var o=V.realPath(r);try{if(e.mode!==void 0&&(J.chmodSync(o,e.mode),r.mode=e.mode),e.timestamp!==void 0){var t=new Date(e.timestamp);J.utimesSync(o,t,t)}e.size!==void 0&&J.truncateSync(o,e.size)}catch(a){throw a.code?new i.ErrnoError(V.convertNodeCode(a)):a}},lookup:(r,e)=>{var o=Y.join2(V.realPath(r),e),t=V.getMode(o);return V.createNode(r,e,t)},mknod:(r,e,o,t)=>{var a=V.createNode(r,e,o,t),s=V.realPath(a);try{i.isDir(a.mode)?J.mkdirSync(s,a.mode):J.writeFileSync(s,"",{mode:a.mode})}catch(l){throw l.code?new i.ErrnoError(V.convertNodeCode(l)):l}return a},rename:(r,e,o)=>{var t=V.realPath(r),a=Y.join2(V.realPath(e),o);try{J.renameSync(t,a)}catch(s){throw s.code?new i.ErrnoError(V.convertNodeCode(s)):s}r.name=o},unlink:(r,e)=>{var o=Y.join2(V.realPath(r),e);try{J.unlinkSync(o)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}},rmdir:(r,e)=>{var o=Y.join2(V.realPath(r),e);try{J.rmdirSync(o)}catch(t){throw t.code?new i.ErrnoError(V.convertNodeCode(t)):t}},readdir:r=>{var e=V.realPath(r);try{return J.readdirSync(e)}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}},symlink:(r,e,o)=>{var t=Y.join2(V.realPath(r),e);try{J.symlinkSync(o,t)}catch(a){throw a.code?new i.ErrnoError(V.convertNodeCode(a)):a}},readlink:r=>{var e=V.realPath(r);try{return e=J.readlinkSync(e),e=Me.relative(Me.resolve(r.mount.opts.root),e),e}catch(o){throw o.code?o.code==="UNKNOWN"?new i.ErrnoError(28):new i.ErrnoError(V.convertNodeCode(o)):o}}},stream_ops:{open:r=>{var e=V.realPath(r.node);try{i.isFile(r.node.mode)&&(r.nfd=J.openSync(e,V.flagsForNode(r.flags)))}catch(o){throw o.code?new i.ErrnoError(V.convertNodeCode(o)):o}},close:r=>{try{i.isFile(r.node.mode)&&r.nfd&&J.closeSync(r.nfd)}catch(e){throw e.code?new i.ErrnoError(V.convertNodeCode(e)):e}},read:(r,e,o,t,a)=>{if(t===0)return 0;try{return J.readSync(r.nfd,Buffer.from(e.buffer),o,t,a)}catch(s){throw new i.ErrnoError(V.convertNodeCode(s))}},write:(r,e,o,t,a)=>{try{return J.writeSync(r.nfd,Buffer.from(e.buffer),o,t,a)}catch(s){throw new i.ErrnoError(V.convertNodeCode(s))}},llseek:(r,e,o)=>{var t=e;if(o===1)t+=r.position;else if(o===2&&i.isFile(r.node.mode))try{var a=J.fstatSync(r.nfd);t+=a.size}catch(s){throw new i.ErrnoError(V.convertNodeCode(s))}if(t<0)throw new i.ErrnoError(28);return t},mmap:(r,e,o,t,a)=>{if(!i.isFile(r.node.mode))throw new i.ErrnoError(43);var s=Ir(e);return V.stream_ops.read(r,ee,s,e,o),{ptr:s,allocated:!0}},msync:(r,e,o,t,a)=>(V.stream_ops.write(r,e,0,t,o,!1),0)}},i={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,e={})=>{if(r=Q.resolve(i.cwd(),r),!r)return{path:"",node:null};var o={follow_mount:!0,recurse_count:0};if(e=Object.assign(o,e),e.recurse_count>8)throw new i.ErrnoError(32);for(var t=Y.normalizeArray(r.split("/").filter(N=>!!N),!1),a=i.root,s="/",l=0;l<t.length;l++){var h=l===t.length-1;if(h&&e.parent)break;if(a=i.lookupNode(a,t[l]),s=Y.join2(s,t[l]),i.isMountpoint(a)&&(!h||h&&e.follow_mount)&&(a=a.mounted.root),!h||e.follow)for(var w=0;i.isLink(a.mode);){var S=i.readlink(s);s=Q.resolve(Y.dirname(s),S);var O=i.lookupPath(s,{recurse_count:e.recurse_count+1});if(a=O.node,w++>40)throw new i.ErrnoError(32)}}return{path:s,node:a}},getPath:r=>{for(var e;;){if(i.isRoot(r)){var o=r.mount.mountpoint;return e?o[o.length-1]!=="/"?o+"/"+e:o+e:o}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var o=0,t=0;t<e.length;t++)o=(o<<5)-o+e.charCodeAt(t)|0;return(r+o>>>0)%i.nameTable.length},hashAddNode:r=>{var e=i.hashName(r.parent.id,r.name);r.name_next=i.nameTable[e],i.nameTable[e]=r},hashRemoveNode:r=>{var e=i.hashName(r.parent.id,r.name);if(i.nameTable[e]===r)i.nameTable[e]=r.name_next;else for(var o=i.nameTable[e];o;){if(o.name_next===r){o.name_next=r.name_next;break}o=o.name_next}},lookupNode:(r,e)=>{var o=i.mayLookup(r);if(o)throw new i.ErrnoError(o,r);for(var t=i.hashName(r.id,e),a=i.nameTable[t];a;a=a.name_next){var s=a.name;if(a.parent.id===r.id&&s===e)return a}return i.lookup(r,e)},createNode:(r,e,o,t)=>{var a=new i.FSNode(r,e,o,t);return i.hashAddNode(a),a},destroyNode:r=>{i.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>(r&61440)===32768,isDir:r=>(r&61440)===16384,isLink:r=>(r&61440)===40960,isChrdev:r=>(r&61440)===8192,isBlkdev:r=>(r&61440)===24576,isFIFO:r=>(r&61440)===4096,isSocket:r=>(r&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var e=i.flagModes[r];if(typeof e>"u")throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:r=>{var e=["r","w","rw"][r&3];return r&512&&(e+="w"),e},nodePermissions:(r,e)=>i.ignorePermissions?0:e.includes("r")&&!(r.mode&292)||e.includes("w")&&!(r.mode&146)||e.includes("x")&&!(r.mode&73)?2:0,mayLookup:r=>{var e=i.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{var o=i.lookupNode(r,e);return 20}catch{}return i.nodePermissions(r,"wx")},mayDelete:(r,e,o)=>{var t;try{t=i.lookupNode(r,e)}catch(s){return s.errno}var a=i.nodePermissions(r,"wx");if(a)return a;if(o){if(!i.isDir(t.mode))return 54;if(i.isRoot(t)||i.getPath(t)===i.cwd())return 10}else if(i.isDir(t.mode))return 31;return 0},mayOpen:(r,e)=>r?i.isLink(r.mode)?32:i.isDir(r.mode)&&(i.flagsToPermissionString(e)!=="r"||e&512)?31:i.nodePermissions(r,i.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=i.MAX_OPEN_FDS)=>{for(var o=r;o<=e;o++)if(!i.streams[o])return o;throw new i.ErrnoError(33)},getStream:r=>i.streams[r],createStream:(r,e,o)=>{i.FSStream||(i.FSStream=function(){this.shared={}},i.FSStream.prototype={},Object.defineProperties(i.FSStream.prototype,{object:{get:function(){return this.node},set:function(a){this.node=a}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(a){this.shared.flags=a}},position:{get:function(){return this.shared.position},set:function(a){this.shared.position=a}}})),r=Object.assign(new i.FSStream,r);var t=i.nextfd(e,o);return r.fd=t,i.streams[t]=r,r},closeStream:r=>{i.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=i.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new i.ErrnoError(70)}},major:r=>r>>8,minor:r=>r&255,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{i.devices[r]={stream_ops:e}},getDevice:r=>i.devices[r],getMounts:r=>{for(var e=[],o=[r];o.length;){var t=o.pop();e.push(t),o.push.apply(o,t.mounts)}return e},syncfs:(r,e)=>{typeof r=="function"&&(e=r,r=!1),i.syncFSRequests++,i.syncFSRequests>1&&fe("warning: "+i.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var o=i.getMounts(i.root.mount),t=0;function a(l){return i.syncFSRequests--,e(l)}function s(l){if(l)return s.errored?void 0:(s.errored=!0,a(l));++t>=o.length&&a(null)}o.forEach(l=>{if(!l.type.syncfs)return s(null);l.type.syncfs(l,r,s)})},mount:(r,e,o)=>{var t=o==="/",a=!o,s;if(t&&i.root)throw new i.ErrnoError(10);if(!t&&!a){var l=i.lookupPath(o,{follow_mount:!1});if(o=l.path,s=l.node,i.isMountpoint(s))throw new i.ErrnoError(10);if(!i.isDir(s.mode))throw new i.ErrnoError(54)}var h={type:r,opts:e,mountpoint:o,mounts:[]},w=r.mount(h);return w.mount=h,h.root=w,t?i.root=w:s&&(s.mounted=h,s.mount&&s.mount.mounts.push(h)),w},unmount:r=>{var e=i.lookupPath(r,{follow_mount:!1});if(!i.isMountpoint(e.node))throw new i.ErrnoError(28);var o=e.node,t=o.mounted,a=i.getMounts(t);Object.keys(i.nameTable).forEach(l=>{for(var h=i.nameTable[l];h;){var w=h.name_next;a.includes(h.mount)&&i.destroyNode(h),h=w}}),o.mounted=null;var s=o.mount.mounts.indexOf(t);o.mount.mounts.splice(s,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,o)=>{var t=i.lookupPath(r,{parent:!0}),a=t.node,s=Y.basename(r);if(!s||s==="."||s==="..")throw new i.ErrnoError(28);var l=i.mayCreate(a,s);if(l)throw new i.ErrnoError(l);if(!a.node_ops.mknod)throw new i.ErrnoError(63);return a.node_ops.mknod(a,s,e,o)},create:(r,e)=>(e=e!==void 0?e:438,e&=4095,e|=32768,i.mknod(r,e,0)),mkdir:(r,e)=>(e=e!==void 0?e:511,e&=1023,e|=16384,i.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var o=r.split("/"),t="",a=0;a<o.length;++a)if(o[a]){t+="/"+o[a];try{i.mkdir(t,e)}catch(s){if(s.errno!=20)throw s}}},mkdev:(r,e,o)=>(typeof o>"u"&&(o=e,e=438),e|=8192,i.mknod(r,e,o)),symlink:(r,e)=>{if(!Q.resolve(r))throw new i.ErrnoError(44);var o=i.lookupPath(e,{parent:!0}),t=o.node;if(!t)throw new i.ErrnoError(44);var a=Y.basename(e),s=i.mayCreate(t,a);if(s)throw new i.ErrnoError(s);if(!t.node_ops.symlink)throw new i.ErrnoError(63);return t.node_ops.symlink(t,a,r)},rename:(r,e)=>{var o=Y.dirname(r),t=Y.dirname(e),a=Y.basename(r),s=Y.basename(e),l,h,w;if(l=i.lookupPath(r,{parent:!0}),h=l.node,l=i.lookupPath(e,{parent:!0}),w=l.node,!h||!w)throw new i.ErrnoError(44);if(h.mount!==w.mount)throw new i.ErrnoError(75);var S=i.lookupNode(h,a),O=Q.relative(r,t);if(O.charAt(0)!==".")throw new i.ErrnoError(28);if(O=Q.relative(e,o),O.charAt(0)!==".")throw new i.ErrnoError(55);var N;try{N=i.lookupNode(w,s)}catch{}if(S!==N){var T=i.isDir(S.mode),F=i.mayDelete(h,a,T);if(F)throw new i.ErrnoError(F);if(F=N?i.mayDelete(w,s,T):i.mayCreate(w,s),F)throw new i.ErrnoError(F);if(!h.node_ops.rename)throw new i.ErrnoError(63);if(i.isMountpoint(S)||N&&i.isMountpoint(N))throw new i.ErrnoError(10);if(w!==h&&(F=i.nodePermissions(h,"w"),F))throw new i.ErrnoError(F);i.hashRemoveNode(S);try{h.node_ops.rename(S,w,s)}catch(L){throw L}finally{i.hashAddNode(S)}}},rmdir:r=>{var e=i.lookupPath(r,{parent:!0}),o=e.node,t=Y.basename(r),a=i.lookupNode(o,t),s=i.mayDelete(o,t,!0);if(s)throw new i.ErrnoError(s);if(!o.node_ops.rmdir)throw new i.ErrnoError(63);if(i.isMountpoint(a))throw new i.ErrnoError(10);o.node_ops.rmdir(o,t),i.destroyNode(a)},readdir:r=>{var e=i.lookupPath(r,{follow:!0}),o=e.node;if(!o.node_ops.readdir)throw new i.ErrnoError(54);return o.node_ops.readdir(o)},unlink:r=>{var e=i.lookupPath(r,{parent:!0}),o=e.node;if(!o)throw new i.ErrnoError(44);var t=Y.basename(r),a=i.lookupNode(o,t),s=i.mayDelete(o,t,!1);if(s)throw new i.ErrnoError(s);if(!o.node_ops.unlink)throw new i.ErrnoError(63);if(i.isMountpoint(a))throw new i.ErrnoError(10);o.node_ops.unlink(o,t),i.destroyNode(a)},readlink:r=>{var e=i.lookupPath(r),o=e.node;if(!o)throw new i.ErrnoError(44);if(!o.node_ops.readlink)throw new i.ErrnoError(28);return Q.resolve(i.getPath(o.parent),o.node_ops.readlink(o))},stat:(r,e)=>{var o=i.lookupPath(r,{follow:!e}),t=o.node;if(!t)throw new i.ErrnoError(44);if(!t.node_ops.getattr)throw new i.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>i.stat(r,!0),chmod:(r,e,o)=>{var t;if(typeof r=="string"){var a=i.lookupPath(r,{follow:!o});t=a.node}else t=r;if(!t.node_ops.setattr)throw new i.ErrnoError(63);t.node_ops.setattr(t,{mode:e&4095|t.mode&-4096,timestamp:Date.now()})},lchmod:(r,e)=>{i.chmod(r,e,!0)},fchmod:(r,e)=>{var o=i.getStream(r);if(!o)throw new i.ErrnoError(8);i.chmod(o.node,e)},chown:(r,e,o,t)=>{var a;if(typeof r=="string"){var s=i.lookupPath(r,{follow:!t});a=s.node}else a=r;if(!a.node_ops.setattr)throw new i.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown:(r,e,o)=>{i.chown(r,e,o,!0)},fchown:(r,e,o)=>{var t=i.getStream(r);if(!t)throw new i.ErrnoError(8);i.chown(t.node,e,o)},truncate:(r,e)=>{if(e<0)throw new i.ErrnoError(28);var o;if(typeof r=="string"){var t=i.lookupPath(r,{follow:!0});o=t.node}else o=r;if(!o.node_ops.setattr)throw new i.ErrnoError(63);if(i.isDir(o.mode))throw new i.ErrnoError(31);if(!i.isFile(o.mode))throw new i.ErrnoError(28);var a=i.nodePermissions(o,"w");if(a)throw new i.ErrnoError(a);o.node_ops.setattr(o,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var o=i.getStream(r);if(!o)throw new i.ErrnoError(8);if(!(o.flags&2097155))throw new i.ErrnoError(28);i.truncate(o.node,e)},utime:(r,e,o)=>{var t=i.lookupPath(r,{follow:!0}),a=t.node;a.node_ops.setattr(a,{timestamp:Math.max(e,o)})},open:(r,e,o)=>{if(r==="")throw new i.ErrnoError(44);e=typeof e=="string"?i.modeStringToFlags(e):e,o=typeof o>"u"?438:o,e&64?o=o&4095|32768:o=0;var t;if(typeof r=="object")t=r;else{r=Y.normalize(r);try{var a=i.lookupPath(r,{follow:!(e&131072)});t=a.node}catch{}}var s=!1;if(e&64)if(t){if(e&128)throw new i.ErrnoError(20)}else t=i.mknod(r,o,0),s=!0;if(!t)throw new i.ErrnoError(44);if(i.isChrdev(t.mode)&&(e&=-513),e&65536&&!i.isDir(t.mode))throw new i.ErrnoError(54);if(!s){var l=i.mayOpen(t,e);if(l)throw new i.ErrnoError(l)}e&512&&!s&&i.truncate(t,0),e&=-131713;var h=i.createStream({node:t,path:i.getPath(t),flags:e,seekable:!0,position:0,stream_ops:t.stream_ops,ungotten:[],error:!1});return h.stream_ops.open&&h.stream_ops.open(h),f.logReadFiles&&!(e&1)&&(i.readFiles||(i.readFiles={}),r in i.readFiles||(i.readFiles[r]=1)),h},close:r=>{if(i.isClosed(r))throw new i.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{i.closeStream(r.fd)}r.fd=null},isClosed:r=>r.fd===null,llseek:(r,e,o)=>{if(i.isClosed(r))throw new i.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new i.ErrnoError(70);if(o!=0&&o!=1&&o!=2)throw new i.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,o),r.ungotten=[],r.position},read:(r,e,o,t,a)=>{if(t<0||a<0)throw new i.ErrnoError(28);if(i.isClosed(r))throw new i.ErrnoError(8);if((r.flags&2097155)===1)throw new i.ErrnoError(8);if(i.isDir(r.node.mode))throw new i.ErrnoError(31);if(!r.stream_ops.read)throw new i.ErrnoError(28);var s=typeof a<"u";if(!s)a=r.position;else if(!r.seekable)throw new i.ErrnoError(70);var l=r.stream_ops.read(r,e,o,t,a);return s||(r.position+=l),l},write:(r,e,o,t,a,s)=>{if(t<0||a<0)throw new i.ErrnoError(28);if(i.isClosed(r))throw new i.ErrnoError(8);if(!(r.flags&2097155))throw new i.ErrnoError(8);if(i.isDir(r.node.mode))throw new i.ErrnoError(31);if(!r.stream_ops.write)throw new i.ErrnoError(28);r.seekable&&r.flags&1024&&i.llseek(r,0,2);var l=typeof a<"u";if(!l)a=r.position;else if(!r.seekable)throw new i.ErrnoError(70);var h=r.stream_ops.write(r,e,o,t,a,s);return l||(r.position+=h),h},allocate:(r,e,o)=>{if(i.isClosed(r))throw new i.ErrnoError(8);if(e<0||o<=0)throw new i.ErrnoError(28);if(!(r.flags&2097155))throw new i.ErrnoError(8);if(!i.isFile(r.node.mode)&&!i.isDir(r.node.mode))throw new i.ErrnoError(43);if(!r.stream_ops.allocate)throw new i.ErrnoError(138);r.stream_ops.allocate(r,e,o)},mmap:(r,e,o,t,a)=>{if(t&2&&!(a&2)&&(r.flags&2097155)!==2)throw new i.ErrnoError(2);if((r.flags&2097155)===1)throw new i.ErrnoError(2);if(!r.stream_ops.mmap)throw new i.ErrnoError(43);return r.stream_ops.mmap(r,e,o,t,a)},msync:(r,e,o,t,a)=>r.stream_ops.msync?r.stream_ops.msync(r,e,o,t,a):0,munmap:r=>0,ioctl:(r,e,o)=>{if(!r.stream_ops.ioctl)throw new i.ErrnoError(59);return r.stream_ops.ioctl(r,e,o)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary",e.encoding!=="utf8"&&e.encoding!=="binary")throw new Error('Invalid encoding type "'+e.encoding+'"');var o,t=i.open(r,e.flags),a=i.stat(r),s=a.size,l=new Uint8Array(s);return i.read(t,l,0,s,0),e.encoding==="utf8"?o=ze(l,0):e.encoding==="binary"&&(o=l),i.close(t),o},writeFile:(r,e,o={})=>{o.flags=o.flags||577;var t=i.open(r,o.flags,o.mode);if(typeof e=="string"){var a=new Uint8Array(Ce(e)+1),s=Ze(e,a,0,a.length);i.write(t,a,0,s,void 0,o.canOwn)}else if(ArrayBuffer.isView(e))i.write(t,e,0,e.byteLength,void 0,o.canOwn);else throw new Error("Unsupported data type");i.close(t)},cwd:()=>i.currentPath,chdir:r=>{var e=i.lookupPath(r,{follow:!0});if(e.node===null)throw new i.ErrnoError(44);if(!i.isDir(e.node.mode))throw new i.ErrnoError(54);var o=i.nodePermissions(e.node,"x");if(o)throw new i.ErrnoError(o);i.currentPath=e.path},createDefaultDirectories:()=>{i.mkdir("/tmp"),i.mkdir("/home"),i.mkdir("/home/web_user")},createDefaultDevices:()=>{i.mkdir("/dev"),i.registerDevice(i.makedev(1,3),{read:()=>0,write:(e,o,t,a,s)=>a}),i.mkdev("/dev/null",i.makedev(1,3)),ge.register(i.makedev(5,0),ge.default_tty_ops),ge.register(i.makedev(6,0),ge.default_tty1_ops),i.mkdev("/dev/tty",i.makedev(5,0)),i.mkdev("/dev/tty1",i.makedev(6,0));var r=no();i.createDevice("/dev","random",r),i.createDevice("/dev","urandom",r),i.mkdir("/dev/shm"),i.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{i.mkdir("/proc");var r=i.mkdir("/proc/self");i.mkdir("/proc/self/fd"),i.mount({mount:()=>{var e=i.createNode(r,"fd",16895,73);return e.node_ops={lookup:(o,t)=>{var a=+t,s=i.getStream(a);if(!s)throw new i.ErrnoError(8);var l={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>s.path}};return l.parent=l,l}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{f.stdin?i.createDevice("/dev","stdin",f.stdin):i.symlink("/dev/tty","/dev/stdin"),f.stdout?i.createDevice("/dev","stdout",null,f.stdout):i.symlink("/dev/tty","/dev/stdout"),f.stderr?i.createDevice("/dev","stderr",null,f.stderr):i.symlink("/dev/tty1","/dev/stderr");var r=i.open("/dev/stdin",0),e=i.open("/dev/stdout",1),o=i.open("/dev/stderr",1)},ensureErrnoError:()=>{i.ErrnoError||(i.ErrnoError=function(e,o){this.node=o,this.setErrno=function(t){this.errno=t},this.setErrno(e),this.message="FS error"},i.ErrnoError.prototype=new Error,i.ErrnoError.prototype.constructor=i.ErrnoError,[44].forEach(r=>{i.genericErrors[r]=new i.ErrnoError(r),i.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:()=>{i.ensureErrnoError(),i.nameTable=new Array(4096),i.mount(G,{},"/"),i.createDefaultDirectories(),i.createDefaultDevices(),i.createSpecialDirectories(),i.filesystems={MEMFS:G,NODEFS:V}},init:(r,e,o)=>{i.init.initialized=!0,i.ensureErrnoError(),f.stdin=r||f.stdin,f.stdout=e||f.stdout,f.stderr=o||f.stderr,i.createStandardStreams()},quit:()=>{i.init.initialized=!1,zr(0);for(var r=0;r<i.streams.length;r++){var e=i.streams[r];e&&i.close(e)}},getMode:(r,e)=>{var o=0;return r&&(o|=365),e&&(o|=146),o},findObject:(r,e)=>{var o=i.analyzePath(r,e);return o.exists?o.object:null},analyzePath:(r,e)=>{try{var o=i.lookupPath(r,{follow:!e});r=o.path}catch{}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var o=i.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=o.path,t.parentObject=o.node,t.name=Y.basename(r),o=i.lookupPath(r,{follow:!e}),t.exists=!0,t.path=o.path,t.object=o.node,t.name=o.node.name,t.isRoot=o.path==="/"}catch(a){t.error=a.errno}return t},createPath:(r,e,o,t)=>{r=typeof r=="string"?r:i.getPath(r);for(var a=e.split("/").reverse();a.length;){var s=a.pop();if(s){var l=Y.join2(r,s);try{i.mkdir(l)}catch{}r=l}}return l},createFile:(r,e,o,t,a)=>{var s=Y.join2(typeof r=="string"?r:i.getPath(r),e),l=i.getMode(t,a);return i.create(s,l)},createDataFile:(r,e,o,t,a,s)=>{var l=e;r&&(r=typeof r=="string"?r:i.getPath(r),l=e?Y.join2(r,e):r);var h=i.getMode(t,a),w=i.create(l,h);if(o){if(typeof o=="string"){for(var S=new Array(o.length),O=0,N=o.length;O<N;++O)S[O]=o.charCodeAt(O);o=S}i.chmod(w,h|146);var T=i.open(w,577);i.write(T,o,0,o.length,0,s),i.close(T),i.chmod(w,h)}return w},createDevice:(r,e,o,t)=>{var a=Y.join2(typeof r=="string"?r:i.getPath(r),e),s=i.getMode(!!o,!!t);i.createDevice.major||(i.createDevice.major=64);var l=i.makedev(i.createDevice.major++,0);return i.registerDevice(l,{open:h=>{h.seekable=!1},close:h=>{t&&t.buffer&&t.buffer.length&&t(10)},read:(h,w,S,O,N)=>{for(var T=0,F=0;F<O;F++){var L;try{L=o()}catch{throw new i.ErrnoError(29)}if(L===void 0&&T===0)throw new i.ErrnoError(6);if(L==null)break;T++,w[S+F]=L}return T&&(h.node.timestamp=Date.now()),T},write:(h,w,S,O,N)=>{for(var T=0;T<O;T++)try{t(w[S+T])}catch{throw new i.ErrnoError(29)}return O&&(h.node.timestamp=Date.now()),T}}),i.mkdev(a,s,l)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(We)try{r.contents=Er(We(r.url),!0),r.usedBytes=r.contents.length}catch{throw new i.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(r,e,o,t,a)=>{function s(){this.lengthKnown=!1,this.chunks=[]}if(s.prototype.get=function(F){if(!(F>this.length-1||F<0)){var L=F%this.chunkSize,R=F/this.chunkSize|0;return this.getter(R)[L]}},s.prototype.setDataGetter=function(F){this.getter=F},s.prototype.cacheLength=function(){var F=new XMLHttpRequest;if(F.open("HEAD",o,!1),F.send(null),!(F.status>=200&&F.status<300||F.status===304))throw new Error("Couldn't load "+o+". Status: "+F.status);var L=Number(F.getResponseHeader("Content-length")),R,B=(R=F.getResponseHeader("Accept-Ranges"))&&R==="bytes",P=(R=F.getResponseHeader("Content-Encoding"))&&R==="gzip",M=1024*1024;B||(M=L);var z=(W,X)=>{if(W>X)throw new Error("invalid range ("+W+", "+X+") or no bytes requested!");if(X>L-1)throw new Error("only "+L+" bytes available! programmer error!");var oe=new XMLHttpRequest;if(oe.open("GET",o,!1),L!==M&&oe.setRequestHeader("Range","bytes="+W+"-"+X),oe.responseType="arraybuffer",oe.overrideMimeType&&oe.overrideMimeType("text/plain; charset=x-user-defined"),oe.send(null),!(oe.status>=200&&oe.status<300||oe.status===304))throw new Error("Couldn't load "+o+". Status: "+oe.status);return oe.response!==void 0?new Uint8Array(oe.response||[]):Er(oe.responseText||"",!0)},q=this;q.setDataGetter(W=>{var X=W*M,oe=(W+1)*M-1;if(oe=Math.min(oe,L-1),typeof q.chunks[W]>"u"&&(q.chunks[W]=z(X,oe)),typeof q.chunks[W]>"u")throw new Error("doXHR failed!");return q.chunks[W]}),(P||!L)&&(M=L=1,L=this.getter(0).length,M=L,er("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=L,this._chunkSize=M,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!pe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var l=new s;Object.defineProperties(l,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var h={isDevice:!1,contents:l}}else var h={isDevice:!1,url:o};var w=i.createFile(r,e,h,t,a);h.contents?w.contents=h.contents:h.url&&(w.contents=null,w.url=h.url),Object.defineProperties(w,{usedBytes:{get:function(){return this.contents.length}}});var S={},O=Object.keys(w.stream_ops);O.forEach(T=>{var F=w.stream_ops[T];S[T]=function(){return i.forceLoadFile(w),F.apply(null,arguments)}});function N(T,F,L,R,B){var P=T.node.contents;if(B>=P.length)return 0;var M=Math.min(P.length-B,R);if(P.slice)for(var z=0;z<M;z++)F[L+z]=P[B+z];else for(var z=0;z<M;z++)F[L+z]=P.get(B+z);return M}return S.read=(T,F,L,R,B)=>(i.forceLoadFile(w),N(T,F,L,R,B)),S.mmap=(T,F,L,R,B)=>{i.forceLoadFile(w);var P=Ir(F);if(!P)throw new i.ErrnoError(48);return N(T,ee,P,F,L),{ptr:P,allocated:!0}},w.stream_ops=S,w},createPreloadedFile:(r,e,o,t,a,s,l,h,w,S)=>{var O=e?Q.resolve(Y.join2(r,e)):r,N="cp "+O;function T(F){function L(R){S&&S(),h||i.createDataFile(r,e,R,t,a,w),s&&s(),Je(N)}Browser.handledByPreloadPlugin(F,O,L,()=>{l&&l(),Je(N)})||L(F)}dr(N),typeof o=="string"?Ct(o,F=>T(F),l):T(o)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,e,o)=>{e=e||(()=>{}),o=o||(()=>{});var t=i.indexedDB();try{var a=t.open(i.DB_NAME(),i.DB_VERSION)}catch(s){return o(s)}a.onupgradeneeded=()=>{er("creating db");var s=a.result;s.createObjectStore(i.DB_STORE_NAME)},a.onsuccess=()=>{var s=a.result,l=s.transaction([i.DB_STORE_NAME],"readwrite"),h=l.objectStore(i.DB_STORE_NAME),w=0,S=0,O=r.length;function N(){S==0?e():o()}r.forEach(T=>{var F=h.put(i.analyzePath(T).object.contents,T);F.onsuccess=()=>{w++,w+S==O&&N()},F.onerror=()=>{S++,w+S==O&&N()}}),l.onerror=o},a.onerror=o},loadFilesFromDB:(r,e,o)=>{e=e||(()=>{}),o=o||(()=>{});var t=i.indexedDB();try{var a=t.open(i.DB_NAME(),i.DB_VERSION)}catch(s){return o(s)}a.onupgradeneeded=o,a.onsuccess=()=>{var s=a.result;try{var l=s.transaction([i.DB_STORE_NAME],"readonly")}catch(T){o(T);return}var h=l.objectStore(i.DB_STORE_NAME),w=0,S=0,O=r.length;function N(){S==0?e():o()}r.forEach(T=>{var F=h.get(T);F.onsuccess=()=>{i.analyzePath(T).exists&&i.unlink(T),i.createDataFile(Y.dirname(T),Y.basename(T),F.result,!0,!0,!0),w++,w+S==O&&N()},F.onerror=()=>{S++,w+S==O&&N()}}),l.onerror=o},a.onerror=o}},C={DEFAULT_POLLMASK:5,calculateAt:function(r,e,o){if(Y.isAbs(e))return e;var t;if(r===-100)t=i.cwd();else{var a=C.getStreamFromFD(r);t=a.path}if(e.length==0){if(!o)throw new i.ErrnoError(44);return t}return Y.join2(t,e)},doStat:function(r,e,o){try{var t=r(e)}catch(a){if(a&&a.node&&Y.normalize(e)!==Y.normalize(i.getPath(a.node)))return-54;throw a}return E[o>>2]=t.dev,E[o+8>>2]=t.ino,E[o+12>>2]=t.mode,j[o+16>>2]=t.nlink,E[o+20>>2]=t.uid,E[o+24>>2]=t.gid,E[o+28>>2]=t.rdev,Z=[t.size>>>0,(U=t.size,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[o+40>>2]=Z[0],E[o+44>>2]=Z[1],E[o+48>>2]=4096,E[o+52>>2]=t.blocks,Z=[Math.floor(t.atime.getTime()/1e3)>>>0,(U=Math.floor(t.atime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[o+56>>2]=Z[0],E[o+60>>2]=Z[1],j[o+64>>2]=0,Z=[Math.floor(t.mtime.getTime()/1e3)>>>0,(U=Math.floor(t.mtime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[o+72>>2]=Z[0],E[o+76>>2]=Z[1],j[o+80>>2]=0,Z=[Math.floor(t.ctime.getTime()/1e3)>>>0,(U=Math.floor(t.ctime.getTime()/1e3),+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[o+88>>2]=Z[0],E[o+92>>2]=Z[1],j[o+96>>2]=0,Z=[t.ino>>>0,(U=t.ino,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[o+104>>2]=Z[0],E[o+108>>2]=Z[1],0},doMsync:function(r,e,o,t,a){if(!i.isFile(e.node.mode))throw new i.ErrnoError(43);if(t&2)return 0;var s=le.slice(r,r+o);i.msync(e,s,a,o,t)},varargs:void 0,get:function(){C.varargs+=4;var r=E[C.varargs-4>>2];return r},getStr:function(r){var e=ne(r);return e},getStreamFromFD:function(r){var e=i.getStream(r);if(!e)throw new i.ErrnoError(8);return e}};function v(r,e,o,t,a){try{for(var s=0,l=e?E[e>>2]:0,h=e?E[e+4>>2]:0,w=o?E[o>>2]:0,S=o?E[o+4>>2]:0,O=t?E[t>>2]:0,N=t?E[t+4>>2]:0,T=0,F=0,L=0,R=0,B=0,P=0,M=(e?E[e>>2]:0)|(o?E[o>>2]:0)|(t?E[t>>2]:0),z=(e?E[e+4>>2]:0)|(o?E[o+4>>2]:0)|(t?E[t+4>>2]:0),q=function(Oe,Ae,Qe,Ke){return Oe<32?Ae&Ke:Qe&Ke},W=0;W<r;W++){var X=1<<W%32;if(q(W,M,z,X)){var oe=C.getStreamFromFD(W),se=C.DEFAULT_POLLMASK;oe.stream_ops?.poll&&(se=oe.stream_ops.poll(oe)),se&1&&q(W,l,h,X)&&(W<32?T=T|X:F=F|X,s++),se&4&&q(W,w,S,X)&&(W<32?L=L|X:R=R|X,s++),se&2&&q(W,O,N,X)&&(W<32?B=B|X:P=P|X,s++)}}return e&&(E[e>>2]=T,E[e+4>>2]=F),o&&(E[o>>2]=L,E[o+4>>2]=R),t&&(E[t>>2]=B,E[t+4>>2]=P),s}catch(Oe){if(typeof i>"u"||!(Oe instanceof i.ErrnoError))throw Oe;return-Oe.errno}}var H={mount:function(r){return f.websocket=f.websocket&&typeof f.websocket=="object"?f.websocket:{},f.websocket._callbacks={},f.websocket.on=function(e,o){return typeof o=="function"&&(this._callbacks[e]=o),this},f.websocket.emit=function(e,o){typeof this._callbacks[e]=="function"&&this._callbacks[e].call(this,o)},i.createNode(null,"/",16895,0)},createSocket:function(r,e,o){e&=-526337;var t=e==1;if(t&&o&&o!=6)throw new i.ErrnoError(66);var a={family:r,type:e,protocol:o,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:H.websocket_sock_ops},s=H.nextname(),l=i.createNode(H.root,s,49152,0);l.sock=a;var h=i.createStream({path:s,node:l,flags:2,seekable:!1,stream_ops:H.stream_ops});return a.stream=h,a},getSocket:function(r){var e=i.getStream(r);return!e||!i.isSocket(e.node.mode)?null:e.node.sock},stream_ops:{poll:function(r){var e=r.node.sock;return e.sock_ops.poll(e)},ioctl:function(r,e,o){var t=r.node.sock;return t.sock_ops.ioctl(t,e,o)},read:function(r,e,o,t,a){var s=r.node.sock,l=s.sock_ops.recvmsg(s,t);return l?(e.set(l.buffer,o),l.buffer.length):0},write:function(r,e,o,t,a){var s=r.node.sock;return s.sock_ops.sendmsg(s,e,o,t)},close:function(r){var e=r.node.sock;e.sock_ops.close(e)}},nextname:function(){return H.nextname.current||(H.nextname.current=0),"socket["+H.nextname.current+++"]"},websocket_sock_ops:{createPeer:function(r,e,o){var t;if(typeof e=="object"&&(t=e,e=null,o=null),t)if(t._socket)e=t._socket.remoteAddress,o=t._socket.remotePort;else{var a=/ws[s]?:\/\/([^:]+):(\d+)/.exec(t.url);if(!a)throw new Error("WebSocket URL must be in the format ws(s)://address:port");e=a[1],o=parseInt(a[2],10)}else try{var s=f.websocket&&typeof f.websocket=="object",l="ws:#".replace("#","//");if(s&&(typeof f.websocket.url=="function"?l=f.websocket.url(...arguments):typeof f.websocket.url=="string"&&(l=f.websocket.url)),l==="ws://"||l==="wss://"){var h=e.split("/");l=l+h[0]+":"+o+"/"+h.slice(1).join("/")}var w="binary";s&&typeof f.websocket.subprotocol=="string"&&(w=f.websocket.subprotocol);var S=void 0;w!=="null"&&(w=w.replace(/^ +| +$/g,"").split(/ *, */),S=w),s&&f.websocket.subprotocol===null&&(w="null",S=void 0);var O;te?O=An():O=WebSocket,f.websocket.decorator&&(O=f.websocket.decorator(O)),t=new O(l,S),t.binaryType="arraybuffer"}catch{throw new i.ErrnoError(23)}var N={addr:e,port:o,socket:t,dgram_send_queue:[]};return H.websocket_sock_ops.addPeer(r,N),H.websocket_sock_ops.handlePeerEvents(r,N),r.type===2&&typeof r.sport<"u"&&N.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(r.sport&65280)>>8,r.sport&255])),N},getPeer:function(r,e,o){return r.peers[e+":"+o]},addPeer:function(r,e){r.peers[e.addr+":"+e.port]=e},removePeer:function(r,e){delete r.peers[e.addr+":"+e.port]},handlePeerEvents:function(r,e){var o=!0,t=function(){f.websocket.emit("open",r.stream.fd);try{for(var s=e.dgram_send_queue.shift();s;)e.socket.send(s),s=e.dgram_send_queue.shift()}catch{e.socket.close()}};function a(s){if(typeof s=="string"){var l=new TextEncoder;s=l.encode(s)}else{if(Le(s.byteLength!==void 0),s.byteLength==0)return;s=new Uint8Array(s)}var h=o;if(o=!1,h&&s.length===10&&s[0]===255&&s[1]===255&&s[2]===255&&s[3]===255&&s[4]==="p".charCodeAt(0)&&s[5]==="o".charCodeAt(0)&&s[6]==="r".charCodeAt(0)&&s[7]==="t".charCodeAt(0)){var w=s[8]<<8|s[9];H.websocket_sock_ops.removePeer(r,e),e.port=w,H.websocket_sock_ops.addPeer(r,e);return}r.recv_queue.push({addr:e.addr,port:e.port,data:s}),f.websocket.emit("message",r.stream.fd)}te?(e.socket.on("open",t),e.socket.on("message",function(s,l){l&&a(new Uint8Array(s).buffer)}),e.socket.on("close",function(){f.websocket.emit("close",r.stream.fd)}),e.socket.on("error",function(s){r.error=14,f.websocket.emit("error",[r.stream.fd,r.error,"ECONNREFUSED: Connection refused"])})):(e.socket.onopen=t,e.socket.onclose=function(){f.websocket.emit("close",r.stream.fd)},e.socket.onmessage=function(l){a(l.data)},e.socket.onerror=function(s){r.error=14,f.websocket.emit("error",[r.stream.fd,r.error,"ECONNREFUSED: Connection refused"])})},poll:function(r){if(r.type===1&&r.server)return r.pending.length?65:0;var e=0,o=r.type===1?H.websocket_sock_ops.getPeer(r,r.daddr,r.dport):null;return(r.recv_queue.length||!o||o&&o.socket.readyState===o.socket.CLOSING||o&&o.socket.readyState===o.socket.CLOSED)&&(e|=65),(!o||o&&o.socket.readyState===o.socket.OPEN)&&(e|=4),(o&&o.socket.readyState===o.socket.CLOSING||o&&o.socket.readyState===o.socket.CLOSED)&&(e|=16),e},ioctl:function(r,e,o){switch(e){case 21531:var t=0;return r.recv_queue.length&&(t=r.recv_queue[0].data.length),E[o>>2]=t,0;default:return 28}},close:function(r){if(r.server){try{r.server.close()}catch{}r.server=null}for(var e=Object.keys(r.peers),o=0;o<e.length;o++){var t=r.peers[e[o]];try{t.socket.close()}catch{}H.websocket_sock_ops.removePeer(r,t)}return 0},bind:function(r,e,o){if(typeof r.saddr<"u"||typeof r.sport<"u")throw new i.ErrnoError(28);if(r.saddr=e,r.sport=o,r.type===2){r.server&&(r.server.close(),r.server=null);try{r.sock_ops.listen(r,0)}catch(t){if(!(t instanceof i.ErrnoError)||t.errno!==138)throw t}}},connect:function(r,e,o){if(r.server)throw new i.ErrnoError(138);if(typeof r.daddr<"u"&&typeof r.dport<"u"){var t=H.websocket_sock_ops.getPeer(r,r.daddr,r.dport);if(t)throw t.socket.readyState===t.socket.CONNECTING?new i.ErrnoError(7):new i.ErrnoError(30)}var a=H.websocket_sock_ops.createPeer(r,e,o);throw r.daddr=a.addr,r.dport=a.port,new i.ErrnoError(26)},listen:function(r,e){if(!te)throw new i.ErrnoError(138);if(r.server)throw new i.ErrnoError(28);var o=An().Server,t=r.saddr;r.server=new o({host:t,port:r.sport}),f.websocket.emit("listen",r.stream.fd),r.server.on("connection",function(a){if(r.type===1){var s=H.createSocket(r.family,r.type,r.protocol),l=H.websocket_sock_ops.createPeer(s,a);s.daddr=l.addr,s.dport=l.port,r.pending.push(s),f.websocket.emit("connection",s.stream.fd)}else H.websocket_sock_ops.createPeer(r,a),f.websocket.emit("connection",r.stream.fd)}),r.server.on("close",function(){f.websocket.emit("close",r.stream.fd),r.server=null}),r.server.on("error",function(a){r.error=23,f.websocket.emit("error",[r.stream.fd,r.error,"EHOSTUNREACH: Host is unreachable"])})},accept:function(r){if(!r.server||!r.pending.length)throw new i.ErrnoError(28);var e=r.pending.shift();return e.stream.flags=r.stream.flags,e},getname:function(r,e){var o,t;if(e){if(r.daddr===void 0||r.dport===void 0)throw new i.ErrnoError(53);o=r.daddr,t=r.dport}else o=r.saddr||0,t=r.sport||0;return{addr:o,port:t}},sendmsg:function(r,e,o,t,a,s){if(r.type===2){if((a===void 0||s===void 0)&&(a=r.daddr,s=r.dport),a===void 0||s===void 0)throw new i.ErrnoError(17)}else a=r.daddr,s=r.dport;var l=H.websocket_sock_ops.getPeer(r,a,s);if(r.type===1){if(!l||l.socket.readyState===l.socket.CLOSING||l.socket.readyState===l.socket.CLOSED)throw new i.ErrnoError(53);if(l.socket.readyState===l.socket.CONNECTING)throw new i.ErrnoError(6)}ArrayBuffer.isView(e)&&(o+=e.byteOffset,e=e.buffer);var h;if(h=e.slice(o,o+t),r.type===2&&(!l||l.socket.readyState!==l.socket.OPEN))return(!l||l.socket.readyState===l.socket.CLOSING||l.socket.readyState===l.socket.CLOSED)&&(l=H.websocket_sock_ops.createPeer(r,a,s)),l.dgram_send_queue.push(h),t;try{return l.socket.send(h),t}catch{throw new i.ErrnoError(28)}},recvmsg:function(r,e){if(r.type===1&&r.server)throw new i.ErrnoError(53);var o=r.recv_queue.shift();if(!o){if(r.type===1){var t=H.websocket_sock_ops.getPeer(r,r.daddr,r.dport);if(!t)throw new i.ErrnoError(53);if(t.socket.readyState===t.socket.CLOSING||t.socket.readyState===t.socket.CLOSED)return null;throw new i.ErrnoError(6)}throw new i.ErrnoError(6)}var a=o.data.byteLength||o.data.length,s=o.data.byteOffset||0,l=o.data.buffer||o.data,h=Math.min(e,a),w={buffer:new Uint8Array(l,s,h),addr:o.addr,port:o.port};if(r.type===1&&h<a){var S=a-h;o.data=new Uint8Array(l,s+h,S),r.recv_queue.unshift(o)}return w}}};function ke(r){var e=H.getSocket(r);if(!e)throw new i.ErrnoError(8);return e}function he(r){return E[on()>>2]=r,r}function Ie(r){for(var e=r.split("."),o=0;o<4;o++){var t=Number(e[o]);if(isNaN(t))return null;e[o]=t}return(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0}function ce(r){return parseInt(r)}function Ar(r){var e,o,t,a,s=/^((?=.*::)(?!.*::.+::)(::)?([\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,l=[];if(!s.test(r))return null;if(r==="::")return[0,0,0,0,0,0,0,0];for(r.startsWith("::")?r=r.replace("::","Z:"):r=r.replace("::",":Z:"),r.indexOf(".")>0?(r=r.replace(new RegExp("[.]","g"),":"),e=r.split(":"),e[e.length-4]=ce(e[e.length-4])+ce(e[e.length-3])*256,e[e.length-3]=ce(e[e.length-2])+ce(e[e.length-1])*256,e=e.slice(0,e.length-2)):e=r.split(":"),t=0,a=0,o=0;o<e.length;o++)if(typeof e[o]=="string")if(e[o]==="Z"){for(a=0;a<8-e.length+1;a++)l[o+a]=0;t=a-1}else l[o+t]=It(parseInt(e[o],16));else l[o+t]=e[o];return[l[1]<<16|l[0],l[3]<<16|l[2],l[5]<<16|l[4],l[7]<<16|l[6]]}function be(r,e,o,t,a){switch(e){case 2:o=Ie(o),wr(r,16),a&&(E[a>>2]=16),we[r>>1]=e,E[r+4>>2]=o,we[r+2>>1]=It(t);break;case 10:o=Ar(o),wr(r,28),a&&(E[a>>2]=28),E[r>>2]=e,E[r+8>>2]=o[0],E[r+12>>2]=o[1],E[r+16>>2]=o[2],E[r+20>>2]=o[3],we[r+2>>1]=It(t);break;default:return 5}return 0}var ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(r){var e=Ie(r);if(e!==null||(e=Ar(r),e!==null))return r;var o;if(ue.address_map.addrs[r])o=ue.address_map.addrs[r];else{var t=ue.address_map.id++;Le(t<65535,"exceeded max address mappings of 65535"),o="172.29."+(t&255)+"."+(t&65280),ue.address_map.names[o]=r,ue.address_map.addrs[r]=o}return o},lookup_addr:function(r){return ue.address_map.names[r]?ue.address_map.names[r]:null}};function Zr(r,e,o,t){try{var a=ke(r),s=a.sock_ops.accept(a);if(e)var l=be(e,s.family,ue.lookup_name(s.daddr),s.dport,o);return s.stream.fd}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Ne(r){return(r&255)+"."+(r>>8&255)+"."+(r>>16&255)+"."+(r>>24&255)}function kn(r){var e="",o=0,t=0,a=0,s=0,l=0,h=0,w=[r[0]&65535,r[0]>>16,r[1]&65535,r[1]>>16,r[2]&65535,r[2]>>16,r[3]&65535,r[3]>>16],S=!0,O="";for(h=0;h<5;h++)if(w[h]!==0){S=!1;break}if(S){if(O=Ne(w[6]|w[7]<<16),w[5]===-1)return e="::ffff:",e+=O,e;if(w[5]===0)return e="::",O==="0.0.0.0"&&(O=""),O==="0.0.0.1"&&(O="1"),e+=O,e}for(o=0;o<8;o++)w[o]===0&&(o-a>1&&(l=0),a=o,l++),l>t&&(t=l,s=o-t+1);for(o=0;o<8;o++){if(t>1&&w[o]===0&&o>=s&&o<s+t){o===s&&(e+=":",s===0&&(e+=":"));continue}e+=Number(Qr(w[o]&65535)).toString(16),e+=o<7?":":""}return e}function Gr(r,e){var o=we[r>>1],t=Qr(lt[r+2>>1]),a;switch(o){case 2:if(e!==16)return{errno:28};a=E[r+4>>2],a=Ne(a);break;case 10:if(e!==28)return{errno:28};a=[E[r+8>>2],E[r+12>>2],E[r+16>>2],E[r+20>>2]],a=kn(a);break;default:return{errno:5}}return{family:o,addr:a,port:t}}function Yr(r,e,o){if(o&&r===0)return null;var t=Gr(r,e);if(t.errno)throw new i.ErrnoError(t.errno);return t.addr=ue.lookup_addr(t.addr)||t.addr,t}function dn(r,e,o){try{var t=ke(r),a=Yr(e,o);return t.sock_ops.bind(t,a.addr,a.port),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function Pt(r){try{return r=C.getStr(r),i.chdir(r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function oo(r,e){try{return r=C.getStr(r),i.chmod(r,e),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function io(r,e,o){try{var t=ke(r),a=Yr(e,o);return t.sock_ops.connect(t,a.addr,a.port),0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function ao(r){try{var e=C.getStreamFromFD(r);return i.createStream(e,0).fd}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function so(r,e,o){try{var t=C.getStreamFromFD(r);if(t.fd===e)return-28;var a=i.getStream(e);return a&&i.close(a),i.createStream(t,e,e+1).fd}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function uo(r,e,o,t){try{if(e=C.getStr(e),e=C.calculateAt(r,e),o&-8)return-28;var a=i.lookupPath(e,{follow:!0}),s=a.node;if(!s)return-44;var l="";return o&4&&(l+="r"),o&2&&(l+="w"),o&1&&(l+="x"),l&&i.nodePermissions(s,l)?-2:0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function _n(r,e){try{return i.fchmod(r,e),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function fo(r,e,o){try{return i.fchown(r,e,o),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function gt(r,e,o,t,a){try{e=C.getStr(e);var s=a&256;return a=a&-257,e=C.calculateAt(r,e),(s?i.lchown:i.chown)(e,o,t),0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function co(r,e,o){C.varargs=o;try{var t=C.getStreamFromFD(r);switch(e){case 0:{var a=C.get();if(a<0)return-28;var s;return s=i.createStream(t,a),s.fd}case 1:case 2:return 0;case 3:return t.flags;case 4:{var a=C.get();return t.flags|=a,0}case 5:{var a=C.get(),l=0;return we[a+l>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return he(28),-1;default:return-28}}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function lo(r,e){try{var o=C.getStreamFromFD(r);return C.doStat(i.stat,o.path,e)}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function qt(r,e){return e+2097152>>>0<4194305-!!r?(r>>>0)+e*4294967296:NaN}function _o(r,e,o){try{var t=qt(e,o);return isNaN(t)?-61:(i.ftruncate(r,t),0)}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function mo(r,e){try{if(e===0)return-28;var o=i.cwd(),t=Ce(o)+1;return e<t?-68:(Fe(o,r,e),t)}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function vo(r,e,o){try{var t=C.getStreamFromFD(r);t.getdents||(t.getdents=i.readdir(t.path));for(var a=280,s=0,l=i.llseek(t,0,1),h=Math.floor(l/a);h<t.getdents.length&&s+a<=o;){var w,S,O=t.getdents[h];if(O===".")w=t.node.id,S=4;else if(O===".."){var N=i.lookupPath(t.path,{parent:!0});w=N.node.id,S=4}else{var T=i.lookupNode(t.node,O);w=T.id,S=i.isChrdev(T.mode)?2:i.isDir(T.mode)?4:i.isLink(T.mode)?10:8}Z=[w>>>0,(U=w,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+s>>2]=Z[0],E[e+s+4>>2]=Z[1],Z=[(h+1)*a>>>0,(U=(h+1)*a,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[e+s+8>>2]=Z[0],E[e+s+12>>2]=Z[1],we[e+s+16>>1]=280,ee[e+s+18>>0]=S,Fe(O,e+s+19,256),s+=a,h+=1}return i.llseek(t,h*a,0),s}catch(F){if(typeof i>"u"||!(F instanceof i.ErrnoError))throw F;return-F.errno}}function po(r,e,o){try{var t=ke(r);if(!t.daddr)return-53;var a=be(e,t.family,ue.lookup_name(t.daddr),t.dport,o);return 0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function ho(r,e,o){try{fe("__syscall_getsockname "+r);var t=ke(r),a=be(e,t.family,ue.lookup_name(t.saddr||"0.0.0.0"),t.sport,o);return 0}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function yo(r,e,o,t,a){try{var s=ke(r);return e===1&&o===4?(E[t>>2]=s.error,E[a>>2]=4,s.error=null,0):-50}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function Eo(r,e,o){C.varargs=o;try{var t=C.getStreamFromFD(r);switch(e){case 21509:case 21505:return t.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return t.tty?0:-59;case 21519:{if(!t.tty)return-59;var a=C.get();return E[a>>2]=0,0}case 21520:return t.tty?-28:-59;case 21531:{var a=C.get();return i.ioctl(t,e,a)}case 21523:return t.tty?0:-59;case 21524:return t.tty?0:-59;default:return-28}}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}function wo(r,e){try{var o=ke(r);return o.sock_ops.listen(o,e),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function go(r,e){try{return r=C.getStr(r),C.doStat(i.lstat,r,e)}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function So(r,e,o){try{return e=C.getStr(e),e=C.calculateAt(r,e),e=Y.normalize(e),e[e.length-1]==="/"&&(e=e.substr(0,e.length-1)),i.mkdir(e,o,0),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function bo(r,e,o,t){try{e=C.getStr(e);var a=t&256,s=t&4096;return t=t&-4353,e=C.calculateAt(r,e,s),C.doStat(a?i.lstat:i.stat,e,o)}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return-l.errno}}function ko(r,e,o,t){C.varargs=t;try{e=C.getStr(e),e=C.calculateAt(r,e);var a=t?C.get():0;return i.open(e,o,a).fd}catch(s){if(typeof i>"u"||!(s instanceof i.ErrnoError))throw s;return-s.errno}}var ae={BUCKET_BUFFER_SIZE:8192,mount:function(r){return i.createNode(null,"/",16895,0)},createPipe:function(){var r={buckets:[],refcnt:2};r.buckets.push({buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var e=ae.nextname(),o=ae.nextname(),t=i.createNode(ae.root,e,4096,0),a=i.createNode(ae.root,o,4096,0);t.pipe=r,a.pipe=r;var s=i.createStream({path:e,node:t,flags:0,seekable:!1,stream_ops:ae.stream_ops});t.stream=s;var l=i.createStream({path:o,node:a,flags:1,seekable:!1,stream_ops:ae.stream_ops});return a.stream=l,{readable_fd:s.fd,writable_fd:l.fd}},stream_ops:{poll:function(r){var e=r.node.pipe;if((r.flags&2097155)===1)return 260;if(e.buckets.length>0)for(var o=0;o<e.buckets.length;o++){var t=e.buckets[o];if(t.offset-t.roffset>0)return 65}return 0},ioctl:function(r,e,o){return 28},fsync:function(r){return 28},read:function(r,e,o,t,a){for(var s=r.node.pipe,l=0,h=0;h<s.buckets.length;h++){var w=s.buckets[h];l+=w.offset-w.roffset}Le(e instanceof ArrayBuffer||ArrayBuffer.isView(e));var S=e.subarray(o,o+t);if(t<=0)return 0;if(l==0)throw new i.ErrnoError(6);for(var O=Math.min(l,t),N=O,T=0,h=0;h<s.buckets.length;h++){var F=s.buckets[h],L=F.offset-F.roffset;if(O<=L){var R=F.buffer.subarray(F.roffset,F.offset);O<L?(R=R.subarray(0,O),F.roffset+=O):T++,S.set(R);break}else{var R=F.buffer.subarray(F.roffset,F.offset);S.set(R),S=S.subarray(R.byteLength),O-=R.byteLength,T++}}return T&&T==s.buckets.length&&(T--,s.buckets[T].offset=0,s.buckets[T].roffset=0),s.buckets.splice(0,T),N},write:function(r,e,o,t,a){var s=r.node.pipe;Le(e instanceof ArrayBuffer||ArrayBuffer.isView(e));var l=e.subarray(o,o+t),h=l.byteLength;if(h<=0)return 0;var w=null;s.buckets.length==0?(w={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:0,roffset:0},s.buckets.push(w)):w=s.buckets[s.buckets.length-1],Le(w.offset<=ae.BUCKET_BUFFER_SIZE);var S=ae.BUCKET_BUFFER_SIZE-w.offset;if(S>=h)return w.buffer.set(l,w.offset),w.offset+=h,h;S>0&&(w.buffer.set(l.subarray(0,S),w.offset),w.offset+=S,l=l.subarray(S,l.byteLength));for(var O=l.byteLength/ae.BUCKET_BUFFER_SIZE|0,N=l.byteLength%ae.BUCKET_BUFFER_SIZE,T=0;T<O;T++){var F={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:ae.BUCKET_BUFFER_SIZE,roffset:0};s.buckets.push(F),F.buffer.set(l.subarray(0,ae.BUCKET_BUFFER_SIZE)),l=l.subarray(ae.BUCKET_BUFFER_SIZE,l.byteLength)}if(N>0){var F={buffer:new Uint8Array(ae.BUCKET_BUFFER_SIZE),offset:l.byteLength,roffset:0};s.buckets.push(F),F.buffer.set(l)}return h},close:function(r){var e=r.node.pipe;e.refcnt--,e.refcnt===0&&(e.buckets=null)}},nextname:function(){return ae.nextname.current||(ae.nextname.current=0),"pipe["+ae.nextname.current+++"]"}};function Oo(r){try{if(r==0)throw new i.ErrnoError(21);var e=ae.createPipe();return E[r>>2]=e.readable_fd,E[r+4>>2]=e.writable_fd,0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function kr(r,e,o){try{for(var t=0,a=0;a<e;a++){var s=r+8*a,l=E[s>>2],h=we[s+4>>1],w=32,S=i.getStream(l);S&&(w=C.DEFAULT_POLLMASK,S.stream_ops?.poll&&(w=S.stream_ops.poll(S))),w&=h|8|16,w&&t++,we[s+6>>1]=w}return t}catch(O){if(typeof i>"u"||!(O instanceof i.ErrnoError))throw O;return-O.errno}}function Do(r,e,o,t){try{if(e=C.getStr(e),e=C.calculateAt(r,e),t<=0)return-28;var a=i.readlink(e),s=Math.min(t,Ce(a)),l=ee[o+s];return Fe(a,o,t+1),ee[o+s]=l,s}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Se(r,e,o,t,a,s){try{var l=ke(r),h=l.sock_ops.recvmsg(l,o);if(!h)return 0;if(a)var w=be(a,l.family,ue.lookup_name(h.addr),h.port,s);return le.set(h.buffer,e),h.buffer.byteLength}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function No(r,e,o,t){try{return e=C.getStr(e),t=C.getStr(t),e=C.calculateAt(r,e),t=C.calculateAt(o,t),i.rename(e,t),0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function To(r){try{return r=C.getStr(r),i.rmdir(r),0}catch(e){if(typeof i>"u"||!(e instanceof i.ErrnoError))throw e;return-e.errno}}function Ao(r,e,o,t,a,s){try{var l=ke(r),h=Yr(a,s,!0);return h?l.sock_ops.sendmsg(l,ee,e,o,h.addr,h.port):i.write(l.stream,ee,e,o)}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function Fo(r,e,o){try{var t=H.createSocket(r,e,o);return t.stream.fd}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return-a.errno}}function Co(r,e){try{return r=C.getStr(r),C.doStat(i.stat,r,e)}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function Po(r,e,o){try{return r=C.getStr(r),E[o+4>>2]=4096,E[o+40>>2]=4096,E[o+8>>2]=1e6,E[o+12>>2]=5e5,E[o+16>>2]=5e5,E[o+20>>2]=i.nextInode,E[o+24>>2]=1e6,E[o+28>>2]=42,E[o+44>>2]=2,E[o+36>>2]=255,0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function Ro(r,e){try{return r=C.getStr(r),e=C.getStr(e),i.symlink(r,e),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return-o.errno}}function Mo(r,e,o){try{return e=C.getStr(e),e=C.calculateAt(r,e),o===0?i.unlink(e):o===512?i.rmdir(e):me("Invalid flags passed to unlinkat"),0}catch(t){if(typeof i>"u"||!(t instanceof i.ErrnoError))throw t;return-t.errno}}function jr(r){return j[r>>2]+E[r+4>>2]*4294967296}function Lo(r,e,o,t){try{if(e=C.getStr(e),e=C.calculateAt(r,e,!0),o){var l=jr(o),h=E[o+8>>2];a=l*1e3+h/(1e3*1e3),o+=16,l=jr(o),h=E[o+8>>2],s=l*1e3+h/(1e3*1e3)}else var a=Date.now(),s=a;return i.utime(e,a,s),0}catch(w){if(typeof i>"u"||!(w instanceof i.ErrnoError))throw w;return-w.errno}}function mn(r){}var Vt="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function St(r,e){me(Vt)}function Fn(r,e){me(Vt)}var Uo=!0;function vn(){return Uo}function Io(){throw 1/0}function Bo(r,e){var o=new Date(jr(r)*1e3);E[e>>2]=o.getUTCSeconds(),E[e+4>>2]=o.getUTCMinutes(),E[e+8>>2]=o.getUTCHours(),E[e+12>>2]=o.getUTCDate(),E[e+16>>2]=o.getUTCMonth(),E[e+20>>2]=o.getUTCFullYear()-1900,E[e+24>>2]=o.getUTCDay();var t=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),a=(o.getTime()-t)/(1e3*60*60*24)|0;E[e+28>>2]=a}function xo(r,e){var o=new Date(jr(r)*1e3);E[e>>2]=o.getSeconds(),E[e+4>>2]=o.getMinutes(),E[e+8>>2]=o.getHours(),E[e+12>>2]=o.getDate(),E[e+16>>2]=o.getMonth(),E[e+20>>2]=o.getFullYear()-1900,E[e+24>>2]=o.getDay();var t=new Date(o.getFullYear(),0,1),a=(o.getTime()-t.getTime())/(1e3*60*60*24)|0;E[e+28>>2]=a,E[e+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),l=t.getTimezoneOffset(),h=(s!=l&&o.getTimezoneOffset()==Math.min(l,s))|0;E[e+32>>2]=h}function zo(r){var e=new Date(E[r+20>>2]+1900,E[r+16>>2],E[r+12>>2],E[r+8>>2],E[r+4>>2],E[r>>2],0),o=E[r+32>>2],t=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),s=new Date(e.getFullYear(),6,1).getTimezoneOffset(),l=a.getTimezoneOffset(),h=Math.min(l,s);if(o<0)E[r+32>>2]=+(s!=l&&h==t);else if(o>0!=(h==t)){var w=Math.max(l,s),S=o>0?h:w;e.setTime(e.getTime()+(S-t)*6e4)}E[r+24>>2]=e.getDay();var O=(e.getTime()-a.getTime())/(1e3*60*60*24)|0;return E[r+28>>2]=O,E[r>>2]=e.getSeconds(),E[r+4>>2]=e.getMinutes(),E[r+8>>2]=e.getHours(),E[r+12>>2]=e.getDate(),E[r+16>>2]=e.getMonth(),E[r+20>>2]=e.getYear(),e.getTime()/1e3|0}function Ho(r,e,o,t,a,s){try{var l=C.getStreamFromFD(t),h=i.mmap(l,r,a,e,o),w=h.ptr;return E[s>>2]=h.allocated,w}catch(S){if(typeof i>"u"||!(S instanceof i.ErrnoError))throw S;return-S.errno}}function Wo(r,e,o,t,a,s){try{var l=C.getStreamFromFD(a);o&2&&C.doMsync(r,l,e,t,s),i.munmap(l)}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return-h.errno}}function Gt(r){var e=Ce(r)+1,o=Jr(e);return o&&Ze(r,ee,o,e),o}function Yo(r,e,o){var t=new Date().getFullYear(),a=new Date(t,0,1),s=new Date(t,6,1),l=a.getTimezoneOffset(),h=s.getTimezoneOffset(),w=Math.max(l,h);E[r>>2]=w*60,E[e>>2]=+(l!=h);function S(L){var R=L.toTimeString().match(/\(([A-Za-z ]+)\)$/);return R?R[1]:"GMT"}var O=S(a),N=S(s),T=Gt(O),F=Gt(N);h<l?(j[o>>2]=T,j[o+4>>2]=F):(j[o>>2]=F,j[o+4>>2]=T)}function rt(r,e,o){rt.called||(rt.called=!0,Yo(r,e,o))}function jo(){me("")}function Kt(){return Date.now()}function Xt(){return 2147483648}function Rt(){return Xt()}var tt;te?tt=()=>{var r=process.hrtime();return r[0]*1e3+r[1]/1e6}:tt=()=>performance.now();function qo(r,e,o){le.copyWithin(r,e,e+o)}function Zt(r){try{return ir.grow(r-Rr.byteLength+65535>>>16),_t(ir.buffer),1}catch{}}function Vo(r){var e=le.length;r=r>>>0;var o=Xt();if(r>o)return!1;let t=(w,S)=>w+(S-w%S)%S;for(var a=1;a<=4;a*=2){var s=e*(1+.2/a);s=Math.min(s,r+100663296);var l=Math.min(o,t(Math.max(r,s),65536)),h=Zt(l);if(h)return!0}return!1}function Mt(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var it=A.ENV||{};function Go(){return ie||"./this.program"}function Or(){if(!Or.strings){var r=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:r,_:Go()};for(var o in it)it[o]===void 0?delete e[o]:e[o]=it[o];var t=[];for(var o in e)t.push(o+"="+e[o]);Or.strings=t}return Or.strings}function at(r,e,o){for(var t=0;t<r.length;++t)ee[e++>>0]=r.charCodeAt(t);o||(ee[e>>0]=0)}function st(r,e){var o=0;return Or().forEach(function(t,a){var s=e+o;j[r+a*4>>2]=s,at(t,s),o+=t.length+1}),0}function On(r,e){var o=Or();j[r>>2]=o.length;var t=0;return o.forEach(function(a){t+=a.length+1}),j[e>>2]=t,0}function qr(r){Pr=r,Mr()||(f.onExit&&f.onExit(r),Tr=!0),_e(r,new Ur(r))}function Lt(r,e){Pr=r,Mr()||Kn(),qr(r)}var Cn=Lt;function Ko(r){try{var e=C.getStreamFromFD(r);return i.close(e),0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return o.errno}}function pn(r,e){try{var o=C.getStreamFromFD(r),t=o.tty?2:i.isDir(o.mode)?3:i.isLink(o.mode)?7:4;return ee[e>>0]=t,0}catch(a){if(typeof i>"u"||!(a instanceof i.ErrnoError))throw a;return a.errno}}function Xo(r,e,o,t){for(var a=0,s=0;s<o;s++){var l=j[e>>2],h=j[e+4>>2];e+=8;var w=i.read(r,ee,l,h,t);if(w<0)return-1;if(a+=w,w<h)break}return a}function Zo(r,e,o,t){try{var a=C.getStreamFromFD(r),s=Xo(a,e,o);return j[t>>2]=s,0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return l.errno}}function $o(r,e,o,t,a){try{var s=qt(e,o);if(isNaN(s))return 61;var l=C.getStreamFromFD(r);return i.llseek(l,s,t),Z=[l.position>>>0,(U=l.position,+Math.abs(U)>=1?U>0?(Math.min(+Math.floor(U/4294967296),4294967295)|0)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],E[a>>2]=Z[0],E[a+4>>2]=Z[1],l.getdents&&s===0&&t===0&&(l.getdents=null),0}catch(h){if(typeof i>"u"||!(h instanceof i.ErrnoError))throw h;return h.errno}}function Jo(r){try{var e=C.getStreamFromFD(r);return e.stream_ops&&e.stream_ops.fsync?e.stream_ops.fsync(e):0}catch(o){if(typeof i>"u"||!(o instanceof i.ErrnoError))throw o;return o.errno}}function Qo(r,e,o,t){for(var a=0,s=0;s<o;s++){var l=j[e>>2],h=j[e+4>>2];e+=8;var w=i.write(r,ee,l,h,t);if(w<0)return-1;a+=w}return a}function ei(r,e,o,t){try{var a=C.getStreamFromFD(r),s=Qo(a,e,o);return j[t>>2]=s,0}catch(l){if(typeof i>"u"||!(l instanceof i.ErrnoError))throw l;return l.errno}}function nn(r){var e=Jr(20),o=Jr(r.length+1);Fe(r,o,r.length+1),j[e>>2]=o;var t=Jr(4);j[t>>2]=0,j[e+4>>2]=t;var a=2;E[e+8>>2]=a,E[e+12>>2]=4;var s=Jr(12);return j[s>>2]=s+8,j[s+4>>2]=0,E[s+8>>2]=Ie(ue.lookup_name(r)),j[e+16>>2]=s,e}function Pn(r,e,o){if(o!==2)return he(5),null;r=E[r>>2];var t=Ne(r),a=ue.lookup_addr(t);return a&&(t=a),nn(t)}function Rn(r){return nn(ne(r))}function ri(r,e){for(var o=Math.min(e,3),t=8,a=0;a<o;a++)dt[r+a*t>>3]=.1;return o}function Mn(r,e,o,t,a,s,l){var h=Gr(r,e);if(h.errno)return-6;var w=h.port,S=h.addr,O=!1;if(o&&t){var N;if(l&1||!(N=ue.lookup_addr(S))){if(l&8)return-2}else S=N;var T=Fe(S,o,t);T+1>=t&&(O=!0)}if(a&&s){w=""+w;var T=Fe(w,a,s);T+1>=s&&(O=!0)}return O?-12:0}var hn={list:[],map:{}};function nt(r){function e(s,l,h){var w=Jr(s.length+1);at(s,w);for(var S=0,O=h.length,N=Jr((O+1)*4),T=0;T<O;T++,S+=4){var F=h[T],L=Jr(F.length+1);at(F,L),j[N+S>>2]=L}j[N+S>>2]=0;var R=Jr(12);return j[R>>2]=w,j[R+4>>2]=N,E[R+8>>2]=l,R}var o=hn.list,t=hn.map;if(o.length===0){var a=e("tcp",6,["TCP"]);o.push(a),t.tcp=t[6]=a,a=e("udp",17,["UDP"]),o.push(a),t.udp=t[17]=a}nt.index=0}function bt(r){r=ne(r),nt(!0);var e=hn.map[r];return e}function $t(r){nt(!0);var e=hn.map[r];return e}function yn(r){var e=Ce(r)+1,o=Te(e);return Ze(r,ee,o,e),o}var Fr={getAllWebSockets:function(r){let e=new Set;r.server&&r.server.clients.forEach(o=>{e.add(o)});for(let o of Fr.getAllPeers(r))e.add(o.socket);return Array.from(e)},getAllPeers:function(r){let e=new Set;if(r.server&&r.pending.filter(o=>o.peers).forEach(o=>{for(let t of Object.values(o.peers))e.add(t)}),r.peers)for(let o of Object.values(r.peers))e.add(o);return Array.from(e)},awaitData:function(r){return Fr.awaitWsEvent(r,"message")},awaitConnection:function(r){return r.OPEN===r.readyState?[Promise.resolve(),Fr.noop]:Fr.awaitWsEvent(r,"open")},awaitClose:function(r){return[r.CLOSING,r.CLOSED].includes(r.readyState)?[Promise.resolve(),Fr.noop]:Fr.awaitWsEvent(r,"close")},awaitError:function(r){return[r.CLOSING,r.CLOSED].includes(r.readyState)?[Promise.resolve(),Fr.noop]:Fr.awaitWsEvent(r,"error")},awaitWsEvent:function(r,e){let o,t=()=>{o()};return[new Promise(function(l){o=l,r.once(e,t)}),()=>{r.removeListener(e,t),setTimeout(o)}]},noop:function(){},shutdownSocket:function(r,e){let o=ke(r),t=Object.values(o.peers)[0];if(!t)return-1;try{return t.socket.close(),H.websocket_sock_ops.removePeer(o,t),0}catch(a){return console.log("Socket shutdown error",a),-1}}};function Ue(r,e,o){if(!r)return 1;let t=ne(r);if(!t.length)return 0;let a=ne(e);if(!a.length)return 0;if(f.popen_to_file){let{path:s,exitCode:l}=f.popen_to_file(t,a);return le[o]=l,yn(s)}if(te){let s=require("os").tmpdir(),l="php-process-stream",h=s+"/"+l,w=require("child_process"),S;if(a==="r")S=w.spawnSync(t,[],{shell:!0,stdio:["inherit","pipe","inherit"]}),le[o]=S.status,require("fs").writeFileSync(h,S.stdout,{encoding:"utf8",flag:"w+"});else return a==="w"?(console.error("popen mode w not implemented yet"),_W_EXITCODE(0,2)):(console.error("invalid mode "+a+" (should be r or w)"),_W_EXITCODE(0,2));return yn(h)}throw new Error("popen() is unsupported in the browser. Implement popen_to_file in your Module or disable shell_exec() and similar functions via php.ini.")}function hr(r){return r%4===0&&(r%100!==0||r%400===0)}function tr(r,e){for(var o=0,t=0;t<=e;o+=r[t++]);return o}var Hr=[31,29,31,30,31,30,31,31,30,31,30,31],Ge=[31,28,31,30,31,30,31,31,30,31,30,31];function Xe(r,e){for(var o=new Date(r.getTime());e>0;){var t=hr(o.getFullYear()),a=o.getMonth(),s=(t?Hr:Ge)[a];if(e>s-o.getDate())e-=s-o.getDate()+1,o.setDate(1),a<11?o.setMonth(a+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1));else return o.setDate(o.getDate()+e),o}return o}function Ve(r,e,o,t){var a=E[t+40>>2],s={tm_sec:E[t>>2],tm_min:E[t+4>>2],tm_hour:E[t+8>>2],tm_mday:E[t+12>>2],tm_mon:E[t+16>>2],tm_year:E[t+20>>2],tm_wday:E[t+24>>2],tm_yday:E[t+28>>2],tm_isdst:E[t+32>>2],tm_gmtoff:E[t+36>>2],tm_zone:a?ne(a):""},l=ne(o),h={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var w in h)l=l.replace(new RegExp(w,"g"),h[w]);var S=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],O=["January","February","March","April","May","June","July","August","September","October","November","December"];function N(M,z,q){for(var W=typeof M=="number"?M.toString():M||"";W.length<z;)W=q[0]+W;return W}function T(M,z){return N(M,z,"0")}function F(M,z){function q(X){return X<0?-1:X>0?1:0}var W;return(W=q(M.getFullYear()-z.getFullYear()))===0&&(W=q(M.getMonth()-z.getMonth()))===0&&(W=q(M.getDate()-z.getDate())),W}function L(M){switch(M.getDay()){case 0:return new Date(M.getFullYear()-1,11,29);case 1:return M;case 2:return new Date(M.getFullYear(),0,3);case 3:return new Date(M.getFullYear(),0,2);case 4:return new Date(M.getFullYear(),0,1);case 5:return new Date(M.getFullYear()-1,11,31);case 6:return new Date(M.getFullYear()-1,11,30)}}function R(M){var z=Xe(new Date(M.tm_year+1900,0,1),M.tm_yday),q=new Date(z.getFullYear(),0,4),W=new Date(z.getFullYear()+1,0,4),X=L(q),oe=L(W);return F(X,z)<=0?F(oe,z)<=0?z.getFullYear()+1:z.getFullYear():z.getFullYear()-1}var B={"%a":function(M){return S[M.tm_wday].substring(0,3)},"%A":function(M){return S[M.tm_wday]},"%b":function(M){return O[M.tm_mon].substring(0,3)},"%B":function(M){return O[M.tm_mon]},"%C":function(M){var z=M.tm_year+1900;return T(z/100|0,2)},"%d":function(M){return T(M.tm_mday,2)},"%e":function(M){return N(M.tm_mday,2," ")},"%g":function(M){return R(M).toString().substring(2)},"%G":function(M){return R(M)},"%H":function(M){return T(M.tm_hour,2)},"%I":function(M){var z=M.tm_hour;return z==0?z=12:z>12&&(z-=12),T(z,2)},"%j":function(M){return T(M.tm_mday+tr(hr(M.tm_year+1900)?Hr:Ge,M.tm_mon-1),3)},"%m":function(M){return T(M.tm_mon+1,2)},"%M":function(M){return T(M.tm_min,2)},"%n":function(){return`
34
+ `},"%p":function(M){return M.tm_hour>=0&&M.tm_hour<12?"AM":"PM"},"%S":function(M){return T(M.tm_sec,2)},"%t":function(){return" "},"%u":function(M){return M.tm_wday||7},"%U":function(M){var z=M.tm_yday+7-M.tm_wday;return T(Math.floor(z/7),2)},"%V":function(M){var z=Math.floor((M.tm_yday+7-(M.tm_wday+6)%7)/7);if((M.tm_wday+371-M.tm_yday-2)%7<=2&&z++,z){if(z==53){var W=(M.tm_wday+371-M.tm_yday)%7;W!=4&&(W!=3||!hr(M.tm_year))&&(z=1)}}else{z=52;var q=(M.tm_wday+7-M.tm_yday-1)%7;(q==4||q==5&&hr(M.tm_year%400-1))&&z++}return T(z,2)},"%w":function(M){return M.tm_wday},"%W":function(M){var z=M.tm_yday+7-(M.tm_wday+6)%7;return T(Math.floor(z/7),2)},"%y":function(M){return(M.tm_year+1900).toString().substring(2)},"%Y":function(M){return M.tm_year+1900},"%z":function(M){var z=M.tm_gmtoff,q=z>=0;return z=Math.abs(z)/60,z=z/60*100+z%60,(q?"+":"-")+("0000"+z).slice(-4)},"%Z":function(M){return M.tm_zone},"%%":function(){return"%"}};l=l.replace(/%%/g,"\0\0");for(var w in B)l.includes(w)&&(l=l.replace(new RegExp(w,"g"),B[w](s)));l=l.replace(/\0\0/g,"%");var P=Er(l,!1);return P.length>e?0:(Et(P,r),P.length-1)}function ut(r,e,o){for(var t=ne(e),a="\\!@#$^&*()+=-[]/{}|:<>?,.",s=0,l=a.length;s<l;++s)t=t.replace(new RegExp("\\"+a[s],"g"),"\\"+a[s]);var h={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var w in h)t=t.replace(w,h[w]);var S={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"},O={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},N={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},T={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6};for(var F in S)t=t.replace(F,"("+F+S[F]+")");for(var L=[],s=t.indexOf("%");s>=0;s=t.indexOf("%"))L.push(t[s+1]),t=t.replace(new RegExp("\\%"+t[s+1],"g"),"");var R=new RegExp("^"+t,"i").exec(ne(r));function B(){function or(xr,et,pi){return typeof xr!="number"||isNaN(xr)?et:xr>=et?xr<=pi?xr:pi:et}return{year:or(E[o+20>>2]+1900,1970,9999),month:or(E[o+16>>2],0,11),day:or(E[o+12>>2],1,31),hour:or(E[o+8>>2],0,23),min:or(E[o+4>>2],0,59),sec:or(E[o>>2],0,59)}}if(R){var P=B(),M,z=or=>{var xr=L.indexOf(or);if(xr>=0)return R[xr+1]};if((M=z("S"))&&(P.sec=ce(M)),(M=z("M"))&&(P.min=ce(M)),M=z("H"))P.hour=ce(M);else if(M=z("I")){var q=ce(M);(M=z("p"))&&(q+=M.toUpperCase()[0]==="P"?12:0),P.hour=q}if(M=z("Y"))P.year=ce(M);else if(M=z("y")){var W=ce(M);(M=z("C"))?W+=ce(M)*100:W+=W<69?2e3:1900,P.year=W}if((M=z("m"))?P.month=ce(M)-1:(M=z("b"))&&(P.month=O[M.substring(0,3).toUpperCase()]||0),M=z("d"))P.day=ce(M);else if(M=z("j"))for(var X=ce(M),oe=hr(P.year),se=0;se<12;++se){var Oe=tr(oe?Hr:Ge,se-1);X<=Oe+(oe?Hr:Ge)[se]&&(P.day=X-Oe)}else if(M=z("a")){var Ae=M.substring(0,3).toUpperCase();if(M=z("U")){var Qe=N[Ae],Ke=ce(M),rr=new Date(P.year,0,1),je;rr.getDay()===0?je=Xe(rr,Qe+7*(Ke-1)):je=Xe(rr,7-rr.getDay()+Qe+7*(Ke-1)),P.day=je.getDate(),P.month=je.getMonth()}else if(M=z("W")){var Qe=T[Ae],Ke=ce(M),rr=new Date(P.year,0,1),je;rr.getDay()===1?je=Xe(rr,Qe+7*(Ke-1)):je=Xe(rr,7-rr.getDay()+1+Qe+7*(Ke-1)),P.day=je.getDate(),P.month=je.getMonth()}}var nr=new Date(P.year,P.month,P.day,P.hour,P.min,P.sec,0);return E[o>>2]=nr.getSeconds(),E[o+4>>2]=nr.getMinutes(),E[o+8>>2]=nr.getHours(),E[o+12>>2]=nr.getDate(),E[o+16>>2]=nr.getMonth(),E[o+20>>2]=nr.getFullYear()-1900,E[o+24>>2]=nr.getDay(),E[o+28>>2]=tr(hr(nr.getFullYear())?Hr:Ge,nr.getMonth()-1)+nr.getDate()-1,E[o+32>>2]=0,r+Er(R[0]).length-1}return 0}function Kr(r){return Fr.shutdownSocket(r,2)}function ot(r,e,o){if(typeof Asyncify>"u")return 0;let t=1,a=2,s=4,l=8,h=16,w=32;return Asyncify.handleSleep(S=>{let O=ke(r);if(!O){S(0);return}let N=[],T=new Set;if(e&t||e&a){if(O.server){for(let M of O.pending)if((M.recv_queue||[]).length>0){S(1);return}}else if((O.recv_queue||[]).length>0){S(1);return}}let F=Fr.getAllWebSockets(O);if(!F.length){S(0);return}for(let M of F)(e&t||e&a)&&(N.push(Fr.awaitData(M)),T.add("POLLIN")),e&s&&(N.push(Fr.awaitConnection(M)),T.add("POLLOUT")),e&h&&(N.push(Fr.awaitClose(M)),T.add("POLLHUP")),(e&l||e&w)&&(N.push(Fr.awaitError(M)),T.add("POLLERR"));if(N.length===0){console.warn("Unsupported poll event "+e+", defaulting to setTimeout()."),setTimeout(function(){S(0)},o);return}let L=N.map(([M])=>M),R=()=>N.forEach(([,M])=>M()),B=!1;Promise.race(L).then(function(M){B||(B=!0,S(1),clearTimeout(P),R())});let P=setTimeout(function(){B||(B=!0,S(0),R())},o)})}function ft(r,e,o,t,a){let s=le[t];if(!(e===1&&o===9||e===6&&o===1))return console.warn(`Unsupported socket option: ${e}, ${o}, ${s}`),-1;let N=Fr.getAllWebSockets(r)[0];return N?(N.setSocketOpt(e,o,t),0):-1}function Ot(r){var e=f["_"+r];return e}function Dt(r,e,o,t,a){var s={string:L=>{var R=0;if(L!=null&&L!==0){var B=(L.length<<2)+1;R=Te(B),Fe(L,R,B)}return R},array:L=>{var R=Te(L.length);return Et(L,R),R}};function l(L){return e==="string"?ne(L):e==="boolean"?!!L:L}var h=Ot(r),w=[],S=0;if(t)for(var O=0;O<t.length;O++){var N=s[o[O]];N?(S===0&&(S=Sr()),w[O]=N(t[O])):w[O]=t[O]}var T=h.apply(null,w);function F(L){return S!==0&&br(S),l(L)}return T=F(T),T}var Jt=function(r,e,o,t){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=i.nextInode++,this.name=e,this.mode=o,this.node_ops={},this.stream_ops={},this.rdev=t},Ut=365,Xr=146;Object.defineProperties(Jt.prototype,{read:{get:function(){return(this.mode&Ut)===Ut},set:function(r){r?this.mode|=Ut:this.mode&=~Ut}},write:{get:function(){return(this.mode&Xr)===Xr},set:function(r){r?this.mode|=Xr:this.mode&=~Xr}},isFolder:{get:function(){return i.isDir(this.mode)}},isDevice:{get:function(){return i.isChrdev(this.mode)}}}),i.FSNode=Jt,i.staticInit(),f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_unlink=i.unlink,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,te&&(yr(),V.staticInit()),re={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};var $r={l:to,Ta:wt,Sa:v,Ra:Zr,Qa:dn,Pa:Pt,M:oo,Oa:io,Na:ao,Ma:so,La:uo,Ka:_n,Ja:fo,L:gt,n:co,Ia:lo,R:_o,Ha:mo,Ga:vo,Fa:po,Ea:ho,Da:yo,K:Eo,Ca:wo,Ba:go,Aa:So,za:bo,C:ko,ya:Oo,xa:kr,wa:Do,va:Se,ua:No,J:To,ta:Ao,I:Fo,sa:Co,ra:Po,qa:Ro,H:Mo,pa:Lo,la:mn,ka:St,ja:Fn,ia:vn,ha:Io,ga:Bo,fa:xo,ea:zo,da:Ho,ca:Wo,ba:rt,o:jo,A:Kt,aa:Rt,E:tt,$:qo,_:Vo,Z:Mt,oa:st,na:On,d:Cn,u:Ko,G:pn,F:Zo,Q:$o,ma:Jo,B:ei,D:Pn,z:Rn,Y:ri,X:Mn,W:bt,V:$t,j:_i,c:In,b:di,g:xn,h:bn,t:c,U:y,m:fn,T:k,y:u,P:d,O:b,f:li,a:Nn,e:Tn,i:Bn,s:g,p:_,k:D,x:m,S:Ue,r:Ve,N:ut,q:Kr,w:ot,v:ft},En=ro(),ti=f.___wasm_call_ctors=function(){return(ti=f.___wasm_call_ctors=f.asm.Va).apply(null,arguments)},wn=f._wasm_popen=function(){return(wn=f._wasm_popen=f.asm.Wa).apply(null,arguments)},on=f.___errno_location=function(){return(on=f.___errno_location=f.asm.Xa).apply(null,arguments)},Qt=f._wasm_pclose=function(){return(Qt=f._wasm_pclose=f.asm.Ya).apply(null,arguments)},Dn=f._php_pollfd_for=function(){return(Dn=f._php_pollfd_for=f.asm.Za).apply(null,arguments)},gn=f._wasm_select=function(){return(gn=f._wasm_select=f.asm._a).apply(null,arguments)},Tt=f._wasm_add_cli_arg=function(){return(Tt=f._wasm_add_cli_arg=f.asm.$a).apply(null,arguments)},Jr=f._malloc=function(){return(Jr=f._malloc=f.asm.ab).apply(null,arguments)},mr=f._run_cli=function(){return(mr=f._run_cli=f.asm.bb).apply(null,arguments)},Qr=f._ntohs=function(){return(Qr=f._ntohs=f.asm.db).apply(null,arguments)},It=f._htons=function(){return(It=f._htons=f.asm.eb).apply(null,arguments)},zr=f._fflush=function(){return(zr=f._fflush=f.asm.fb).apply(null,arguments)},Nt=f._wasm_set_phpini_path=function(){return(Nt=f._wasm_set_phpini_path=f.asm.gb).apply(null,arguments)},Dr=f._wasm_set_phpini_entries=function(){return(Dr=f._wasm_set_phpini_entries=f.asm.hb).apply(null,arguments)},At=f._wasm_add_SERVER_entry=function(){return(At=f._wasm_add_SERVER_entry=f.asm.ib).apply(null,arguments)},an=f._wasm_add_uploaded_file=function(){return(an=f._wasm_add_uploaded_file=f.asm.jb).apply(null,arguments)},Br=f._wasm_set_query_string=function(){return(Br=f._wasm_set_query_string=f.asm.kb).apply(null,arguments)},Vr=f._wasm_set_path_translated=function(){return(Vr=f._wasm_set_path_translated=f.asm.lb).apply(null,arguments)},Ft=f._wasm_set_skip_shebang=function(){return(Ft=f._wasm_set_skip_shebang=f.asm.mb).apply(null,arguments)},sn=f._wasm_set_request_uri=function(){return(sn=f._wasm_set_request_uri=f.asm.nb).apply(null,arguments)},en=f._wasm_set_request_method=function(){return(en=f._wasm_set_request_method=f.asm.ob).apply(null,arguments)},un=f._wasm_set_request_host=function(){return(un=f._wasm_set_request_host=f.asm.pb).apply(null,arguments)},rn=f._wasm_set_content_type=function(){return(rn=f._wasm_set_content_type=f.asm.qb).apply(null,arguments)},tn=f._wasm_set_request_body=function(){return(tn=f._wasm_set_request_body=f.asm.rb).apply(null,arguments)},Sn=f._wasm_set_content_length=function(){return(Sn=f._wasm_set_content_length=f.asm.sb).apply(null,arguments)},ni=f._wasm_set_cookies=function(){return(ni=f._wasm_set_cookies=f.asm.tb).apply(null,arguments)},oi=f._wasm_set_php_code=function(){return(oi=f._wasm_set_php_code=f.asm.ub).apply(null,arguments)},ii=f._wasm_set_request_port=function(){return(ii=f._wasm_set_request_port=f.asm.vb).apply(null,arguments)},ai=f._phpwasm_init_uploaded_files_hash=function(){return(ai=f._phpwasm_init_uploaded_files_hash=f.asm.wb).apply(null,arguments)},si=f._phpwasm_register_uploaded_file=function(){return(si=f._phpwasm_register_uploaded_file=f.asm.xb).apply(null,arguments)},ui=f._phpwasm_destroy_uploaded_files_hash=function(){return(ui=f._phpwasm_destroy_uploaded_files_hash=f.asm.yb).apply(null,arguments)},fi=f._wasm_sapi_handle_request=function(){return(fi=f._wasm_sapi_handle_request=f.asm.zb).apply(null,arguments)},ci=f._php_wasm_init=function(){return(ci=f._php_wasm_init=f.asm.Ab).apply(null,arguments)},Ln=f.___funcs_on_exit=function(){return(Ln=f.___funcs_on_exit=f.asm.Bb).apply(null,arguments)},Un=f._emscripten_builtin_memalign=function(){return(Un=f._emscripten_builtin_memalign=f.asm.Cb).apply(null,arguments)},Cr=f._setThrew=function(){return(Cr=f._setThrew=f.asm.Db).apply(null,arguments)},Sr=f.stackSave=function(){return(Sr=f.stackSave=f.asm.Eb).apply(null,arguments)},br=f.stackRestore=function(){return(br=f.stackRestore=f.asm.Fb).apply(null,arguments)},Te=f.stackAlloc=function(){return(Te=f.stackAlloc=f.asm.Gb).apply(null,arguments)},De=f.dynCall_viii=function(){return(De=f.dynCall_viii=f.asm.Hb).apply(null,arguments)},ye=f.dynCall_vi=function(){return(ye=f.dynCall_vi=f.asm.Ib).apply(null,arguments)},sr=f.dynCall_ii=function(){return(sr=f.dynCall_ii=f.asm.Jb).apply(null,arguments)},Ye=f.dynCall_iii=function(){return(Ye=f.dynCall_iii=f.asm.Kb).apply(null,arguments)},vr=f.dynCall_iiii=function(){return(vr=f.dynCall_iiii=f.asm.Lb).apply(null,arguments)},Be=f.dynCall_v=function(){return(Be=f.dynCall_v=f.asm.Mb).apply(null,arguments)},ur=f.dynCall_iiiii=function(){return(ur=f.dynCall_iiiii=f.asm.Nb).apply(null,arguments)},fr=f.dynCall_iiiiii=function(){return(fr=f.dynCall_iiiiii=f.asm.Ob).apply(null,arguments)},cr=f.dynCall_vii=function(){return(cr=f.dynCall_vii=f.asm.Pb).apply(null,arguments)},He=f.dynCall_viiii=function(){return(He=f.dynCall_viiii=f.asm.Qb).apply(null,arguments)},xe=f.dynCall_iiiiiii=function(){return(xe=f.dynCall_iiiiiii=f.asm.Rb).apply(null,arguments)},lr=f.dynCall_i=function(){return(lr=f.dynCall_i=f.asm.Sb).apply(null,arguments)},kt=f.dynCall_viiiii=function(){return(kt=f.dynCall_viiiii=f.asm.Tb).apply(null,arguments)},Bt=f.dynCall_iiiiiiii=function(){return(Bt=f.dynCall_iiiiiiii=f.asm.Ub).apply(null,arguments)},xt=f.dynCall_iiiiiiiii=function(){return(xt=f.dynCall_iiiiiiiii=f.asm.Vb).apply(null,arguments)},zt=f.dynCall_iiiiiiiiii=function(){return(zt=f.dynCall_iiiiiiiiii=f.asm.Wb).apply(null,arguments)},Ht=f.dynCall_viiiiiiiii=function(){return(Ht=f.dynCall_viiiiiiiii=f.asm.Xb).apply(null,arguments)},Wt=f.dynCall_viiiiii=function(){return(Wt=f.dynCall_viiiiii=f.asm.Yb).apply(null,arguments)},Yt=f.dynCall_iiji=function(){return(Yt=f.dynCall_iiji=f.asm.Zb).apply(null,arguments)},jt=f.dynCall_iijiji=function(){return(jt=f.dynCall_iijiji=f.asm._b).apply(null,arguments)};function fn(r,e,o,t,a,s,l,h){var w=Sr();try{return Bt(r,e,o,t,a,s,l,h)}catch(S){if(br(w),S!==S+0)throw S;Cr(1,0)}}function Nn(r,e){var o=Sr();try{ye(r,e)}catch(t){if(br(o),t!==t+0)throw t;Cr(1,0)}}function Tn(r,e,o){var t=Sr();try{cr(r,e,o)}catch(a){if(br(t),a!==a+0)throw a;Cr(1,0)}}function In(r,e){var o=Sr();try{return sr(r,e)}catch(t){if(br(o),t!==t+0)throw t;Cr(1,0)}}function Bn(r,e,o,t){var a=Sr();try{De(r,e,o,t)}catch(s){if(br(a),s!==s+0)throw s;Cr(1,0)}}function li(r){var e=Sr();try{Be(r)}catch(o){if(br(e),o!==o+0)throw o;Cr(1,0)}}function di(r,e,o){var t=Sr();try{return Ye(r,e,o)}catch(a){if(br(t),a!==a+0)throw a;Cr(1,0)}}function _i(r){var e=Sr();try{return lr(r)}catch(o){if(br(e),o!==o+0)throw o;Cr(1,0)}}function bn(r,e,o,t,a){var s=Sr();try{return ur(r,e,o,t,a)}catch(l){if(br(s),l!==l+0)throw l;Cr(1,0)}}function xn(r,e,o,t){var a=Sr();try{return vr(r,e,o,t)}catch(s){if(br(a),s!==s+0)throw s;Cr(1,0)}}function g(r,e,o,t,a){var s=Sr();try{He(r,e,o,t,a)}catch(l){if(br(s),l!==l+0)throw l;Cr(1,0)}}function k(r,e,o,t,a,s,l,h,w){var S=Sr();try{return xt(r,e,o,t,a,s,l,h,w)}catch(O){if(br(S),O!==O+0)throw O;Cr(1,0)}}function D(r,e,o,t,a,s,l){var h=Sr();try{Wt(r,e,o,t,a,s,l)}catch(w){if(br(h),w!==w+0)throw w;Cr(1,0)}}function _(r,e,o,t,a,s){var l=Sr();try{kt(r,e,o,t,a,s)}catch(h){if(br(l),h!==h+0)throw h;Cr(1,0)}}function u(r,e,o,t,a,s,l,h,w,S){var O=Sr();try{return zt(r,e,o,t,a,s,l,h,w,S)}catch(N){if(br(O),N!==N+0)throw N;Cr(1,0)}}function c(r,e,o,t,a,s){var l=Sr();try{return fr(r,e,o,t,a,s)}catch(h){if(br(l),h!==h+0)throw h;Cr(1,0)}}function m(r,e,o,t,a,s,l,h,w,S){var O=Sr();try{Ht(r,e,o,t,a,s,l,h,w,S)}catch(N){if(br(O),N!==N+0)throw N;Cr(1,0)}}function y(r,e,o,t,a,s,l){var h=Sr();try{return xe(r,e,o,t,a,s,l)}catch(w){if(br(h),w!==w+0)throw w;Cr(1,0)}}function b(r,e,o,t,a,s,l,h){var w=Sr();try{return jt(r,e,o,t,a,s,l,h)}catch(S){if(br(w),S!==S+0)throw S;Cr(1,0)}}function d(r,e,o,t,a){var s=Sr();try{return Yt(r,e,o,t,a)}catch(l){if(br(s),l!==l+0)throw l;Cr(1,0)}}f.UTF8ToString=ne,f.lengthBytesUTF8=Ce,f.addRunDependency=dr,f.removeRunDependency=Je,f.FS_createPath=i.createPath,f.FS_createDataFile=i.createDataFile,f.FS_createPreloadedFile=i.createPreloadedFile,f.FS_createLazyFile=i.createLazyFile,f.FS_createDevice=i.createDevice,f.FS_unlink=i.unlink,f.ccall=Dt,f.FS=i;var p;$e=function r(){p||n(),p||($e=r)};function n(r){if(r=r||$,Pe>0||(Vn(),Pe>0))return;function e(){p||(p=!0,f.calledRun=!0,!Tr&&(Gn(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Xn()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),e()},1)):e()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return n(),A}var Kf,mu,pu=Oi(()=>{"use strict";Kf=9837958,mu=__dirname+"/php_5_6.wasm"});var tc={};gi(tc,{PHP:()=>Qi,PHPBrowser:()=>ra,PHPServer:()=>ea,getPHPLoaderModule:()=>Zf,loadPHPRuntime:()=>Ba,parseWorkerStartupOptions:()=>$f});module.exports=Si(tc);var pa=require("util");async function Zf(x="8.2"){switch(x){case"8.2":return Vs(),Si(qs);case"8.1":return Xs(),Si(Ks);case"8.0":return Js(),Si($s);case"7.4":return ru(),Si(eu);case"7.3":return ou(),Si(nu);case"7.2":return su(),Si(au);case"7.1":return cu(),Si(fu);case"7.0":return _u(),Si(du);case"5.6":return pu(),Si(vu)}throw new Error(`Unsupported PHP version ${x}`)}function $f(){return JSON.parse(process.env.WORKER_OPTIONS||"{}")}var ec={},mi="string",Bi="number",_a=[];async function Ba(x,A={},I=[]){let f,K,$=new Promise(Ee=>{K=Ee}),ie=new Promise(Ee=>{f=Ee}),_e=x.default(Jf,{onAbort(Ee){console.error("WASM aborted: "),console.error(Ee)},ENV:{},locateFile:Ee=>Ee,...A,noInitialRun:!0,onRuntimeInitialized(){A.onRuntimeInitialized&&A.onRuntimeInitialized(),f()},monitorRunDependencies(Ee){Ee===0&&(delete _e.monitorRunDependencies,K())}});for(let{default:Ee}of I)Ee(_e);return I.length||K(),await $,await ie,_a.push(_e),_a.length-1}var Jf=function(){return typeof window<"u"&&!ec.env.TEST?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"}(),Qi=class{#e;#r=[];#t=!1;constructor(A){A!==void 0&&this.initializeRuntime(A)}initializeRuntime(A){if(this.#e)throw new Error("PHP runtime already initialized.");if(!_a[A])throw new Error("Invalid PHP runtime id.");this.#e=_a[A]}setPhpIniPath(A){if(this.#t)throw new Error("Cannot set PHP ini path after calling run().");this.#e.ccall("wasm_set_phpini_path",null,["string"],[A])}setPhpIniEntry(A,I){if(this.#t)throw new Error("Cannot set PHP ini entries after calling run().");this.#r.push([A,I])}chdir(A){this.#e.FS.chdir(A)}run(A={}){this.#t||(this.#o(),this.#t=!0),this.#c(A.scriptPath||""),this.#n(A.relativeUri||""),this.#s(A.method||"GET");let{host:I,...f}={host:"example.com:443",...Qf(A.headers||{})};if(this.#a(I,A.protocol||"http"),this.#u(f),A.body&&this.#f(A.body),A.fileInfos)for(let K of A.fileInfos)this.#l(K);return A.code&&this.#d(" ?>"+A.code),this.#_()}#o(){if(this.#r.length>0){let A=this.#r.map(([I,f])=>`${I}=${f}`).join(`
35
+ `);this.#e.ccall("wasm_set_phpini_entries",null,[mi],[A])}this.#e.ccall("php_wasm_init",null,[],[])}cli(A){for(let I of A)this.#e.ccall("wasm_add_cli_arg",null,[mi],[I]);return this.#e.ccall("run_cli",null,[],[],{async:!0})}#i(){let A="/tmp/headers.json";if(!this.fileExists(A))throw new Error("SAPI Error: Could not find response headers file.");let I=JSON.parse(this.readFileAsText(A)),f={};for(let K of I.headers){if(!K.includes(": "))continue;let $=K.indexOf(": "),ie=K.substring(0,$).toLowerCase(),_e=K.substring($+2);ie in f||(f[ie]=[]),f[ie].push(_e)}return{headers:f,httpStatusCode:I.status}}#n(A){if(this.#e.ccall("wasm_set_request_uri",null,[mi],[A]),A.includes("?")){let I=A.substring(A.indexOf("?")+1);this.#e.ccall("wasm_set_query_string",null,[mi],[I])}}#a(A,I){this.#e.ccall("wasm_set_request_host",null,[mi],[A]);let f;try{f=parseInt(new URL(A).port,10)}catch{}(!f||isNaN(f)||f===80)&&(f=I==="https"?443:80),this.#e.ccall("wasm_set_request_port",null,[Bi],[f]),(I==="https"||!I&&f===443)&&this.addServerGlobalEntry("HTTPS","on")}#s(A){this.#e.ccall("wasm_set_request_method",null,[mi],[A])}setSkipShebang(A){this.#e.ccall("wasm_set_skip_shebang",null,[Bi],[A?1:0])}#u(A){A.cookie&&this.#e.ccall("wasm_set_cookies",null,[mi],[A.cookie]),A["content-type"]&&this.#e.ccall("wasm_set_content_type",null,[mi],[A["content-type"]]),A["content-length"]&&this.#e.ccall("wasm_set_content_length",null,[Bi],[parseInt(A["content-length"],10)]);for(let I in A)this.addServerGlobalEntry(`HTTP_${I.toUpperCase().replace(/-/g,"_")}`,A[I])}#f(A){this.#e.ccall("wasm_set_request_body",null,[mi],[A]),this.#e.ccall("wasm_set_content_length",null,[Bi],[A.length])}#c(A){this.#e.ccall("wasm_set_path_translated",null,[mi],[A])}addServerGlobalEntry(A,I){this.#e.ccall("wasm_add_SERVER_entry",null,[mi,mi],[A,I])}#l(A){let{key:I,name:f,type:K,data:$}=A,ie=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(ie,$);let _e=0;this.#e.ccall("wasm_add_uploaded_file",null,[mi,mi,mi,mi,Bi,Bi],[I,f,K,ie,_e,$.byteLength])}#d(A){this.#e.ccall("wasm_set_php_code",null,[mi],[A])}#_(){return{exitCode:this.#e.ccall("wasm_sapi_handle_request",Bi,[],[]),body:this.readFileAsBuffer("/tmp/stdout"),errors:this.readFileAsText("/tmp/stderr"),...this.#i()}}mkdirTree(A){this.#e.FS.mkdirTree(A)}readFileAsText(A){return new TextDecoder().decode(this.readFileAsBuffer(A))}readFileAsBuffer(A){return this.#e.FS.readFile(A)}writeFile(A,I){this.#e.FS.writeFile(A,I)}unlink(A){this.#e.FS.unlink(A)}listFiles(A){if(!this.fileExists(A))return[];try{return this.#e.FS.readdir(A).filter(I=>I!=="."&&I!=="..")}catch(I){return console.error(I,{path:A}),[]}}isDir(A){return this.fileExists(A)?this.#e.FS.isDir(this.#e.FS.lookupPath(A).node.mode):!1}fileExists(A){try{return this.#e.FS.lookupPath(A),!0}catch{return!1}}mount(A,I){this.#e.FS.mount(this.#e.FS.filesystems.NODEFS,A,I)}};function Qf(x){let A={};for(let I in x)A[I.toLowerCase()]=x[I];return A}var xa="http://example.com";function ma(x){return x.toString().substring(x.origin.length)}function va(x,A){return!A||!x.startsWith(A)?x:x.substring(A.length)}function za(x,A){return!A||x.startsWith(A)?x:A+x}var ea=class{#e;#r;#t;#o;#i;#n;#a;php;#s;constructor(A,I={}){let{documentRoot:f="/www/",absoluteUrl:K=location.origin,isStaticFilePath:$=()=>!1}=I;this.php=A,this.#e=f,this.#s=$;let ie=new URL(K);this.#t=ie.hostname,this.#o=ie.port?Number(ie.port):ie.protocol==="https:"?443:80,this.#r=(ie.protocol||"").replace(":","");let _e=this.#o!==443&&this.#o!==80;this.#i=[this.#t,_e?`:${this.#o}`:""].join(""),this.#n=ie.pathname.replace(/\/+$/,""),this.#a=[`${this.#r}://`,this.#i,this.#n].join("")}pathToInternalUrl(A){return`${this.absoluteUrl}${A}`}internalUrlToPath(A){let I=new URL(A);return I.pathname.startsWith(this.#n)&&(I.pathname=I.pathname.slice(this.#n.length)),ma(I)}get absoluteUrl(){return this.#a}get documentRoot(){return this.#e}async request(A){let I;A.relativeUrl!==void 0?I=new URL(A.relativeUrl,xa):I=new URL(A.absoluteUrl);let f=va(I.pathname,this.#n);return this.#s(f)?this.#u(f):await this.#f(A,I)}#u(A){let I=`${this.#e}${A}`;if(!this.php.fileExists(I))return{body:new TextEncoder().encode("404 File not found"),headers:{},httpStatusCode:404,exitCode:0,errors:""};let f=this.php.readFileAsBuffer(I);return{body:f,headers:{"content-length":[`${f.byteLength}`],"content-type":[rc(I)],"accept-ranges":["bytes"],"cache-control":["public, max-age=0"]},httpStatusCode:200,exitCode:0,errors:""}}async#f(A,I){this.php.addServerGlobalEntry("DOCUMENT_ROOT",this.#e),this.php.addServerGlobalEntry("HTTPS",this.#a.startsWith("https://")?"on":"");let f="GET",K=[];if(A.files){f="POST";for(let _e in A.files){let Ee=A.files[_e];K.push({key:_e,name:Ee.name,type:Ee.type,data:new Uint8Array(await Ee.arrayBuffer())})}}let $={host:this.#i},ie;return A.formData!==void 0?(f="POST",$["content-type"]="application/x-www-form-urlencoded",ie=new URLSearchParams(A.formData).toString()):ie=A.body,this.php.run({relativeUri:za(ma(I),this.#n),protocol:this.#r,method:A.method||f,body:ie,fileInfos:K,scriptPath:this.#c(I.pathname),headers:{...$,...A.headers||{}}})}#c(A){let I=va(A,this.#n);I.includes(".php")?I=I.split(".php")[0]+".php":(I.endsWith("/")||(I+="/"),I.endsWith("index.php")||(I+="index.php"));let f=`${this.#e}${I}`;return this.php.fileExists(f)?f:`${this.#e}/index.php`}};function rc(x){switch(x.split(".").pop()){case"css":return"text/css";case"js":return"application/javascript";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"svg":return"image/svg+xml";case"woff":return"font/woff";case"woff2":return"font/woff2";case"ttf":return"font/ttf";case"otf":return"font/otf";case"eot":return"font/eot";case"ico":return"image/x-icon";case"html":return"text/html";case"json":return"application/json";case"xml":return"application/xml";case"txt":case"md":return"text/plain";default:return"application-octet-stream"}}var ra=class{#e;#r;server;constructor(A,I={}){this.server=A,this.#e={},this.#r={handleRedirects:!1,maxRedirects:4,...I}}async request(A,I=0){let f=await this.server.request({...A,headers:{...A.headers,cookie:this.#o()}});if(f.headers["set-cookie"]&&this.#t(f.headers["set-cookie"]),this.#r.handleRedirects&&f.headers.location&&I<this.#r.maxRedirects){let K=new URL(f.headers.location[0],this.server.absoluteUrl);return this.request({absoluteUrl:K.toString(),method:"GET",headers:{}},I+1)}return f}#t(A){for(let I of A)try{if(!I.includes("="))continue;let f=I.indexOf("="),K=I.substring(0,f),$=I.substring(f+1).split(";")[0];this.#e[K]=$}catch(f){console.error(f)}}#o(){let A=[];for(let I in this.#e)A.push(`${I}=${this.#e[I]}`);return A.join("; ")}};global.TextEncoder=pa.TextEncoder;global.TextDecoder=pa.TextDecoder;0&&(module.exports={PHP,PHPBrowser,PHPServer,getPHPLoaderModule,loadPHPRuntime,parseWorkerStartupOptions});