-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwebterm.bundle.js
3 lines (3 loc) · 329 KB
/
webterm.bundle.js
1
2
3
/*! For license information please see webterm.bundle.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.WasmWebTerm=e():t.WasmWebTerm=e()}(self,(()=>(()=>{var t={788:(t,e,r)=>{"use strict";const n=r(983),i=r(32),o=r(975),s=r(621),a={hrtime:r(918).default(i.default),exit:t=>{throw new s.WASIExitError(t)},kill:t=>{throw new s.WASIKillError(t)},randomFillSync:n.randomFillSync,isTTY:()=>!0,path:o,fs:null};e.A=a},524:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(395);e.WASI_ESUCCESS=0,e.WASI_E2BIG=1,e.WASI_EACCES=2,e.WASI_EADDRINUSE=3,e.WASI_EADDRNOTAVAIL=4,e.WASI_EAFNOSUPPORT=5,e.WASI_EAGAIN=6,e.WASI_EALREADY=7,e.WASI_EBADF=8,e.WASI_EBADMSG=9,e.WASI_EBUSY=10,e.WASI_ECANCELED=11,e.WASI_ECHILD=12,e.WASI_ECONNABORTED=13,e.WASI_ECONNREFUSED=14,e.WASI_ECONNRESET=15,e.WASI_EDEADLK=16,e.WASI_EDESTADDRREQ=17,e.WASI_EDOM=18,e.WASI_EDQUOT=19,e.WASI_EEXIST=20,e.WASI_EFAULT=21,e.WASI_EFBIG=22,e.WASI_EHOSTUNREACH=23,e.WASI_EIDRM=24,e.WASI_EILSEQ=25,e.WASI_EINPROGRESS=26,e.WASI_EINTR=27,e.WASI_EINVAL=28,e.WASI_EIO=29,e.WASI_EISCONN=30,e.WASI_EISDIR=31,e.WASI_ELOOP=32,e.WASI_EMFILE=33,e.WASI_EMLINK=34,e.WASI_EMSGSIZE=35,e.WASI_EMULTIHOP=36,e.WASI_ENAMETOOLONG=37,e.WASI_ENETDOWN=38,e.WASI_ENETRESET=39,e.WASI_ENETUNREACH=40,e.WASI_ENFILE=41,e.WASI_ENOBUFS=42,e.WASI_ENODEV=43,e.WASI_ENOENT=44,e.WASI_ENOEXEC=45,e.WASI_ENOLCK=46,e.WASI_ENOLINK=47,e.WASI_ENOMEM=48,e.WASI_ENOMSG=49,e.WASI_ENOPROTOOPT=50,e.WASI_ENOSPC=51,e.WASI_ENOSYS=52,e.WASI_ENOTCONN=53,e.WASI_ENOTDIR=54,e.WASI_ENOTEMPTY=55,e.WASI_ENOTRECOVERABLE=56,e.WASI_ENOTSOCK=57,e.WASI_ENOTSUP=58,e.WASI_ENOTTY=59,e.WASI_ENXIO=60,e.WASI_EOVERFLOW=61,e.WASI_EOWNERDEAD=62,e.WASI_EPERM=63,e.WASI_EPIPE=64,e.WASI_EPROTO=65,e.WASI_EPROTONOSUPPORT=66,e.WASI_EPROTOTYPE=67,e.WASI_ERANGE=68,e.WASI_EROFS=69,e.WASI_ESPIPE=70,e.WASI_ESRCH=71,e.WASI_ESTALE=72,e.WASI_ETIMEDOUT=73,e.WASI_ETXTBSY=74,e.WASI_EXDEV=75,e.WASI_ENOTCAPABLE=76,e.WASI_SIGABRT=0,e.WASI_SIGALRM=1,e.WASI_SIGBUS=2,e.WASI_SIGCHLD=3,e.WASI_SIGCONT=4,e.WASI_SIGFPE=5,e.WASI_SIGHUP=6,e.WASI_SIGILL=7,e.WASI_SIGINT=8,e.WASI_SIGKILL=9,e.WASI_SIGPIPE=10,e.WASI_SIGQUIT=11,e.WASI_SIGSEGV=12,e.WASI_SIGSTOP=13,e.WASI_SIGTERM=14,e.WASI_SIGTRAP=15,e.WASI_SIGTSTP=16,e.WASI_SIGTTIN=17,e.WASI_SIGTTOU=18,e.WASI_SIGURG=19,e.WASI_SIGUSR1=20,e.WASI_SIGUSR2=21,e.WASI_SIGVTALRM=22,e.WASI_SIGXCPU=23,e.WASI_SIGXFSZ=24,e.WASI_FILETYPE_UNKNOWN=0,e.WASI_FILETYPE_BLOCK_DEVICE=1,e.WASI_FILETYPE_CHARACTER_DEVICE=2,e.WASI_FILETYPE_DIRECTORY=3,e.WASI_FILETYPE_REGULAR_FILE=4,e.WASI_FILETYPE_SOCKET_DGRAM=5,e.WASI_FILETYPE_SOCKET_STREAM=6,e.WASI_FILETYPE_SYMBOLIC_LINK=7,e.WASI_FDFLAG_APPEND=1,e.WASI_FDFLAG_DSYNC=2,e.WASI_FDFLAG_NONBLOCK=4,e.WASI_FDFLAG_RSYNC=8,e.WASI_FDFLAG_SYNC=16,e.WASI_RIGHT_FD_DATASYNC=n.BigIntPolyfill(1),e.WASI_RIGHT_FD_READ=n.BigIntPolyfill(2),e.WASI_RIGHT_FD_SEEK=n.BigIntPolyfill(4),e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS=n.BigIntPolyfill(8),e.WASI_RIGHT_FD_SYNC=n.BigIntPolyfill(16),e.WASI_RIGHT_FD_TELL=n.BigIntPolyfill(32),e.WASI_RIGHT_FD_WRITE=n.BigIntPolyfill(64),e.WASI_RIGHT_FD_ADVISE=n.BigIntPolyfill(128),e.WASI_RIGHT_FD_ALLOCATE=n.BigIntPolyfill(256),e.WASI_RIGHT_PATH_CREATE_DIRECTORY=n.BigIntPolyfill(512),e.WASI_RIGHT_PATH_CREATE_FILE=n.BigIntPolyfill(1024),e.WASI_RIGHT_PATH_LINK_SOURCE=n.BigIntPolyfill(2048),e.WASI_RIGHT_PATH_LINK_TARGET=n.BigIntPolyfill(4096),e.WASI_RIGHT_PATH_OPEN=n.BigIntPolyfill(8192),e.WASI_RIGHT_FD_READDIR=n.BigIntPolyfill(16384),e.WASI_RIGHT_PATH_READLINK=n.BigIntPolyfill(32768),e.WASI_RIGHT_PATH_RENAME_SOURCE=n.BigIntPolyfill(65536),e.WASI_RIGHT_PATH_RENAME_TARGET=n.BigIntPolyfill(131072),e.WASI_RIGHT_PATH_FILESTAT_GET=n.BigIntPolyfill(262144),e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE=n.BigIntPolyfill(524288),e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES=n.BigIntPolyfill(1048576),e.WASI_RIGHT_FD_FILESTAT_GET=n.BigIntPolyfill(2097152),e.WASI_RIGHT_FD_FILESTAT_SET_SIZE=n.BigIntPolyfill(4194304),e.WASI_RIGHT_FD_FILESTAT_SET_TIMES=n.BigIntPolyfill(8388608),e.WASI_RIGHT_PATH_SYMLINK=n.BigIntPolyfill(16777216),e.WASI_RIGHT_PATH_REMOVE_DIRECTORY=n.BigIntPolyfill(33554432),e.WASI_RIGHT_PATH_UNLINK_FILE=n.BigIntPolyfill(67108864),e.WASI_RIGHT_POLL_FD_READWRITE=n.BigIntPolyfill(134217728),e.WASI_RIGHT_SOCK_SHUTDOWN=n.BigIntPolyfill(268435456),e.RIGHTS_ALL=e.WASI_RIGHT_FD_DATASYNC|e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_SEEK|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_TELL|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_FD_ALLOCATE|e.WASI_RIGHT_PATH_CREATE_DIRECTORY|e.WASI_RIGHT_PATH_CREATE_FILE|e.WASI_RIGHT_PATH_LINK_SOURCE|e.WASI_RIGHT_PATH_LINK_TARGET|e.WASI_RIGHT_PATH_OPEN|e.WASI_RIGHT_FD_READDIR|e.WASI_RIGHT_PATH_READLINK|e.WASI_RIGHT_PATH_RENAME_SOURCE|e.WASI_RIGHT_PATH_RENAME_TARGET|e.WASI_RIGHT_PATH_FILESTAT_GET|e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_SYMLINK|e.WASI_RIGHT_PATH_UNLINK_FILE|e.WASI_RIGHT_PATH_REMOVE_DIRECTORY|e.WASI_RIGHT_POLL_FD_READWRITE|e.WASI_RIGHT_SOCK_SHUTDOWN,e.RIGHTS_BLOCK_DEVICE_BASE=e.RIGHTS_ALL,e.RIGHTS_BLOCK_DEVICE_INHERITING=e.RIGHTS_ALL,e.RIGHTS_CHARACTER_DEVICE_BASE=e.RIGHTS_ALL,e.RIGHTS_CHARACTER_DEVICE_INHERITING=e.RIGHTS_ALL,e.RIGHTS_REGULAR_FILE_BASE=e.WASI_RIGHT_FD_DATASYNC|e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_SEEK|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_TELL|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_FD_ALLOCATE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_SIZE|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_REGULAR_FILE_INHERITING=n.BigIntPolyfill(0),e.RIGHTS_DIRECTORY_BASE=e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_PATH_CREATE_DIRECTORY|e.WASI_RIGHT_PATH_CREATE_FILE|e.WASI_RIGHT_PATH_LINK_SOURCE|e.WASI_RIGHT_PATH_LINK_TARGET|e.WASI_RIGHT_PATH_OPEN|e.WASI_RIGHT_FD_READDIR|e.WASI_RIGHT_PATH_READLINK|e.WASI_RIGHT_PATH_RENAME_SOURCE|e.WASI_RIGHT_PATH_RENAME_TARGET|e.WASI_RIGHT_PATH_FILESTAT_GET|e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_PATH_SYMLINK|e.WASI_RIGHT_PATH_UNLINK_FILE|e.WASI_RIGHT_PATH_REMOVE_DIRECTORY|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_DIRECTORY_INHERITING=e.RIGHTS_DIRECTORY_BASE|e.RIGHTS_REGULAR_FILE_BASE,e.RIGHTS_SOCKET_BASE=e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_POLL_FD_READWRITE|e.WASI_RIGHT_SOCK_SHUTDOWN,e.RIGHTS_SOCKET_INHERITING=e.RIGHTS_ALL,e.RIGHTS_TTY_BASE=e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_TTY_INHERITING=n.BigIntPolyfill(0),e.WASI_CLOCK_REALTIME=0,e.WASI_CLOCK_MONOTONIC=1,e.WASI_CLOCK_PROCESS_CPUTIME_ID=2,e.WASI_CLOCK_THREAD_CPUTIME_ID=3,e.WASI_EVENTTYPE_CLOCK=0,e.WASI_EVENTTYPE_FD_READ=1,e.WASI_EVENTTYPE_FD_WRITE=2,e.WASI_FILESTAT_SET_ATIM=1,e.WASI_FILESTAT_SET_ATIM_NOW=2,e.WASI_FILESTAT_SET_MTIM=4,e.WASI_FILESTAT_SET_MTIM_NOW=8,e.WASI_O_CREAT=1,e.WASI_O_DIRECTORY=2,e.WASI_O_EXCL=4,e.WASI_O_TRUNC=8,e.WASI_PREOPENTYPE_DIR=0,e.WASI_DIRCOOKIE_START=0,e.WASI_STDIN_FILENO=0,e.WASI_STDOUT_FILENO=1,e.WASI_STDERR_FILENO=2,e.WASI_WHENCE_SET=0,e.WASI_WHENCE_CUR=1,e.WASI_WHENCE_END=2,e.ERROR_MAP={E2BIG:e.WASI_E2BIG,EACCES:e.WASI_EACCES,EADDRINUSE:e.WASI_EADDRINUSE,EADDRNOTAVAIL:e.WASI_EADDRNOTAVAIL,EAFNOSUPPORT:e.WASI_EAFNOSUPPORT,EALREADY:e.WASI_EALREADY,EAGAIN:e.WASI_EAGAIN,EBADF:e.WASI_EBADF,EBADMSG:e.WASI_EBADMSG,EBUSY:e.WASI_EBUSY,ECANCELED:e.WASI_ECANCELED,ECHILD:e.WASI_ECHILD,ECONNABORTED:e.WASI_ECONNABORTED,ECONNREFUSED:e.WASI_ECONNREFUSED,ECONNRESET:e.WASI_ECONNRESET,EDEADLOCK:e.WASI_EDEADLK,EDESTADDRREQ:e.WASI_EDESTADDRREQ,EDOM:e.WASI_EDOM,EDQUOT:e.WASI_EDQUOT,EEXIST:e.WASI_EEXIST,EFAULT:e.WASI_EFAULT,EFBIG:e.WASI_EFBIG,EHOSTDOWN:e.WASI_EHOSTUNREACH,EHOSTUNREACH:e.WASI_EHOSTUNREACH,EIDRM:e.WASI_EIDRM,EILSEQ:e.WASI_EILSEQ,EINPROGRESS:e.WASI_EINPROGRESS,EINTR:e.WASI_EINTR,EINVAL:e.WASI_EINVAL,EIO:e.WASI_EIO,EISCONN:e.WASI_EISCONN,EISDIR:e.WASI_EISDIR,ELOOP:e.WASI_ELOOP,EMFILE:e.WASI_EMFILE,EMLINK:e.WASI_EMLINK,EMSGSIZE:e.WASI_EMSGSIZE,EMULTIHOP:e.WASI_EMULTIHOP,ENAMETOOLONG:e.WASI_ENAMETOOLONG,ENETDOWN:e.WASI_ENETDOWN,ENETRESET:e.WASI_ENETRESET,ENETUNREACH:e.WASI_ENETUNREACH,ENFILE:e.WASI_ENFILE,ENOBUFS:e.WASI_ENOBUFS,ENODEV:e.WASI_ENODEV,ENOENT:e.WASI_ENOENT,ENOEXEC:e.WASI_ENOEXEC,ENOLCK:e.WASI_ENOLCK,ENOLINK:e.WASI_ENOLINK,ENOMEM:e.WASI_ENOMEM,ENOMSG:e.WASI_ENOMSG,ENOPROTOOPT:e.WASI_ENOPROTOOPT,ENOSPC:e.WASI_ENOSPC,ENOSYS:e.WASI_ENOSYS,ENOTCONN:e.WASI_ENOTCONN,ENOTDIR:e.WASI_ENOTDIR,ENOTEMPTY:e.WASI_ENOTEMPTY,ENOTRECOVERABLE:e.WASI_ENOTRECOVERABLE,ENOTSOCK:e.WASI_ENOTSOCK,ENOTTY:e.WASI_ENOTTY,ENXIO:e.WASI_ENXIO,EOVERFLOW:e.WASI_EOVERFLOW,EOWNERDEAD:e.WASI_EOWNERDEAD,EPERM:e.WASI_EPERM,EPIPE:e.WASI_EPIPE,EPROTO:e.WASI_EPROTO,EPROTONOSUPPORT:e.WASI_EPROTONOSUPPORT,EPROTOTYPE:e.WASI_EPROTOTYPE,ERANGE:e.WASI_ERANGE,EROFS:e.WASI_EROFS,ESPIPE:e.WASI_ESPIPE,ESRCH:e.WASI_ESRCH,ESTALE:e.WASI_ESTALE,ETIMEDOUT:e.WASI_ETIMEDOUT,ETXTBSY:e.WASI_ETXTBSY,EXDEV:e.WASI_EXDEV},e.SIGNAL_MAP={[e.WASI_SIGHUP]:"SIGHUP",[e.WASI_SIGINT]:"SIGINT",[e.WASI_SIGQUIT]:"SIGQUIT",[e.WASI_SIGILL]:"SIGILL",[e.WASI_SIGTRAP]:"SIGTRAP",[e.WASI_SIGABRT]:"SIGABRT",[e.WASI_SIGBUS]:"SIGBUS",[e.WASI_SIGFPE]:"SIGFPE",[e.WASI_SIGKILL]:"SIGKILL",[e.WASI_SIGUSR1]:"SIGUSR1",[e.WASI_SIGSEGV]:"SIGSEGV",[e.WASI_SIGUSR2]:"SIGUSR2",[e.WASI_SIGPIPE]:"SIGPIPE",[e.WASI_SIGALRM]:"SIGALRM",[e.WASI_SIGTERM]:"SIGTERM",[e.WASI_SIGCHLD]:"SIGCHLD",[e.WASI_SIGCONT]:"SIGCONT",[e.WASI_SIGSTOP]:"SIGSTOP",[e.WASI_SIGTSTP]:"SIGTSTP",[e.WASI_SIGTTIN]:"SIGTTIN",[e.WASI_SIGTTOU]:"SIGTTOU",[e.WASI_SIGURG]:"SIGURG",[e.WASI_SIGXCPU]:"SIGXCPU",[e.WASI_SIGXFSZ]:"SIGXFSZ",[e.WASI_SIGVTALRM]:"SIGVTALRM"}},621:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(395),i=r(137),o=r(10);let s;const a=r(524),h=a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_SYNC|a.WASI_RIGHT_FD_ADVISE|a.WASI_RIGHT_FD_FILESTAT_GET|a.WASI_RIGHT_POLL_FD_READWRITE,u=a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_SYNC|a.WASI_RIGHT_FD_ADVISE|a.WASI_RIGHT_FD_FILESTAT_GET|a.WASI_RIGHT_POLL_FD_READWRITE,f=u,l=t=>{const e=Math.trunc(t),r=n.BigIntPolyfill(Math.round(1e6*(t-e)));return n.BigIntPolyfill(e)*n.BigIntPolyfill(1e6)+r},c=t=>{"number"==typeof t&&(t=Math.trunc(t));const e=n.BigIntPolyfill(t);return Number(e/n.BigIntPolyfill(1e6))},p=t=>(...e)=>{try{return t(...e)}catch(t){if(t&&t.code&&"string"==typeof t.code)return a.ERROR_MAP[t.code]||a.WASI_EINVAL;if(t instanceof m)return t.errno;throw t}},d=(t,e)=>{const r=t.FD_MAP.get(e);if(!r)throw new m(a.WASI_EBADF);if(void 0===r.filetype){const n=t.bindings.fs.fstatSync(r.real),{filetype:i,rightsBase:o,rightsInheriting:s}=_(t,e,n);r.filetype=i,r.rights||(r.rights={base:o,inheriting:s})}return r},_=(t,e,r)=>{switch(!0){case r.isBlockDevice():return{filetype:a.WASI_FILETYPE_BLOCK_DEVICE,rightsBase:a.RIGHTS_BLOCK_DEVICE_BASE,rightsInheriting:a.RIGHTS_BLOCK_DEVICE_INHERITING};case r.isCharacterDevice():{const r=a.WASI_FILETYPE_CHARACTER_DEVICE;return void 0!==e&&t.bindings.isTTY(e)?{filetype:r,rightsBase:a.RIGHTS_TTY_BASE,rightsInheriting:a.RIGHTS_TTY_INHERITING}:{filetype:r,rightsBase:a.RIGHTS_CHARACTER_DEVICE_BASE,rightsInheriting:a.RIGHTS_CHARACTER_DEVICE_INHERITING}}case r.isDirectory():return{filetype:a.WASI_FILETYPE_DIRECTORY,rightsBase:a.RIGHTS_DIRECTORY_BASE,rightsInheriting:a.RIGHTS_DIRECTORY_INHERITING};case r.isFIFO():return{filetype:a.WASI_FILETYPE_SOCKET_STREAM,rightsBase:a.RIGHTS_SOCKET_BASE,rightsInheriting:a.RIGHTS_SOCKET_INHERITING};case r.isFile():return{filetype:a.WASI_FILETYPE_REGULAR_FILE,rightsBase:a.RIGHTS_REGULAR_FILE_BASE,rightsInheriting:a.RIGHTS_REGULAR_FILE_INHERITING};case r.isSocket():return{filetype:a.WASI_FILETYPE_SOCKET_STREAM,rightsBase:a.RIGHTS_SOCKET_BASE,rightsInheriting:a.RIGHTS_SOCKET_INHERITING};case r.isSymbolicLink():return{filetype:a.WASI_FILETYPE_SYMBOLIC_LINK,rightsBase:n.BigIntPolyfill(0),rightsInheriting:n.BigIntPolyfill(0)};default:return{filetype:a.WASI_FILETYPE_UNKNOWN,rightsBase:n.BigIntPolyfill(0),rightsInheriting:n.BigIntPolyfill(0)}}};class m extends Error{constructor(t){super(),this.errno=t,Object.setPrototypeOf(this,m.prototype)}}e.WASIError=m;class g extends Error{constructor(t){super(`WASI Exit error: ${t}`),this.code=t,Object.setPrototypeOf(this,g.prototype)}}e.WASIExitError=g;class y extends Error{constructor(t){super(`WASI Kill signal: ${t}`),this.signal=t,Object.setPrototypeOf(this,y.prototype)}}e.WASIKillError=y;class E{constructor(t){let e={};t&&t.preopens?e=t.preopens:t&&t.preopenDirectories&&(e=t.preopenDirectories);let r={};t&&t.env&&(r=t.env);let i=[];t&&t.args&&(i=t.args);let g=s;t&&t.bindings&&(g=t.bindings),this.memory=void 0,this.view=void 0,this.bindings=g,this.FD_MAP=new Map([[a.WASI_STDIN_FILENO,{real:0,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:h,inheriting:n.BigIntPolyfill(0)},path:void 0}],[a.WASI_STDOUT_FILENO,{real:1,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:u,inheriting:n.BigIntPolyfill(0)},path:void 0}],[a.WASI_STDERR_FILENO,{real:2,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:f,inheriting:n.BigIntPolyfill(0)},path:void 0}]]);let y=this.bindings.fs,E=this.bindings.path;for(const[t,r]of Object.entries(e)){const e=y.openSync(r,y.constants.O_RDONLY),n=[...this.FD_MAP.keys()].reverse()[0]+1;this.FD_MAP.set(n,{real:e,filetype:a.WASI_FILETYPE_DIRECTORY,rights:{base:a.RIGHTS_DIRECTORY_BASE,inheriting:a.RIGHTS_DIRECTORY_INHERITING},fakePath:t,path:r})}const w=(t,e)=>(this.refreshMemory(),Array.from({length:e},((e,r)=>{const n=t+8*r,i=this.view.getUint32(n,!0),o=this.view.getUint32(n+4,!0);return new Uint8Array(this.memory.buffer,i,o)}))),S=(t,e)=>{const r=d(this,t);if(e!==n.BigIntPolyfill(0)&&(r.rights.base&e)===n.BigIntPolyfill(0))throw new m(a.WASI_EPERM);return r},I=g.hrtime(),v=t=>{switch(t){case a.WASI_CLOCK_MONOTONIC:return g.hrtime();case a.WASI_CLOCK_REALTIME:return l(Date.now());case a.WASI_CLOCK_PROCESS_CPUTIME_ID:case a.WASI_CLOCK_THREAD_CPUTIME_ID:return g.hrtime()-I;default:return null}};this.wasiImport={args_get:(t,e)=>{this.refreshMemory();let r=t,n=e;return i.forEach((t=>{this.view.setUint32(r,n,!0),r+=4,n+=o.default.from(this.memory.buffer).write(`${t}\0`,n)})),a.WASI_ESUCCESS},args_sizes_get:(t,e)=>{this.refreshMemory(),this.view.setUint32(t,i.length,!0);const r=i.reduce(((t,e)=>t+o.default.byteLength(e)+1),0);return this.view.setUint32(e,r,!0),a.WASI_ESUCCESS},environ_get:(t,e)=>{this.refreshMemory();let n=t,i=e;return Object.entries(r).forEach((([t,e])=>{this.view.setUint32(n,i,!0),n+=4,i+=o.default.from(this.memory.buffer).write(`${t}=${e}\0`,i)})),a.WASI_ESUCCESS},environ_sizes_get:(t,e)=>{this.refreshMemory();const n=Object.entries(r).map((([t,e])=>`${t}=${e}\0`)),i=n.reduce(((t,e)=>t+o.default.byteLength(e)),0);return this.view.setUint32(t,n.length,!0),this.view.setUint32(e,i,!0),a.WASI_ESUCCESS},clock_res_get:(t,e)=>{let r;switch(t){case a.WASI_CLOCK_MONOTONIC:case a.WASI_CLOCK_PROCESS_CPUTIME_ID:case a.WASI_CLOCK_THREAD_CPUTIME_ID:r=n.BigIntPolyfill(1);break;case a.WASI_CLOCK_REALTIME:r=n.BigIntPolyfill(1e3)}return this.view.setBigUint64(e,r),a.WASI_ESUCCESS},clock_time_get:(t,e,r)=>{this.refreshMemory();const i=v(t);return null===i?a.WASI_EINVAL:(this.view.setBigUint64(r,n.BigIntPolyfill(i),!0),a.WASI_ESUCCESS)},fd_advise:p(((t,e,r,n)=>(S(t,a.WASI_RIGHT_FD_ADVISE),a.WASI_ENOSYS))),fd_allocate:p(((t,e,r)=>(S(t,a.WASI_RIGHT_FD_ALLOCATE),a.WASI_ENOSYS))),fd_close:p((t=>{const e=S(t,n.BigIntPolyfill(0));return y.closeSync(e.real),this.FD_MAP.delete(t),a.WASI_ESUCCESS})),fd_datasync:p((t=>{const e=S(t,a.WASI_RIGHT_FD_DATASYNC);return y.fdatasyncSync(e.real),a.WASI_ESUCCESS})),fd_fdstat_get:p(((t,e)=>{const r=S(t,n.BigIntPolyfill(0));return this.refreshMemory(),this.view.setUint8(e,r.filetype),this.view.setUint16(e+2,0,!0),this.view.setUint16(e+4,0,!0),this.view.setBigUint64(e+8,n.BigIntPolyfill(r.rights.base),!0),this.view.setBigUint64(e+8+8,n.BigIntPolyfill(r.rights.inheriting),!0),a.WASI_ESUCCESS})),fd_fdstat_set_flags:p(((t,e)=>(S(t,a.WASI_RIGHT_FD_FDSTAT_SET_FLAGS),a.WASI_ENOSYS))),fd_fdstat_set_rights:p(((t,e,r)=>{const i=S(t,n.BigIntPolyfill(0));return(i.rights.base|e)>i.rights.base||(i.rights.inheriting|r)>i.rights.inheriting?a.WASI_EPERM:(i.rights.base=e,i.rights.inheriting=r,a.WASI_ESUCCESS)})),fd_filestat_get:p(((t,e)=>{const r=S(t,a.WASI_RIGHT_FD_FILESTAT_GET),i=y.fstatSync(r.real);return this.refreshMemory(),this.view.setBigUint64(e,n.BigIntPolyfill(i.dev),!0),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.ino),!0),e+=8,this.view.setUint8(e,r.filetype),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.nlink),!0),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.size),!0),e+=8,this.view.setBigUint64(e,l(i.atimeMs),!0),e+=8,this.view.setBigUint64(e,l(i.mtimeMs),!0),e+=8,this.view.setBigUint64(e,l(i.ctimeMs),!0),a.WASI_ESUCCESS})),fd_filestat_set_size:p(((t,e)=>{const r=S(t,a.WASI_RIGHT_FD_FILESTAT_SET_SIZE);return y.ftruncateSync(r.real,Number(e)),a.WASI_ESUCCESS})),fd_filestat_set_times:p(((t,e,r,n)=>{const i=S(t,a.WASI_RIGHT_FD_FILESTAT_SET_TIMES),o=y.fstatSync(i.real);let s=o.atime,h=o.mtime;const u=c(v(a.WASI_CLOCK_REALTIME)),f=a.WASI_FILESTAT_SET_ATIM|a.WASI_FILESTAT_SET_ATIM_NOW;if((n&f)===f)return a.WASI_EINVAL;const l=a.WASI_FILESTAT_SET_MTIM|a.WASI_FILESTAT_SET_MTIM_NOW;return(n&l)===l?a.WASI_EINVAL:((n&a.WASI_FILESTAT_SET_ATIM)===a.WASI_FILESTAT_SET_ATIM?s=c(e):(n&a.WASI_FILESTAT_SET_ATIM_NOW)===a.WASI_FILESTAT_SET_ATIM_NOW&&(s=u),(n&a.WASI_FILESTAT_SET_MTIM)===a.WASI_FILESTAT_SET_MTIM?h=c(r):(n&a.WASI_FILESTAT_SET_MTIM_NOW)===a.WASI_FILESTAT_SET_MTIM_NOW&&(h=u),y.futimesSync(i.real,new Date(s),new Date(h)),a.WASI_ESUCCESS)})),fd_prestat_get:p(((t,e)=>{const r=S(t,n.BigIntPolyfill(0));return r.path?(this.refreshMemory(),this.view.setUint8(e,a.WASI_PREOPENTYPE_DIR),this.view.setUint32(e+4,o.default.byteLength(r.fakePath),!0),a.WASI_ESUCCESS):a.WASI_EINVAL})),fd_prestat_dir_name:p(((t,e,r)=>{const i=S(t,n.BigIntPolyfill(0));return i.path?(this.refreshMemory(),o.default.from(this.memory.buffer).write(i.fakePath,e,r,"utf8"),a.WASI_ESUCCESS):a.WASI_EINVAL})),fd_pwrite:p(((t,e,r,n,i)=>{const o=S(t,a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_SEEK);let s=0;return w(e,r).forEach((t=>{let e=0;for(;e<t.byteLength;)e+=y.writeSync(o.real,t,e,t.byteLength-e,Number(n)+s+e);s+=e})),this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_write:p(((t,e,r,i)=>{const o=S(t,a.WASI_RIGHT_FD_WRITE);let s=0;return w(e,r).forEach((t=>{let e=0;for(;e<t.byteLength;){const r=y.writeSync(o.real,t,e,t.byteLength-e,o.offset?Number(o.offset):null);o.offset&&(o.offset+=n.BigIntPolyfill(r)),e+=r}s+=e})),this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_pread:p(((t,e,r,n,i)=>{const o=S(t,a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_SEEK);let s=0;t:for(const t of w(e,r)){let e=0;for(;e<t.byteLength;){const r=t.byteLength-e,i=y.readSync(o.real,t,e,t.byteLength-e,Number(n)+s+e);if(e+=i,s+=i,0===i||i<r)break t}s+=e}return this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_read:p(((t,e,r,i)=>{const o=S(t,a.WASI_RIGHT_FD_READ),s=0===o.real;let h=0;t:for(const t of w(e,r)){let e=0;for(;e<t.byteLength;){let r=t.byteLength-e,i=s||void 0===o.offset?null:Number(o.offset),a=y.readSync(o.real,t,e,r,i);if(s||(o.offset=(o.offset?o.offset:n.BigIntPolyfill(0))+n.BigIntPolyfill(a)),e+=a,h+=a,0===a||a<r)break t}}return this.view.setUint32(i,h,!0),a.WASI_ESUCCESS})),fd_readdir:p(((t,e,r,i,s)=>{const h=S(t,a.WASI_RIGHT_FD_READDIR);this.refreshMemory();const u=y.readdirSync(h.path,{withFileTypes:!0}),f=e;for(let t=Number(i);t<u.length;t+=1){const i=u[t];let s=o.default.byteLength(i.name);if(e-f>r)break;if(this.view.setBigUint64(e,n.BigIntPolyfill(t+1),!0),(e+=8)-f>r)break;const l=y.statSync(E.resolve(h.path,i.name));if(this.view.setBigUint64(e,n.BigIntPolyfill(l.ino),!0),(e+=8)-f>r)break;if(this.view.setUint32(e,s,!0),(e+=4)-f>r)break;let c;switch(!0){case l.isBlockDevice():c=a.WASI_FILETYPE_BLOCK_DEVICE;break;case l.isCharacterDevice():c=a.WASI_FILETYPE_CHARACTER_DEVICE;break;case l.isDirectory():c=a.WASI_FILETYPE_DIRECTORY;break;case l.isFIFO():c=a.WASI_FILETYPE_SOCKET_STREAM;break;case l.isFile():c=a.WASI_FILETYPE_REGULAR_FILE;break;case l.isSocket():c=a.WASI_FILETYPE_SOCKET_STREAM;break;case l.isSymbolicLink():c=a.WASI_FILETYPE_SYMBOLIC_LINK;break;default:c=a.WASI_FILETYPE_UNKNOWN}if(this.view.setUint8(e,c),e+=1,(e+=3)+s>=f+r)break;o.default.from(this.memory.buffer).write(i.name,e),e+=s}const l=e-f;return this.view.setUint32(s,Math.min(l,r),!0),a.WASI_ESUCCESS})),fd_renumber:p(((t,e)=>(S(t,n.BigIntPolyfill(0)),S(e,n.BigIntPolyfill(0)),y.closeSync(this.FD_MAP.get(t).real),this.FD_MAP.set(t,this.FD_MAP.get(e)),this.FD_MAP.delete(e),a.WASI_ESUCCESS))),fd_seek:p(((t,e,r,i)=>{const o=S(t,a.WASI_RIGHT_FD_SEEK);switch(this.refreshMemory(),r){case a.WASI_WHENCE_CUR:o.offset=(o.offset?o.offset:n.BigIntPolyfill(0))+n.BigIntPolyfill(e);break;case a.WASI_WHENCE_END:const{size:t}=y.fstatSync(o.real);o.offset=n.BigIntPolyfill(t)+n.BigIntPolyfill(e);break;case a.WASI_WHENCE_SET:o.offset=n.BigIntPolyfill(e)}return this.view.setBigUint64(i,o.offset,!0),a.WASI_ESUCCESS})),fd_tell:p(((t,e)=>{const r=S(t,a.WASI_RIGHT_FD_TELL);return this.refreshMemory(),r.offset||(r.offset=n.BigIntPolyfill(0)),this.view.setBigUint64(e,r.offset,!0),a.WASI_ESUCCESS})),fd_sync:p((t=>{const e=S(t,a.WASI_RIGHT_FD_SYNC);return y.fsyncSync(e.real),a.WASI_ESUCCESS})),path_create_directory:p(((t,e,r)=>{const n=S(t,a.WASI_RIGHT_PATH_CREATE_DIRECTORY);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return y.mkdirSync(E.resolve(n.path,i)),a.WASI_ESUCCESS})),path_filestat_get:p(((t,e,r,i,s)=>{const h=S(t,a.WASI_RIGHT_PATH_FILESTAT_GET);if(!h.path)return a.WASI_EINVAL;this.refreshMemory();const u=o.default.from(this.memory.buffer,r,i).toString(),f=y.statSync(E.resolve(h.path,u));return this.view.setBigUint64(s,n.BigIntPolyfill(f.dev),!0),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(f.ino),!0),s+=8,this.view.setUint8(s,_(this,void 0,f).filetype),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(f.nlink),!0),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(f.size),!0),s+=8,this.view.setBigUint64(s,l(f.atimeMs),!0),s+=8,this.view.setBigUint64(s,l(f.mtimeMs),!0),s+=8,this.view.setBigUint64(s,l(f.ctimeMs),!0),a.WASI_ESUCCESS})),path_filestat_set_times:p(((t,e,r,n,i,s,h)=>{const u=S(t,a.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);if(!u.path)return a.WASI_EINVAL;this.refreshMemory();const f=y.fstatSync(u.real);let l=f.atime,p=f.mtime;const d=c(v(a.WASI_CLOCK_REALTIME)),_=a.WASI_FILESTAT_SET_ATIM|a.WASI_FILESTAT_SET_ATIM_NOW;if((h&_)===_)return a.WASI_EINVAL;const m=a.WASI_FILESTAT_SET_MTIM|a.WASI_FILESTAT_SET_MTIM_NOW;if((h&m)===m)return a.WASI_EINVAL;(h&a.WASI_FILESTAT_SET_ATIM)===a.WASI_FILESTAT_SET_ATIM?l=c(i):(h&a.WASI_FILESTAT_SET_ATIM_NOW)===a.WASI_FILESTAT_SET_ATIM_NOW&&(l=d),(h&a.WASI_FILESTAT_SET_MTIM)===a.WASI_FILESTAT_SET_MTIM?p=c(s):(h&a.WASI_FILESTAT_SET_MTIM_NOW)===a.WASI_FILESTAT_SET_MTIM_NOW&&(p=d);const g=o.default.from(this.memory.buffer,r,n).toString();return y.utimesSync(E.resolve(u.path,g),new Date(l),new Date(p)),a.WASI_ESUCCESS})),path_link:p(((t,e,r,n,i,s,h)=>{const u=S(t,a.WASI_RIGHT_PATH_LINK_SOURCE),f=S(i,a.WASI_RIGHT_PATH_LINK_TARGET);if(!u.path||!f.path)return a.WASI_EINVAL;this.refreshMemory();const l=o.default.from(this.memory.buffer,r,n).toString(),c=o.default.from(this.memory.buffer,s,h).toString();return y.linkSync(E.resolve(u.path,l),E.resolve(f.path,c)),a.WASI_ESUCCESS})),path_open:p(((t,e,r,i,s,h,u,f,l)=>{const c=S(t,a.WASI_RIGHT_PATH_OPEN);h=n.BigIntPolyfill(h),u=n.BigIntPolyfill(u);const p=(h&(a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_READDIR))!==n.BigIntPolyfill(0),_=(h&(a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_ALLOCATE|a.WASI_RIGHT_FD_FILESTAT_SET_SIZE))!==n.BigIntPolyfill(0);let m;_&&p?m=y.constants.O_RDWR:p?m=y.constants.O_RDONLY:_&&(m=y.constants.O_WRONLY);let g=h|a.WASI_RIGHT_PATH_OPEN,w=h|u;s&a.WASI_O_CREAT&&(m|=y.constants.O_CREAT,g|=a.WASI_RIGHT_PATH_CREATE_FILE),s&a.WASI_O_DIRECTORY&&(m|=y.constants.O_DIRECTORY),s&a.WASI_O_EXCL&&(m|=y.constants.O_EXCL),s&a.WASI_O_TRUNC&&(m|=y.constants.O_TRUNC,g|=a.WASI_RIGHT_PATH_FILESTAT_SET_SIZE),f&a.WASI_FDFLAG_APPEND&&(m|=y.constants.O_APPEND),f&a.WASI_FDFLAG_DSYNC&&(y.constants.O_DSYNC?m|=y.constants.O_DSYNC:m|=y.constants.O_SYNC,w|=a.WASI_RIGHT_FD_DATASYNC),f&a.WASI_FDFLAG_NONBLOCK&&(m|=y.constants.O_NONBLOCK),f&a.WASI_FDFLAG_RSYNC&&(y.constants.O_RSYNC?m|=y.constants.O_RSYNC:m|=y.constants.O_SYNC,w|=a.WASI_RIGHT_FD_SYNC),f&a.WASI_FDFLAG_SYNC&&(m|=y.constants.O_SYNC,w|=a.WASI_RIGHT_FD_SYNC),!_||m&(y.constants.O_APPEND|y.constants.O_TRUNC)||(w|=a.WASI_RIGHT_FD_SEEK),this.refreshMemory();const I=o.default.from(this.memory.buffer,r,i).toString(),v=E.resolve(c.path,I);if(E.relative(c.path,v).startsWith(".."))return a.WASI_ENOTCAPABLE;let A,b,T;try{if(A=y.realpathSync(v),E.relative(c.path,A).startsWith(".."))return a.WASI_ENOTCAPABLE}catch(t){if("ENOENT"!==t.code)throw t;A=v}try{b=y.statSync(A).isDirectory()}catch(t){}T=!_&&b?y.openSync(A,y.constants.O_RDONLY):y.openSync(A,m);const R=[...this.FD_MAP.keys()].reverse()[0]+1;return this.FD_MAP.set(R,{real:T,filetype:void 0,rights:{base:g,inheriting:w},path:A}),d(this,R),this.view.setUint32(l,R,!0),a.WASI_ESUCCESS})),path_readlink:p(((t,e,r,n,i,s)=>{const h=S(t,a.WASI_RIGHT_PATH_READLINK);if(!h.path)return a.WASI_EINVAL;this.refreshMemory();const u=o.default.from(this.memory.buffer,e,r).toString(),f=E.resolve(h.path,u),l=y.readlinkSync(f),c=o.default.from(this.memory.buffer).write(l,n,i);return this.view.setUint32(s,c,!0),a.WASI_ESUCCESS})),path_remove_directory:p(((t,e,r)=>{const n=S(t,a.WASI_RIGHT_PATH_REMOVE_DIRECTORY);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return y.rmdirSync(E.resolve(n.path,i)),a.WASI_ESUCCESS})),path_rename:p(((t,e,r,n,i,s)=>{const h=S(t,a.WASI_RIGHT_PATH_RENAME_SOURCE),u=S(n,a.WASI_RIGHT_PATH_RENAME_TARGET);if(!h.path||!u.path)return a.WASI_EINVAL;this.refreshMemory();const f=o.default.from(this.memory.buffer,e,r).toString(),l=o.default.from(this.memory.buffer,i,s).toString();return y.renameSync(E.resolve(h.path,f),E.resolve(u.path,l)),a.WASI_ESUCCESS})),path_symlink:p(((t,e,r,n,i)=>{const s=S(r,a.WASI_RIGHT_PATH_SYMLINK);if(!s.path)return a.WASI_EINVAL;this.refreshMemory();const h=o.default.from(this.memory.buffer,t,e).toString(),u=o.default.from(this.memory.buffer,n,i).toString();return y.symlinkSync(h,E.resolve(s.path,u)),a.WASI_ESUCCESS})),path_unlink_file:p(((t,e,r)=>{const n=S(t,a.WASI_RIGHT_PATH_UNLINK_FILE);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return y.unlinkSync(E.resolve(n.path,i)),a.WASI_ESUCCESS})),poll_oneoff:(t,e,r,i)=>{let o=0,s=0;this.refreshMemory();for(let i=0;i<r;i+=1){const r=this.view.getBigUint64(t,!0);t+=8;const i=this.view.getUint8(t);switch(t+=1,i){case a.WASI_EVENTTYPE_CLOCK:{t+=7,this.view.getBigUint64(t,!0),t+=8;const i=this.view.getUint32(t,!0);t+=4,t+=4;const h=this.view.getBigUint64(t,!0);t+=8,this.view.getBigUint64(t,!0),t+=8;const u=this.view.getUint16(t,!0);t+=2,t+=6;const f=1===u;let l=a.WASI_ESUCCESS;const c=n.BigIntPolyfill(v(i));if(null===c)l=a.WASI_EINVAL;else{const t=f?h:c+h;s=t>s?t:s}this.view.setBigUint64(e,r,!0),e+=8,this.view.setUint16(e,l,!0),e+=2,this.view.setUint8(e,a.WASI_EVENTTYPE_CLOCK),e+=1,e+=5,o+=1;break}case a.WASI_EVENTTYPE_FD_READ:case a.WASI_EVENTTYPE_FD_WRITE:t+=3,this.view.getUint32(t,!0),t+=4,this.view.setBigUint64(e,r,!0),e+=8,this.view.setUint16(e,a.WASI_ENOSYS,!0),e+=2,this.view.setUint8(e,i),e+=1,e+=5,o+=1;break;default:return a.WASI_EINVAL}}for(this.view.setUint32(i,o,!0);g.hrtime()<s;);return a.WASI_ESUCCESS},proc_exit:t=>(g.exit(t),a.WASI_ESUCCESS),proc_raise:t=>t in a.SIGNAL_MAP?(g.kill(a.SIGNAL_MAP[t]),a.WASI_ESUCCESS):a.WASI_EINVAL,random_get:(t,e)=>(this.refreshMemory(),g.randomFillSync(new Uint8Array(this.memory.buffer),t,e),a.WASI_ESUCCESS),sched_yield:()=>a.WASI_ESUCCESS,sock_recv:()=>a.WASI_ENOSYS,sock_send:()=>a.WASI_ENOSYS,sock_shutdown:()=>a.WASI_ENOSYS},t.traceSyscalls&&Object.keys(this.wasiImport).forEach((t=>{const e=this.wasiImport[t];this.wasiImport[t]=function(...r){console.log(`WASI: wasiImport called: ${t} (${r})`);try{let t=e(...r);return console.log(`WASI: => ${t}`),t}catch(t){throw console.log(`Catched error: ${t}`),t}}}))}refreshMemory(){this.view&&0!==this.view.buffer.byteLength||(this.view=new i.DataViewPolyfill(this.memory.buffer))}setMemory(t){this.memory=t}start(t){const e=t.exports;if(null===e||"object"!=typeof e)throw new Error(`instance.exports must be an Object. Received ${e}.`);const{memory:r}=e;if(!(r instanceof WebAssembly.Memory))throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${r}.`);this.setMemory(r),e._start&&e._start()}getImportNamespace(t){let e=null;for(let r of WebAssembly.Module.imports(t))if("function"===r.kind&&r.module.startsWith("wasi_"))if(e){if(e!==r.module)throw new Error("Multiple namespaces detected.")}else e=r.module;return e}getImports(t){switch(this.getImportNamespace(t)){case"wasi_unstable":return{wasi_unstable:this.wasiImport};case"wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw new Error("Can't detect a WASI namespace for the WebAssembly Module")}}}e.default=E,E.defaultBindings=s,e.WASI=E},395:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:{};e.BigIntPolyfill="undefined"!=typeof BigInt?BigInt:n.BigInt||Number},32:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=Math.floor(.001*(Date.now()-performance.now()));e.default=function(t){let e=.001*performance.now(),n=Math.floor(e)+r,i=Math.floor(e%1*1e9);return t&&(n-=t[0],i-=t[1],i<0&&(n--,i+=1e9)),[n,i]}},10:(t,e,r)=>{"use strict";var n=r(287).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const i=n;e.default=i},137:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(395);let i=DataView;i.prototype.setBigUint64||(i.prototype.setBigUint64=function(t,e,r){let n,i;if(e<2**32)n=Number(e),i=0;else{for(var o=e.toString(2),s="",a=0;a<64-o.length;a++)s+="0";s+=o,i=parseInt(s.substring(0,32),2),n=parseInt(s.substring(32),2)}this.setUint32(t+(r?0:4),n,r),this.setUint32(t+(r?4:0),i,r)},i.prototype.getBigUint64=function(t,e){let r=this.getUint32(t+(e?0:4),e),i=this.getUint32(t+(e?4:0),e);for(var o=r.toString(2),s=i.toString(2),a="",h=0;h<32-o.length;h++)a+="0";return a+=o,n.BigIntPolyfill("0b"+s+a)}),e.DataViewPolyfill=i},918:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=t=>e=>{const r=t(e);return 1e9*r[0]+r[1]}},526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],h=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,h)),f=0,l=h>0?s-4:s;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===h&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===h&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(h(t,a,a+s>u?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},287:(t,e,r)=>{"use strict";var n=r(526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50;var s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,h.prototype),e}function h(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|_(t,e),n=a(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return h.from(n,e,r);var i=function(t){if(h.isBuffer(t)){var e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||H(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),a(t<0?0:0|d(t))}function c(t){for(var e=t.length<0?0:0|d(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,h.prototype),n}function d(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function _(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return M(t).length;default:if(i)return n?-1:U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return b(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,i){var o,s=1,a=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===h)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+h>a&&(r=a-h),o=r;o>=0;o--){for(var l=!0,c=0;c<h;c++)if(u(t,o+c)!==u(e,c)){l=!1;break}if(l)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(H(a))return s;t[r+s]=a}return s}function S(t,e,r,n){return x(U(e,t.length-r),t,r,n)}function I(t,e,r,n){return x(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function v(t,e,r,n){return x(M(e),t,r,n)}function A(t,e,r,n){return x(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function b(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,h,u=t[i],f=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[i+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=R));return r}(n)}e.kMaxLength=s,h.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),h.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),h.poolSize=8192,h.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(h.prototype,Uint8Array.prototype),Object.setPrototypeOf(h,Uint8Array),h.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},h.allocUnsafe=function(t){return l(t)},h.allocUnsafeSlow=function(t){return l(t)},h.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==h.prototype},h.compare=function(t,e){if(G(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},h.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=h.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(G(o,Uint8Array))i+o.length>n.length?h.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!h.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},h.byteLength=_,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},h.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},h.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},h.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):m.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(h.prototype[o]=h.prototype.inspect),h.prototype.compare=function(t,e,r,n,i){if(G(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),f=t.slice(e,r),l=0;l<a;++l)if(u[l]!==f[l]){o=u[l],s=f[l];break}return o<s?-1:s<o?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},h.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":case"latin1":case"binary":return I(this,t,e,r);case"base64":return v(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function N(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Y[t[o]];return i}function P(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function k(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function W(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,o){return e=+e,r>>>=0,o||W(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||W(t,0,r,8),i.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,h.prototype),n},h.prototype.readUintLE=h.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},h.prototype.readUintBE=h.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},h.prototype.readUint8=h.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return t>>>=0,e||k(t,4,this.length),i.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),i.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),i.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),i.read(this,t,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},h.prototype.writeUint8=h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},h.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=h.isBuffer(t)?t:h.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var D=/[^+/0-9A-Za-z-_]/g;function U(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function M(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function x(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function H(t){return t!=t}var Y=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,h=(1<<a)-1,u=h>>1,f=-7,l=r?i-1:0,c=r?-1:1,p=t[e+l];for(l+=c,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=c,f-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,h,u=8*o-i-1,f=(1<<u)-1,l=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*h-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*_}},13:function(t,e){var r,n;void 0===(n="function"==typeof(r=function(){"use strict";function t(t){function e(t){for(var e=0,i=r.length;e<i;++e)r[e](t);n.push(t)}if("function"!=typeof Promise)throw new Error("Promise implementation not available in this environment.");var r=[],n=[],i=new Promise((function(r,n){t(r,n,e)}));i.progress=function(t){if("function"!=typeof t)throw new Error("cb is not a function.");for(var e=0,o=n.length;e<o;++e)t(n[e]);return r.push(t),i};var o=i.then;return i.then=function(t,e,r){return o.call(i,t,e),void 0!==r&&i.progress(r),i},i}function e(t){return Object.defineProperties(t,o),t}var r,n=window||this,i=n.URL||n.webkitURL,o={blob:{get:function(){return this._blob||(this._blob=new Blob([this.buffer]))}},getBlobUrl:{value:function(){return this._blobUrl||(this._blobUrl=i.createObjectURL(this.blob))}},readAsString:{value:function(){for(var t=this.buffer,e=t.byteLength,r=new DataView(t),n=[],i=0;i<e;++i){var o=r.getUint8(1*i,!0);n.push(o)}return this._string=String.fromCharCode.apply(null,n)}},readAsJSON:{value:function(){return JSON.parse(this.readAsString())}}};return r=(window||this).URL.createObjectURL(new Blob(['"use strict";function UntarWorker(){}function decodeUTF8(e){for(var r="",t=0;t<e.length;){var a=e[t++];if(a>127){if(a>191&&a<224){if(t>=e.length)throw"UTF-8 decode: incomplete 2-byte sequence";a=(31&a)<<6|63&e[t]}else if(a>223&&a<240){if(t+1>=e.length)throw"UTF-8 decode: incomplete 3-byte sequence";a=(15&a)<<12|(63&e[t])<<6|63&e[++t]}else{if(!(a>239&&a<248))throw"UTF-8 decode: unknown multibyte start 0x"+a.toString(16)+" at index "+(t-1);if(t+2>=e.length)throw"UTF-8 decode: incomplete 4-byte sequence";a=(7&a)<<18|(63&e[t])<<12|(63&e[++t])<<6|63&e[++t]}++t}if(a<=65535)r+=String.fromCharCode(a);else{if(!(a<=1114111))throw"UTF-8 decode: code point 0x"+a.toString(16)+" exceeds UTF-16 reach";a-=65536,r+=String.fromCharCode(a>>10|55296),r+=String.fromCharCode(1023&a|56320)}}return r}function PaxHeader(e){this._fields=e}function TarFile(){}function UntarStream(e){this._bufferView=new DataView(e),this._position=0}function UntarFileStream(e){this._stream=new UntarStream(e),this._globalPaxHeader=null}if(UntarWorker.prototype={onmessage:function(e){try{if("extract"!==e.data.type)throw new Error("Unknown message type: "+e.data.type);this.untarBuffer(e.data.buffer)}catch(r){this.postError(r)}},postError:function(e){this.postMessage({type:"error",data:{message:e.message}})},postLog:function(e,r){this.postMessage({type:"log",data:{level:e,msg:r}})},untarBuffer:function(e){try{for(var r=new UntarFileStream(e);r.hasNext();){var t=r.next();this.postMessage({type:"extract",data:t},[t.buffer])}this.postMessage({type:"complete"})}catch(a){this.postError(a)}},postMessage:function(e,r){self.postMessage(e,r)}},"undefined"!=typeof self){var worker=new UntarWorker;self.onmessage=function(e){worker.onmessage(e)}}PaxHeader.parse=function(e){for(var r=new Uint8Array(e),t=[];r.length>0;){var a=parseInt(decodeUTF8(r.subarray(0,r.indexOf(32)))),n=decodeUTF8(r.subarray(0,a)),i=n.match(/^\\d+ ([^=]+)=(.*)\\n$/);if(null===i)throw new Error("Invalid PAX header data format.");var s=i[1],o=i[2];0===o.length?o=null:null!==o.match(/^\\d+$/)&&(o=parseInt(o));var f={name:s,value:o};t.push(f),r=r.subarray(a)}return new PaxHeader(t)},PaxHeader.prototype={applyHeader:function(e){this._fields.forEach(function(r){var t=r.name,a=r.value;"path"===t?(t="name",void 0!==e.prefix&&delete e.prefix):"linkpath"===t&&(t="linkname"),null===a?delete e[t]:e[t]=a})}},UntarStream.prototype={readString:function(e){for(var r=1,t=e*r,a=[],n=0;n<e;++n){var i=this._bufferView.getUint8(this.position()+n*r,!0);if(0===i)break;a.push(i)}return this.seek(t),String.fromCharCode.apply(null,a)},readBuffer:function(e){var r;if("function"==typeof ArrayBuffer.prototype.slice)r=this._bufferView.buffer.slice(this.position(),this.position()+e);else{r=new ArrayBuffer(e);var t=new Uint8Array(r),a=new Uint8Array(this._bufferView.buffer,this.position(),e);t.set(a)}return this.seek(e),r},seek:function(e){this._position+=e},peekUint32:function(){return this._bufferView.getUint32(this.position(),!0)},position:function(e){return void 0===e?this._position:void(this._position=e)},size:function(){return this._bufferView.byteLength}},UntarFileStream.prototype={hasNext:function(){return this._stream.position()+4<this._stream.size()&&0!==this._stream.peekUint32()},next:function(){return this._readNextFile()},_readNextFile:function(){var e=this._stream,r=new TarFile,t=!1,a=null,n=e.position(),i=n+512;switch(r.name=e.readString(100),r.mode=e.readString(8),r.uid=parseInt(e.readString(8)),r.gid=parseInt(e.readString(8)),r.size=parseInt(e.readString(12),8),r.mtime=parseInt(e.readString(12),8),r.checksum=parseInt(e.readString(8)),r.type=e.readString(1),r.linkname=e.readString(100),r.ustarFormat=e.readString(6),r.ustarFormat.indexOf("ustar")>-1&&(r.version=e.readString(2),r.uname=e.readString(32),r.gname=e.readString(32),r.devmajor=parseInt(e.readString(8)),r.devminor=parseInt(e.readString(8)),r.namePrefix=e.readString(155),r.namePrefix.length>0&&(r.name=r.namePrefix+"/"+r.name)),e.position(i),r.type){case"0":case"":r.buffer=e.readBuffer(r.size);break;case"1":break;case"2":break;case"3":break;case"4":break;case"5":break;case"6":break;case"7":break;case"g":t=!0,this._globalPaxHeader=PaxHeader.parse(e.readBuffer(r.size));break;case"x":t=!0,a=PaxHeader.parse(e.readBuffer(r.size))}void 0===r.buffer&&(r.buffer=new ArrayBuffer(0));var s=i+r.size;return r.size%512!==0&&(s+=512-r.size%512),e.position(s),t&&(r=this._readNextFile()),null!==this._globalPaxHeader&&this._globalPaxHeader.applyHeader(r),null!==a&&a.applyHeader(r),r}};'])),function(i){if(!(i instanceof ArrayBuffer))throw new TypeError("arrayBuffer is not an instance of ArrayBuffer.");if(!n.Worker)throw new Error("Worker implementation is not available in this environment.");return new t((function(t,n,o){var s=new Worker(r),a=[];s.onerror=function(t){n(t)},s.onmessage=function(r){switch((r=r.data).type){case"log":console[r.data.level]("Worker: "+r.data.msg);break;case"extract":var i=e(r.data);a.push(i),o(i);break;case"complete":s.terminate(),t(a);break;case"error":s.terminate(),n(new Error(r.data.message));break;default:s.terminate(),n(new Error("Unknown message from worker: "+r.type))}},s.postMessage({type:"extract",buffer:i},[i])}))}})?r.apply(e,[]):r)||(t.exports=n)},975:(t,e,r)=>{"use strict";var n=r(606);function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function o(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var h=n.lastIndexOf("/");if(h!==n.length-1){-1===h?(n="",i=0):i=(n=n.slice(0,h)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(o+1,a):n=t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var s={resolve:function(){for(var t,e="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=n.cwd()),a=t),i(a),0!==a.length&&(e=a+"/"+e,r=47===a.charCodeAt(0))}return e=o(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];i(r),r.length>0&&(void 0===t?t=r:t+="/"+r)}return void 0===t?".":s.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=s.resolve(t))===(e=s.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,o=n-r,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var h=e.length-a,u=o<h?o:h,f=-1,l=0;l<=u;++l){if(l===u){if(h>u){if(47===e.charCodeAt(a+l))return e.slice(a+l+1);if(0===l)return e.slice(a+l)}else o>u&&(47===t.charCodeAt(r+l)?f=l:0===l&&(f=0));break}var c=t.charCodeAt(r+l);if(c!==e.charCodeAt(a+l))break;47===c&&(f=l)}var p="";for(l=r+f+1;l<=n;++l)l!==n&&47!==t.charCodeAt(l)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(a+f):(a+=f,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!o){n=s;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var r,n=0,o=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,h=-1;for(r=t.length-1;r>=0;--r){var u=t.charCodeAt(r);if(47===u){if(!s){n=r+1;break}}else-1===h&&(s=!1,h=r+1),a>=0&&(u===e.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=h))}return n===o?o=h:-1===o&&(o=t.length),t.slice(n,o)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){n=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":t.slice(n,o)},extname:function(t){i(t);for(var e=-1,r=0,n=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var h=t.charCodeAt(a);if(47!==h)-1===n&&(o=!1,n=a+1),46===h?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!o){r=a+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,n=t.charCodeAt(0),o=47===n;o?(e.root="/",r=1):r=0;for(var s=-1,a=0,h=-1,u=!0,f=t.length-1,l=0;f>=r;--f)if(47!==(n=t.charCodeAt(f)))-1===h&&(u=!1,h=f+1),46===n?-1===s?s=f:1!==l&&(l=1):-1!==s&&(l=-1);else if(!u){a=f+1;break}return-1===s||-1===h||0===l||1===l&&s===h-1&&s===a+1?-1!==h&&(e.base=e.name=0===a&&o?t.slice(1,h):t.slice(a,h)):(0===a&&o?(e.name=t.slice(1,s),e.base=t.slice(1,h)):(e.name=t.slice(a,s),e.base=t.slice(a,h)),e.ext=t.slice(s,h)),a>0?e.dir=t.slice(0,a-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,t.exports=s},606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,h=[],u=!1,f=-1;function l(){u&&a&&(u=!1,a.length?h=a.concat(h):f=-1,h.length&&c())}function c(){if(!u){var t=s(l);u=!0;for(var e=h.length;e;){for(a=h,h=[];++f<e;)a&&a[f].run();f=-1,e=h.length}a=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new p(t,e)),1!==h.length||u||s(c)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},209:(t,e,r)=>{"use strict";var n=r(606),i=65536,o=r(861).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(t);if(t>0)if(t>i)for(var a=0;a<t;a+=i)s.getRandomValues(r.slice(a,a+i));else s.getRandomValues(r);return"function"==typeof e?n.nextTick((function(){e(null,r)})):r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},983:(t,e,r)=>{"use strict";var n=r(606);function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(861),s=r(209),a=o.Buffer,h=o.kMaxLength,u=r.g.crypto||r.g.msCrypto,f=Math.pow(2,32)-1;function l(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>f||t<0)throw new TypeError("offset must be a uint32");if(t>h||t>e)throw new RangeError("offset out of range")}function c(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>h)throw new RangeError("buffer too small")}function p(t,e,r,i){if(n.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return u.getRandomValues(a),i?void n.nextTick((function(){i(null,t)})):t}if(!i)return s(r).copy(t,e),t;s(r,(function(r,n){if(r)return i(r);n.copy(t,e),i(null,t)}))}u&&u.getRandomValues||!n.browser?(e.randomFill=function(t,e,n,i){if(!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(e,t.length),c(n,e,t.length),p(t,e,n,i)},e.randomFillSync=function(t,e,n){if(void 0===e&&(e=0),!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return l(e,t.length),void 0===n&&(n=t.length-e),c(n,e,t.length),p(t,e,n)}):(e.randomFill=i,e.randomFillSync=i)},861:(t,e,r)=>{var n=r(287),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},192:(t,e,r)=>{"use strict";r(940),e.parse=r(563)},563:t=>{"use strict";for(var e="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",r=new RegExp("^"+e+"$"),n="|&;()<> \\t",i=/^#$/,o="",s=0;s<4;s++)o+=(4294967296*Math.random()).toString(16);var a=new RegExp("^"+o);t.exports=function(t,s,h){var u=function(t,s,a){a||(a={});var h=a.escape||"\\",u=new RegExp(["("+e+")","((\\"+h+"['\""+n+"]|[^\\s'\""+n+"])+|\"((\\\\\"|[^\"])*?)\"|'((\\\\'|[^'])*?)')+"].join("|"),"g"),f=function(t,e){for(var r,n=e.lastIndex,i=[];r=e.exec(t);)i.push(r),e.lastIndex===r.index&&(e.lastIndex+=1);return e.lastIndex=n,i}(t,u);if(0===f.length)return[];s||(s={});var l=!1;return f.map((function(e){var n=e[0];if(n&&!l){if(r.test(n))return{op:n};var a,u=!1,f=!1,c="",p=!1;for(a=0;a<n.length;a++){var d=n.charAt(a);if(p=p||!u&&("*"===d||"?"===d),f)c+=d,f=!1;else if(u)d===u?u=!1:"'"==u?c+=d:d===h?(a+=1,c+='"'===(d=n.charAt(a))||d===h||"$"===d?d:h+d):c+="$"===d?m():d;else if('"'===d||"'"===d)u=d;else{if(r.test(d))return{op:n};if(i.test(d)){l=!0;var _={comment:t.slice(e.index+a+1)};return c.length?[c,_]:[_]}d===h?f=!0:c+="$"===d?m():d}}return p?{op:"glob",pattern:c}:c}function m(){var t,e;a+=1;var r=n.charAt(a);if("{"===r){if(a+=1,"}"===n.charAt(a))throw new Error("Bad substitution: "+n.slice(a-2,a+1));if((t=n.indexOf("}",a))<0)throw new Error("Bad substitution: "+n.slice(a));e=n.slice(a,t),a=t}else if(/[*@#?$!_-]/.test(r))e=r,a+=1;else{var i=n.slice(a);(t=i.match(/[^\w\d_]/))?(e=i.slice(0,t.index),a+=t.index-1):(e=i,a=n.length)}return function(t,e,r){var n="function"==typeof t?t(r):t[r];return void 0===n&&""!=r?n="":void 0===n&&(n="$"),"object"==typeof n?""+o+JSON.stringify(n)+o:""+n}(s,0,e)}})).reduce((function(t,e){return void 0===e?t:t.concat(e)}),[])}(t,s,h);return"function"!=typeof s?u:u.reduce((function(t,e){if("object"==typeof e)return t.concat(e);var r=e.split(RegExp("("+o+".*?"+o+")","g"));return 1===r.length?t.concat(r[0]):t.concat(r.filter(Boolean).map((function(t){return a.test(t)?JSON.parse(t.split(o)[1]):t})))}),[])}},940:t=>{"use strict";t.exports=function(t){return t.map((function(t){return t&&"object"==typeof t?t.op.replace(/(.)/g,"\\$1"):/["\s]/.test(t)&&!/'/.test(t)?"'"+t.replace(/(['\\])/g,"\\$1")+"'":/["'\s]/.test(t)?'"'+t.replace(/(["\\$`!])/g,"\\$1")+'"':String(t).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")})).join(" ")}},195:t=>{self,t.exports=(()=>{"use strict";var t={775:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FitAddon=void 0;var r=function(){function t(){}return t.prototype.activate=function(t){this._terminal=t},t.prototype.dispose=function(){},t.prototype.fit=function(){var t=this.proposeDimensions();if(t&&this._terminal){var e=this._terminal._core;this._terminal.rows===t.rows&&this._terminal.cols===t.cols||(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}},t.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element&&this._terminal.element.parentElement){var t=this._terminal._core;if(0!==t._renderService.dimensions.actualCellWidth&&0!==t._renderService.dimensions.actualCellHeight){var e=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(e.getPropertyValue("height")),n=Math.max(0,parseInt(e.getPropertyValue("width"))),i=window.getComputedStyle(this._terminal.element),o=r-(parseInt(i.getPropertyValue("padding-top"))+parseInt(i.getPropertyValue("padding-bottom"))),s=n-(parseInt(i.getPropertyValue("padding-right"))+parseInt(i.getPropertyValue("padding-left")))-t.viewport.scrollBarWidth;return{cols:Math.max(2,Math.floor(s/t._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(o/t._renderService.dimensions.actualCellHeight))}}}},t}();e.FitAddon=r}},e={};return function r(n){if(e[n])return e[n].exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(775)})()},437:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>ln});const n=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),h=t=>"object"==typeof t&&null!==t||"function"==typeof t,u=new Map([["proxy",{canHandle:t=>h(t)&&t[n],serialize(t){const{port1:e,port2:r}=new MessageChannel;return f(t,e),[r,[r]]},deserialize:t=>(t.start(),c(t))}],["throw",{canHandle:t=>h(t)&&a in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function f(t,e=globalThis,r=["*"]){e.addEventListener("message",(function n(i){if(!i||!i.data)return;if(!function(t,e){for(const r of t){if(e===r||"*"===r)return!0;if(r instanceof RegExp&&r.test(e))return!0}return!1}(r,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:o,type:h,path:u}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(I);let p;try{const e=u.slice(0,-1).reduce(((t,e)=>t[e]),t),r=u.reduce(((t,e)=>t[e]),t);switch(h){case"GET":p=r;break;case"SET":e[u.slice(-1)[0]]=I(i.data.value),p=!0;break;case"APPLY":p=r.apply(e,c);break;case"CONSTRUCT":p=w(new r(...c));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;f(t,r),p=function(t,e){return E.set(t,e),t}(e,[e])}break;case"RELEASE":p=void 0;break;default:return}}catch(t){p={value:t,[a]:0}}Promise.resolve(p).catch((t=>({value:t,[a]:0}))).then((r=>{const[i,a]=S(r);e.postMessage(Object.assign(Object.assign({},i),{id:o}),a),"RELEASE"===h&&(e.removeEventListener("message",n),l(e),s in t&&"function"==typeof t[s]&&t[s]())})).catch((t=>{const[r,n]=S({value:new TypeError("Unserializable return value"),[a]:0});e.postMessage(Object.assign(Object.assign({},r),{id:o}),n)}))})),e.start&&e.start()}function l(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t,e){return g(t,[],e)}function p(t){if(t)throw new Error("Proxy has been released and is not useable")}function d(t){return v(t,{type:"RELEASE"}).then((()=>{l(t)}))}const _=new WeakMap,m="FinalizationRegistry"in globalThis&&new FinalizationRegistry((t=>{const e=(_.get(t)||0)-1;_.set(t,e),0===e&&d(t)}));function g(t,e=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(r,i){if(p(n),i===o)return()=>{!function(t){m&&m.unregister(t)}(s),d(t),n=!0};if("then"===i){if(0===e.length)return{then:()=>s};const r=v(t,{type:"GET",path:e.map((t=>t.toString()))}).then(I);return r.then.bind(r)}return g(t,[...e,i])},set(r,i,o){p(n);const[s,a]=S(o);return v(t,{type:"SET",path:[...e,i].map((t=>t.toString())),value:s},a).then(I)},apply(r,o,s){p(n);const a=e[e.length-1];if(a===i)return v(t,{type:"ENDPOINT"}).then(I);if("bind"===a)return g(t,e.slice(0,-1));const[h,u]=y(s);return v(t,{type:"APPLY",path:e.map((t=>t.toString())),argumentList:h},u).then(I)},construct(r,i){p(n);const[o,s]=y(i);return v(t,{type:"CONSTRUCT",path:e.map((t=>t.toString())),argumentList:o},s).then(I)}});return function(t,e){const r=(_.get(e)||0)+1;_.set(e,r),m&&m.register(t,e,t)}(s,t),s}function y(t){const e=t.map(S);return[e.map((t=>t[0])),(r=e.map((t=>t[1])),Array.prototype.concat.apply([],r))];var r}const E=new WeakMap;function w(t){return Object.assign(t,{[n]:!0})}function S(t){for(const[e,r]of u)if(r.canHandle(t)){const[n,i]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},i]}return[{type:"RAW",value:t},E.get(t)||[]]}function I(t){switch(t.type){case"HANDLER":return u.get(t.name).deserialize(t.value);case"RAW":return t.value}}function v(t,e,r){return new Promise((n=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(r){r.data&&r.data.id&&r.data.id===i&&(t.removeEventListener("message",e),n(r.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:i},e),r)}))}var A=r(195);class b{constructor(t){this.size=t,this.entries=[],this.cursor=0}push(t){""!==t.trim()&&t!=this.entries[this.entries.length-1]&&(this.entries.push(t),this.entries.length>this.size&&this.entries.pop(0),this.cursor=this.entries.length)}rewind(){this.cursor=this.entries.length}getPrevious(){const t=Math.max(0,this.cursor-1);return this.cursor=t,this.entries[t]}getNext(){const t=Math.min(this.entries.length,this.cursor+1);return this.cursor=t,this.entries[t]}}var T=r(192);function R(t,e=!0){let r;const n=[],i=/\w+/g;for(;r=i.exec(t);)e?n.push(r.index):n.push(r.index+r[0].length);return n}function O(t,e){const r=R(t,!0).reverse().find((t=>t<e));return null==r?0:r}function C(t,e,r){let n=0,i=0;for(let o=0;o<e;++o)"\n"==t.charAt(o)?(i=0,n+=1):(i+=1,i>r&&(i=0,n+=1));return{row:n,col:i}}function N(t,e){return C(t,t.length,e).row+1}function P(t){return null!=t.match(/[^\\][ \t]$/m)}function k(t){return""===t.trim()||P(t)?"":(0,T.parse)(t).pop()||""}function L(t,e){if(t.length>=e[0].length)return t;const r=t;t+=e[0].slice(t.length,t.length+1);for(let n=0;n<e.length;n++){if(!e[n].startsWith(r))return null;if(!e[n].startsWith(t))return r}return L(t,e)}const W=class{constructor(t=null,e={}){this.term=t,this._handleTermData=this.handleTermData.bind(this),this._handleTermResize=this.handleTermResize.bind(this),this.history=new b(e.historySize||10),this.maxAutocompleteEntries=e.maxAutocompleteEntries||100,this._autocompleteHandlers=[],this._active=!1,this._input="",this._cursor=0,this._activePrompt=null,this._activeCharPrompt=null,this._termSize={cols:0,rows:0},this._disposables=[],t&&(t.loadAddon?t.loadAddon(this):this.attach())}activate(t){this.term=t,this.attach()}dispose(){this.detach()}detach(){this.term.off?(this.term.off("data",this._handleTermData),this.term.off("resize",this._handleTermResize)):(this._disposables.forEach((t=>t.dispose())),this._disposables=[])}attach(){this.term.on?(this.term.on("data",this._handleTermData),this.term.on("resize",this._handleTermResize)):(this._disposables.push(this.term.onData(this._handleTermData)),this._disposables.push(this.term.onResize(this._handleTermResize))),this._termSize={cols:this.term.cols,rows:this.term.rows}}addAutocompleteHandler(t,...e){this._autocompleteHandlers.push({fn:t,args:e})}removeAutocompleteHandler(t){const e=this._autocompleteHandlers.findIndex((e=>e.fn===t));-1!==e&&this._autocompleteHandlers.splice(e,1)}read(t,e="> "){return new Promise(((r,n)=>{this.term.write(t),this._activePrompt={prompt:t,continuationPrompt:e,resolve:r,reject:n},this._input="",this._cursor=0,this._active=!0}))}readChar(t){return new Promise(((e,r)=>{this.term.write(t),this._activeCharPrompt={prompt:t,resolve:e,reject:r}}))}abortRead(t="aborted"){null==this._activePrompt&&null==this._activeCharPrompt||this.term.write("\r\n"),null!=this._activePrompt&&(this._activePrompt.reject(t),this._activePrompt=null),null!=this._activeCharPrompt&&(this._activeCharPrompt.reject(t),this._activeCharPrompt=null),this._active=!1}println(t){this.print(t+"\n")}print(t){const e=t.replace(/[\r\n]+/g,"\n");this.term.write(e.replace(/\n/g,"\r\n"))}printWide(t,e=2){if(0==t.length)return println("");const r=t.reduce(((t,e)=>Math.max(t,e.length)),0)+e,n=Math.floor(this._termSize.cols/r),i=Math.ceil(t.length/n);let o=0;for(let e=0;e<i;++e){let e="";for(let i=0;i<n;++i)if(o<t.length){let n=t[o++];n+=" ".repeat(r-n.length),e+=n}this.println(e)}}applyPrompts(t){const e=(this._activePrompt||{}).prompt||"",r=(this._activePrompt||{}).continuationPrompt||"";return e+t.replace(/\n/g,"\n"+r)}applyPromptOffset(t,e){return this.applyPrompts(t.substr(0,e)).length}clearInput(){const t=this.applyPrompts(this._input),e=N(t,this._termSize.cols),r=this.applyPromptOffset(this._input,this._cursor),{col:n,row:i}=C(t,r,this._termSize.cols),o=e-i-1;for(var s=0;s<o;++s)this.term.write("[E");for(this.term.write("\r[K"),s=1;s<e;++s)this.term.write("[F[K")}setInput(t,e=!0){e&&this.clearInput();const r=this.applyPrompts(t);this.print(r),this._cursor>t.length&&(this._cursor=t.length);const n=this.applyPromptOffset(t,this._cursor),i=N(r,this._termSize.cols),{col:o,row:s}=C(r,n,this._termSize.cols),a=i-s-1;this.term.write("\r");for(var h=0;h<a;++h)this.term.write("[F");for(h=0;h<o;++h)this.term.write("[C");this._input=t}printAndRestartPrompt(t){const e=this._cursor;this.setCursor(this._input.length),this.term.write("\r\n");const r=()=>{this._cursor=e,this.setInput(this._input)},n=t();null==n?r():n.then(r)}setCursor(t){t<0&&(t=0),t>this._input.length&&(t=this._input.length);const e=this.applyPrompts(this._input),r=(N(e,this._termSize.cols),this.applyPromptOffset(this._input,this._cursor)),{col:n,row:i}=C(e,r,this._termSize.cols),o=this.applyPromptOffset(this._input,t),{col:s,row:a}=C(e,o,this._termSize.cols);if(a>i)for(let t=i;t<a;++t)this.term.write("[B");else for(let t=a;t<i;++t)this.term.write("[A");if(s>n)for(let t=n;t<s;++t)this.term.write("[C");else for(let t=s;t<n;++t)this.term.write("[D");this._cursor=t}handleCursorMove(t){if(t>0){const e=Math.min(t,this._input.length-this._cursor);this.setCursor(this._cursor+e)}else if(t<0){const e=Math.max(t,-this._cursor);this.setCursor(this._cursor+e)}}handleCursorErase(t){const{_cursor:e,_input:r}=this;if(t){if(e<=0)return;const t=r.substr(0,e-1)+r.substr(e);this.clearInput(),this._cursor-=1,this.setInput(t,!1)}else{const t=r.substr(0,e)+r.substr(e+1);this.setInput(t)}}handleCursorInsert(t){const{_cursor:e,_input:r}=this,n=r.substr(0,e)+t+r.substr(e);this._cursor+=t.length,this.setInput(n)}handleReadComplete(){this.history&&this.history.push(this._input),this._activePrompt&&(this._activePrompt.resolve(this._input),this._activePrompt=null),this.term.write("\r\n"),this._active=!1}handleTermResize(t){const{rows:e,cols:r}=t;this.clearInput(),this._termSize={cols:r,rows:e},this.setInput(this._input,!1)}handleTermData(t){if(this._active){if(null!=this._activeCharPrompt)return this._activeCharPrompt.resolve(t),this._activeCharPrompt=null,void this.term.write("\r\n");if(t.length>3&&27!==t.charCodeAt(0)){const e=t.replace(/[\r\n]+/g,"\r");Array.from(e).forEach((t=>this.handleData(t)))}else this.handleData(t)}}handleData(t){if(!this._active)return;const e=t.charCodeAt(0);let r;if(27==e)switch(t.substr(1)){case"[A":if(this.history){let t=this.history.getPrevious();t&&(this.setInput(t),this.setCursor(t.length))}break;case"[B":if(this.history){let t=this.history.getNext();t||(t=""),this.setInput(t),this.setCursor(t.length)}break;case"[D":this.handleCursorMove(-1);break;case"[C":this.handleCursorMove(1);break;case"[3~":this.handleCursorErase(!1);break;case"[F":this.setCursor(this._input.length);break;case"[H":this.setCursor(0);break;case"b":r=O(this._input,this._cursor),null!=r&&this.setCursor(r);break;case"f":r=function(t,e){const r=R(t,!1).find((t=>t>e));return null==r?t.length:r}(this._input,this._cursor),null!=r&&this.setCursor(r);break;case"":r=O(this._input,this._cursor),null!=r&&(this.setInput(this._input.substr(0,r)+this._input.substr(this._cursor)),this.setCursor(r))}else if(e<32||127===e)switch(t){case"\r":""!=(n=this._input).trim()&&((n.match(/'/g)||[]).length%2!=0||(n.match(/"/g)||[]).length%2!=0||""==n.split(/(\|\||\||&&)/g).pop().trim()||n.endsWith("\\")&&!n.endsWith("\\\\"))?this.handleCursorInsert("\n"):this.handleReadComplete();break;case"":this.handleCursorErase(!0);break;case"\t":if(this._autocompleteHandlers.length>0){const t=this._input.substr(0,this._cursor),e=P(t),r=function(t,e){const r=(0,T.parse)(e);let n=r.length-1,i=r[n]||"";return""===e.trim()?(n=0,i=""):P(e)&&(n+=1,i=""),t.reduce(((t,{fn:e,args:i})=>{try{return t.concat(e(n,r,...i))}catch(e){return console.error("Auto-complete error:",e),t}}),[]).filter((t=>t.startsWith(i)))}(this._autocompleteHandlers,t);if(r.sort(),0===r.length)e||this.handleCursorInsert(" ");else if(1===r.length){const e=k(t);this.handleCursorInsert(r[0].substr(e.length)+" ")}else if(r.length<=this.maxAutocompleteEntries){const e=L(t,r);if(e){const r=k(t);this.handleCursorInsert(e.substr(r.length))}this.printAndRestartPrompt((()=>{this.printWide(r)}))}else this.printAndRestartPrompt((()=>this.readChar(`Display all ${r.length} possibilities? (y or n)`).then((t=>{"y"!=t&&"Y"!=t||this.printWide(r)}))))}else this.handleCursorInsert(" ");break;case"":this.setCursor(this._input.length),this.term.write("^C\r\n"+((this._activePrompt||{}).prompt||"")),this._input="",this._cursor=0,this.history&&this.history.rewind()}else this.handleCursorInsert(t);var n}};var B=r(563),F=r.n(B);function D(t){let e=t.length;for(;--e>=0;)t[e]=0}const U=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),M=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),x=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),G=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),H=new Array(576);D(H);const Y=new Array(60);D(Y);const j=new Array(512);D(j);const z=new Array(256);D(z);const V=new Array(29);D(V);const K=new Array(30);function Z(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let q,X,J;function Q(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}D(K);const $=t=>t<256?j[t]:j[256+(t>>>7)],tt=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},et=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,tt(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},rt=(t,e,r)=>{et(t,r[2*e],r[2*e+1])},nt=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},it=(t,e,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=15;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=nt(n[e]++,e))}},ot=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},st=t=>{t.bi_valid>8?tt(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},at=(t,e,r,n)=>{const i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]},ht=(t,e,r)=>{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&at(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!at(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},ut=(t,e,r)=>{let n,i,o,s,a=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+a++],n+=(255&t.pending_buf[t.sym_buf+a++])<<8,i=t.pending_buf[t.sym_buf+a++],0===n?rt(t,i,e):(o=z[i],rt(t,o+256+1,e),s=U[o],0!==s&&(i-=V[o],et(t,i,s)),n--,o=$(n),rt(t,o,r),s=M[o],0!==s&&(n-=K[o],et(t,n,s)))}while(a<t.sym_next);rt(t,256,e)},ft=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems;let s,a,h,u=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(t.heap[++t.heap_len]=u=s,t.depth[s]=0):r[2*s+1]=0;for(;t.heap_len<2;)h=t.heap[++t.heap_len]=u<2?++u:0,r[2*h]=1,t.depth[h]=0,t.opt_len--,i&&(t.static_len-=n[2*h+1]);for(e.max_code=u,s=t.heap_len>>1;s>=1;s--)ht(t,r,s);h=o;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ht(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[2*h]=r[2*s]+r[2*a],t.depth[h]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[2*s+1]=r[2*a+1]=h,t.heap[1]=h++,ht(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,h=e.stat_desc.max_length;let u,f,l,c,p,d,_=0;for(c=0;c<=15;c++)t.bl_count[c]=0;for(r[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;u<573;u++)f=t.heap[u],c=r[2*r[2*f+1]+1]+1,c>h&&(c=h,_++),r[2*f+1]=c,f>n||(t.bl_count[c]++,p=0,f>=a&&(p=s[f-a]),d=r[2*f],t.opt_len+=d*(c+p),o&&(t.static_len+=d*(i[2*f+1]+p)));if(0!==_){do{for(c=h-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[h]--,_-=2}while(_>0);for(c=h;0!==c;c--)for(f=t.bl_count[c];0!==f;)l=t.heap[--u],l>n||(r[2*l+1]!==c&&(t.opt_len+=(c-r[2*l+1])*r[2*l],r[2*l+1]=c),f--)}})(t,e),it(r,u,t.bl_count)},lt=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,h=7,u=4;for(0===s&&(h=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=e[2*(n+1)+1],++a<h&&i===s||(a<u?t.bl_tree[2*i]+=a:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,o=i,0===s?(h=138,u=3):i===s?(h=6,u=3):(h=7,u=4))},ct=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,h=7,u=4;for(0===s&&(h=138,u=3),n=0;n<=r;n++)if(i=s,s=e[2*(n+1)+1],!(++a<h&&i===s)){if(a<u)do{rt(t,i,t.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(rt(t,i,t.bl_tree),a--),rt(t,16,t.bl_tree),et(t,a-3,2)):a<=10?(rt(t,17,t.bl_tree),et(t,a-3,3)):(rt(t,18,t.bl_tree),et(t,a-11,7));a=0,o=i,0===s?(h=138,u=3):i===s?(h=6,u=3):(h=7,u=4)}};let pt=!1;const dt=(t,e,r,n)=>{et(t,0+(n?1:0),3),st(t),tt(t,r),tt(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};var _t={_tr_init:t=>{pt||((()=>{let t,e,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(V[n]=r,t=0;t<1<<U[n];t++)z[r++]=n;for(z[r-1]=n,i=0,n=0;n<16;n++)for(K[n]=i,t=0;t<1<<M[n];t++)j[i++]=n;for(i>>=7;n<30;n++)for(K[n]=i<<7,t=0;t<1<<M[n]-7;t++)j[256+i++]=n;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)H[2*t+1]=8,t++,o[8]++;for(;t<=255;)H[2*t+1]=9,t++,o[9]++;for(;t<=279;)H[2*t+1]=7,t++,o[7]++;for(;t<=287;)H[2*t+1]=8,t++,o[8]++;for(it(H,287,o),t=0;t<30;t++)Y[2*t+1]=5,Y[2*t]=nt(t,5);q=new Z(H,U,257,286,15),X=new Z(Y,M,0,30,15),J=new Z(new Array(0),x,0,19,7)})(),pt=!0),t.l_desc=new Q(t.dyn_ltree,q),t.d_desc=new Q(t.dyn_dtree,X),t.bl_desc=new Q(t.bl_tree,J),t.bi_buf=0,t.bi_valid=0,ot(t)},_tr_stored_block:dt,_tr_flush_block:(t,e,r,n)=>{let i,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),ft(t,t.l_desc),ft(t,t.d_desc),s=(t=>{let e;for(lt(t,t.dyn_ltree,t.l_desc.max_code),lt(t,t.dyn_dtree,t.d_desc.max_code),ft(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*G[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?dt(t,e,r,n):4===t.strategy||o===i?(et(t,2+(n?1:0),3),ut(t,H,Y)):(et(t,4+(n?1:0),3),((t,e,r,n)=>{let i;for(et(t,e-257,5),et(t,r-1,5),et(t,n-4,4),i=0;i<n;i++)et(t,t.bl_tree[2*G[i]+1],3);ct(t,t.dyn_ltree,e-1),ct(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),ut(t,t.dyn_ltree,t.dyn_dtree)),ot(t),n&&st(t)},_tr_tally:(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(z[r]+256+1)]++,t.dyn_dtree[2*$(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{et(t,2,3),rt(t,256,H),(t=>{16===t.bi_valid?(tt(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}},mt=(t,e,r,n)=>{let i=65535&t,o=t>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+e[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16};const gt=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var yt=(t,e,r,n)=>{const i=gt,o=n+r;t^=-1;for(let r=n;r<o;r++)t=t>>>8^i[255&(t^e[r])];return~t},Et={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},wt={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:St,_tr_stored_block:It,_tr_flush_block:vt,_tr_tally:At,_tr_align:bt}=_t,{Z_NO_FLUSH:Tt,Z_PARTIAL_FLUSH:Rt,Z_FULL_FLUSH:Ot,Z_FINISH:Ct,Z_BLOCK:Nt,Z_OK:Pt,Z_STREAM_END:kt,Z_STREAM_ERROR:Lt,Z_DATA_ERROR:Wt,Z_BUF_ERROR:Bt,Z_DEFAULT_COMPRESSION:Ft,Z_FILTERED:Dt,Z_HUFFMAN_ONLY:Ut,Z_RLE:Mt,Z_FIXED:xt,Z_DEFAULT_STRATEGY:Gt,Z_UNKNOWN:Ht,Z_DEFLATED:Yt}=wt,jt=258,zt=262,Vt=42,Kt=113,Zt=666,qt=(t,e)=>(t.msg=Et[e],e),Xt=t=>2*t-(t>4?9:0),Jt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Qt=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do{r=t.head[--n],t.head[n]=r>=i?r-i:0}while(--e);e=i,n=e;do{r=t.prev[--n],t.prev[n]=r>=i?r-i:0}while(--e)};let $t=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const te=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},ee=(t,e)=>{vt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,te(t.strm)},re=(t,e)=>{t.pending_buf[t.pending++]=e},ne=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},ie=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=mt(t.adler,e,i,r):2===t.state.wrap&&(t.adler=yt(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},oe=(t,e)=>{let r,n,i=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match;const h=t.strstart>t.w_size-zt?t.strstart-(t.w_size-zt):0,u=t.window,f=t.w_mask,l=t.prev,c=t.strstart+jt;let p=u[o+s-1],d=u[o+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(r=e,u[r+s]===d&&u[r+s-1]===p&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<c);if(n=jt-(c-o),o=c-jt,n>s){if(t.match_start=e,s=n,n>=a)break;p=u[o+s-1],d=u[o+s]}}}while((e=l[e&f])>h&&0!=--i);return s<=t.lookahead?s:t.lookahead},se=t=>{const e=t.w_size;let r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-zt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Qt(t),n+=e),0===t.strm.avail_in)break;if(r=ie(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=$t(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=$t(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<zt&&0!==t.strm.avail_in)},ae=(t,e)=>{let r,n,i,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,a=t.strm.avail_in;do{if(r=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,n=t.strstart-t.block_start,r>n+t.strm.avail_in&&(r=n+t.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&e!==Ct||e===Tt||r!==n+t.strm.avail_in))break;s=e===Ct&&r===n+t.strm.avail_in?1:0,It(t,0,0,s),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,te(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(ie(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===s);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==Tt&&e!==Ct&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(ie(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,o=i>t.w_size?t.w_size:i,n=t.strstart-t.block_start,(n>=o||(n||e===Ct)&&e!==Tt&&0===t.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=e===Ct&&0===t.strm.avail_in&&r===n?1:0,It(t,t.block_start,r,s),t.block_start+=r,te(t.strm)),s?3:1)},he=(t,e)=>{let r,n;for(;;){if(t.lookahead<zt){if(se(t),t.lookahead<zt&&e===Tt)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=$t(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-zt&&(t.match_length=oe(t,r)),t.match_length>=3)if(n=At(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=$t(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=$t(t,t.ins_h,t.window[t.strstart+1]);else n=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(ee(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Ct?(ee(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ee(t,!1),0===t.strm.avail_out)?1:2},ue=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<zt){if(se(t),t.lookahead<zt&&e===Tt)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=$t(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-zt&&(t.match_length=oe(t,r),t.match_length<=5&&(t.strategy===Dt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=At(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=$t(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(ee(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=At(t,0,t.window[t.strstart-1]),n&&ee(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=At(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Ct?(ee(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ee(t,!1),0===t.strm.avail_out)?1:2};function fe(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const le=[new fe(0,0,0,0,ae),new fe(4,4,8,4,he),new fe(4,5,16,8,he),new fe(4,6,32,32,he),new fe(4,4,16,16,ue),new fe(8,16,32,32,ue),new fe(8,16,128,128,ue),new fe(8,32,128,256,ue),new fe(32,128,258,1024,ue),new fe(32,258,258,4096,ue)];function ce(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Yt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Jt(this.dyn_ltree),Jt(this.dyn_dtree),Jt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Jt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Jt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Vt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==Kt&&e.status!==Zt?1:0},de=t=>{if(pe(t))return qt(t,Lt);t.total_in=t.total_out=0,t.data_type=Ht;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?Vt:Kt,t.adler=2===e.wrap?0:1,e.last_flush=-2,St(e),Pt},_e=t=>{const e=de(t);var r;return e===Pt&&((r=t.state).window_size=2*r.w_size,Jt(r.head),r.max_lazy_match=le[r.level].max_lazy,r.good_match=le[r.level].good_length,r.nice_match=le[r.level].nice_length,r.max_chain_length=le[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},me=(t,e,r,n,i,o)=>{if(!t)return Lt;let s=1;if(e===Ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==Yt||n<8||n>15||e<0||e>9||o<0||o>xt||8===n&&1!==s)return qt(t,Lt);8===n&&(n=9);const a=new ce;return t.state=a,a.strm=t,a.status=Vt,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=e,a.strategy=o,a.method=r,_e(t)};var ge=me,ye=(t,e)=>pe(t)||2!==t.state.wrap?Lt:(t.state.gzhead=e,Pt),Ee=(t,e)=>{if(pe(t)||e>Nt||e<0)return t?qt(t,Lt):Lt;const r=t.state;if(!t.output||0!==t.avail_in&&!t.input||r.status===Zt&&e!==Ct)return qt(t,0===t.avail_out?Bt:Lt);const n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(te(t),0===t.avail_out)return r.last_flush=-1,Pt}else if(0===t.avail_in&&Xt(e)<=Xt(n)&&e!==Ct)return qt(t,Bt);if(r.status===Zt&&0!==t.avail_in)return qt(t,Bt);if(r.status===Vt&&0===r.wrap&&(r.status=Kt),r.status===Vt){let e=Yt+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=Ut||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,ne(r,e),0!==r.strstart&&(ne(r,t.adler>>>16),ne(r,65535&t.adler)),t.adler=1,r.status=Kt,te(t),0!==r.pending)return r.last_flush=-1,Pt}if(57===r.status)if(t.adler=0,re(r,31),re(r,139),re(r,8),r.gzhead)re(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),re(r,255&r.gzhead.time),re(r,r.gzhead.time>>8&255),re(r,r.gzhead.time>>16&255),re(r,r.gzhead.time>>24&255),re(r,9===r.level?2:r.strategy>=Ut||r.level<2?4:0),re(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(re(r,255&r.gzhead.extra.length),re(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=yt(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(re(r,0),re(r,0),re(r,0),re(r,0),re(r,0),re(r,9===r.level?2:r.strategy>=Ut||r.level<2?4:0),re(r,3),r.status=Kt,te(t),0!==r.pending)return r.last_flush=-1,Pt;if(69===r.status){if(r.gzhead.extra){let e=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>e&&(t.adler=yt(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex+=i,te(t),0!==r.pending)return r.last_flush=-1,Pt;e=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>e&&(t.adler=yt(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=yt(t.adler,r.pending_buf,r.pending-n,n)),te(t),0!==r.pending)return r.last_flush=-1,Pt;n=0}e=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,re(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=yt(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=yt(t.adler,r.pending_buf,r.pending-n,n)),te(t),0!==r.pending)return r.last_flush=-1,Pt;n=0}e=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,re(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=yt(t.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(te(t),0!==r.pending))return r.last_flush=-1,Pt;re(r,255&t.adler),re(r,t.adler>>8&255),t.adler=0}if(r.status=Kt,te(t),0!==r.pending)return r.last_flush=-1,Pt}if(0!==t.avail_in||0!==r.lookahead||e!==Tt&&r.status!==Zt){let n=0===r.level?ae(r,e):r.strategy===Ut?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(se(t),0===t.lookahead)){if(e===Tt)return 1;break}if(t.match_length=0,r=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(ee(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Ct?(ee(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ee(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===Mt?((t,e)=>{let r,n,i,o;const s=t.window;for(;;){if(t.lookahead<=jt){if(se(t),t.lookahead<=jt&&e===Tt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=t.strstart+jt;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);t.match_length=jt-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=At(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(ee(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Ct?(ee(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ee(t,!1),0===t.strm.avail_out)?1:2})(r,e):le[r.level].func(r,e);if(3!==n&&4!==n||(r.status=Zt),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),Pt;if(2===n&&(e===Rt?bt(r):e!==Nt&&(It(r,0,0,!1),e===Ot&&(Jt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),te(t),0===t.avail_out))return r.last_flush=-1,Pt}return e!==Ct?Pt:r.wrap<=0?kt:(2===r.wrap?(re(r,255&t.adler),re(r,t.adler>>8&255),re(r,t.adler>>16&255),re(r,t.adler>>24&255),re(r,255&t.total_in),re(r,t.total_in>>8&255),re(r,t.total_in>>16&255),re(r,t.total_in>>24&255)):(ne(r,t.adler>>>16),ne(r,65535&t.adler)),te(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Pt:kt)},we=t=>{if(pe(t))return Lt;const e=t.state.status;return t.state=null,e===Kt?qt(t,Wt):Pt},Se=(t,e)=>{let r=e.length;if(pe(t))return Lt;const n=t.state,i=n.wrap;if(2===i||1===i&&n.status!==Vt||n.lookahead)return Lt;if(1===i&&(t.adler=mt(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===i&&(Jt(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const o=t.avail_in,s=t.next_in,a=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,se(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=$t(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,se(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=a,t.avail_in=o,n.wrap=i,Pt};const Ie=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var ve=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)Ie(r,e)&&(t[e]=r[e])}}return t},Ae=t=>{let e=0;for(let r=0,n=t.length;r<n;r++)e+=t[r].length;const r=new Uint8Array(e);for(let e=0,n=0,i=t.length;e<i;e++){let i=t[e];r.set(i,n),n+=i.length}return r};let be=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){be=!1}const Te=new Uint8Array(256);for(let t=0;t<256;t++)Te[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Te[254]=Te[254]=1;var Re=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,i,o,s=t.length,a=0;for(i=0;i<s;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(a),o=0,i=0;o<a;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},Oe=(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let e=t[n++];if(e<128){o[i++]=e;continue}let s=Te[e];if(s>4)o[i++]=65533,n+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&n<r;)e=e<<6|63&t[n++],s--;s>1?o[i++]=65533:e<65536?o[i++]=e:(e-=65536,o[i++]=55296|e>>10&1023,o[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&be)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r})(o,i)},Ce=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+Te[t[r]]>e?r:e},Ne=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Pe=Object.prototype.toString,{Z_NO_FLUSH:ke,Z_SYNC_FLUSH:Le,Z_FULL_FLUSH:We,Z_FINISH:Be,Z_OK:Fe,Z_STREAM_END:De,Z_DEFAULT_COMPRESSION:Ue,Z_DEFAULT_STRATEGY:Me,Z_DEFLATED:xe}=wt;function Ge(t){this.options=ve({level:Ue,method:xe,chunkSize:16384,windowBits:15,memLevel:8,strategy:Me},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ne,this.strm.avail_out=0;let r=ge(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Fe)throw new Error(Et[r]);if(e.header&&ye(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Re(e.dictionary):"[object ArrayBuffer]"===Pe.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=Se(this.strm,t),r!==Fe)throw new Error(Et[r]);this._dict_set=!0}}function He(t,e){const r=new Ge(e);if(r.push(t,!0),r.err)throw r.msg||Et[r.err];return r.result}Ge.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?Be:ke,"string"==typeof t?r.input=Re(t):"[object ArrayBuffer]"===Pe.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Le||o===We)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Ee(r,o),i===De)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=we(this.strm),this.onEnd(i),this.ended=!0,i===Fe;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Ge.prototype.onData=function(t){this.chunks.push(t)},Ge.prototype.onEnd=function(t){t===Fe&&(this.result=Ae(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Ye={Deflate:Ge,deflate:He,deflateRaw:function(t,e){return(e=e||{}).raw=!0,He(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,He(t,e)},constants:wt};const je=16209;var ze=function(t,e){let r,n,i,o,s,a,h,u,f,l,c,p,d,_,m,g,y,E,w,S,I,v,A,b;const T=t.state;r=t.next_in,A=t.input,n=r+(t.avail_in-5),i=t.next_out,b=t.output,o=i-(e-t.avail_out),s=i+(t.avail_out-257),a=T.dmax,h=T.wsize,u=T.whave,f=T.wnext,l=T.window,c=T.hold,p=T.bits,d=T.lencode,_=T.distcode,m=(1<<T.lenbits)-1,g=(1<<T.distbits)-1;t:do{p<15&&(c+=A[r++]<<p,p+=8,c+=A[r++]<<p,p+=8),y=d[c&m];e:for(;;){if(E=y>>>24,c>>>=E,p-=E,E=y>>>16&255,0===E)b[i++]=65535&y;else{if(!(16&E)){if(64&E){if(32&E){T.mode=16191;break t}t.msg="invalid literal/length code",T.mode=je;break t}y=d[(65535&y)+(c&(1<<E)-1)];continue e}for(w=65535&y,E&=15,E&&(p<E&&(c+=A[r++]<<p,p+=8),w+=c&(1<<E)-1,c>>>=E,p-=E),p<15&&(c+=A[r++]<<p,p+=8,c+=A[r++]<<p,p+=8),y=_[c&g];;){if(E=y>>>24,c>>>=E,p-=E,E=y>>>16&255,16&E){if(S=65535&y,E&=15,p<E&&(c+=A[r++]<<p,p+=8,p<E&&(c+=A[r++]<<p,p+=8)),S+=c&(1<<E)-1,S>a){t.msg="invalid distance too far back",T.mode=je;break t}if(c>>>=E,p-=E,E=i-o,S>E){if(E=S-E,E>u&&T.sane){t.msg="invalid distance too far back",T.mode=je;break t}if(I=0,v=l,0===f){if(I+=h-E,E<w){w-=E;do{b[i++]=l[I++]}while(--E);I=i-S,v=b}}else if(f<E){if(I+=h+f-E,E-=f,E<w){w-=E;do{b[i++]=l[I++]}while(--E);if(I=0,f<w){E=f,w-=E;do{b[i++]=l[I++]}while(--E);I=i-S,v=b}}}else if(I+=f-E,E<w){w-=E;do{b[i++]=l[I++]}while(--E);I=i-S,v=b}for(;w>2;)b[i++]=v[I++],b[i++]=v[I++],b[i++]=v[I++],w-=3;w&&(b[i++]=v[I++],w>1&&(b[i++]=v[I++]))}else{I=i-S;do{b[i++]=b[I++],b[i++]=b[I++],b[i++]=b[I++],w-=3}while(w>2);w&&(b[i++]=b[I++],w>1&&(b[i++]=b[I++]))}break}if(64&E){t.msg="invalid distance code",T.mode=je;break t}y=_[(65535&y)+(c&(1<<E)-1)]}}break}}while(r<n&&i<s);w=p>>3,r-=w,p-=w<<3,c&=(1<<p)-1,t.next_in=r,t.next_out=i,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=i<s?s-i+257:257-(i-s),T.hold=c,T.bits=p};const Ve=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ke=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Ze=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),qe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Xe=(t,e,r,n,i,o,s,a)=>{const h=a.bits;let u,f,l,c,p,d,_=0,m=0,g=0,y=0,E=0,w=0,S=0,I=0,v=0,A=0,b=null;const T=new Uint16Array(16),R=new Uint16Array(16);let O,C,N,P=null;for(_=0;_<=15;_++)T[_]=0;for(m=0;m<n;m++)T[e[r+m]]++;for(E=h,y=15;y>=1&&0===T[y];y--);if(E>y&&(E=y),0===y)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(g=1;g<y&&0===T[g];g++);for(E<g&&(E=g),I=1,_=1;_<=15;_++)if(I<<=1,I-=T[_],I<0)return-1;if(I>0&&(0===t||1!==y))return-1;for(R[1]=0,_=1;_<15;_++)R[_+1]=R[_]+T[_];for(m=0;m<n;m++)0!==e[r+m]&&(s[R[e[r+m]]++]=m);if(0===t?(b=P=s,d=20):1===t?(b=Ve,P=Ke,d=257):(b=Ze,P=qe,d=0),A=0,m=0,_=g,p=o,w=E,S=0,l=-1,v=1<<E,c=v-1,1===t&&v>852||2===t&&v>592)return 1;for(;;){O=_-S,s[m]+1<d?(C=0,N=s[m]):s[m]>=d?(C=P[s[m]-d],N=b[s[m]-d]):(C=96,N=0),u=1<<_-S,f=1<<w,g=f;do{f-=u,i[p+(A>>S)+f]=O<<24|C<<16|N}while(0!==f);for(u=1<<_-1;A&u;)u>>=1;if(0!==u?(A&=u-1,A+=u):A=0,m++,0==--T[_]){if(_===y)break;_=e[r+s[m]]}if(_>E&&(A&c)!==l){for(0===S&&(S=E),p+=g,w=_-S,I=1<<w;w+S<y&&(I-=T[w+S],!(I<=0));)w++,I<<=1;if(v+=1<<w,1===t&&v>852||2===t&&v>592)return 1;l=A&c,i[l]=E<<24|w<<16|p-o}}return 0!==A&&(i[p+A]=_-S<<24|64<<16),a.bits=E,0};const{Z_FINISH:Je,Z_BLOCK:Qe,Z_TREES:$e,Z_OK:tr,Z_STREAM_END:er,Z_NEED_DICT:rr,Z_STREAM_ERROR:nr,Z_DATA_ERROR:ir,Z_MEM_ERROR:or,Z_BUF_ERROR:sr,Z_DEFLATED:ar}=wt,hr=16180,ur=16190,fr=16191,lr=16192,cr=16194,pr=16199,dr=16200,_r=16206,mr=16209,gr=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function yr(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Er=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<hr||e.mode>16211?1:0},wr=t=>{if(Er(t))return nr;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=hr,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,tr},Sr=t=>{if(Er(t))return nr;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,wr(t)},Ir=(t,e)=>{let r;if(Er(t))return nr;const n=t.state;return e<0?(r=0,e=-e):(r=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?nr:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Sr(t))},vr=(t,e)=>{if(!t)return nr;const r=new yr;t.state=r,r.strm=t,r.window=null,r.mode=hr;const n=Ir(t,e);return n!==tr&&(t.state=null),n};let Ar,br,Tr=!0;const Rr=t=>{if(Tr){Ar=new Int32Array(512),br=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Xe(1,t.lens,0,288,Ar,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Xe(2,t.lens,0,32,br,0,t.work,{bits:5}),Tr=!1}t.lencode=Ar,t.lenbits=9,t.distcode=br,t.distbits=5},Or=(t,e,r,n)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(e.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(e.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Cr=Sr,Nr=vr,Pr=(t,e)=>{let r,n,i,o,s,a,h,u,f,l,c,p,d,_,m,g,y,E,w,S,I,v,A=0;const b=new Uint8Array(4);let T,R;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Er(t)||!t.output||!t.input&&0!==t.avail_in)return nr;r=t.state,r.mode===fr&&(r.mode=lr),s=t.next_out,i=t.output,h=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,f=r.bits,l=a,c=h,v=tr;t:for(;;)switch(r.mode){case hr:if(0===r.wrap){r.mode=lr;break}for(;f<16;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(2&r.wrap&&35615===u){0===r.wbits&&(r.wbits=15),r.check=0,b[0]=255&u,b[1]=u>>>8&255,r.check=yt(r.check,b,2,0),u=0,f=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=mr;break}if((15&u)!==ar){t.msg="unknown compression method",r.mode=mr;break}if(u>>>=4,f-=4,I=8+(15&u),0===r.wbits&&(r.wbits=I),I>15||I>r.wbits){t.msg="invalid window size",r.mode=mr;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=512&u?16189:fr,u=0,f=0;break;case 16181:for(;f<16;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(r.flags=u,(255&r.flags)!==ar){t.msg="unknown compression method",r.mode=mr;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=mr;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&4&r.wrap&&(b[0]=255&u,b[1]=u>>>8&255,r.check=yt(r.check,b,2,0)),u=0,f=0,r.mode=16182;case 16182:for(;f<32;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}r.head&&(r.head.time=u),512&r.flags&&4&r.wrap&&(b[0]=255&u,b[1]=u>>>8&255,b[2]=u>>>16&255,b[3]=u>>>24&255,r.check=yt(r.check,b,4,0)),u=0,f=0,r.mode=16183;case 16183:for(;f<16;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&4&r.wrap&&(b[0]=255&u,b[1]=u>>>8&255,r.check=yt(r.check,b,2,0)),u=0,f=0,r.mode=16184;case 16184:if(1024&r.flags){for(;f<16;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&4&r.wrap&&(b[0]=255&u,b[1]=u>>>8&255,r.check=yt(r.check,b,2,0)),u=0,f=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(p=r.length,p>a&&(p=a),p&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+p),I)),512&r.flags&&4&r.wrap&&(r.check=yt(r.check,n,p,o)),a-=p,o+=p,r.length-=p),r.length))break t;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break t;p=0;do{I=n[o+p++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I))}while(I&&p<a);if(512&r.flags&&4&r.wrap&&(r.check=yt(r.check,n,p,o)),a-=p,o+=p,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break t;p=0;do{I=n[o+p++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I))}while(I&&p<a);if(512&r.flags&&4&r.wrap&&(r.check=yt(r.check,n,p,o)),a-=p,o+=p,I)break t}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;f<16;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(4&r.wrap&&u!==(65535&r.check)){t.msg="header crc mismatch",r.mode=mr;break}u=0,f=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=fr;break;case 16189:for(;f<32;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}t.adler=r.check=gr(u),u=0,f=0,r.mode=ur;case ur:if(0===r.havedict)return t.next_out=s,t.avail_out=h,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=f,rr;t.adler=r.check=1,r.mode=fr;case fr:if(e===Qe||e===$e)break t;case lr:if(r.last){u>>>=7&f,f-=7&f,r.mode=_r;break}for(;f<3;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}switch(r.last=1&u,u>>>=1,f-=1,3&u){case 0:r.mode=16193;break;case 1:if(Rr(r),r.mode=pr,e===$e){u>>>=2,f-=2;break t}break;case 2:r.mode=16196;break;case 3:t.msg="invalid block type",r.mode=mr}u>>>=2,f-=2;break;case 16193:for(u>>>=7&f,f-=7&f;f<32;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if((65535&u)!=(u>>>16^65535)){t.msg="invalid stored block lengths",r.mode=mr;break}if(r.length=65535&u,u=0,f=0,r.mode=cr,e===$e)break t;case cr:r.mode=16195;case 16195:if(p=r.length,p){if(p>a&&(p=a),p>h&&(p=h),0===p)break t;i.set(n.subarray(o,o+p),s),a-=p,o+=p,h-=p,s+=p,r.length-=p;break}r.mode=fr;break;case 16196:for(;f<14;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(r.nlen=257+(31&u),u>>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=mr;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;f<3;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}r.lens[O[r.have++]]=7&u,u>>>=3,f-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},v=Xe(0,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,v){t.msg="invalid code lengths set",r.mode=mr;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;A=r.lencode[u&(1<<r.lenbits)-1],m=A>>>24,g=A>>>16&255,y=65535&A,!(m<=f);){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(y<16)u>>>=m,f-=m,r.lens[r.have++]=y;else{if(16===y){for(R=m+2;f<R;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(u>>>=m,f-=m,0===r.have){t.msg="invalid bit length repeat",r.mode=mr;break}I=r.lens[r.have-1],p=3+(3&u),u>>>=2,f-=2}else if(17===y){for(R=m+3;f<R;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}u>>>=m,f-=m,I=0,p=3+(7&u),u>>>=3,f-=3}else{for(R=m+7;f<R;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}u>>>=m,f-=m,I=0,p=11+(127&u),u>>>=7,f-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=mr;break}for(;p--;)r.lens[r.have++]=I}}if(r.mode===mr)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=mr;break}if(r.lenbits=9,T={bits:r.lenbits},v=Xe(1,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,v){t.msg="invalid literal/lengths set",r.mode=mr;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},v=Xe(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,v){t.msg="invalid distances set",r.mode=mr;break}if(r.mode=pr,e===$e)break t;case pr:r.mode=dr;case dr:if(a>=6&&h>=258){t.next_out=s,t.avail_out=h,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=f,ze(t,c),s=t.next_out,i=t.output,h=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,f=r.bits,r.mode===fr&&(r.back=-1);break}for(r.back=0;A=r.lencode[u&(1<<r.lenbits)-1],m=A>>>24,g=A>>>16&255,y=65535&A,!(m<=f);){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(g&&!(240&g)){for(E=m,w=g,S=y;A=r.lencode[S+((u&(1<<E+w)-1)>>E)],m=A>>>24,g=A>>>16&255,y=65535&A,!(E+m<=f);){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}u>>>=E,f-=E,r.back+=E}if(u>>>=m,f-=m,r.back+=m,r.length=y,0===g){r.mode=16205;break}if(32&g){r.back=-1,r.mode=fr;break}if(64&g){t.msg="invalid literal/length code",r.mode=mr;break}r.extra=15&g,r.mode=16201;case 16201:if(r.extra){for(R=r.extra;f<R;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;A=r.distcode[u&(1<<r.distbits)-1],m=A>>>24,g=A>>>16&255,y=65535&A,!(m<=f);){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(!(240&g)){for(E=m,w=g,S=y;A=r.distcode[S+((u&(1<<E+w)-1)>>E)],m=A>>>24,g=A>>>16&255,y=65535&A,!(E+m<=f);){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}u>>>=E,f-=E,r.back+=E}if(u>>>=m,f-=m,r.back+=m,64&g){t.msg="invalid distance code",r.mode=mr;break}r.offset=y,r.extra=15&g,r.mode=16203;case 16203:if(r.extra){for(R=r.extra;f<R;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=mr;break}r.mode=16204;case 16204:if(0===h)break t;if(p=c-h,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=mr;break}p>r.wnext?(p-=r.wnext,d=r.wsize-p):d=r.wnext-p,p>r.length&&(p=r.length),_=r.window}else _=i,d=s-r.offset,p=r.length;p>h&&(p=h),h-=p,r.length-=p;do{i[s++]=_[d++]}while(--p);0===r.length&&(r.mode=dr);break;case 16205:if(0===h)break t;i[s++]=r.length,h--,r.mode=dr;break;case _r:if(r.wrap){for(;f<32;){if(0===a)break t;a--,u|=n[o++]<<f,f+=8}if(c-=h,t.total_out+=c,r.total+=c,4&r.wrap&&c&&(t.adler=r.check=r.flags?yt(r.check,i,c,s-c):mt(r.check,i,c,s-c)),c=h,4&r.wrap&&(r.flags?u:gr(u))!==r.check){t.msg="incorrect data check",r.mode=mr;break}u=0,f=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;f<32;){if(0===a)break t;a--,u+=n[o++]<<f,f+=8}if(4&r.wrap&&u!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=mr;break}u=0,f=0}r.mode=16208;case 16208:v=er;break t;case mr:v=ir;break t;case 16210:return or;default:return nr}return t.next_out=s,t.avail_out=h,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=f,(r.wsize||c!==t.avail_out&&r.mode<mr&&(r.mode<_r||e!==Je))&&Or(t,t.output,t.next_out,c-t.avail_out),l-=t.avail_in,c-=t.avail_out,t.total_in+=l,t.total_out+=c,r.total+=c,4&r.wrap&&c&&(t.adler=r.check=r.flags?yt(r.check,i,c,t.next_out-c):mt(r.check,i,c,t.next_out-c)),t.data_type=r.bits+(r.last?64:0)+(r.mode===fr?128:0)+(r.mode===pr||r.mode===cr?256:0),(0===l&&0===c||e===Je)&&v===tr&&(v=sr),v},kr=t=>{if(Er(t))return nr;let e=t.state;return e.window&&(e.window=null),t.state=null,tr},Lr=(t,e)=>{if(Er(t))return nr;const r=t.state;return 2&r.wrap?(r.head=e,e.done=!1,tr):nr},Wr=(t,e)=>{const r=e.length;let n,i,o;return Er(t)?nr:(n=t.state,0!==n.wrap&&n.mode!==ur?nr:n.mode===ur&&(i=1,i=mt(i,e,r,0),i!==n.check)?ir:(o=Or(t,e,r,r),o?(n.mode=16210,or):(n.havedict=1,tr)))},Br=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Fr=Object.prototype.toString,{Z_NO_FLUSH:Dr,Z_FINISH:Ur,Z_OK:Mr,Z_STREAM_END:xr,Z_NEED_DICT:Gr,Z_STREAM_ERROR:Hr,Z_DATA_ERROR:Yr,Z_MEM_ERROR:jr}=wt;function zr(t){this.options=ve({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ne,this.strm.avail_out=0;let r=Nr(this.strm,e.windowBits);if(r!==Mr)throw new Error(Et[r]);if(this.header=new Br,Lr(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Re(e.dictionary):"[object ArrayBuffer]"===Fr.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Wr(this.strm,e.dictionary),r!==Mr)))throw new Error(Et[r])}function Vr(t,e){const r=new zr(e);if(r.push(t),r.err)throw r.msg||Et[r.err];return r.result}zr.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Ur:Dr,"[object ArrayBuffer]"===Fr.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=Pr(r,s),o===Gr&&i&&(o=Wr(r,i),o===Mr?o=Pr(r,s):o===Yr&&(o=Gr));r.avail_in>0&&o===xr&&r.state.wrap>0&&0!==t[r.next_in];)Cr(r),o=Pr(r,s);switch(o){case Hr:case Yr:case Gr:case jr:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===xr))if("string"===this.options.to){let t=Ce(r.output,r.next_out),e=r.next_out-t,i=Oe(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==Mr||0!==a){if(o===xr)return o=kr(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},zr.prototype.onData=function(t){this.chunks.push(t)},zr.prototype.onEnd=function(t){t===Mr&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ae(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Kr={Inflate:zr,inflate:Vr,inflateRaw:function(t,e){return(e=e||{}).raw=!0,Vr(t,e)},ungzip:Vr,constants:wt};const{Deflate:Zr,deflate:qr,deflateRaw:Xr,gzip:Jr}=Ye,{Inflate:Qr,inflate:$r,inflateRaw:tn,ungzip:en}=Kr;var rn=$r,nn={Deflate:Zr,deflate:qr,deflateRaw:Xr,gzip:Jr,Inflate:Qr,inflate:rn,inflateRaw:tn,ungzip:en,constants:wt};class on{#t;#e;constructor(t){if("function"!=typeof t)throw new ValueError(`'outputFn' must be a function but is '${typeof t}'!`);this.#t=t,this.#e=""}write(t){"number"==typeof t&&(t=String.fromCharCode(t)),this.#e+=t;let e=this.#e.indexOf("\n");for(;e>=0;)this.#t(this.#e.slice(0,e+1)),this.#e=this.#e.slice(e+1),e=this.#e.indexOf("\n")}flush(){this.#e.length>0&&(this.#t(this.#e),this.#e="")}}var sn=r(316),an=r(13),hn=r.n(an);class un{static WAPM_GRAPHQL_QUERY="query shellGetCommandQuery($command: String!) {\n command: getCommand(name: $command) {\n command\n module {\n name\n abi\n source\n }\n packageVersion {\n version\n package {\n name\n displayName\n }\n filesystem {\n wasm\n host\n }\n distribution {\n downloadUrl\n }\n modules {\n name\n publicUrl\n abi\n }\n commands {\n command\n module {\n name\n abi\n source\n }\n }\n }\n }\n }";static getCommandFromWAPM=async t=>{const e=await fetch("https://registry.wapm.io/graphql",{method:"POST",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({operationName:"shellGetCommandQuery",query:un.WAPM_GRAPHQL_QUERY,variables:{command:t}})}),r=await e.json();if(r&&r.data&&r.data.command)return r.data.command;throw new Error(`command not found ${t}`)};static fetchCommandFromWAPM=async({args:t,env:e})=>{const r=t[0],n=await un.getCommandFromWAPM(r);if("wasi"!==n.module.abi)throw new Error(`Only WASI modules are supported. The "${r}" command is using the "${n.module.abi}" ABI.`);return n};static WAPM_PACKAGE_QUERY="query shellGetPackageQuery($name: String!, $version: String) {\n packageVersion: getPackageVersion(name: $name, version: $version) {\n version\n package {\n name\n displayName\n }\n filesystem {\n wasm\n host\n }\n distribution {\n downloadUrl\n }\n modules {\n name\n publicUrl\n abi\n }\n commands {\n command\n module {\n name\n abi\n source\n }\n }\n }\n }";static execWapmQuery=async(t,e)=>{const r=await fetch("https://registry.wapm.io/graphql",{method:"POST",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({query:t,variables:e})}),n=await r.json();if(n&&n.data)return n.data};static getBinaryFromUrl=async t=>{const e=await fetch(t),r=await e.arrayBuffer();return new Uint8Array(r)};static getWAPMPackageFromPackageName=async t=>{let e;if(t.indexOf("@")>-1){const r=t.split("@");t=r[0],e=r[1]}let r=await un.execWapmQuery(un.WAPM_PACKAGE_QUERY,{name:t,version:e});if(r&&r.packageVersion)return r.packageVersion;throw new Error(`Package not found in the registry ${t}`)};static getWasmBinaryFromUrl=async t=>{const e=await fetch(t),r=await e.arrayBuffer();return new Uint8Array(r)};static getWasmBinaryFromCommand=async t=>{const e=await un.fetchCommandFromWAPM({args:[t]}),r=await un.getBinaryFromUrl(e.packageVersion.distribution.downloadUrl),n=nn.inflate(r),i=(await hn()(n.buffer)).filter((t=>t.name.split("/").pop().endsWith(".wasm")));if(i.length>1)throw Error("more than 1 wasm file, don't know what to do :D");return i[0].buffer}}const fn=un,ln=class{isRunningCommand;onActivated;onDisposed;onFileSystemUpdate;onBeforeCommandRun;onCommandRunFinish;_xterm;_xtermEcho;_xtermPrompt;_worker;_wasmRunner;_jsCommands;_wasmModules;_wasmFsFiles;_stdoutBuffer;_stderrBuffer;_outputBuffer;_lastOutputTime;constructor(t){this.wasmBinaryPath=t,this._jsCommands=new Map,this.isRunningCommand=!1,this._worker=!1,this._wasmModules=[],this._wasmFsFiles=[],this._outputBuffer="",this._lastOutputTime=0,this.onActivated=()=>{},this.onDisposed=()=>{},this.onFileSystemUpdate=()=>{},this.onBeforeCommandRun=()=>{},this.onCommandRunFinish=()=>{},[typeof Worker,typeof SharedArrayBuffer,typeof Atomics].includes("undefined")?this._wasmRunner=new sn.A:this._initWorker(),this._suppressOutputs=!1,window.term=this}async activate(t){this._xterm=t,this._xtermFitAddon=new A.FitAddon,this._xtermFitAddon.activate(this._xterm),setTimeout((()=>this._xtermFitAddon.fit()),1),window.addEventListener("resize",(()=>{this._xtermFitAddon.fit()})),setTimeout((()=>this._initWasmModuleDragAndDrop()),1),this._xtermPrompt=async()=>"$ ",this._xtermEcho=new W,this._xtermEcho.activate(this._xterm),this.registerJsCommand("help",(async function*(t){yield"todo: show helping things\n"})),this.registerJsCommand("about",(async t=>"Wasm-WebTerm version 0.0.10.\nBackend: "+(this._worker?"WebWorker":"Prompts Fallback")+".\n")),this.registerJsCommand("clear",(async t=>await this.printWelcomeMessagePlusControlSequences())),this._worker instanceof Promise&&await this._worker,this._xterm.onData((t=>this._onXtermData(t))),await this.onActivated(),this._xterm.writeln(await this.printWelcomeMessagePlusControlSequences(),(()=>{this.repl(),setTimeout((()=>this._xterm.focus()),1)}))}async dispose(){await this._xtermEcho.dispose(),await this._xtermFitAddon.dispose(),this._worker&&this._terminateWorker(),await this.onDisposed()}registerJsCommand(t,e,r){return this._jsCommands.set(t,{name:t,callback:e,autocomplete:r}),this}unregisterJsCommand(t){return this._jsCommands.delete(t)}get jsCommands(){return this._jsCommands}async repl(){try{const t=await this._xtermPrompt(),e=await this._xtermEcho.read(t);if(""==e.trim())return this.repl();await this.onBeforeCommandRun(),this._xterm.write("\r\n"),await this.runLine(e),"\n"!=this._outputBuffer.slice(-1)&&this._xterm.write("⏎\r\n"),this._xterm.write("\r\n"),await this.onCommandRunFinish(),this.repl()}catch(t){}}_parseCommands(t){let e=!1,r=!1;const n=F()(t,(t=>{e=!0})),i=[];let o=[];t:for(let t=0;t<n.length;++t){const s=n[t];if("string"==typeof s){if(0===o.length&&s.match(/^\w+=.*$/)){e=!0;continue}o.push(s)}else{if("|"!==s.op){r=!0,console.error("Unsupported shell operator:",s.op);break t}i.push(o),o=[]}}return i.push(o),e&&this._stderr("[1m[[33mWARN[39m][0m Environment variables are not supported!\n"),r&&this._stderr("[1m[[33mWARN[39m][0m Advanced bash features are not supported! Only the pipe '|' works for now.\n"),i}async runLine(t){try{let e=null;this._suppressOutputs=!1;const r=this._parseCommands(t);for(const[t,n]of r.entries()){const i=n.shift(),o=this._jsCommands.get(i);if("function"==typeof o?.callback){const i=o.callback(n,e);let s;if(i.then)s=(await i||"").toString();else if(i.next)for await(let t of i)s=null==s?t:s+t;else s=i.toString();t==r.length-1?this._stdout(s):e=s||null}else null==o?t<r.length-1?e=(await this.runWasmCommandHeadless(i,n,e)).stdout:(await this.runWasmCommand(i,n,e),e=null):console.error("command is defined but has no function:",i)}}catch(t){"\n"!=this._outputBuffer.slice(-1)&&this._stderr("\n"),this._stderr(`[1m[[31mERROR[39m][0m ${t.toString()}\n`),console.error("Error running line:",t)}}runWasmCommand(t,e,r,n){if(console.log("called runWasmCommand:",t,e),this.isRunningCommand)throw"WasmWebTerm is already running a command";this.isRunningCommand=!0,this._suppressOutputs=!1,this._outputBuffer="";const i=w((async r=>{console.log("command finished:",t,e),this.isRunningCommand=!1,this._wasmFsFiles=r,await this.onFileSystemUpdate(this._wasmFsFiles),await this._waitForOutputPause(),this._stdoutBuffer.flush(),this._stderrBuffer.flush(),this._waitForOutputPause().then((()=>{"function"==typeof n&&n(),this._runWasmCommandPromise?.resolve()}))})),o=w((t=>this._stderr(t+"\n")));return this._stdout("loading web assembly ..."),this._getOrFetchWasmModule(t).then((n=>{this._xterm.write("[2K\r"),this._worker?this._worker.runCommand(t,n.module,n.type,e,this._stdinProxy,this._stdoutProxy,this._stderrProxy,this._wasmFsFiles,i,o,null,r,n.runtime):this._wasmRunner.runCommand(t,n.module,n.type,e,null,this._stdoutProxy,this._stderrProxy,this._wasmFsFiles,i,o,null,r,n.runtime)})).catch((t=>{this.isRunningCommand=!1,this._runWasmCommandPromise?.reject(t)})),new Promise(((t,e)=>this._runWasmCommandPromise={resolve:t,reject:e}))}runWasmCommandHeadless(t,e,r,n){if(this.isRunningCommand)throw"WasmWebTerm is already running a command";this.isRunningCommand=!0;let i={resolve:()=>{},reject:()=>{}};const o=w((t=>{this.isRunningCommand=!1,this._stdoutBuffer.flush(),this._stderrBuffer.flush(),"function"==typeof n&&n(t),i.resolve(t)})),s=w((t=>this._stderr(t+"\n"))),a=w((()=>{}));return this._getOrFetchWasmModule(t).then((n=>{this._worker?this._worker.runCommandHeadless(t,n.module,n.type,e,this._wasmFsFiles,o,s,a,r,n.runtime):this._wasmRunner.runCommandHeadless(t,n.module,n.type,e,this._wasmFsFiles,o,s,a,r,n.runtime)})).catch((t=>{this.isRunningCommand=!1,i.reject(t)})),new Promise(((t,e)=>i={resolve:t,reject:e}))}_getOrFetchWasmModule(t){return new Promise((async(e,r)=>{let n,i,o=!1;if(this._wasmModules.forEach((e=>{e.name==t&&(n=e)})),n?.module instanceof WebAssembly.Module)e(n);else try{if(n={name:t,type:"emscripten",module:void 0},null!=this.wasmBinaryPath){const e=await fetch(this.wasmBinaryPath+"/"+t+".wasm");if(i=await e.arrayBuffer(),e?.ok&&WebAssembly.validate(i)){const e=await fetch(this.wasmBinaryPath+"/"+t+".js");if(e?.ok){const t=await e.arrayBuffer();"<"!=String.fromCharCode(new Uint8Array(t).subarray(0,1).toString())&&(n.runtime=t)}n.runtime||(n.type="wasmer"),o=!0}else{const e=await fetch(this.wasmBinaryPath+"/"+t+".lnk");if(e?.ok){const t=await e.text(),r=this.wasmBinaryPath+"/"+t+".wasm",s=await fetch(r);if(s?.ok&&(i=await s.arrayBuffer(),WebAssembly.validate(i))){const e=await fetch(this.wasmBinaryPath+"/"+t+".js");if(e?.ok){const t=await e.arrayBuffer();"<"!=String.fromCharCode(new Uint8Array(t).subarray(0,1).toString())&&(n.runtime=t)}n.runtime||(n.type="wasmer"),o=!0}}}}o||(i=await fn.getWasmBinaryFromCommand(t),n.type="wasmer"),n.module=await WebAssembly.compile(i),this._wasmModules.push(n),e(n)}catch(t){r(t)}}))}_initWasmModuleDragAndDrop(){this._xterm.element.addEventListener("dragenter",(t=>{this._xterm.element.style.opacity="0.8"})),this._xterm.element.addEventListener("dragover",(t=>{t.preventDefault(),this._xterm.element.style.opacity="0.8"})),this._xterm.element.addEventListener("dragleave",(t=>{this._xterm.element.style.opacity=""})),this._xterm.element.addEventListener("drop",(async t=>{t.preventDefault();let e=[];if(t.dataTransfer.items)for(let r=0;r<t.dataTransfer.items.length;r++)if("file"==t.dataTransfer.items[r].kind)e.push(t.dataTransfer.items[r].getAsFile());else for(let r=0;r<t.dataTransfer.files.length;r++)e.push(t.dataTransfer.files[r]);for(let t=0;t<e.length;t++){const r=e[t];if(r.name.endsWith(".wasm")){const t=r.name.replace(/\.wasm$/,"");if(this._wasmModules=this._wasmModules.filter((e=>e.name!=t)),e.some((e=>e.name==t+".js"))){const n=e.find((e=>e.name==t+".js")),i=await WebAssembly.compile(await r.arrayBuffer());this._wasmModules.push({name:t,type:"emscripten",runtime:await n.arrayBuffer(),module:i}),alert("Emscripten Wasm Module added: "+t)}else{const e=await WebAssembly.compile(await r.arrayBuffer());this._wasmModules.push({name:t,type:"wasmer",module:e}),alert("WASI Module added: "+t)}}}this._xterm.element.style.opacity=""}),!1)}_initWorker(){this._worker=new Promise((async t=>{this._pauseBuffer=new Int32Array(new SharedArrayBuffer(1*Int32Array.BYTES_PER_ELEMENT)),this._stdinBuffer=new Int32Array(new SharedArrayBuffer(1e3*Int32Array.BYTES_PER_ELEMENT));const e=fetch("data:application/gzip;base64,H4sIAAAAAAAAA6VYe2/cNhL//z6FrBy2ZMIo6/YQoLunBj5n2wbIC3aK3GG7SGWJXiuWyAVJ+XEyv/vN8CHJr94FBxheSRzOe34z5Iune8nPUiVNXXKheVKLU6nawtRSJLuGF/BJc55cSnXOVVbKdlc3vMq+6uztm8PV++NVZq5M8vTFX/ZOO1HiNsKZoX0qT77y0qR5bq53XJ4m/GonldGz2b2VVlZdw1/5nyzQ5YbQRRp5jsQVP60Fn838b1a01Sv/SNYbkLt4TO6r8Ju1RS0ccz48WqJ5c8oIoflP7l9/UaiE5/3LH+cLNIcJ/FhKoU2i8g9OQnbOrzURWUuX4DHiFtdAuwGZgYILo2qORNvsizdPU6qyWpRNV8ECpzc3yGLNN7mhSy9A5sLt+Fzo9qgTgqs3rynTt8RKup5vlqj1hCyXa72x7IeXU6XTDiMIeoBPliJTxFAmsooY1oPfiq4xC7T4q43iVX583Z7IhqSHsm1qcZ7tlLy6TimT91a4qHayFiZF/e4uKu7S52PYXd8jgKgVTf1vrmC1uLdqzpS8FLDU5Tz/6X5YZzPRNc1envObmwfyhLMyF/wyeVfsyHqdehtYXxbi10JUDV8A0w4CMJvxtdowzVXtlIFPPtA9psv+wjD8/X4hrGfHtS62/PCsAI83S8VNp0TSuJxnawF/GwgBxDbyQzmEZ9oUCjKNnQElJGonfNJWlNoNW6fO2IfVK6AkwZpRQUjOpgMCS/uGm8REJUyO1QuCRIkOWCkl1au+1u5hsTdnfl/fehMw//0TE0WLr/jDYH95vnAKl+fWLkYG+ywKZmsDRty2E/1Wn4KlgZ46k2IlFFrXW0hr8KBbBTrHLKpAWfhAl35feLV2s4H6CtH1fs63jTwpmk9ntWYiX6dP0w3tQURVrS6g4t7W2nCoBpIG3ikjAwNJtFNzT9/c7OmsKkxBvfuW+PU2hA1lncBGyCi30+R5LiDjnqb4EDbvzXG7mLr/iG9XVztI0sxwbaDqBlIbHvYtEUxnUtXbWsTl5ELWVYJSJWDhZaEE+eONAF/AV0+ZfPfXPu6y3yWgJJC7kklckv8RCrmvq0XHsBoWJdsV5myxs/ntcPTu8xoCGVzBqpz4x6xQ264N7ry5WW8ooOWOXNAl5ly7NOo64KHJd5nG7kHm7Pk+hbKvOnghzof5T3xtNhBdAB2ge2RtqS9rU56REkoPECP9ZfUpXbS5WJ4oXpwv3bdj/GbWURZIAgTc5BdRX589rM0hFpNtBx8/vv2XY5YVu11zDbhX0SnB4Yf3x5+Ofjt0Esf40z7E47bHOOsBLaCYLDQNzGZBsiyDKp6yXL1//fHDm/fA8RuQBFNboP63czBocZJpbjzIcAs2oOPsROTR6u3q4HiFNrgEij6IEO/ZWFsW6Gewrs0jjLB1sVnMrQWcbmvNIUaQehectDTz1AQR7A41pRQAmgtCRGyMa8X0Jl8RASWc7aQ2wUBy24N3MtAyRZlLVQs9hLLBEqiucjYjBvRp5QV/rLQlZafY0mqHkjBcPNAJ1vUGUb7eEEBbOjUraC6YQs2DjRicT7DVA1X6m4gYV5w0PIlliqTQnII7vs1kMZqsUCP4Y8a3iNnMxF5hB9Q6xYiR+8mZBnkfIa/QYTxz9qiuNFI5OLfUt7isbKTmU567CNgBqEdoTl3HTs4KnZxwLpLQx6sEGlNS60RIk8BQgd5IJwyrSdEcY6E46BniaWPCuPkK5aLhHkJaVxCfIWGhW7Ntnv7sJwM3hQKQQtjVdQoBHpEfgBW2PEQ3CSxgE2mzLVYODFpz+nx/2Y6FNAePgb8rr8rYZM5ck4EmLcZapH3otirf2w+DUu20ds4CIO9RjIB8RKfuiMJxKc91gHVn9N40gtvZbJt1QjmtIaVBCVIDAMMDAyFzix0lRZdhZD1bp3HWcLE1Z4FxjxRugqtt0EvkE/cjlHr0Nw7A0Tk8M/IYJkKxhYKgMTAA7SF6wn3ITmpRQTWHduXcsgawM0wC9jDtzYWa7dFaL3tdswIrSQ+8JqocD6pENo9oFOaM2rJi0A2eHXxDx2T1VGRS5GYdnfJ8f4NuK5zH7mswAPPEZvQyWopejrOAT4FpV4v2dazc5NcQqAfs863mz53Npm0VAICVEwuH4vV5NHEr2Ixi5UNixwb2LaK1BTcOou3A+Hb3iQkVqsi4KnoWqwhPGMzl8ZjFcOxwmYwdvx7B4XoYq3FMdRquosz1RGPo6aApNJXpt338dqBUcY1HESPRbkQ6wPHQ1LFYKd0s8dgmAqicTEFlrO4VajIe2MAGPLCVFOe3bBi/gYgObU1uYHqYDrpR8RCBXw/ev367Okr9HG1C+ioLG+1tyqODz+k4RZ8M0ITD9KDhBWoYJiIIIWwMY1GUE7p5Uvr9DuhpdmsWj8O0Hw5AatwzzNWDuONwVozYHUANZwFC1ACl0rnTRYH8jcLZrWnI3A+FDtLfQe5lp40Ez7pHBX6ULaFP33ftCVfZu4N/fjk++Hn1Bepv9cvqiI7Juf8Sx4mvcJAk6fOULvn/NstDmdBeuOkPx2w3BdbV5BFRAEYI/l9GCGgFivhNvhXz2IrHYxv/k/aOrVxaZCNcTxPk5Y/ziE6X+Z1DusvRc0goQS6BqAEmyVXCr0CrSpNzqNT+CV8+MctJK/fFqLsd6A2TArS/7AnPeXgyubG7Ajry6oqXXWhX8QTRyC1JcRUcHS5xQFigg/nlwECkSw2GSsVJYM3mbH9cuixqc3vlFnOYF7v2Ye7WrT2u159sfVSxObVPAJ1yPPy7puhvAXiE7rivkUUVtiEkuWMLdnV3WYMvPJ8v+d8DRegfS/7s2Yh6j7EKnVhQP2PD6Nfps0mnNPaLFKtWl+rYVLU4LJrG1xhMe6GNwzFZ7Lqhl7uDpRchOwML/+hOT6Fo9K4B37/4Xb36XbzYUkjCHaEhA+6GnAWeuddUxEyZMnw2CI7o6kswO4WCh5OIOpSVw75Yjqkbk+5oG4ECHL+MS94FGBM7II1f0Wf1KU6z4BOsAv6QU/5f24ebs8H22M9kBvFeFTjvE38jxtcCL9se9I78Br/I4A4LGGHq0t0z4ojdN+SKxo+1/uxS+7iUO1wLc/tw/ZPuxVOKp/vFDbiOejZD5JheKdwjsfYquyNhNrvKoibBK1/zKwvwlPd27IICZgt3yQkugwMtprQ/N+5NJicZ72IdZmlHmffh26K3NjoZb9CIZjrS41wwvNhhqmwBsgD38DrPyYZJADH2yxeu3/krYGwkPJveS/JxKHV3lsXCwKnJWLzDzMM1gmvnyFDhIdBQkUkgVeCLPXzk7jFgtvc79DfAUnONa6znAkBK4XkGb8mgpy7QUjjhg5Dt9AyAs+Lde8jxSBLdNn5xtyQRFOD95sYdWiLDdLKUUiiR4XT+kKBLGFLlZRTi36wleJsroyeCkeOUBIe4D5cimgvzTROuKkWmXBweSkV/Ezub+d+hT38qto+78T4tC8fp1McWZm722OZ0TIE0bnNXLEyQH14C4lMcYJf/AelhXBmrGAAA").then((t=>{if("DecompressionStream"in self){const e=t.body.pipeThrough(new DecompressionStream("gzip"));return new Response(e).text()}return t.bytes().then((t=>rn(t)))})),n={};try{const t=Object.keys(r.m);let e=[sn.D];for(let i=e.shift();null!=i;i=e.shift()){const o=r.m[i];n[i]=o;const s=o.toString().matchAll(/\br\((\d+)\)/g);for(const r of s)t.includes(r[1])&&e.push(r[1])}}catch(e){return console.error(`Cannot collect the \`WasmRunner\` module and its dependencies for use in the Worker: ${e}`),console.error("Falling back to excuting `WasmRunner` in the PromptsFallback"),this._wasmRunner=new sn.A,this._worker=!1,void t(this._worker)}let i="self._modules={";for(const[t,e]of Object.entries(n))i+=`${t}:${e.toString()},`;i+=`};self.WasmRunnerID=${sn.D}\n`;const o=new Blob([i,await e],{type:"application/javascript"});this._workerRAW=new Worker(URL.createObjectURL(o));const s=c(this._workerRAW);this._worker=await new s(this._pauseBuffer,this._stdinBuffer),t(this._worker)}))}_resumeWorker(){console.log("resuming worker (request)"),Atomics.store(this._pauseBuffer,0,0),Atomics.notify(this._pauseBuffer,0)}_terminateWorker(){console.log("called terminate worker"),this._workerRAW.terminate()}_waitForOutputPause(t=80,e=20){return new Promise((r=>{const n=()=>{setTimeout((()=>{this._lastOutputTime>Date.now()-t?n():r()}),e)};n()}))}_setStdinBuffer(t){for(let e=0;e<this._stdinBuffer.length;e++)this._stdinBuffer[e]=t[e]?t[e].charCodeAt(0):0}_stdinProxy=w((t=>{this._waitForOutputPause().then((async()=>{console.log("called _stdinProxy",t),this._stdoutBuffer.flush(),this._stderrBuffer.flush();const e=await new Promise(((e,r)=>{let n="";const i=this._xterm.onData((r=>""==r?(this._xterm.write("^C"),i.dispose(),e("")):""==r?(i.dispose(),e(n)):("\r"==r?r="\n":""==r&&(r="\b"),"\b"==r?n=n.slice(0,-1):n+=r,"\n"==r?(t||this._xterm.write("\r\n"),i.dispose(),e(n)):void("\b"==r?this._xterm.write("^H"):27==r.charCodeAt(0)?this._xterm.write("^["+r.slice(1)):this._xterm.write(r)))))}));this._setStdinBuffer(e),this._resumeWorker()}))}));_stdoutProxy=w((t=>this._stdoutBuffer.write(t)));_stderrProxy=w((t=>this._stderrBuffer.write(t)));_stdoutBuffer=new on(this._stdout.bind(this));_stderrBuffer=new on(this._stderr.bind(this));_stdout(t){this._suppressOutputs||("number"==typeof t&&(t=String.fromCharCode(t)),t=t.replace(/\n/g,"\r\n"),this._outputBuffer+=t,this._lastOutputTime=Date.now(),this._xterm.write(t))}_stderr(t){t instanceof Error&&(console.error("stderr error:",t),t=t.toString()+"\n"),this._stdout(t)}async printWelcomeMessage(){let t="[1;32m\n _ _ _ _ _ _ _ _____ \r\n| | | |___ ___ _____ | | | |___| |_ |_ _|___ ___ _____ \r\n| | | | .'|_ -| | | | | | -_| . | | | | -_| _| |\r\n|_____|__,|___|_|_|_| |_____|___|___| |_| |___|_| |_|_|_|\r\n [37m\r\n";return t+="Run WebAssembly binaries compiled with Emscripten or Wasmer.\r\n",t+="You can also define and run custom JavaScript functions.\r\n\r\n",t+="Version: 0.0.10. ",t+="Backend: "+(this._worker?"WebWorker":"Prompts Fallback")+".\r\n",t+="Commands: "+[...this._jsCommands].map((t=>t[0])).sort().join(", ")+". ",t}async printWelcomeMessagePlusControlSequences(){return"c[0;37m"+await this.printWelcomeMessage()+"[0;37m\r\n"}_onXtermData(t){""==t&&this._worker&&(this._suppressOutputs=!0,this._terminateWorker(),this._initWorker(),this._runWasmCommandPromise?.reject("Ctrl + C"),this.isRunningCommand=!1)}}},814:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=class{programName;wasmModule;#r;constructor(t,e,r){this.programName=t,this.wasmModule=e,this._loadEmscrJsRuntime(r)}run(t,e,r,n,i,o,s,a,h){console.log("emscr runnable run:",this.programName,t),"function"!=typeof e&&(e=()=>{}),"function"!=typeof r&&(r=()=>{}),"function"!=typeof n&&(n=()=>{}),i instanceof Array||(i=[]),"function"!=typeof o&&(o=()=>{}),"function"!=typeof s&&(s=t=>{console.error(t)}),"function"!=typeof a&&(a=()=>{});let u,f={thisProgramm:this.programName,instantiateWasm:(t,e)=>(WebAssembly.instantiate(this.wasmModule,t).then((t=>e(t,this.wasmModule))),{}),preInit:[()=>{f.TTY.register(f.FS.makedev(5,0),{get_char:t=>e(t),put_char:(t,e)=>{t.output.push(e),r(e)},flush:t=>t.output=[],fsync:t=>console.log("fsynced stdout (EmscriptenRunnable does nothing in this case)")}),f.TTY.register(f.FS.makedev(6,0),{get_char:t=>e(t),put_char:(t,e)=>{t.output.push(e),n(e)},flush:t=>t.output=[],fsync:t=>console.log("fsynced stderr (EmscriptenRunnable does nothing in this case)")})}]};if(h){"string"!=typeof h&&(h=(h||"").toString());let t=0;f.stdin=()=>t<h.length?h.charCodeAt(t++):null}this.#r(f).then((e=>{this._writeFilesToFS(e,i),e.callMain(t),u=this._readFilesFromFS(e),a(u)})).catch((t=>s(t))).finally((()=>o(u||i)))}runHeadless(t,e,r,n,i,o){console.log("emscr runnable run headless:",this.programName,t),"function"!=typeof r&&(r=()=>{});let s="",a="",h="";this.run(t,(()=>{console.log("called runHeadless stdin")}),(t=>{s+=String.fromCharCode(t),a+=String.fromCharCode(t)}),(t=>{s+=String.fromCharCode(t),h+=String.fromCharCode(t)}),e,(()=>r({output:s,stdout:a,stderr:h})),n,i,o)}_readFilesFromFS(t,e="/",r=!0){const n=t.FS.lookupPath(e),i=e=>{let n=[];return Object.values(e.contents).forEach((e=>{let o=t.FS.getPath(e);t.FS.isFile(e.mode)&&n.push({name:o,timestamp:e.timestamp,bytes:r?t.FS.readFile(o):new Uint8Array}),t.FS.isDir(e.mode)&&(n=[...n,...i(e)])})),n};return i(n.node)}_writeFilesToFS(t,e=[]){e.forEach((e=>{try{if(e.bytes instanceof Uint8Array){t.FS.writeFile(e.name,e.bytes);const r=e.timestamp instanceof Date?e.timestamp.getTime():e.timestamp;"number"==typeof r&&t.FS.utime(e.name,r,r)}}catch(t){console.error(t.name+": "+t.message)}}))}_loadEmscrJsRuntime(t){const e="EmscrJSR_"+this.programName;if(this._isWorkerScope()){let r=new Blob([t],{type:"application/javascript"});importScripts(URL.createObjectURL(r)),console.log(t,r),this.#r=self[e]||self._createPyodideModule}else{if("undefined"==typeof document)throw new Error("can not load emscr js runtime environment");{const r=this.programName+"_emscrJSR";if(!document.getElementById(r)){let e=document.createElement("script");e.type="text/javascript",e.id=r,e.innerHTML=new TextDecoder("utf-8").decode(t),document.head.appendChild(e)}this.#r=window[e]}}}_isWorkerScope(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}}},34:(t,e,r)=>{"use strict";function n(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},n(t,e)}function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function o(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function s(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(void 0===e||0<e--)&&!(n=t.next()).done;)i.push(n.value)}catch(t){var o={error:t}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return i}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}r.d(e,{A:()=>Ro});var h="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:{},u="undefined"!=typeof BigInt?BigInt:h.BigInt||Number,f=DataView;f.prototype.setBigUint64||(f.prototype.setBigUint64=function(t,e,r){if(e<Math.pow(2,32)){e=Number(e);var n=0}else{n=e.toString(2),e="";for(var i=0;i<64-n.length;i++)e+="0";e+=n,n=parseInt(e.substring(0,32),2),e=parseInt(e.substring(32),2)}this.setUint32(t+(r?0:4),e,r),this.setUint32(t+(r?4:0),n,r)},f.prototype.getBigUint64=function(t,e){var r=this.getUint32(t+(e?0:4),e);t=this.getUint32(t+(e?4:0),e),r=r.toString(2),t=t.toString(2),e="";for(var n=0;n<32-r.length;n++)e+="0";return u("0b"+t+(e+r))});var l=void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c=[],p=[],d="undefined"!=typeof Uint8Array?Uint8Array:Array,_=!1;function m(){_=!0;for(var t=0;64>t;++t)c[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],p["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;p[45]=62,p[95]=63}function g(t,e,r){for(var n=[],i=e;i<r;i+=3)e=(t[i]<<16)+(t[i+1]<<8)+t[i+2],n.push(c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]);return n.join("")}function y(t){_||m();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;o<s;o+=16383)i.push(g(t,o,o+16383>s?s:o+16383));return 1===r?(t=t[e-1],n+=c[t>>2],n+=c[t<<4&63],n+="=="):2===r&&(t=(t[e-2]<<8)+t[e-1],n+=c[t>>10],n+=c[t>>4&63],n+=c[t<<2&63],n+="="),i.push(n),i.join("")}function E(t,e,r,n,i){var o=8*i-n-1,s=(1<<o)-1,a=s>>1,h=-7,u=r?-1:1,f=t[e+(i=r?i-1:0)];for(i+=u,r=f&(1<<-h)-1,f>>=-h,h+=o;0<h;r=256*r+t[e+i],i+=u,h-=8);for(o=r&(1<<-h)-1,r>>=-h,h+=n;0<h;o=256*o+t[e+i],i+=u,h-=8);if(0===r)r=1-a;else{if(r===s)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),r-=a}return(f?-1:1)*o*Math.pow(2,r-n)}function w(t,e,r,n,i,o){var s,a=8*o-i-1,h=(1<<a)-1,u=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var l=n?1:-1,c=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,n=h):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),2<=(e=1<=n+u?e+f/s:e+f*Math.pow(2,1-u))*s&&(n++,s/=2),n+u>=h?(e=0,n=h):1<=n+u?(e=(e*s-1)*Math.pow(2,i),n+=u):(e=e*Math.pow(2,u-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=255&e,o+=l,e/=256,i-=8);for(n=n<<i|e,a+=i;0<a;t[r+o]=255&n,o+=l,n/=256,a-=8);t[r+o-l]|=128*c}var S={}.toString,I=Array.isArray||function(t){return"[object Array]"==S.call(t)};b.TYPED_ARRAY_SUPPORT=void 0===l.TYPED_ARRAY_SUPPORT||l.TYPED_ARRAY_SUPPORT;var v=b.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function A(t,e){if((b.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<e)throw new RangeError("Invalid typed array length");return b.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=b.prototype:(null===t&&(t=new b(e)),t.length=e),t}function b(t,e,r){if(!(b.TYPED_ARRAY_SUPPORT||this instanceof b))return new b(t,e,r);if("number"==typeof t){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return O(this,t)}return T(this,t,e,r)}function T(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){if(e.byteLength,0>r||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),b.TYPED_ARRAY_SUPPORT?(t=e).__proto__=b.prototype:t=C(t,e),t}if("string"==typeof e){if(n=t,"string"==typeof(t=r)&&""!==t||(t="utf8"),!b.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return(e=(n=A(n,r=0|k(e,t))).write(e,t))!==r&&(n=n.slice(0,e)),n}return function(t,e){if(P(e)){var r=0|N(e.length);return 0===(t=A(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return(r="number"!=typeof e.length)||(r=(r=e.length)!=r),r?A(t,0):C(t,e);if("Buffer"===e.type&&I(e.data))return C(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function R(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function O(t,e){if(R(e),t=A(t,0>e?0:0|N(e)),!b.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function C(t,e){var r=0>e.length?0:0|N(e.length);t=A(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function N(t){if(t>=(b.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(b.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return 0|t}function P(t){return!(null==t||!t._isBuffer)}function k(t,e){if(P(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(n)return z(t).length;e=(""+e).toLowerCase(),n=!0}}function L(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r<e;++r)n=(t=n)+(n=16>(n=this[r])?"0"+n.toString(16):n.toString(16));return n;case"utf8":case"utf-8":return D(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(127&this[e]);return t;case"latin1":case"binary":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(this[e]);return t;case"base64":return 0===e&&r===this.length?y(this):y(this.slice(e,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(e=this.slice(e,r),r="",t=0;t<e.length;t+=2)r+=String.fromCharCode(e[t]+256*e[t+1]);return r;default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function W(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function B(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=b.from(e,n)),P(e))return 0===e.length?-1:F(t,e,r,n,i);if("number"==typeof e)return e&=255,b.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):F(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function F(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;s=2,a/=2,h/=2,r/=2}if(i)for(n=-1;r<a;r++)if(o(t,r)===o(e,-1===n?0:r-n)){if(-1===n&&(n=r),r-n+1===h)return n*s}else-1!==n&&(r-=r-n),n=-1;else for(r+h>a&&(r=a-h);0<=r;r--){for(a=!0,n=0;n<h;n++)if(o(t,r+n)!==o(e,n)){a=!1;break}if(a)return r}return-1}function D(t,e,r){r=Math.min(t.length,r);for(var n=[];e<r;){var i=t[e],o=null,s=239<i?4:223<i?3:191<i?2:1;if(e+s<=r)switch(s){case 1:128>i&&(o=i);break;case 2:var a=t[e+1];128==(192&a)&&127<(i=(31&i)<<6|63&a)&&(o=i);break;case 3:a=t[e+1];var h=t[e+2];128==(192&a)&&128==(192&h)&&2047<(i=(15&i)<<12|(63&a)<<6|63&h)&&(55296>i||57343<i)&&(o=i);break;case 4:a=t[e+1],h=t[e+2];var u=t[e+3];128==(192&a)&&128==(192&h)&&128==(192&u)&&65535<(i=(15&i)<<18|(63&a)<<12|(63&h)<<6|63&u)&&1114112>i&&(o=i)}null===o?(o=65533,s=1):65535<o&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),e+=s}if((t=n.length)<=U)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e<t;)r+=String.fromCharCode.apply(String,n.slice(e,e+=U));n=r}return n}b.poolSize=8192,b._augment=function(t){return t.__proto__=b.prototype,t},b.from=function(t,e,r){return T(null,t,e,r)},b.TYPED_ARRAY_SUPPORT&&(b.prototype.__proto__=Uint8Array.prototype,b.__proto__=Uint8Array),b.alloc=function(t,e,r){return R(t),0>=t?A(null,t):void 0!==e?"string"==typeof r?A(null,t).fill(e,r):A(null,t).fill(e):A(null,t)},b.allocUnsafe=function(t){return O(null,t)},b.allocUnsafeSlow=function(t){return O(null,t)},b.isBuffer=q,b.compare=function(t,e){if(!P(t)||!P(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},b.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},b.concat=function(t,e){if(!I(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return b.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;e=b.allocUnsafe(e);var n=0;for(r=0;r<t.length;++r){var i=t[r];if(!P(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(e,n),n+=i.length}return e},b.byteLength=k,b.prototype._isBuffer=!0,b.prototype.swap16=function(){var t=this.length;if(0!=t%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)W(this,e,e+1);return this},b.prototype.swap32=function(){var t=this.length;if(0!=t%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)W(this,e,e+3),W(this,e+1,e+2);return this},b.prototype.swap64=function(){var t=this.length;if(0!=t%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)W(this,e,e+7),W(this,e+1,e+6),W(this,e+2,e+5),W(this,e+3,e+4);return this},b.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?D(this,0,t):L.apply(this,arguments)},b.prototype.equals=function(t){if(!P(t))throw new TypeError("Argument must be a Buffer");return this===t||0===b.compare(this,t)},b.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(t+=" ... ")),"<Buffer "+t+">"},b.prototype.compare=function(t,e,r,n,i){if(!P(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;e<a;++e)if(n[e]!==t[e]){o=n[e],s=t[e];break}return o<s?-1:s<o?1:0},b.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},b.prototype.indexOf=function(t,e,r){return B(this,t,e,r,!0)},b.prototype.lastIndexOf=function(t,e,r){return B(this,t,e,r,!1)},b.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),0<t.length&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r))>n&&(r=n):r=n,0!=(n=t.length)%2)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n<r;++n){if(i=parseInt(t.substr(2*n,2),16),isNaN(i)){t=n;break t}this[e+n]=i}t=n}return t;case"utf8":case"utf-8":return Z(z(t,this.length-e),this,e,r);case"ascii":case"latin1":case"binary":return Z(V(t),this,e,r);case"base64":return Z(K(t),this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=t,i=this.length-e;for(var o=[],s=0;s<n.length&&!(0>(i-=2));++s){var a=n.charCodeAt(s);t=a>>8,a%=256,o.push(a),o.push(t)}return Z(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var U=4096;function M(t,e,r){if(0!=t%1||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,r,n,i,o){if(!P(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function G(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function H(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function Y(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}b.prototype.slice=function(t,e){var r=this.length;if(0>(t=~~t)?0>(t+=r)&&(t=0):t>r&&(t=r),0>(e=void 0===e?r:~~e)?0>(e+=r)&&(e=0):e>r&&(e=r),e<t&&(e=t),b.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,e)).__proto__=b.prototype;else{e=new b(r=e-t,void 0);for(var n=0;n<r;++n)e[n]=this[n+t]}return e},b.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r},b.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length),r=this[t+--e];for(var n=1;0<e&&(n*=256);)r+=this[t+--e]*n;return r},b.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},b.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},b.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},b.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},b.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},b.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r>=128*n&&(r-=Math.pow(2,8*e)),r},b.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0<r&&(n*=256);)i+=this[t+--r]*n;return i>=128*n&&(i-=Math.pow(2,8*e)),i},b.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},b.prototype.readInt16LE=function(t,e){return e||M(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},b.prototype.readInt16BE=function(t,e){return e||M(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},b.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},b.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},b.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),E(this,t,!0,23,4)},b.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),E(this,t,!1,23,4)},b.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),E(this,t,!0,52,8)},b.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),E(this,t,!1,52,8)},b.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=255&t;++i<r&&(n*=256);)this[e+i]=t/n&255;return e+r},b.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)this[e+n]=t/i&255;return e+r},b.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,1,255,0),b.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},b.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,65535,0),b.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):G(this,t,e,!0),e+2},b.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,65535,0),b.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):G(this,t,e,!1),e+2},b.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,4294967295,0),b.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):H(this,t,e,!0),e+4},b.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,4294967295,0),b.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},b.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||x(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n),n=0;var i=1,o=0;for(this[e]=255&t;++n<r&&(i*=256);)0>t&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/i|0)-o&255;return e+r},b.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||x(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=1,o=0;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)0>t&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/i|0)-o&255;return e+r},b.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,1,127,-128),b.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},b.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,32767,-32768),b.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):G(this,t,e,!0),e+2},b.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,32767,-32768),b.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):G(this,t,e,!1),e+2},b.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,2147483647,-2147483648),b.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):H(this,t,e,!0),e+4},b.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),b.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},b.prototype.writeFloatLE=function(t,e,r){return r||Y(this,0,e,4),w(this,t,e,!0,23,4),e+4},b.prototype.writeFloatBE=function(t,e,r){return r||Y(this,0,e,4),w(this,t,e,!1,23,4),e+4},b.prototype.writeDoubleLE=function(t,e,r){return r||Y(this,0,e,8),w(this,t,e,!0,52,8),e+8},b.prototype.writeDoubleBE=function(t,e,r){return r||Y(this,0,e,8),w(this,t,e,!1,52,8),e+8},b.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&r<e&&e<n)for(n=i-1;0<=n;--n)t[n+e]=this[n+r];else if(1e3>i||!b.TYPED_ARRAY_SUPPORT)for(n=0;n<i;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},b.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);256>i&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!b.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else for(i=(t=P(t)?t:z(new b(t,n).toString())).length,n=0;n<r-e;++n)this[n+e]=t[n%i];return this};var j=/[^+\/0-9A-Za-z-_]/g;function z(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&57344>r){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(56320>r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw Error("Invalid code point");if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function K(t){if(2>(t=(t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(j,"")).length)t="";else for(;0!=t.length%4;)t+="=";_||m();var e=t.length;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var r="="===t[e-2]?2:"="===t[e-1]?1:0,n=new d(3*e/4-r),i=0<r?e-4:e,o=0;for(e=0;e<i;e+=4){var s=p[t.charCodeAt(e)]<<18|p[t.charCodeAt(e+1)]<<12|p[t.charCodeAt(e+2)]<<6|p[t.charCodeAt(e+3)];n[o++]=s>>16&255,n[o++]=s>>8&255,n[o++]=255&s}return 2===r?(s=p[t.charCodeAt(e)]<<2|p[t.charCodeAt(e+1)]>>4,n[o++]=255&s):1===r&&(s=p[t.charCodeAt(e)]<<10|p[t.charCodeAt(e+1)]<<4|p[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=255&s),n}function Z(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function q(t){return null!=t&&(!!t._isBuffer||X(t)||"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&X(t.slice(0,0)))}function X(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var J=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:v,Buffer:b,SlowBuffer:function(t){return+t!=t&&(t=0),b.alloc(+t)},isBuffer:q}),Q=b,$="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function tt(t,e){return t(e={exports:{}},e.exports),e.exports}function et(){throw Error("setTimeout has not been defined")}function rt(){throw Error("clearTimeout has not been defined")}var nt=et,it=rt;function ot(t){if(nt===setTimeout)return setTimeout(t,0);if((nt===et||!nt)&&setTimeout)return nt=setTimeout,setTimeout(t,0);try{return nt(t,0)}catch(e){try{return nt.call(null,t,0)}catch(e){return nt.call(this,t,0)}}}"function"==typeof l.setTimeout&&(nt=setTimeout),"function"==typeof l.clearTimeout&&(it=clearTimeout);var st,at=[],ht=!1,ut=-1;function ft(){ht&&st&&(ht=!1,st.length?at=st.concat(at):ut=-1,at.length&<())}function lt(){if(!ht){var t=ot(ft);ht=!0;for(var e=at.length;e;){for(st=at,at=[];++ut<e;)st&&st[ut].run();ut=-1,e=at.length}st=null,ht=!1,function(t){if(it===clearTimeout)return clearTimeout(t);if((it===rt||!it)&&clearTimeout)return it=clearTimeout,clearTimeout(t);try{return it(t)}catch(e){try{return it.call(null,t)}catch(e){return it.call(this,t)}}}(t)}}function ct(t,e){this.fun=t,this.array=e}ct.prototype.run=function(){this.fun.apply(null,this.array)};var pt=l.performance||{},dt=(pt.now||pt.mozNow||pt.msNow||pt.oNow||pt.webkitNow,new Date,function(){return"/"}),_t=tt((function(t,e){function r(t,e){for(var r in t)e[r]=t[r]}function n(t,e,r){return i(t,e,r)}var i=J.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=J:(r(J,e),e.Buffer=n),n.prototype=Object.create(i.prototype),r(i,n),n.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},n.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");return t=i(t),void 0!==e?"string"==typeof r?t.fill(e,r):t.fill(e):t.fill(0),t},n.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return J.SlowBuffer(t)}})),mt=tt((function(t,e){function r(){throw Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function n(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>u||0>t)throw new TypeError("offset must be a uint32");if(t>a||t>e)throw new RangeError("offset out of range")}function i(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>u||0>t)throw new TypeError("size must be a uint32");if(t+e>r||t>a)throw new RangeError("buffer too small")}function o(t,e,r,n){if(e=new Uint8Array(t.buffer,e,r),h.getRandomValues(e),!n)return t;!function(t){var e=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];at.push(new ct(t,e)),1!==at.length||ht||ot(lt)}((function(){n(null,t)}))}var s=_t.Buffer,a=_t.kMaxLength,h=$.crypto||$.msCrypto,u=Math.pow(2,32)-1;h&&h.getRandomValues?(e.randomFill=function(t,e,r,a){if(!(s.isBuffer(t)||t instanceof $.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)a=e,e=0,r=t.length;else if("function"==typeof r)a=r,r=t.length-e;else if("function"!=typeof a)throw new TypeError('"cb" argument must be a function');return n(e,t.length),i(r,e,t.length),o(t,e,r,a)},e.randomFillSync=function(t,e,r){if(void 0===e&&(e=0),!(s.isBuffer(t)||t instanceof $.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return n(e,t.length),void 0===r&&(r=t.length-e),i(r,e,t.length),o(t,e,r)}):(e.randomFill=r,e.randomFillSync=r)})),gt=tt((function(t){t.exports=mt})).randomFillSync,yt=Math.floor(.001*(Date.now()-performance.now()));function Et(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function wt(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(2>n.length||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(2<n.length){if((o=n.lastIndexOf("/"))!==n.length-1){-1===o?(n="",i=0):i=(n=n.slice(0,o)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n=0<n.length?n+"/..":"..",i=2)}else n=0<n.length?n+"/"+t.slice(o+1,a):t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var St,It={resolve:function(){for(var t,e="",r=!1,n=arguments.length-1;-1<=n&&!r;n--){if(0<=n)var i=arguments[n];else void 0===t&&(t=dt()),i=t;Et(i),0!==i.length&&(e=i+"/"+e,r=47===i.charCodeAt(0))}return e=wt(e,!r),r?0<e.length?"/"+e:"/":0<e.length?e:"."},normalize:function(t){if(Et(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=wt(t,!e)).length||e||(t="."),0<t.length&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return Et(t),0<t.length&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];Et(r),0<r.length&&(t=void 0===t?r:t+"/"+r)}return void 0===t?".":It.normalize(t)},relative:function(t,e){if(Et(t),Et(e),t===e)return"";if((t=It.resolve(t))===(e=It.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,i=n-r,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var s=e.length-o,a=i<s?i:s,h=-1,u=0;u<=a;++u){if(u===a){if(s>a){if(47===e.charCodeAt(o+u))return e.slice(o+u+1);if(0===u)return e.slice(o+u)}else i>a&&(47===t.charCodeAt(r+u)?h=u:0===u&&(h=0));break}var f=t.charCodeAt(r+u);if(f!==e.charCodeAt(o+u))break;47===f&&(h=u)}for(i="",u=r+h+1;u<=n;++u)u!==n&&47!==t.charCodeAt(u)||(i=0===i.length?i+"..":i+"/..");return 0<i.length?i+e.slice(o+h):(o+=h,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(Et(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,i=!0,o=t.length-1;1<=o;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');Et(t);var r,n=0,i=-1,o=!0;if(void 0!==e&&0<e.length&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,a=-1;for(r=t.length-1;0<=r;--r){var h=t.charCodeAt(r);if(47===h){if(!o){n=r+1;break}}else-1===a&&(o=!1,a=r+1),0<=s&&(h===e.charCodeAt(s)?-1==--s&&(i=r):(s=-1,i=a))}return n===i?i=a:-1===i&&(i=t.length),t.slice(n,i)}for(r=t.length-1;0<=r;--r)if(47===t.charCodeAt(r)){if(!o){n=r+1;break}}else-1===i&&(o=!1,i=r+1);return-1===i?"":t.slice(n,i)},extname:function(t){Et(t);for(var e=-1,r=0,n=-1,i=!0,o=0,s=t.length-1;0<=s;--s){var a=t.charCodeAt(s);if(47===a){if(!i){r=s+1;break}}else-1===n&&(i=!1,n=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1)}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);var e=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return e?e===t.root?e+r:e+"/"+r:r},parse:function(t){Et(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r=t.charCodeAt(0),n=47===r;if(n){e.root="/";var i=1}else i=0;for(var o=-1,s=0,a=-1,h=!0,u=t.length-1,f=0;u>=i;--u)if(47===(r=t.charCodeAt(u))){if(!h){s=u+1;break}}else-1===a&&(h=!1,a=u+1),46===r?-1===o?o=u:1!==f&&(f=1):-1!==o&&(f=-1);return-1===o||-1===a||0===f||1===f&&o===a-1&&o===s+1?-1!==a&&(e.base=e.name=0===s&&n?t.slice(1,a):t.slice(s,a)):(0===s&&n?(e.name=t.slice(1,o),e.base=t.slice(1,a)):(e.name=t.slice(s,o),e.base=t.slice(s,a)),e.ext=t.slice(o,a)),0<s?e.dir=t.slice(0,s-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null},vt=It.posix=It,At={hrtime:function(t){return 1e9*(t=function(t){var e=.001*performance.now(),r=Math.floor(e)+yt;return e=Math.floor(e%1*1e9),t&&(r-=t[0],0>(e-=t[1])&&(r--,e+=1e9)),[r,e]}(t))[0]+t[1]},exit:function(t){throw new ye(t)},kill:function(t){throw new Ee(t)},randomFillSync:gt,isTTY:function(){return!0},path:Object.freeze({__proto__:null,default:vt,__moduleExports:vt}),fs:null},bt=u(1),Tt=u(2),Rt=u(4),Ot=u(8),Ct=u(16),Nt=u(32),Pt=u(64),kt=u(128),Lt=u(256),Wt=u(512),Bt=u(1024),Ft=u(2048),Dt=u(4096),Ut=u(8192),Mt=u(16384),xt=u(32768),Gt=u(65536),Ht=u(131072),Yt=u(262144),jt=u(524288),zt=u(1048576),Vt=u(2097152),Kt=u(4194304),Zt=u(8388608),qt=u(16777216),Xt=u(33554432),Jt=u(67108864),Qt=u(134217728),$t=u(268435456),te=bt|Tt|Rt|Ot|Ct|Nt|Pt|kt|Lt|Wt|Bt|Ft|Dt|Ut|Mt|xt|Gt|Ht|Yt|jt|zt|Vt|Zt|Kt|qt|Jt|Xt|Qt|$t,ee=bt|Tt|Rt|Ot|Ct|Nt|Pt|kt|Lt|Vt|Kt|Zt|Qt,re=u(0),ne=Ot|Ct|kt|Wt|Bt|Ft|Dt|Ut|Mt|xt|Gt|Ht|Yt|jt|zt|Vt|Zt|qt|Jt|Xt|Qt,ie=ne|ee,oe=Tt|Ot|Pt|Vt|Qt|$t,se=Tt|Ot|Pt|Vt|Qt,ae=u(0),he={E2BIG:1,EACCES:2,EADDRINUSE:3,EADDRNOTAVAIL:4,EAFNOSUPPORT:5,EALREADY:7,EAGAIN:6,EBADF:8,EBADMSG:9,EBUSY:10,ECANCELED:11,ECHILD:12,ECONNABORTED:13,ECONNREFUSED:14,ECONNRESET:15,EDEADLOCK:16,EDESTADDRREQ:17,EDOM:18,EDQUOT:19,EEXIST:20,EFAULT:21,EFBIG:22,EHOSTDOWN:23,EHOSTUNREACH:23,EIDRM:24,EILSEQ:25,EINPROGRESS:26,EINTR:27,EINVAL:28,EIO:29,EISCONN:30,EISDIR:31,ELOOP:32,EMFILE:33,EMLINK:34,EMSGSIZE:35,EMULTIHOP:36,ENAMETOOLONG:37,ENETDOWN:38,ENETRESET:39,ENETUNREACH:40,ENFILE:41,ENOBUFS:42,ENODEV:43,ENOENT:44,ENOEXEC:45,ENOLCK:46,ENOLINK:47,ENOMEM:48,ENOMSG:49,ENOPROTOOPT:50,ENOSPC:51,ENOSYS:52,ENOTCONN:53,ENOTDIR:54,ENOTEMPTY:55,ENOTRECOVERABLE:56,ENOTSOCK:57,ENOTTY:59,ENXIO:60,EOVERFLOW:61,EOWNERDEAD:62,EPERM:63,EPIPE:64,EPROTO:65,EPROTONOSUPPORT:66,EPROTOTYPE:67,ERANGE:68,EROFS:69,ESPIPE:70,ESRCH:71,ESTALE:72,ETIMEDOUT:73,ETXTBSY:74,EXDEV:75},ue=((St={})[6]="SIGHUP",St[8]="SIGINT",St[11]="SIGQUIT",St[7]="SIGILL",St[15]="SIGTRAP",St[0]="SIGABRT",St[2]="SIGBUS",St[5]="SIGFPE",St[9]="SIGKILL",St[20]="SIGUSR1",St[12]="SIGSEGV",St[21]="SIGUSR2",St[10]="SIGPIPE",St[1]="SIGALRM",St[14]="SIGTERM",St[3]="SIGCHLD",St[4]="SIGCONT",St[13]="SIGSTOP",St[16]="SIGTSTP",St[17]="SIGTTIN",St[18]="SIGTTOU",St[19]="SIGURG",St[23]="SIGXCPU",St[24]="SIGXFSZ",St[22]="SIGVTALRM",St),fe=bt|Tt|Ct|kt|Vt|Qt,le=bt|Pt|Ct|kt|Vt|Qt;function ce(t){var e=Math.trunc(t);return t=u(Math.round(1e6*(t-e))),u(e)*u(1e6)+t}function pe(t){return"number"==typeof t&&(t=Math.trunc(t)),t=u(t),Number(t/u(1e6))}function de(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{return t.apply(void 0,a(e))}catch(t){if(t&&t.code&&"string"==typeof t.code)return he[t.code]||28;if(t instanceof ge)return t.errno;throw t}}}function _e(t,e){var r=t.FD_MAP.get(e);if(!r)throw new ge(8);if(void 0===r.filetype){var n=t.bindings.fs.fstatSync(r.real);e=(t=me(t,e,n)).rightsBase,n=t.rightsInheriting,r.filetype=t.filetype,r.rights||(r.rights={base:e,inheriting:n})}return r}function me(t,e,r){switch(!0){case r.isBlockDevice():return{filetype:1,rightsBase:te,rightsInheriting:te};case r.isCharacterDevice():return void 0!==e&&t.bindings.isTTY(e)?{filetype:2,rightsBase:se,rightsInheriting:ae}:{filetype:2,rightsBase:te,rightsInheriting:te};case r.isDirectory():return{filetype:3,rightsBase:ne,rightsInheriting:ie};case r.isFIFO():return{filetype:6,rightsBase:oe,rightsInheriting:te};case r.isFile():return{filetype:4,rightsBase:ee,rightsInheriting:re};case r.isSocket():return{filetype:6,rightsBase:oe,rightsInheriting:te};case r.isSymbolicLink():return{filetype:7,rightsBase:u(0),rightsInheriting:u(0)};default:return{filetype:0,rightsBase:u(0),rightsInheriting:u(0)}}}var ge=function(t){function e(r){var n=t.call(this)||this;return n.errno=r,Object.setPrototypeOf(n,e.prototype),n}return i(e,t),e}(Error),ye=function(t){function e(r){var n=t.call(this,"WASI Exit error: "+r)||this;return n.code=r,Object.setPrototypeOf(n,e.prototype),n}return i(e,t),e}(Error),Ee=function(t){function e(r){var n=t.call(this,"WASI Kill signal: "+r)||this;return n.signal=r,Object.setPrototypeOf(n,e.prototype),n}return i(e,t),e}(Error),we=function(){function t(t){function e(t){switch(t){case 1:return p.hrtime();case 0:return ce(Date.now());case 2:case 3:return p.hrtime()-A;default:return null}}function r(t,e){if(t=_e(h,t),e!==u(0)&&(t.rights.base&e)===u(0))throw new ge(63);return t}function n(t,e){return h.refreshMemory(),Array.from({length:e},(function(e,r){return r=t+8*r,e=h.view.getUint32(r,!0),r=h.view.getUint32(r+4,!0),new Uint8Array(h.memory.buffer,e,r)}))}var i,h=this,f={};t&&t.preopens?f=t.preopens:t&&t.preopenDirectories&&(f=t.preopenDirectories);var l={};t&&t.env&&(l=t.env);var c=[];t&&t.args&&(c=t.args);var p=At;t&&t.bindings&&(p=t.bindings),this.view=this.memory=void 0,this.bindings=p,this.FD_MAP=new Map([[0,{real:0,filetype:2,rights:{base:fe,inheriting:u(0)},path:void 0}],[1,{real:1,filetype:2,rights:{base:le,inheriting:u(0)},path:void 0}],[2,{real:2,filetype:2,rights:{base:le,inheriting:u(0)},path:void 0}]]);var d=this.bindings.fs,_=this.bindings.path;try{for(var m=o(Object.entries(f)),g=m.next();!g.done;g=m.next()){var y=s(g.value,2),E=y[0],w=y[1],S=d.openSync(w,d.constants.O_RDONLY),I=a(this.FD_MAP.keys()).reverse()[0]+1;this.FD_MAP.set(I,{real:S,filetype:3,rights:{base:ne,inheriting:ie},fakePath:E,path:w})}}catch(t){var v={error:t}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(v)throw v.error}}var A=p.hrtime();this.wasiImport={args_get:function(t,e){h.refreshMemory();var r=t,n=e;return c.forEach((function(t){h.view.setUint32(r,n,!0),r+=4,n+=Q.from(h.memory.buffer).write(t+"\0",n)})),0},args_sizes_get:function(t,e){return h.refreshMemory(),h.view.setUint32(t,c.length,!0),t=c.reduce((function(t,e){return t+Q.byteLength(e)+1}),0),h.view.setUint32(e,t,!0),0},environ_get:function(t,e){h.refreshMemory();var r=t,n=e;return Object.entries(l).forEach((function(t){var e=s(t,2);t=e[0],e=e[1],h.view.setUint32(r,n,!0),r+=4,n+=Q.from(h.memory.buffer).write(t+"="+e+"\0",n)})),0},environ_sizes_get:function(t,e){h.refreshMemory();var r=Object.entries(l).map((function(t){return(t=s(t,2))[0]+"="+t[1]+"\0"})),n=r.reduce((function(t,e){return t+Q.byteLength(e)}),0);return h.view.setUint32(t,r.length,!0),h.view.setUint32(e,n,!0),0},clock_res_get:function(t,e){switch(t){case 1:case 2:case 3:var r=u(1);break;case 0:r=u(1e3)}return h.view.setBigUint64(e,r),0},clock_time_get:function(t,r,n){return h.refreshMemory(),null===(t=e(t))?28:(h.view.setBigUint64(n,u(t),!0),0)},fd_advise:de((function(t){return r(t,kt),52})),fd_allocate:de((function(t){return r(t,Lt),52})),fd_close:de((function(t){var e=r(t,u(0));return d.closeSync(e.real),h.FD_MAP.delete(t),0})),fd_datasync:de((function(t){return t=r(t,bt),d.fdatasyncSync(t.real),0})),fd_fdstat_get:de((function(t,e){return t=r(t,u(0)),h.refreshMemory(),h.view.setUint8(e,t.filetype),h.view.setUint16(e+2,0,!0),h.view.setUint16(e+4,0,!0),h.view.setBigUint64(e+8,u(t.rights.base),!0),h.view.setBigUint64(e+8+8,u(t.rights.inheriting),!0),0})),fd_fdstat_set_flags:de((function(t){return r(t,Ot),52})),fd_fdstat_set_rights:de((function(t,e,n){return((t=r(t,u(0))).rights.base|e)>t.rights.base||(t.rights.inheriting|n)>t.rights.inheriting?63:(t.rights.base=e,t.rights.inheriting=n,0)})),fd_filestat_get:de((function(t,e){t=r(t,Vt);var n=d.fstatSync(t.real);return h.refreshMemory(),h.view.setBigUint64(e,u(n.dev),!0),e+=8,h.view.setBigUint64(e,u(n.ino),!0),e+=8,h.view.setUint8(e,t.filetype),e+=8,h.view.setBigUint64(e,u(n.nlink),!0),e+=8,h.view.setBigUint64(e,u(n.size),!0),e+=8,h.view.setBigUint64(e,ce(n.atimeMs),!0),e+=8,h.view.setBigUint64(e,ce(n.mtimeMs),!0),h.view.setBigUint64(e+8,ce(n.ctimeMs),!0),0})),fd_filestat_set_size:de((function(t,e){return t=r(t,Kt),d.ftruncateSync(t.real,Number(e)),0})),fd_filestat_set_times:de((function(t,n,i,o){t=r(t,Zt);var s=d.fstatSync(t.real),a=s.atime;s=s.mtime;var h=pe(e(0));return 3&~o&&12&~o?(1&~o?!(2&~o)&&(a=h):a=pe(n),4&~o?!(8&~o)&&(s=h):s=pe(i),d.futimesSync(t.real,new Date(a),new Date(s)),0):28})),fd_prestat_get:de((function(t,e){return(t=r(t,u(0))).path?(h.refreshMemory(),h.view.setUint8(e,0),h.view.setUint32(e+4,Q.byteLength(t.fakePath),!0),0):28})),fd_prestat_dir_name:de((function(t,e,n){return(t=r(t,u(0))).path?(h.refreshMemory(),Q.from(h.memory.buffer).write(t.fakePath,e,n,"utf8"),0):28})),fd_pwrite:de((function(t,e,i,o,s){var a=r(t,Pt|Rt),u=0;return n(e,i).forEach((function(t){for(var e=0;e<t.byteLength;)e+=d.writeSync(a.real,t,e,t.byteLength-e,Number(o)+u+e);u+=e})),h.view.setUint32(s,u,!0),0})),fd_write:de((function(t,e,i,o){var s=r(t,Pt),a=0;return n(e,i).forEach((function(t){for(var e=0;e<t.byteLength;){var r=d.writeSync(s.real,t,e,t.byteLength-e,s.offset?Number(s.offset):null);s.offset&&(s.offset+=u(r)),e+=r}a+=e})),h.view.setUint32(o,a,!0),0})),fd_pread:de((function(t,e,i,s,a){var u;t=r(t,Tt|Rt);var f=0;try{var l=o(n(e,i)),c=l.next();t:for(;!c.done;c=l.next()){var p=c.value;for(e=0;e<p.byteLength;){var _=p.byteLength-e,m=d.readSync(t.real,p,e,p.byteLength-e,Number(s)+f+e);if(e+=m,f+=m,0===m||m<_)break t}f+=e}}catch(t){var g={error:t}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(g)throw g.error}}return h.view.setUint32(a,f,!0),0})),fd_read:de((function(t,e,i,s){var a,f=0===(t=r(t,Tt)).real,l=0;try{var c=o(n(e,i)),p=c.next();t:for(;!p.done;p=c.next()){var _=p.value;for(e=0;e<_.byteLength;){var m=_.byteLength-e,g=d.readSync(t.real,_,e,m,f||void 0===t.offset?null:Number(t.offset));if(f||(t.offset=(t.offset?t.offset:u(0))+u(g)),e+=g,l+=g,0===g||g<m)break t}}}catch(t){var y={error:t}}finally{try{p&&!p.done&&(a=c.return)&&a.call(c)}finally{if(y)throw y.error}}return h.view.setUint32(s,l,!0),0})),fd_readdir:de((function(t,e,n,i,o){t=r(t,Mt),h.refreshMemory();var s=d.readdirSync(t.path,{withFileTypes:!0}),a=e;for(i=Number(i);i<s.length;i+=1){var f=s[i],l=Q.byteLength(f.name);if(e-a>n)break;if(h.view.setBigUint64(e,u(i+1),!0),(e+=8)-a>n)break;var c=d.statSync(_.resolve(t.path,f.name));if(h.view.setBigUint64(e,u(c.ino),!0),(e+=8)-a>n)break;if(h.view.setUint32(e,l,!0),(e+=4)-a>n)break;switch(!0){case c.isBlockDevice():c=1;break;case c.isCharacterDevice():c=2;break;case c.isDirectory():c=3;break;case c.isFIFO():c=6;break;case c.isFile():c=4;break;case c.isSocket():c=6;break;case c.isSymbolicLink():c=7;break;default:c=0}if(h.view.setUint8(e,c),e+=1,(e+=3)+l>=a+n)break;Q.from(h.memory.buffer).write(f.name,e),e+=l}return h.view.setUint32(o,Math.min(e-a,n),!0),0})),fd_renumber:de((function(t,e){return r(t,u(0)),r(e,u(0)),d.closeSync(h.FD_MAP.get(t).real),h.FD_MAP.set(t,h.FD_MAP.get(e)),h.FD_MAP.delete(e),0})),fd_seek:de((function(t,e,n,i){switch(t=r(t,Rt),h.refreshMemory(),n){case 1:t.offset=(t.offset?t.offset:u(0))+u(e);break;case 2:n=d.fstatSync(t.real).size,t.offset=u(n)+u(e);break;case 0:t.offset=u(e)}return h.view.setBigUint64(i,t.offset,!0),0})),fd_tell:de((function(t,e){return t=r(t,Nt),h.refreshMemory(),t.offset||(t.offset=u(0)),h.view.setBigUint64(e,t.offset,!0),0})),fd_sync:de((function(t){return t=r(t,Ct),d.fsyncSync(t.real),0})),path_create_directory:de((function(t,e,n){return(t=r(t,Wt)).path?(h.refreshMemory(),e=Q.from(h.memory.buffer,e,n).toString(),d.mkdirSync(_.resolve(t.path,e)),0):28})),path_filestat_get:de((function(t,e,n,i,o){return(t=r(t,Yt)).path?(h.refreshMemory(),n=Q.from(h.memory.buffer,n,i).toString(),n=d.statSync(_.resolve(t.path,n)),h.view.setBigUint64(o,u(n.dev),!0),o+=8,h.view.setBigUint64(o,u(n.ino),!0),o+=8,h.view.setUint8(o,me(h,void 0,n).filetype),o+=8,h.view.setBigUint64(o,u(n.nlink),!0),o+=8,h.view.setBigUint64(o,u(n.size),!0),o+=8,h.view.setBigUint64(o,ce(n.atimeMs),!0),o+=8,h.view.setBigUint64(o,ce(n.mtimeMs),!0),h.view.setBigUint64(o+8,ce(n.ctimeMs),!0),0):28})),path_filestat_set_times:de((function(t,n,i,o,s,a,u){if(!(t=r(t,zt)).path)return 28;h.refreshMemory();var f=d.fstatSync(t.real);n=f.atime,f=f.mtime;var l=pe(e(0));return 3&~u&&12&~u?(1&~u?!(2&~u)&&(n=l):n=pe(s),4&~u?!(8&~u)&&(f=l):f=pe(a),i=Q.from(h.memory.buffer,i,o).toString(),d.utimesSync(_.resolve(t.path,i),new Date(n),new Date(f)),0):28})),path_link:de((function(t,e,n,i,o,s,a){return t=r(t,Ft),o=r(o,Dt),t.path&&o.path?(h.refreshMemory(),n=Q.from(h.memory.buffer,n,i).toString(),s=Q.from(h.memory.buffer,s,a).toString(),d.linkSync(_.resolve(t.path,n),_.resolve(o.path,s)),0):28})),path_open:de((function(t,e,n,i,o,s,f,l,c){e=r(t,Ut),s=u(s),f=u(f),t=(s&(Tt|Mt))!==u(0);var p=(s&(bt|Pt|Lt|Kt))!==u(0);if(p&&t)var m=d.constants.O_RDWR;else t?m=d.constants.O_RDONLY:p&&(m=d.constants.O_WRONLY);if(t=s|Ut,s|=f,1&o&&(m|=d.constants.O_CREAT,t|=Bt),2&o&&(m|=d.constants.O_DIRECTORY),4&o&&(m|=d.constants.O_EXCL),8&o&&(m|=d.constants.O_TRUNC,t|=jt),1&l&&(m|=d.constants.O_APPEND),2&l&&(m=d.constants.O_DSYNC?m|d.constants.O_DSYNC:m|d.constants.O_SYNC,s|=bt),4&l&&(m|=d.constants.O_NONBLOCK),8&l&&(m=d.constants.O_RSYNC?m|d.constants.O_RSYNC:m|d.constants.O_SYNC,s|=Ct),16&l&&(m|=d.constants.O_SYNC,s|=Ct),p&&!(m&(d.constants.O_APPEND|d.constants.O_TRUNC))&&(s|=Rt),h.refreshMemory(),n=Q.from(h.memory.buffer,n,i).toString(),n=_.resolve(e.path,n),_.relative(e.path,n).startsWith(".."))return 76;try{var g=d.realpathSync(n);if(_.relative(e.path,g).startsWith(".."))return 76}catch(t){if("ENOENT"!==t.code)throw t;g=n}try{var y=d.statSync(g).isDirectory()}catch(t){}return m=!p&&y?d.openSync(g,d.constants.O_RDONLY):d.openSync(g,m),y=a(h.FD_MAP.keys()).reverse()[0]+1,h.FD_MAP.set(y,{real:m,filetype:void 0,rights:{base:t,inheriting:s},path:g}),_e(h,y),h.view.setUint32(c,y,!0),0})),path_readlink:de((function(t,e,n,i,o,s){return(t=r(t,xt)).path?(h.refreshMemory(),e=Q.from(h.memory.buffer,e,n).toString(),e=_.resolve(t.path,e),e=d.readlinkSync(e),i=Q.from(h.memory.buffer).write(e,i,o),h.view.setUint32(s,i,!0),0):28})),path_remove_directory:de((function(t,e,n){return(t=r(t,Xt)).path?(h.refreshMemory(),e=Q.from(h.memory.buffer,e,n).toString(),d.rmdirSync(_.resolve(t.path,e)),0):28})),path_rename:de((function(t,e,n,i,o,s){return t=r(t,Gt),i=r(i,Ht),t.path&&i.path?(h.refreshMemory(),e=Q.from(h.memory.buffer,e,n).toString(),o=Q.from(h.memory.buffer,o,s).toString(),d.renameSync(_.resolve(t.path,e),_.resolve(i.path,o)),0):28})),path_symlink:de((function(t,e,n,i,o){return(n=r(n,qt)).path?(h.refreshMemory(),t=Q.from(h.memory.buffer,t,e).toString(),i=Q.from(h.memory.buffer,i,o).toString(),d.symlinkSync(t,_.resolve(n.path,i)),0):28})),path_unlink_file:de((function(t,e,n){return(t=r(t,Jt)).path?(h.refreshMemory(),e=Q.from(h.memory.buffer,e,n).toString(),d.unlinkSync(_.resolve(t.path,e)),0):28})),poll_oneoff:function(t,r,n,i){var o=0,s=0;h.refreshMemory();for(var a=0;a<n;a+=1){var f=h.view.getBigUint64(t,!0);t+=8;var l=h.view.getUint8(t);switch(t+=1,l){case 0:t+=7,h.view.getBigUint64(t,!0),t+=8;var c=h.view.getUint32(t,!0);t+=4,t+=4,l=h.view.getBigUint64(t,!0),t+=8,h.view.getBigUint64(t,!0),t+=8;var d=h.view.getUint16(t,!0);t+=2,t+=6;var _=1===d;d=0,null===(c=u(e(c)))?d=28:s=(l=_?l:c+l)>s?l:s,h.view.setBigUint64(r,f,!0),r+=8,h.view.setUint16(r,d,!0),r+=2,h.view.setUint8(r,0),r+=1,r+=5,o+=1;break;case 1:case 2:t+=3,h.view.getUint32(t,!0),t+=4,h.view.setBigUint64(r,f,!0),r+=8,h.view.setUint16(r,52,!0),r+=2,h.view.setUint8(r,l),r+=1,r+=5,o+=1;break;default:return 28}}for(h.view.setUint32(i,o,!0);p.hrtime()<s;);return 0},proc_exit:function(t){return p.exit(t),0},proc_raise:function(t){return t in ue?(p.kill(ue[t]),0):28},random_get:function(t,e){return h.refreshMemory(),p.randomFillSync(new Uint8Array(h.memory.buffer),t,e),0},sched_yield:function(){return 0},sock_recv:function(){return 52},sock_send:function(){return 52},sock_shutdown:function(){return 52}},t.traceSyscalls&&Object.keys(this.wasiImport).forEach((function(t){var e=h.wasiImport[t];h.wasiImport[t]=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.log("WASI: wasiImport called: "+t+" ("+r+")");try{var i=e.apply(void 0,a(r));return console.log("WASI: => "+i),i}catch(t){throw console.log("Catched error: "+t),t}}}))}return t.prototype.refreshMemory=function(){this.view&&0!==this.view.buffer.byteLength||(this.view=new f(this.memory.buffer))},t.prototype.setMemory=function(t){this.memory=t},t.prototype.start=function(t){if(null===(t=t.exports)||"object"!=typeof t)throw Error("instance.exports must be an Object. Received "+t+".");var e=t.memory;if(!(e instanceof WebAssembly.Memory))throw Error("instance.exports.memory must be a WebAssembly.Memory. Recceived "+e+".");this.setMemory(e),t._start&&t._start()},t.prototype.getImportNamespace=function(t){var e,r=null;try{for(var n=o(WebAssembly.Module.imports(t)),i=n.next();!i.done;i=n.next()){var s=i.value;if("function"===s.kind&&s.module.startsWith("wasi_"))if(r){if(r!==s.module)throw Error("Multiple namespaces detected.")}else r=s.module}}catch(t){var a={error:t}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return r},t.prototype.getImports=function(t){switch(this.getImportNamespace(t)){case"wasi_unstable":return{wasi_unstable:this.wasiImport};case"wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw Error("Can't detect a WASI namespace for the WebAssembly Module")}},t.defaultBindings=At,t}(),Se=r(788);function Ie(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function ve(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(void 0===e||0<e--)&&!(n=t.next()).done;)i.push(n.value)}catch(t){var o={error:t}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return i}function Ae(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ve(arguments[e]));return t}var be="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function Te(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Re(t,e){return t(e={exports:{}},e.exports),e.exports}var Oe=Re((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}}));Te(Oe);var Ce=Re((function(t,e){e.default="function"==typeof BigInt?BigInt:function(){throw Error("BigInt is not supported in this environment.")}})),Ne=Re((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=Oe.constants.S_IFMT,n=Oe.constants.S_IFDIR,i=Oe.constants.S_IFREG,o=Oe.constants.S_IFBLK,s=Oe.constants.S_IFCHR,a=Oe.constants.S_IFLNK,h=Oe.constants.S_IFIFO,u=Oe.constants.S_IFSOCK;t=function(){function t(){}return t.build=function(e,r){void 0===r&&(r=!1);var n=new t,i=e.gid,o=e.atime,s=e.mtime,a=e.ctime;return r=r?Ce.default:function(t){return t},n.uid=r(e.uid),n.gid=r(i),n.rdev=r(0),n.blksize=r(4096),n.ino=r(e.ino),n.size=r(e.getSize()),n.blocks=r(1),n.atime=o,n.mtime=s,n.ctime=a,n.birthtime=a,n.atimeMs=r(o.getTime()),n.mtimeMs=r(s.getTime()),i=r(a.getTime()),n.ctimeMs=i,n.birthtimeMs=i,n.dev=r(0),n.mode=r(e.mode),n.nlink=r(e.nlink),n},t.prototype._checkModeProperty=function(t){return(Number(this.mode)&r)===t},t.prototype.isDirectory=function(){return this._checkModeProperty(n)},t.prototype.isFile=function(){return this._checkModeProperty(i)},t.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},t.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},t.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},t.prototype.isFIFO=function(){return this._checkModeProperty(h)},t.prototype.isSocket=function(){return this._checkModeProperty(u)},t}(),e.Stats=t,e.default=t}));Te(Ne);var Pe=void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},ke=[],Le=[],We="undefined"!=typeof Uint8Array?Uint8Array:Array,Be=!1;function Fe(){Be=!0;for(var t=0;64>t;++t)ke[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],Le["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;Le[45]=62,Le[95]=63}function De(t,e,r){for(var n=[],i=e;i<r;i+=3)e=(t[i]<<16)+(t[i+1]<<8)+t[i+2],n.push(ke[e>>18&63]+ke[e>>12&63]+ke[e>>6&63]+ke[63&e]);return n.join("")}function Ue(t){Be||Fe();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;o<s;o+=16383)i.push(De(t,o,o+16383>s?s:o+16383));return 1===r?(t=t[e-1],n+=ke[t>>2],n+=ke[t<<4&63],n+="=="):2===r&&(t=(t[e-2]<<8)+t[e-1],n+=ke[t>>10],n+=ke[t>>4&63],n+=ke[t<<2&63],n+="="),i.push(n),i.join("")}function Me(t,e,r,n,i){var o=8*i-n-1,s=(1<<o)-1,a=s>>1,h=-7,u=r?-1:1,f=t[e+(i=r?i-1:0)];for(i+=u,r=f&(1<<-h)-1,f>>=-h,h+=o;0<h;r=256*r+t[e+i],i+=u,h-=8);for(o=r&(1<<-h)-1,r>>=-h,h+=n;0<h;o=256*o+t[e+i],i+=u,h-=8);if(0===r)r=1-a;else{if(r===s)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),r-=a}return(f?-1:1)*o*Math.pow(2,r-n)}function xe(t,e,r,n,i,o){var s,a=8*o-i-1,h=(1<<a)-1,u=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var l=n?1:-1,c=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,n=h):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),2<=(e=1<=n+u?e+f/s:e+f*Math.pow(2,1-u))*s&&(n++,s/=2),n+u>=h?(e=0,n=h):1<=n+u?(e=(e*s-1)*Math.pow(2,i),n+=u):(e=e*Math.pow(2,u-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=255&e,o+=l,e/=256,i-=8);for(n=n<<i|e,a+=i;0<a;t[r+o]=255&n,o+=l,n/=256,a-=8);t[r+o-l]|=128*c}var Ge={}.toString,He=Array.isArray||function(t){return"[object Array]"==Ge.call(t)};ze.TYPED_ARRAY_SUPPORT=void 0===Pe.TYPED_ARRAY_SUPPORT||Pe.TYPED_ARRAY_SUPPORT;var Ye=ze.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function je(t,e){if((ze.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<e)throw new RangeError("Invalid typed array length");return ze.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=ze.prototype:(null===t&&(t=new ze(e)),t.length=e),t}function ze(t,e,r){if(!(ze.TYPED_ARRAY_SUPPORT||this instanceof ze))return new ze(t,e,r);if("number"==typeof t){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return Ze(this,t)}return Ve(this,t,e,r)}function Ve(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){if(e.byteLength,0>r||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),ze.TYPED_ARRAY_SUPPORT?(t=e).__proto__=ze.prototype:t=qe(t,e),t}if("string"==typeof e){if(n=t,"string"==typeof(t=r)&&""!==t||(t="utf8"),!ze.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return(e=(n=je(n,r=0|Qe(e,t))).write(e,t))!==r&&(n=n.slice(0,e)),n}return function(t,e){if(Je(e)){var r=0|Xe(e.length);return 0===(t=je(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return(r="number"!=typeof e.length)||(r=(r=e.length)!=r),r?je(t,0):qe(t,e);if("Buffer"===e.type&&He(e.data))return qe(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function Ke(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function Ze(t,e){if(Ke(e),t=je(t,0>e?0:0|Xe(e)),!ze.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function qe(t,e){var r=0>e.length?0:0|Xe(e.length);t=je(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function Xe(t){if(t>=(ze.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(ze.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return 0|t}function Je(t){return!(null==t||!t._isBuffer)}function Qe(t,e){if(Je(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return lr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return pr(t).length;default:if(n)return lr(t).length;e=(""+e).toLowerCase(),n=!0}}function $e(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r<e;++r)n=(t=n)+(n=16>(n=this[r])?"0"+n.toString(16):n.toString(16));return n;case"utf8":case"utf-8":return nr(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(127&this[e]);return t;case"latin1":case"binary":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(this[e]);return t;case"base64":return 0===e&&r===this.length?Ue(this):Ue(this.slice(e,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(e=this.slice(e,r),r="",t=0;t<e.length;t+=2)r+=String.fromCharCode(e[t]+256*e[t+1]);return r;default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function tr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function er(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=ze.from(e,n)),Je(e))return 0===e.length?-1:rr(t,e,r,n,i);if("number"==typeof e)return e&=255,ze.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):rr(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function rr(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;s=2,a/=2,h/=2,r/=2}if(i)for(n=-1;r<a;r++)if(o(t,r)===o(e,-1===n?0:r-n)){if(-1===n&&(n=r),r-n+1===h)return n*s}else-1!==n&&(r-=r-n),n=-1;else for(r+h>a&&(r=a-h);0<=r;r--){for(a=!0,n=0;n<h;n++)if(o(t,r+n)!==o(e,n)){a=!1;break}if(a)return r}return-1}function nr(t,e,r){r=Math.min(t.length,r);for(var n=[];e<r;){var i=t[e],o=null,s=239<i?4:223<i?3:191<i?2:1;if(e+s<=r)switch(s){case 1:128>i&&(o=i);break;case 2:var a=t[e+1];128==(192&a)&&127<(i=(31&i)<<6|63&a)&&(o=i);break;case 3:a=t[e+1];var h=t[e+2];128==(192&a)&&128==(192&h)&&2047<(i=(15&i)<<12|(63&a)<<6|63&h)&&(55296>i||57343<i)&&(o=i);break;case 4:a=t[e+1],h=t[e+2];var u=t[e+3];128==(192&a)&&128==(192&h)&&128==(192&u)&&65535<(i=(15&i)<<18|(63&a)<<12|(63&h)<<6|63&u)&&1114112>i&&(o=i)}null===o?(o=65533,s=1):65535<o&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),e+=s}if((t=n.length)<=ir)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e<t;)r+=String.fromCharCode.apply(String,n.slice(e,e+=ir));n=r}return n}ze.poolSize=8192,ze._augment=function(t){return t.__proto__=ze.prototype,t},ze.from=function(t,e,r){return Ve(null,t,e,r)},ze.TYPED_ARRAY_SUPPORT&&(ze.prototype.__proto__=Uint8Array.prototype,ze.__proto__=Uint8Array),ze.alloc=function(t,e,r){return Ke(t),0>=t?je(null,t):void 0!==e?"string"==typeof r?je(null,t).fill(e,r):je(null,t).fill(e):je(null,t)},ze.allocUnsafe=function(t){return Ze(null,t)},ze.allocUnsafeSlow=function(t){return Ze(null,t)},ze.isBuffer=_r,ze.compare=function(t,e){if(!Je(t)||!Je(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},ze.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ze.concat=function(t,e){if(!He(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return ze.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;e=ze.allocUnsafe(e);var n=0;for(r=0;r<t.length;++r){var i=t[r];if(!Je(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(e,n),n+=i.length}return e},ze.byteLength=Qe,ze.prototype._isBuffer=!0,ze.prototype.swap16=function(){var t=this.length;if(0!=t%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)tr(this,e,e+1);return this},ze.prototype.swap32=function(){var t=this.length;if(0!=t%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)tr(this,e,e+3),tr(this,e+1,e+2);return this},ze.prototype.swap64=function(){var t=this.length;if(0!=t%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)tr(this,e,e+7),tr(this,e+1,e+6),tr(this,e+2,e+5),tr(this,e+3,e+4);return this},ze.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?nr(this,0,t):$e.apply(this,arguments)},ze.prototype.equals=function(t){if(!Je(t))throw new TypeError("Argument must be a Buffer");return this===t||0===ze.compare(this,t)},ze.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(t+=" ... ")),"<Buffer "+t+">"},ze.prototype.compare=function(t,e,r,n,i){if(!Je(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;e<a;++e)if(n[e]!==t[e]){o=n[e],s=t[e];break}return o<s?-1:s<o?1:0},ze.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},ze.prototype.indexOf=function(t,e,r){return er(this,t,e,r,!0)},ze.prototype.lastIndexOf=function(t,e,r){return er(this,t,e,r,!1)},ze.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),0<t.length&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r))>n&&(r=n):r=n,0!=(n=t.length)%2)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n<r;++n){if(i=parseInt(t.substr(2*n,2),16),isNaN(i)){t=n;break t}this[e+n]=i}t=n}return t;case"utf8":case"utf-8":return dr(lr(t,this.length-e),this,e,r);case"ascii":case"latin1":case"binary":return dr(cr(t),this,e,r);case"base64":return dr(pr(t),this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=t,i=this.length-e;for(var o=[],s=0;s<n.length&&!(0>(i-=2));++s){var a=n.charCodeAt(s);t=a>>8,a%=256,o.push(a),o.push(t)}return dr(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},ze.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ir=4096;function or(t,e,r){if(0!=t%1||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function sr(t,e,r,n,i,o){if(!Je(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function ar(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function hr(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function ur(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}ze.prototype.slice=function(t,e){var r=this.length;if(0>(t=~~t)?0>(t+=r)&&(t=0):t>r&&(t=r),0>(e=void 0===e?r:~~e)?0>(e+=r)&&(e=0):e>r&&(e=r),e<t&&(e=t),ze.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,e)).__proto__=ze.prototype;else{e=new ze(r=e-t,void 0);for(var n=0;n<r;++n)e[n]=this[n+t]}return e},ze.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||or(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r},ze.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||or(t,e,this.length),r=this[t+--e];for(var n=1;0<e&&(n*=256);)r+=this[t+--e]*n;return r},ze.prototype.readUInt8=function(t,e){return e||or(t,1,this.length),this[t]},ze.prototype.readUInt16LE=function(t,e){return e||or(t,2,this.length),this[t]|this[t+1]<<8},ze.prototype.readUInt16BE=function(t,e){return e||or(t,2,this.length),this[t]<<8|this[t+1]},ze.prototype.readUInt32LE=function(t,e){return e||or(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},ze.prototype.readUInt32BE=function(t,e){return e||or(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},ze.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||or(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r>=128*n&&(r-=Math.pow(2,8*e)),r},ze.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||or(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0<r&&(n*=256);)i+=this[t+--r]*n;return i>=128*n&&(i-=Math.pow(2,8*e)),i},ze.prototype.readInt8=function(t,e){return e||or(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},ze.prototype.readInt16LE=function(t,e){return e||or(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},ze.prototype.readInt16BE=function(t,e){return e||or(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},ze.prototype.readInt32LE=function(t,e){return e||or(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},ze.prototype.readInt32BE=function(t,e){return e||or(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},ze.prototype.readFloatLE=function(t,e){return e||or(t,4,this.length),Me(this,t,!0,23,4)},ze.prototype.readFloatBE=function(t,e){return e||or(t,4,this.length),Me(this,t,!1,23,4)},ze.prototype.readDoubleLE=function(t,e){return e||or(t,8,this.length),Me(this,t,!0,52,8)},ze.prototype.readDoubleBE=function(t,e){return e||or(t,8,this.length),Me(this,t,!1,52,8)},ze.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||sr(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=255&t;++i<r&&(n*=256);)this[e+i]=t/n&255;return e+r},ze.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||sr(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)this[e+n]=t/i&255;return e+r},ze.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,1,255,0),ze.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},ze.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,2,65535,0),ze.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):ar(this,t,e,!0),e+2},ze.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,2,65535,0),ze.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):ar(this,t,e,!1),e+2},ze.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,4,4294967295,0),ze.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):hr(this,t,e,!0),e+4},ze.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,4,4294967295,0),ze.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):hr(this,t,e,!1),e+4},ze.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||sr(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n),n=0;var i=1,o=0;for(this[e]=255&t;++n<r&&(i*=256);)0>t&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/i|0)-o&255;return e+r},ze.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||sr(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=1,o=0;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)0>t&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/i|0)-o&255;return e+r},ze.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,1,127,-128),ze.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},ze.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,2,32767,-32768),ze.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):ar(this,t,e,!0),e+2},ze.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,2,32767,-32768),ze.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):ar(this,t,e,!1),e+2},ze.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,4,2147483647,-2147483648),ze.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):hr(this,t,e,!0),e+4},ze.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||sr(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),ze.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):hr(this,t,e,!1),e+4},ze.prototype.writeFloatLE=function(t,e,r){return r||ur(this,0,e,4),xe(this,t,e,!0,23,4),e+4},ze.prototype.writeFloatBE=function(t,e,r){return r||ur(this,0,e,4),xe(this,t,e,!1,23,4),e+4},ze.prototype.writeDoubleLE=function(t,e,r){return r||ur(this,0,e,8),xe(this,t,e,!0,52,8),e+8},ze.prototype.writeDoubleBE=function(t,e,r){return r||ur(this,0,e,8),xe(this,t,e,!1,52,8),e+8},ze.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&r<e&&e<n)for(n=i-1;0<=n;--n)t[n+e]=this[n+r];else if(1e3>i||!ze.TYPED_ARRAY_SUPPORT)for(n=0;n<i;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},ze.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);256>i&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!ze.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else for(i=(t=Je(t)?t:lr(new ze(t,n).toString())).length,n=0;n<r-e;++n)this[n+e]=t[n%i];return this};var fr=/[^+\/0-9A-Za-z-_]/g;function lr(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&57344>r){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(56320>r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw Error("Invalid code point");if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function cr(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function pr(t){if(2>(t=(t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(fr,"")).length)t="";else for(;0!=t.length%4;)t+="=";Be||Fe();var e=t.length;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var r="="===t[e-2]?2:"="===t[e-1]?1:0,n=new We(3*e/4-r),i=0<r?e-4:e,o=0;for(e=0;e<i;e+=4){var s=Le[t.charCodeAt(e)]<<18|Le[t.charCodeAt(e+1)]<<12|Le[t.charCodeAt(e+2)]<<6|Le[t.charCodeAt(e+3)];n[o++]=s>>16&255,n[o++]=s>>8&255,n[o++]=255&s}return 2===r?(s=Le[t.charCodeAt(e)]<<2|Le[t.charCodeAt(e+1)]>>4,n[o++]=255&s):1===r&&(s=Le[t.charCodeAt(e)]<<10|Le[t.charCodeAt(e+1)]<<4|Le[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=255&s),n}function dr(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function _r(t){return null!=t&&(!!t._isBuffer||mr(t)||"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&mr(t.slice(0,0)))}function mr(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var gr=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:Ye,Buffer:ze,SlowBuffer:function(t){return+t!=t&&(t=0),ze.alloc(+t)},isBuffer:_r}),yr=Re((function(t,e){function r(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new(gr.Buffer.bind.apply(gr.Buffer,n([void 0,t],e)))}var n=be&&be.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Buffer=gr.Buffer,e.bufferAllocUnsafe=gr.Buffer.allocUnsafe||r,e.bufferFrom=gr.Buffer.from||r}));function Er(){throw Error("setTimeout has not been defined")}function wr(){throw Error("clearTimeout has not been defined")}Te(yr);var Sr=Er,Ir=wr;function vr(t){if(Sr===setTimeout)return setTimeout(t,0);if((Sr===Er||!Sr)&&setTimeout)return Sr=setTimeout,setTimeout(t,0);try{return Sr(t,0)}catch(e){try{return Sr.call(null,t,0)}catch(e){return Sr.call(this,t,0)}}}"function"==typeof Pe.setTimeout&&(Sr=setTimeout),"function"==typeof Pe.clearTimeout&&(Ir=clearTimeout);var Ar,br=[],Tr=!1,Rr=-1;function Or(){Tr&&Ar&&(Tr=!1,Ar.length?br=Ar.concat(br):Rr=-1,br.length&&Cr())}function Cr(){if(!Tr){var t=vr(Or);Tr=!0;for(var e=br.length;e;){for(Ar=br,br=[];++Rr<e;)Ar&&Ar[Rr].run();Rr=-1,e=br.length}Ar=null,Tr=!1,function(t){if(Ir===clearTimeout)return clearTimeout(t);if((Ir===wr||!Ir)&&clearTimeout)return Ir=clearTimeout,clearTimeout(t);try{return Ir(t)}catch(e){try{return Ir.call(null,t)}catch(e){return Ir.call(this,t)}}}(t)}}function Nr(t){var e=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];br.push(new Pr(t,e)),1!==br.length||Tr||vr(Cr)}function Pr(t,e){this.fun=t,this.array=e}function kr(){}Pr.prototype.run=function(){this.fun.apply(null,this.array)};var Lr=Pe.performance||{},Wr=Lr.now||Lr.mozNow||Lr.msNow||Lr.oNow||Lr.webkitNow||function(){return(new Date).getTime()},Br=new Date,Fr={nextTick:Nr,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:kr,addListener:kr,once:kr,off:kr,removeListener:kr,removeAllListeners:kr,emit:kr,binding:function(){throw Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(){throw Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*Wr.call(Lr),r=Math.floor(e);return e=Math.floor(e%1*1e9),t&&(r-=t[0],0>(e-=t[1])&&(r--,e+=1e9)),[r,e]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Br)/1e3}},Dr="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},Ur=/%[sdj%]/g;function Mr(t){if(!$r(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(jr(arguments[r]));return e.join(" ")}r=1;var n=arguments,i=n.length;e=String(t).replace(Ur,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}));for(var o=n[r];r<i;o=n[++r])e=null!==o&&rn(o)?e+" "+jr(o):e+" "+o;return e}function xr(t,e){if(tn(Pe.process))return function(){return xr(t,e).apply(this,arguments)};if(!0===Fr.noDeprecation)return t;var r=!1;return function(){if(!r){if(Fr.throwDeprecation)throw Error(e);Fr.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}}var Gr,Hr={};function Yr(t){return tn(Gr)&&(Gr=Fr.env.NODE_DEBUG||""),t=t.toUpperCase(),Hr[t]||(new RegExp("\\b"+t+"\\b","i").test(Gr)?Hr[t]=function(){var e=Mr.apply(null,arguments);console.error("%s %d: %s",t,0,e)}:Hr[t]=function(){}),Hr[t]}function jr(t,e){var r={seen:[],stylize:Vr};return 3<=arguments.length&&(r.depth=arguments[2]),4<=arguments.length&&(r.colors=arguments[3]),Jr(e)?r.showHidden=e:e&&fn(r,e),tn(r.showHidden)&&(r.showHidden=!1),tn(r.depth)&&(r.depth=2),tn(r.colors)&&(r.colors=!1),tn(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=zr),Kr(r,t,r.depth)}function zr(t,e){return(e=jr.styles[e])?"["+jr.colors[e][0]+"m"+t+"["+jr.colors[e][1]+"m":t}function Vr(t){return t}function Kr(t,e,r){if(t.customInspect&&e&&sn(e.inspect)&&e.inspect!==jr&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return $r(n)||(n=Kr(t,n,r)),n}if(n=function(t,e){return tn(e)?t.stylize("undefined","undefined"):$r(e)?(e="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",t.stylize(e,"string")):Qr(e)?t.stylize(""+e,"number"):Jr(e)?t.stylize(""+e,"boolean"):null===e?t.stylize("null","null"):void 0}(t,e))return n;var i=Object.keys(e),o=function(t){var e={};return t.forEach((function(t){e[t]=!0})),e}(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(e)),on(e)&&(0<=i.indexOf("message")||0<=i.indexOf("description")))return Zr(e);if(0===i.length){if(sn(e))return t.stylize("[Function"+(e.name?": "+e.name:"")+"]","special");if(en(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(nn(e))return t.stylize(Date.prototype.toString.call(e),"date");if(on(e))return Zr(e)}n="";var s=!1,a=["{","}"];return Xr(e)&&(s=!0,a=["[","]"]),sn(e)&&(n=" [Function"+(e.name?": "+e.name:"")+"]"),en(e)&&(n=" "+RegExp.prototype.toString.call(e)),nn(e)&&(n=" "+Date.prototype.toUTCString.call(e)),on(e)&&(n=" "+Zr(e)),0!==i.length||s&&0!=e.length?0>r?en(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),i=s?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)Object.prototype.hasOwnProperty.call(e,String(s))?o.push(qr(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(qr(t,e,r,n,i,!0))})),o}(t,e,r,o,i):i.map((function(n){return qr(t,e,r,o,n,s)})),t.seen.pop(),function(t,e,r){return 60<t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(i,n,a)):a[0]+n+a[1]}function Zr(t){return"["+Error.prototype.toString.call(t)+"]"}function qr(t,e,r,n,i,o){var s,a;if((e=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=e.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):e.set&&(a=t.stylize("[Setter]","special")),Object.prototype.hasOwnProperty.call(n,i)||(s="["+i+"]"),a||(0>t.seen.indexOf(e.value)?-1<(a=Kr(t,e.value,null===r?null:r-1)).indexOf("\n")&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),tn(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function Xr(t){return Array.isArray(t)}function Jr(t){return"boolean"==typeof t}function Qr(t){return"number"==typeof t}function $r(t){return"string"==typeof t}function tn(t){return void 0===t}function en(t){return rn(t)&&"[object RegExp]"===Object.prototype.toString.call(t)}function rn(t){return"object"==typeof t&&null!==t}function nn(t){return rn(t)&&"[object Date]"===Object.prototype.toString.call(t)}function on(t){return rn(t)&&("[object Error]"===Object.prototype.toString.call(t)||t instanceof Error)}function sn(t){return"function"==typeof t}function an(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function hn(t){return 10>t?"0"+t.toString(10):t.toString(10)}jr.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},jr.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var un="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");function fn(t,e){if(!e||!rn(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}var ln={inherits:Dr,_extend:fn,log:function(){var t,e;console.log("%s - %s",(e=[hn((t=new Date).getHours()),hn(t.getMinutes()),hn(t.getSeconds())].join(":"),[t.getDate(),un[t.getMonth()],e].join(" ")),Mr.apply(null,arguments))},isBuffer:function(t){return _r(t)},isPrimitive:an,isFunction:sn,isError:on,isDate:nn,isObject:rn,isRegExp:en,isUndefined:tn,isSymbol:function(t){return"symbol"==typeof t},isString:$r,isNumber:Qr,isNullOrUndefined:function(t){return null==t},isNull:function(t){return null===t},isBoolean:Jr,isArray:Xr,inspect:jr,deprecate:xr,format:Mr,debuglog:Yr};function cn(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}var pn,dn=Object.prototype.hasOwnProperty,_n=Object.keys||function(t){var e,r=[];for(e in t)dn.call(t,e)&&r.push(e);return r},mn=Array.prototype.slice;function gn(){return void 0!==pn?pn:pn="foo"===function(){}.name}function yn(t){return!_r(t)&&"function"==typeof Pe.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&!!(t instanceof DataView||t.buffer&&t.buffer instanceof ArrayBuffer))}function En(t,e){t||bn(t,!0,e,"==",Tn)}var wn=/\s*function\s+([^\(\s]*)\s*/;function Sn(t){if(sn(t))return gn()?t.name:(t=t.toString().match(wn))&&t[1]}function In(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=vn(An(this.actual),128)+" "+this.operator+" "+vn(An(this.expected),128),this.generatedMessage=!0);var e=t.stackStartFunction||bn;Error.captureStackTrace?Error.captureStackTrace(this,e):(t=Error()).stack&&(t=t.stack,e=Sn(e),0<=(e=t.indexOf("\n"+e))&&(e=t.indexOf("\n",e+1),t=t.substring(e+1)),this.stack=t)}function vn(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function An(t){return gn()||!sn(t)?jr(t):"[Function"+((t=Sn(t))?": "+t:"")+"]"}function bn(t,e,r,n,i){throw new In({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function Tn(t,e){t||bn(t,!0,e,"==",Tn)}function Rn(t,e,r,n){if(t===e)return!0;if(_r(t)&&_r(e))return 0===cn(t,e);if(nn(t)&&nn(e))return t.getTime()===e.getTime();if(en(t)&&en(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(!yn(t)||!yn(e)||Object.prototype.toString.call(t)!==Object.prototype.toString.call(e)||t instanceof Float32Array||t instanceof Float64Array){if(_r(t)!==_r(e))return!1;var i=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==i&&i===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(an(t)||an(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=On(t),o=On(e);if(i&&!o||!i&&o)return!1;if(i)return Rn(t=mn.call(t),e=mn.call(e),r);i=_n(t);var s=_n(e);if(i.length!==s.length)return!1;for(i.sort(),s.sort(),o=i.length-1;0<=o;o--)if(i[o]!==s[o])return!1;for(o=i.length-1;0<=o;o--)if(!Rn(t[s=i[o]],e[s],r,n))return!1;return!0}(t,e,r,n))}return 0===cn(new Uint8Array(t.buffer),new Uint8Array(e.buffer))}return r?t===e:t==e}function On(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function Cn(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function Nn(t,e,r,n){if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null);try{e()}catch(t){var i=t}e=i,n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!e&&bn(e,r,"Missing expected exception"+n),i="string"==typeof n;var o=!t&&e&&!r;if((!t&&on(e)&&i&&Cn(e,r)||o)&&bn(e,r,"Got unwanted exception"+n),t&&e&&r&&!Cn(e,r)||!t&&e)throw e}En.AssertionError=In,Dr(In,Error),En.fail=bn,En.ok=Tn,En.equal=function t(e,r,n){e!=r&&bn(e,r,n,"==",t)},En.notEqual=function t(e,r,n){e==r&&bn(e,r,n,"!=",t)},En.deepEqual=function t(e,r,n){Rn(e,r,!1)||bn(e,r,n,"deepEqual",t)},En.deepStrictEqual=function t(e,r,n){Rn(e,r,!0)||bn(e,r,n,"deepStrictEqual",t)},En.notDeepEqual=function t(e,r,n){Rn(e,r,!1)&&bn(e,r,n,"notDeepEqual",t)},En.notDeepStrictEqual=function t(e,r,n){Rn(e,r,!0)&&bn(e,r,n,"notDeepStrictEqual",t)},En.strictEqual=function t(e,r,n){e!==r&&bn(e,r,n,"===",t)},En.notStrictEqual=function t(e,r,n){e===r&&bn(e,r,n,"!==",t)},En.throws=function(t,e,r){Nn(!0,t,e,r)},En.doesNotThrow=function(t,e,r){Nn(!1,t,e,r)},En.ifError=function(t){if(t)throw t};var Pn=Re((function(t,e){function r(t){return function(t){function e(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(r=t.call(this,n(e,r))||this).code=e,r[a]=e,r.name=t.prototype.name+" ["+r[a]+"]",r}return s(e,t),e}(t)}function n(t,e){En.strictEqual(typeof t,"string");var r=h[t];if(En(r,"An invalid error message key was used: "+t+"."),"function"==typeof r)t=r;else{if(t=ln.format,void 0===e||0===e.length)return r;e.unshift(r)}return String(t.apply(null,e))}function i(t,e){h[t]="function"==typeof e?e:String(e)}function o(t,e){if(En(t,"expected is required"),En("string"==typeof e,"thing is required"),Array.isArray(t)){var r=t.length;return En(0<r,"At least one expected value needs to be specified"),t=t.map((function(t){return String(t)})),2<r?"one of "+e+" "+t.slice(0,r-1).join(", ")+", or "+t[r-1]:2===r?"one of "+e+" "+t[0]+" or "+t[1]:"of "+e+" "+t[0]}return"of "+e+" "+String(t)}var s=be&&be.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var a="undefined"==typeof Symbol?"_kCode":Symbol("code"),h={};t=function(t){function r(r){if("object"!=typeof r||null===r)throw new e.TypeError("ERR_INVALID_ARG_TYPE","options","object");var n=r.message?t.call(this,r.message)||this:t.call(this,ln.inspect(r.actual).slice(0,128)+" "+r.operator+" "+ln.inspect(r.expected).slice(0,128))||this;return n.generatedMessage=!r.message,n.name="AssertionError [ERR_ASSERTION]",n.code="ERR_ASSERTION",n.actual=r.actual,n.expected=r.expected,n.operator=r.operator,e.Error.captureStackTrace(n,r.stackStartFunction),n}return s(r,t),r}(be.Error),e.AssertionError=t,e.message=n,e.E=i,e.Error=r(be.Error),e.TypeError=r(be.TypeError),e.RangeError=r(be.RangeError),i("ERR_ARG_NOT_ITERABLE","%s must be iterable"),i("ERR_ASSERTION","%s"),i("ERR_BUFFER_OUT_OF_BOUNDS",(function(t,e){return e?"Attempt to write outside buffer bounds":'"'+t+'" is outside of buffer bounds'})),i("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),i("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),i("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),i("ERR_DNS_SET_SERVERS_FAILED",(function(t,e){return'c-ares failed to set servers: "'+t+'" ['+e+"]"})),i("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),i("ERR_ENCODING_NOT_SUPPORTED",(function(t){return'The "'+t+'" encoding is not supported'})),i("ERR_ENCODING_INVALID_ENCODED_DATA",(function(t){return"The encoded data was not valid for encoding "+t})),i("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),i("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),i("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),i("ERR_INDEX_OUT_OF_RANGE","Index out of range"),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){if(En(t,"name is required"),e.includes("not ")){var n="must not be";e=e.split("not ")[1]}else n="must be";if(Array.isArray(t))n="The "+t.map((function(t){return'"'+t+'"'})).join(", ")+" arguments "+n+" "+o(e,"type");else if(t.includes(" argument"))n="The "+t+" "+n+" "+o(e,"type");else{var i=t.includes(".")?"property":"argument";n='The "'+t+'" '+i+" "+n+" "+o(e,"type")}return 3<=arguments.length&&(n+=". Received type "+(null!==r?typeof r:"null")),n})),i("ERR_INVALID_ARRAY_LENGTH",(function(t,e,r){return En.strictEqual(typeof r,"number"),'The array "'+t+'" (length '+r+") must be of length "+e+"."})),i("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),i("ERR_INVALID_CALLBACK","Callback must be a function"),i("ERR_INVALID_CHAR","Invalid character in %s"),i("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),i("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),i("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),i("ERR_INVALID_FILE_URL_PATH","File URL path %s"),i("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),i("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+String(e)+'" is invalid for option "'+t+'"'})),i("ERR_INVALID_OPT_VALUE_ENCODING",(function(t){return'The value "'+String(t)+'" is invalid for option "encoding"'})),i("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),i("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),i("ERR_INVALID_THIS",'Value of "this" must be of type %s'),i("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),i("ERR_INVALID_URL","Invalid URL: %s"),i("ERR_INVALID_URL_SCHEME",(function(t){return"The URL must be "+o(t,"scheme")})),i("ERR_IPC_CHANNEL_CLOSED","Channel closed"),i("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),i("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),i("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),i("ERR_MISSING_ARGS",(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];En(0<t.length,"At least one arg needs to be specified"),e="The ";var r=t.length;switch(t=t.map((function(t){return'"'+t+'"'})),r){case 1:e+=t[0]+" argument";break;case 2:e+=t[0]+" and "+t[1]+" arguments";break;default:e+=t.slice(0,r-1).join(", "),e+=", and "+t[r-1]+" arguments"}return e+" must be specified"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),i("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),i("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),i("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),i("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),i("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),i("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),i("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),i("ERR_SOCKET_CANNOT_SEND","Unable to send data"),i("ERR_SOCKET_CLOSED","Socket is closed"),i("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),i("ERR_STDERR_CLOSE","process.stderr cannot be closed"),i("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),i("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),i("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),i("ERR_TLS_DH_PARAM_SIZE",(function(t){return"DH parameter size "+t+" is less than 2048"})),i("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),i("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),i("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),i("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),i("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),i("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),i("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),i("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),i("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),i("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),i("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl")}));Te(Pn);var kn=Re((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ENCODING_UTF8="utf8",e.assertEncoding=function(t){if(t&&!yr.Buffer.isEncoding(t))throw new Pn.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",t)},e.strToEncoding=function(t,r){return r&&r!==e.ENCODING_UTF8?"buffer"===r?new yr.Buffer(t):new yr.Buffer(t).toString(r):t}}));Te(kn);var Ln=Re((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=Oe.constants.S_IFMT,n=Oe.constants.S_IFDIR,i=Oe.constants.S_IFREG,o=Oe.constants.S_IFBLK,s=Oe.constants.S_IFCHR,a=Oe.constants.S_IFLNK,h=Oe.constants.S_IFIFO,u=Oe.constants.S_IFSOCK;t=function(){function t(){this.name="",this.mode=0}return t.build=function(e,r){var n=new t,i=e.getNode().mode;return n.name=kn.strToEncoding(e.getName(),r),n.mode=i,n},t.prototype._checkModeProperty=function(t){return(this.mode&r)===t},t.prototype.isDirectory=function(){return this._checkModeProperty(n)},t.prototype.isFile=function(){return this._checkModeProperty(i)},t.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},t.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},t.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},t.prototype.isFIFO=function(){return this._checkModeProperty(h)},t.prototype.isSocket=function(){return this._checkModeProperty(u)},t}(),e.Dirent=t,e.default=t}));function Wn(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){var n=0<=r?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(t=n+"/"+t,e="/"===n.charAt(0))}return(e?"/":"")+(t=function(t,e){for(var r=0,n=t.length-1;0<=n;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}(function(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}(t.split("/"),(function(t){return!!t})),!e).join("/"))||"."}function Bn(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=Wn(t).substr(1),e=Wn(e).substr(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),i=n,o=0;o<n;o++)if(t[o]!==e[o]){i=o;break}for(n=[],o=i;o<t.length;o++)n.push("..");return(n=n.concat(e.slice(i))).join("/")}Te(Ln);var Fn=Bn,Dn=Wn;var Un=Re((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),t="function"==typeof setImmediate?setImmediate.bind(be):setTimeout.bind(be),e.default=t}));Te(Un);var Mn=Re((function(t,e){function r(){var t=Fr||{};return t.getuid||(t.getuid=function(){return 0}),t.getgid||(t.getgid=function(){return 0}),t.cwd||(t.cwd=function(){return"/"}),t.nextTick||(t.nextTick=Un.default),t.emitWarning||(t.emitWarning=function(t,e){console.warn(e+(e?": ":"")+t)}),t.env||(t.env={}),t}Object.defineProperty(e,"__esModule",{value:!0}),e.createProcess=r,e.default=r()}));function xn(){}function Gn(){Gn.init.call(this)}function Hn(t,e,r,n){var i;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if(i=t._events){i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events);var o=i[e]}else i=t._events=new xn,t._eventsCount=0;return o?("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),o.warned||(r=void 0===t._maxListeners?Gn.defaultMaxListeners:t._maxListeners)&&0<r&&o.length>r&&(o.warned=!0,(r=Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=t,r.type=e,r.count=o.length,"function"==typeof console.warn?console.warn(r):console.log(r))):(i[e]=r,++t._eventsCount),t}function Yn(t,e,r){function n(){t.removeListener(e,n),i||(i=!0,r.apply(t,arguments))}var i=!1;return n.listener=r,n}function jn(t){var e=this._events;if(e){if("function"==typeof(t=e[t]))return 1;if(t)return t.length}return 0}function zn(t,e){for(var r=Array(e);e--;)r[e]=t[e];return r}Te(Mn),xn.prototype=Object.create(null),Gn.EventEmitter=Gn,Gn.usingDomains=!1,Gn.prototype.domain=void 0,Gn.prototype._events=void 0,Gn.prototype._maxListeners=void 0,Gn.defaultMaxListeners=10,Gn.init=function(){this.domain=null,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new xn,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Gn.prototype.setMaxListeners=function(t){if("number"!=typeof t||0>t||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},Gn.prototype.getMaxListeners=function(){return void 0===this._maxListeners?Gn.defaultMaxListeners:this._maxListeners},Gn.prototype.emit=function(t){var e,r,n="error"===t;if(e=this._events)n=n&&null==e.error;else if(!n)return!1;var i=this.domain;if(n){if(e=arguments[1],!i){if(e instanceof Error)throw e;throw(i=Error('Uncaught, unspecified "error" event. ('+e+")")).context=e,i}return e||(e=Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=i,e.domainThrown=!1,i.emit("error",e),!1}if(!(i=e[t]))return!1;e="function"==typeof i;var o=arguments.length;switch(o){case 1:if(e)i.call(this);else for(i=zn(i,e=i.length),n=0;n<e;++n)i[n].call(this);break;case 2:if(n=arguments[1],e)i.call(this,n);else for(i=zn(i,e=i.length),o=0;o<e;++o)i[o].call(this,n);break;case 3:if(n=arguments[1],o=arguments[2],e)i.call(this,n,o);else for(i=zn(i,e=i.length),r=0;r<e;++r)i[r].call(this,n,o);break;case 4:if(n=arguments[1],o=arguments[2],r=arguments[3],e)i.call(this,n,o,r);else{i=zn(i,e=i.length);for(var s=0;s<e;++s)i[s].call(this,n,o,r)}break;default:for(n=Array(o-1),r=1;r<o;r++)n[r-1]=arguments[r];if(e)i.apply(this,n);else for(i=zn(i,e=i.length),o=0;o<e;++o)i[o].apply(this,n)}return!0},Gn.prototype.addListener=function(t,e){return Hn(this,t,e,!1)},Gn.prototype.on=Gn.prototype.addListener,Gn.prototype.prependListener=function(t,e){return Hn(this,t,e,!0)},Gn.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,Yn(this,t,e)),this},Gn.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,Yn(this,t,e)),this},Gn.prototype.removeListener=function(t,e){var r;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');var n=this._events;if(!n)return this;var i=n[t];if(!i)return this;if(i===e||i.listener&&i.listener===e)0==--this._eventsCount?this._events=new xn:(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){var o=-1;for(r=i.length;0<r--;)if(i[r]===e||i[r].listener&&i[r].listener===e){var s=i[r].listener;o=r;break}if(0>o)return this;if(1===i.length){if(i[0]=void 0,0==--this._eventsCount)return this._events=new xn,this;delete n[t]}else{r=o+1;for(var a=i.length;r<a;o+=1,r+=1)i[o]=i[r];i.pop()}n.removeListener&&this.emit("removeListener",t,s||e)}return this},Gn.prototype.removeAllListeners=function(t){var e=this._events;if(!e)return this;if(!e.removeListener)return 0===arguments.length?(this._events=new xn,this._eventsCount=0):e[t]&&(0==--this._eventsCount?this._events=new xn:delete e[t]),this;if(0===arguments.length){e=Object.keys(e);for(var r,n=0;n<e.length;++n)"removeListener"!==(r=e[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new xn,this._eventsCount=0,this}if("function"==typeof(e=e[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},Gn.prototype.listeners=function(t){var e=this._events;if(e)if(t=e[t])if("function"==typeof t)t=[t.listener||t];else{e=Array(t.length);for(var r=0;r<e.length;++r)e[r]=t[r].listener||t[r];t=e}else t=[];else t=[];return t},Gn.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):jn.call(t,e)},Gn.prototype.listenerCount=jn,Gn.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]};var Vn=Re((function(t,e){var r=be&&be.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=Oe.constants.S_IFMT,i=Oe.constants.S_IFDIR,o=Oe.constants.S_IFREG,s=Oe.constants.S_IFLNK,a=Oe.constants.O_APPEND;e.SEP="/",t=function(t){function e(e,r){void 0===r&&(r=438);var n=t.call(this)||this;return n.uid=Mn.default.getuid(),n.gid=Mn.default.getgid(),n.atime=new Date,n.mtime=new Date,n.ctime=new Date,n.perm=438,n.mode=o,n.nlink=1,n.perm=r,n.mode|=r,n.ino=e,n}return r(e,t),e.prototype.getString=function(t){return void 0===t&&(t="utf8"),this.getBuffer().toString(t)},e.prototype.setString=function(t){this.buf=yr.bufferFrom(t,"utf8"),this.touch()},e.prototype.getBuffer=function(){return this.buf||this.setBuffer(yr.bufferAllocUnsafe(0)),yr.bufferFrom(this.buf)},e.prototype.setBuffer=function(t){this.buf=yr.bufferFrom(t),this.touch()},e.prototype.getSize=function(){return this.buf?this.buf.length:0},e.prototype.setModeProperty=function(t){this.mode=this.mode&~n|t},e.prototype.setIsFile=function(){this.setModeProperty(o)},e.prototype.setIsDirectory=function(){this.setModeProperty(i)},e.prototype.setIsSymlink=function(){this.setModeProperty(s)},e.prototype.isFile=function(){return(this.mode&n)===o},e.prototype.isDirectory=function(){return(this.mode&n)===i},e.prototype.isSymlink=function(){return(this.mode&n)===s},e.prototype.makeSymlink=function(t){this.symlink=t,this.setIsSymlink()},e.prototype.write=function(t,e,r,n){if(void 0===e&&(e=0),void 0===r&&(r=t.length),void 0===n&&(n=0),this.buf||(this.buf=yr.bufferAllocUnsafe(0)),n+r>this.buf.length){var i=yr.bufferAllocUnsafe(n+r);this.buf.copy(i,0,0,this.buf.length),this.buf=i}return t.copy(this.buf,n,e,e+r),this.touch(),r},e.prototype.read=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.byteLength),void 0===n&&(n=0),this.buf||(this.buf=yr.bufferAllocUnsafe(0)),r>t.byteLength&&(r=t.byteLength),r+n>this.buf.length&&(r=this.buf.length-n),this.buf.copy(t,e,n,n+r),r},e.prototype.truncate=function(t){if(void 0===t&&(t=0),t)if(this.buf||(this.buf=yr.bufferAllocUnsafe(0)),t<=this.buf.length)this.buf=this.buf.slice(0,t);else{var e=yr.bufferAllocUnsafe(0);this.buf.copy(e),e.fill(0,t)}else this.buf=yr.bufferAllocUnsafe(0);this.touch()},e.prototype.chmod=function(t){this.perm=t,this.mode=-512&this.mode|t,this.touch()},e.prototype.chown=function(t,e){this.uid=t,this.gid=e,this.touch()},e.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},e.prototype.canRead=function(t,e){return void 0===t&&(t=Mn.default.getuid()),void 0===e&&(e=Mn.default.getgid()),!!(4&this.perm||e===this.gid&&32&this.perm||t===this.uid&&256&this.perm)},e.prototype.canWrite=function(t,e){return void 0===t&&(t=Mn.default.getuid()),void 0===e&&(e=Mn.default.getgid()),!!(2&this.perm||e===this.gid&&16&this.perm||t===this.uid&&128&this.perm)},e.prototype.del=function(){this.emit("delete",this)},e.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},e}(Gn.EventEmitter),e.Node=t,t=function(t){function n(e,r,n){var i=t.call(this)||this;return i.children={},i.steps=[],i.ino=0,i.length=0,i.vol=e,i.parent=r,i.steps=r?r.steps.concat([n]):[n],i}return r(n,t),n.prototype.setNode=function(t){this.node=t,this.ino=t.ino},n.prototype.getNode=function(){return this.node},n.prototype.createChild=function(t,e){void 0===e&&(e=this.vol.createNode());var r=new n(this.vol,this,t);return r.setNode(e),e.isDirectory(),this.setChild(t,r),r},n.prototype.setChild=function(t,e){return void 0===e&&(e=new n(this.vol,this,t)),this.children[t]=e,e.parent=this,this.length++,this.emit("child:add",e,this),e},n.prototype.deleteChild=function(t){delete this.children[t.getName()],this.length--,this.emit("child:delete",t,this)},n.prototype.getChild=function(t){if(Object.hasOwnProperty.call(this.children,t))return this.children[t]},n.prototype.getPath=function(){return this.steps.join(e.SEP)},n.prototype.getName=function(){return this.steps[this.steps.length-1]},n.prototype.walk=function(t,e,r){if(void 0===e&&(e=t.length),void 0===r&&(r=0),r>=t.length||r>=e)return this;var n=this.getChild(t[r]);return n?n.walk(t,e,r+1):null},n.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},n}(Gn.EventEmitter),e.Link=t,t=function(){function t(t,e,r,n){this.position=0,this.link=t,this.node=e,this.flags=r,this.fd=n}return t.prototype.getString=function(){return this.node.getString()},t.prototype.setString=function(t){this.node.setString(t)},t.prototype.getBuffer=function(){return this.node.getBuffer()},t.prototype.setBuffer=function(t){this.node.setBuffer(t)},t.prototype.getSize=function(){return this.node.getSize()},t.prototype.truncate=function(t){this.node.truncate(t)},t.prototype.seekTo=function(t){this.position=t},t.prototype.stats=function(){return Ne.default.build(this.node)},t.prototype.write=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.length),"number"!=typeof n&&(n=this.position),this.flags&a&&(n=this.getSize()),t=this.node.write(t,e,r,n),this.position=n+t,t},t.prototype.read=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.byteLength),"number"!=typeof n&&(n=this.position),t=this.node.read(t,e,r,n),this.position=n+t,t},t.prototype.chmod=function(t){this.node.chmod(t)},t.prototype.chown=function(t,e){this.node.chown(t,e)},t}(),e.File=t}));Te(Vn);var Kn=Vn.Node,Zn=Re((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){var n=setTimeout.apply(null,arguments);return n&&"object"==typeof n&&"function"==typeof n.unref&&n.unref(),n}}));function qn(){this.tail=this.head=null,this.length=0}Te(Zn),qn.prototype.push=function(t){t={data:t,next:null},0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},qn.prototype.unshift=function(t){t={data:t,next:this.head},0===this.length&&(this.tail=t),this.head=t,++this.length},qn.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}},qn.prototype.clear=function(){this.head=this.tail=null,this.length=0},qn.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},qn.prototype.concat=function(t){if(0===this.length)return ze.alloc(0);if(1===this.length)return this.head.data;t=ze.allocUnsafe(t>>>0);for(var e=this.head,r=0;e;)e.data.copy(t,r),r+=e.data.length,e=e.next;return t};var Xn=ze.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Jn(t){if(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),t&&!Xn(t))throw Error("Unknown encoding: "+t);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=$n;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=ti;break;default:return void(this.write=Qn)}this.charBuffer=new ze(6),this.charLength=this.charReceived=0}function Qn(t){return t.toString(this.encoding)}function $n(t){this.charLength=(this.charReceived=t.length%2)?2:0}function ti(t){this.charLength=(this.charReceived=t.length%3)?3:0}Jn.prototype.write=function(t){for(var e="";this.charLength;){if(e=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length,t.copy(this.charBuffer,this.charReceived,0,e),this.charReceived+=e,this.charReceived<this.charLength)return"";t=t.slice(e,t.length);var r=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1);if(!(55296<=r&&56319>=r)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;return this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,55296<=(r=e.charCodeAt(n))&&56319>=r?(r=this.surrogateSize,this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),t.copy(this.charBuffer,0,0,r),e.substring(0,n)):e},Jn.prototype.detectIncompleteChar=function(t){for(var e=3<=t.length?3:t.length;0<e;e--){var r=t[t.length-e];if(1==e&&6==r>>5){this.charLength=2;break}if(2>=e&&14==r>>4){this.charLength=3;break}if(3>=e&&30==r>>3){this.charLength=4;break}}this.charReceived=e},Jn.prototype.end=function(t){var e="";return t&&t.length&&(e=this.write(t)),this.charReceived&&(t=this.encoding,e+=this.charBuffer.slice(0,this.charReceived).toString(t)),e},ni.ReadableState=ri;var ei=Yr("stream");function ri(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof Ci&&(this.objectMode=this.objectMode||!!t.readableObjectMode),e=t.highWaterMark;var r=this.objectMode?16:16384;this.highWaterMark=e||0===e?e:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new qn,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.reading=this.endEmitted=this.ended=!1,this.sync=!0,this.resumeScheduled=this.readableListening=this.emittedReadable=this.needReadable=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.encoding=this.decoder=null,t.encoding&&(this.decoder=new Jn(t.encoding),this.encoding=t.encoding)}function ni(t){if(!(this instanceof ni))return new ni(t);this._readableState=new ri(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),Gn.call(this)}function ii(t,e,r,n,i){var o=r,s=null;if(_r(o)||"string"==typeof o||null==o||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),o=s)t.emit("error",o);else if(null===r)e.reading=!1,e.ended||(e.decoder&&(r=e.decoder.end())&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length),e.ended=!0,si(t));else if(e.objectMode||r&&0<r.length)if(e.ended&&!i)t.emit("error",Error("stream.push() after EOF"));else if(e.endEmitted&&i)t.emit("error",Error("stream.unshift() after end event"));else{if(e.decoder&&!i&&!n){r=e.decoder.write(r);var a=!e.objectMode&&0===r.length}i||(e.reading=!1),a||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&si(t))),e.readingMore||(e.readingMore=!0,Nr(hi,t,e))}else i||(e.reading=!1);return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function oi(t,e){if(0>=t||0===e.length&&e.ended)return 0;if(e.objectMode)return 1;if(t!=t)return e.flowing&&e.length?e.buffer.head.data.length:e.length;if(t>e.highWaterMark){var r=t;8388608<=r?r=8388608:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r}return t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0)}function si(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(ei("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?Nr(ai,t):ai(t))}function ai(t){ei("emit readable"),t.emit("readable"),li(t)}function hi(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(ei("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function ui(t){ei("readable nexttick read 0"),t.read(0)}function fi(t,e){e.reading||(ei("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),li(t),e.flowing&&!e.reading&&t.read(0)}function li(t){var e=t._readableState;for(ei("flow",e.flowing);e.flowing&&null!==t.read(););}function ci(t,e){if(0===e.length)return null;if(e.objectMode)var r=e.buffer.shift();else if(!t||t>=e.length)r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear();else{if(r=e.buffer,e=e.decoder,t<r.head.data.length)e=r.head.data.slice(0,t),r.head.data=r.head.data.slice(t);else{if(t===r.head.data.length)r=r.shift();else if(e){var n=1,i=(e=r.head).data;for(t-=i.length;e=e.next;){var o=e.data,s=t>o.length?o.length:t;if(i=s===o.length?i+o:i+o.slice(0,t),0==(t-=s)){s===o.length?(++n,r.head=e.next?e.next:r.tail=null):(r.head=e,e.data=o.slice(s));break}++n}r.length-=n,r=i}else{for(e=ze.allocUnsafe(t),i=1,(n=r.head).data.copy(e),t-=n.data.length;n=n.next;){if(s=t>(o=n.data).length?o.length:t,o.copy(e,e.length-t,0,s),0==(t-=s)){s===o.length?(++i,r.head=n.next?n.next:r.tail=null):(r.head=n,n.data=o.slice(s));break}++i}r.length-=i,r=e}e=r}r=e}return r}function pi(t){var e=t._readableState;if(0<e.length)throw Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,Nr(di,e,t))}function di(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function _i(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function mi(){}function gi(t,e,r){this.chunk=t,this.encoding=e,this.callback=r,this.next=null}function yi(t,e){Object.defineProperty(this,"buffer",{get:xr((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof Ci&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.finished=this.ended=this.ending=this.needDrain=!1,this.decodeStrings=!1!==t.decodeStrings,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){var r=e._writableState,n=r.sync,i=r.writecb;r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(--r.pendingcb,n?Nr(i,t):i(t),e._writableState.errorEmitted=!0,e.emit("error",t)):((t=vi(r))||r.corked||r.bufferProcessing||!r.bufferedRequest||Ii(e,r),n?Nr(Si,e,r,t,i):Si(e,r,t,i))},this.writecb=null,this.writelen=0,this.lastBufferedRequest=this.bufferedRequest=null,this.pendingcb=0,this.errorEmitted=this.prefinished=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new bi(this)}function Ei(t){if(!(this instanceof Ei||this instanceof Ci))return new Ei(t);this._writableState=new yi(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),Gn.call(this)}function wi(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Si(t,e,r,n){!r&&0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain")),e.pendingcb--,n(),Ai(t,e)}function Ii(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=Array(e.bufferedRequestCount),i=e.corkedRequestsFree;i.entry=r;for(var o=0;r;)n[o]=r,r=r.next,o+=1;wi(t,e,!0,e.length,n,"",i.finish),e.pendingcb++,e.lastBufferedRequest=null,i.next?(e.corkedRequestsFree=i.next,i.next=null):e.corkedRequestsFree=new bi(e)}else{for(;r&&(n=r.chunk,wi(t,e,!1,e.objectMode?1:n.length,n,r.encoding,r.callback),r=r.next,!e.writing););null===r&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=r,e.bufferProcessing=!1}function vi(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function Ai(t,e){var r=vi(e);return r&&(0===e.pendingcb?(e.prefinished||(e.prefinished=!0,t.emit("prefinish")),e.finished=!0,t.emit("finish")):e.prefinished||(e.prefinished=!0,t.emit("prefinish"))),r}function bi(t){var e=this;this.entry=this.next=null,this.finish=function(r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}Dr(ni,Gn),ni.prototype.push=function(t,e){var r=this._readableState;return r.objectMode||"string"!=typeof t||(e=e||r.defaultEncoding)!==r.encoding&&(t=ze.from(t,e),e=""),ii(this,r,t,e,!1)},ni.prototype.unshift=function(t){return ii(this,this._readableState,t,"",!0)},ni.prototype.isPaused=function(){return!1===this._readableState.flowing},ni.prototype.setEncoding=function(t){return this._readableState.decoder=new Jn(t),this._readableState.encoding=t,this},ni.prototype.read=function(t){ei("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return ei("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?pi(this):si(this),null;if(0===(t=oi(t,e))&&e.ended)return 0===e.length&&pi(this),null;var n=e.needReadable;return ei("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&ei("length less than watermark",n=!0),e.ended||e.reading?ei("reading or ended",!1):n&&(ei("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=oi(r,e))),null===(n=0<t?ci(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&pi(this)),null!==n&&this.emit("data",n),n},ni.prototype._read=function(){this.emit("error",Error("not implemented"))},ni.prototype.pipe=function(t,e){function r(t){ei("onunpipe"),t===f&&i()}function n(){ei("onend"),t.end()}function i(){ei("cleanup"),t.removeListener("close",a),t.removeListener("finish",h),t.removeListener("drain",c),t.removeListener("error",s),t.removeListener("unpipe",r),f.removeListener("end",n),f.removeListener("end",i),f.removeListener("data",o),p=!0,!l.awaitDrain||t._writableState&&!t._writableState.needDrain||c()}function o(e){ei("ondata"),d=!1,!1!==t.write(e)||d||((1===l.pipesCount&&l.pipes===t||1<l.pipesCount&&-1!==_i(l.pipes,t))&&!p&&(ei("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,d=!0),f.pause())}function s(e){ei("onerror",e),u(),t.removeListener("error",s),0===t.listeners("error").length&&t.emit("error",e)}function a(){t.removeListener("finish",h),u()}function h(){ei("onfinish"),t.removeListener("close",a),u()}function u(){ei("unpipe"),f.unpipe(t)}var f=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=t;break;case 1:l.pipes=[l.pipes,t];break;default:l.pipes.push(t)}l.pipesCount+=1,ei("pipe count=%d opts=%j",l.pipesCount,e),e=e&&!1===e.end?i:n,l.endEmitted?Nr(e):f.once("end",e),t.on("unpipe",r);var c=function(t){return function(){var e=t._readableState;ei("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,li(t))}}(f);t.on("drain",c);var p=!1,d=!1;return f.on("data",o),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",s),t.once("close",a),t.once("finish",h),t.emit("pipe",f),l.flowing||(ei("pipe resume"),f.resume()),t},ni.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){t=e.pipes;var r=e.pipesCount;for(e.pipes=null,e.pipesCount=0,e.flowing=!1,e=0;e<r;e++)t[e].emit("unpipe",this);return this}return-1===(r=_i(e.pipes,t))||(e.pipes.splice(r,1),--e.pipesCount,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},ni.prototype.on=function(t,e){return e=Gn.prototype.on.call(this,t,e),"data"===t?!1!==this._readableState.flowing&&this.resume():"readable"===t&&((t=this._readableState).endEmitted||t.readableListening||(t.readableListening=t.needReadable=!0,t.emittedReadable=!1,t.reading?t.length&&si(this):Nr(ui,this))),e},ni.prototype.addListener=ni.prototype.on,ni.prototype.resume=function(){var t=this._readableState;return t.flowing||(ei("resume"),t.flowing=!0,t.resumeScheduled||(t.resumeScheduled=!0,Nr(fi,this,t))),this},ni.prototype.pause=function(){return ei("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(ei("pause"),this._readableState.flowing=!1,this.emit("pause")),this},ni.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;for(var i in t.on("end",(function(){if(ei("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&n.push(t)}n.push(null)})),t.on("data",(function(i){ei("wrapped data"),e.decoder&&(i=e.decoder.write(i)),e.objectMode&&null==i||!(e.objectMode||i&&i.length)||n.push(i)||(r=!0,t.pause())})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));return function(t,e){for(var r=0,n=t.length;r<n;r++)e(t[r])}(["error","close","destroy","pause","resume"],(function(e){t.on(e,n.emit.bind(n,e))})),n._read=function(e){ei("wrapped _read",e),r&&(r=!1,t.resume())},n},ni._fromList=ci,Ei.WritableState=yi,Dr(Ei,Gn),yi.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},Ei.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))},Ei.prototype.write=function(t,e,r){var n=this._writableState,i=!1;if("function"==typeof e&&(r=e,e=null),ze.isBuffer(t)?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=mi),n.ended)n=r,t=Error("write after end"),this.emit("error",t),Nr(n,t);else{var o=r,s=!0,a=!1;null===t?a=new TypeError("May not write null values to stream"):ze.isBuffer(t)||"string"==typeof t||void 0===t||n.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(this.emit("error",a),Nr(o,a),s=!1),s&&(n.pendingcb++,i=e,n.objectMode||!1===n.decodeStrings||"string"!=typeof t||(t=ze.from(t,i)),ze.isBuffer(t)&&(i="buffer"),o=n.objectMode?1:t.length,n.length+=o,(e=n.length<n.highWaterMark)||(n.needDrain=!0),n.writing||n.corked?(o=n.lastBufferedRequest,n.lastBufferedRequest=new gi(t,i,r),o?o.next=n.lastBufferedRequest:n.bufferedRequest=n.lastBufferedRequest,n.bufferedRequestCount+=1):wi(this,n,!1,o,t,i,r),i=e)}return i},Ei.prototype.cork=function(){this._writableState.corked++},Ei.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||Ii(this,t))},Ei.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(-1<"hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le raw".split(" ").indexOf((t+"").toLowerCase())))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Ei.prototype._write=function(t,e,r){r(Error("not implemented"))},Ei.prototype._writev=null,Ei.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,e=t=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||(t=r,n.ending=!0,Ai(this,n),t&&(n.finished?Nr(t):this.once("finish",t)),n.ended=!0,this.writable=!1)},Dr(Ci,ni);for(var Ti=Object.keys(Ei.prototype),Ri=0;Ri<Ti.length;Ri++){var Oi=Ti[Ri];Ci.prototype[Oi]||(Ci.prototype[Oi]=Ei.prototype[Oi])}function Ci(t){if(!(this instanceof Ci))return new Ci(t);ni.call(this,t),Ei.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Ni)}function Ni(){this.allowHalfOpen||this._writableState.ended||Nr(Pi,this)}function Pi(t){t.end()}function ki(t){this.afterTransform=function(e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;return i?(n.writechunk=null,n.writecb=null,null!=r&&t.push(r),i(e),(e=t._readableState).reading=!1,(e.needReadable||e.length<e.highWaterMark)&&t._read(e.highWaterMark),e=void 0):e=t.emit("error",Error("no writecb in Transform class")),e},this.transforming=this.needTransform=!1,this.writeencoding=this.writechunk=this.writecb=null}function Li(t){if(!(this instanceof Li))return new Li(t);Ci.call(this,t),this._transformState=new ki(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(t){Wi(e,t)})):Wi(e)}))}function Wi(t,e){if(e)return t.emit("error",e);if(e=t._transformState,t._writableState.length)throw Error("Calling transform done when ws.length != 0");if(e.transforming)throw Error("Calling transform done when still transforming");return t.push(null)}function Bi(t){if(!(this instanceof Bi))return new Bi(t);Li.call(this,t)}function Fi(){Gn.call(this)}Dr(Li,Ci),Li.prototype.push=function(t,e){return this._transformState.needTransform=!1,Ci.prototype.push.call(this,t,e)},Li.prototype._transform=function(){throw Error("Not implemented")},Li.prototype._write=function(t,e,r){var n=this._transformState;n.writecb=r,n.writechunk=t,n.writeencoding=e,n.transforming||(t=this._readableState,(n.needTransform||t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark))},Li.prototype._read=function(){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Dr(Bi,Li),Bi.prototype._transform=function(t,e,r){r(null,t)},Dr(Fi,Gn),Fi.Readable=ni,Fi.Writable=Ei,Fi.Duplex=Ci,Fi.Transform=Li,Fi.PassThrough=Bi,Fi.Stream=Fi,Fi.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&h.pause&&h.pause()}function n(){h.readable&&h.resume&&h.resume()}function i(){u||(u=!0,t.end())}function o(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function s(t){if(a(),0===Gn.listenerCount(this,"error"))throw t}function a(){h.removeListener("data",r),t.removeListener("drain",n),h.removeListener("end",i),h.removeListener("close",o),h.removeListener("error",s),t.removeListener("error",s),h.removeListener("end",a),h.removeListener("close",a),t.removeListener("close",a)}var h=this;h.on("data",r),t.on("drain",n),t._isStdio||e&&!1===e.end||(h.on("end",i),h.on("close",o));var u=!1;return h.on("error",s),t.on("error",s),h.on("end",a),h.on("close",a),t.on("close",a),t.emit("pipe",h),t};var Di=Array.prototype.slice,Ui=function t(e,r){for(var n in r)e[n]=r[n];return 3>arguments.length?e:t.apply(null,[e].concat(Di.call(arguments,2)))},Mi=Re((function(t,e){function r(t,e,r){return void 0===r&&(r=function(t){return t}),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return new Promise((function(o,s){t[e].bind(t).apply(void 0,n(i,[function(t,e){return t?s(t):o(r(e))}]))}))}}var n=be&&be.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){this.vol=t,this.fd=e}return t.prototype.appendFile=function(t,e){return r(this.vol,"appendFile")(this.fd,t,e)},t.prototype.chmod=function(t){return r(this.vol,"fchmod")(this.fd,t)},t.prototype.chown=function(t,e){return r(this.vol,"fchown")(this.fd,t,e)},t.prototype.close=function(){return r(this.vol,"close")(this.fd)},t.prototype.datasync=function(){return r(this.vol,"fdatasync")(this.fd)},t.prototype.read=function(t,e,n,i){return r(this.vol,"read",(function(e){return{bytesRead:e,buffer:t}}))(this.fd,t,e,n,i)},t.prototype.readFile=function(t){return r(this.vol,"readFile")(this.fd,t)},t.prototype.stat=function(t){return r(this.vol,"fstat")(this.fd,t)},t.prototype.sync=function(){return r(this.vol,"fsync")(this.fd)},t.prototype.truncate=function(t){return r(this.vol,"ftruncate")(this.fd,t)},t.prototype.utimes=function(t,e){return r(this.vol,"futimes")(this.fd,t,e)},t.prototype.write=function(t,e,n,i){return r(this.vol,"write",(function(e){return{bytesWritten:e,buffer:t}}))(this.fd,t,e,n,i)},t.prototype.writeFile=function(t,e){return r(this.vol,"writeFile")(this.fd,t,e)},t}();e.FileHandle=i,e.default=function(t){return"undefined"==typeof Promise?null:{FileHandle:i,access:function(e,n){return r(t,"access")(e,n)},appendFile:function(e,n,o){return r(t,"appendFile")(e instanceof i?e.fd:e,n,o)},chmod:function(e,n){return r(t,"chmod")(e,n)},chown:function(e,n,i){return r(t,"chown")(e,n,i)},copyFile:function(e,n,i){return r(t,"copyFile")(e,n,i)},lchmod:function(e,n){return r(t,"lchmod")(e,n)},lchown:function(e,n,i){return r(t,"lchown")(e,n,i)},link:function(e,n){return r(t,"link")(e,n)},lstat:function(e,n){return r(t,"lstat")(e,n)},mkdir:function(e,n){return r(t,"mkdir")(e,n)},mkdtemp:function(e,n){return r(t,"mkdtemp")(e,n)},open:function(e,n,o){return r(t,"open",(function(e){return new i(t,e)}))(e,n,o)},readdir:function(e,n){return r(t,"readdir")(e,n)},readFile:function(e,n){return r(t,"readFile")(e instanceof i?e.fd:e,n)},readlink:function(e,n){return r(t,"readlink")(e,n)},realpath:function(e,n){return r(t,"realpath")(e,n)},rename:function(e,n){return r(t,"rename")(e,n)},rmdir:function(e){return r(t,"rmdir")(e)},stat:function(e,n){return r(t,"stat")(e,n)},symlink:function(e,n,i){return r(t,"symlink")(e,n,i)},truncate:function(e,n){return r(t,"truncate")(e,n)},unlink:function(e){return r(t,"unlink")(e)},utimes:function(e,n,i){return r(t,"utimes")(e,n,i)},writeFile:function(e,n,o){return r(t,"writeFile")(e instanceof i?e.fd:e,n,o)}}}}));Te(Mi);var xi=/[^\x20-\x7E]/,Gi=/[\x2E\u3002\uFF0E\uFF61]/g,Hi="Overflow: input needs wider integers to process",Yi=Math.floor,ji=String.fromCharCode;function zi(t,e){return t+22+75*(26>t)-((0!=e)<<5)}var Vi=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function Ki(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function Zi(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var qi=Object.keys||function(t){var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return r};function Xi(t,e,r,n){r=r||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;for(t=t.split(e||"&"),e=1e3,n&&"number"==typeof n.maxKeys&&(e=n.maxKeys),n=t.length,0<e&&n>e&&(n=e),e=0;e<n;++e){var s=t[e].replace(o,"%20"),a=s.indexOf(r);if(0<=a){var h=s.substr(0,a);s=s.substr(a+1)}else h=s,s="";h=decodeURIComponent(h),s=decodeURIComponent(s),Object.prototype.hasOwnProperty.call(i,h)?Vi(i[h])?i[h].push(s):i[h]=[i[h],s]:i[h]=s}return i}var Ji={parse:co,resolve:function(t,e){return co(t,!1,!0).resolve(e)},resolveObject:function(t,e){return t?co(t,!1,!0).resolveObject(e):e},format:function(t){return $r(t)&&(t=po({},t)),_o(t)},Url:Qi};function Qi(){this.href=this.path=this.pathname=this.query=this.search=this.hash=this.hostname=this.port=this.host=this.auth=this.slashes=this.protocol=null}var $i=/^([a-z0-9.+-]+:)/i,to=/:[0-9]*$/,eo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ro="{}|\\^`".split("").concat('<>"` \r\n\t'.split("")),no=["'"].concat(ro),io=["%","/","?",";","#"].concat(no),oo=["/","?","#"],so=255,ao=/^[+a-z0-9A-Z_-]{0,63}$/,ho=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,uo={javascript:!0,"javascript:":!0},fo={javascript:!0,"javascript:":!0},lo={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function co(t,e,r){if(t&&rn(t)&&t instanceof Qi)return t;var n=new Qi;return n.parse(t,e,r),n}function po(t,e,r,n){if(!$r(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?");if(i=-1!==i&&i<e.indexOf("#")?"?":"#",(e=e.split(i))[0]=e[0].replace(/\\/g,"/"),i=(e=e.join(i)).trim(),!n&&1===e.split("#").length&&(e=eo.exec(i)))return t.path=i,t.href=i,t.pathname=e[1],e[2]?(t.search=e[2],t.query=r?Xi(t.search.substr(1)):t.search.substr(1)):r&&(t.search="",t.query={}),t;if(e=$i.exec(i)){var o=(e=e[0]).toLowerCase();t.protocol=o,i=i.substr(e.length)}if(n||e||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===i.substr(0,2);!s||e&&fo[e]||(i=i.substr(2),t.slashes=!0)}if(!fo[e]&&(s||e&&!lo[e])){for(e=-1,n=0;n<oo.length;n++)-1!==(s=i.indexOf(oo[n]))&&(-1===e||s<e)&&(e=s);for(-1!==(s=-1===e?i.lastIndexOf("@"):i.lastIndexOf("@",e))&&(n=i.slice(0,s),i=i.slice(s+1),t.auth=decodeURIComponent(n)),e=-1,n=0;n<io.length;n++)-1!==(s=i.indexOf(io[n]))&&(-1===e||s<e)&&(e=s);if(-1===e&&(e=i.length),t.host=i.slice(0,e),i=i.slice(e),mo(t),t.hostname=t.hostname||"",!(s="["===t.hostname[0]&&"]"===t.hostname[t.hostname.length-1])){var a=t.hostname.split(/\./);for(n=0,e=a.length;n<e;n++){var h=a[n];if(h&&!h.match(ao)){for(var u="",f=0,l=h.length;f<l;f++)u=127<h.charCodeAt(f)?u+"x":u+h[f];if(!u.match(ao)){e=a.slice(0,n),n=a.slice(n+1),(h=h.match(ho))&&(e.push(h[1]),n.unshift(h[2])),n.length&&(i="/"+n.join(".")+i),t.hostname=e.join(".");break}}}}t.hostname=t.hostname.length>so?"":t.hostname.toLowerCase(),s||(t.hostname=function(t){return function(t,e){var r=t.split("@"),n="";1<r.length&&(n=r[0]+"@",t=r[1]),r=(t=(t=t.replace(Gi,".")).split(".")).length;for(var i=[];r--;)i[r]=e(t[r]);return n+i.join(".")}(t,(function(t){if(xi.test(t)){var e,r=[],n=[],i=0;for(e=t.length;i<e;){var o=t.charCodeAt(i++);if(55296<=o&&56319>=o&&i<e){var s=t.charCodeAt(i++);56320==(64512&s)?n.push(((1023&o)<<10)+(1023&s)+65536):(n.push(o),i--)}else n.push(o)}s=(t=n).length,n=128;var a=0,h=72;for(o=0;o<s;++o){var u=t[o];128>u&&r.push(ji(u))}for((i=e=r.length)&&r.push("-");i<s;){var f=2147483647;for(o=0;o<s;++o)(u=t[o])>=n&&u<f&&(f=u);var l=i+1;if(f-n>Yi((2147483647-a)/l))throw new RangeError(Hi);for(a+=(f-n)*l,n=f,o=0;o<s;++o){if((u=t[o])<n&&2147483647<++a)throw new RangeError(Hi);if(u==n){var c=a;for(f=36;!(c<(u=f<=h?1:f>=h+26?26:f-h));f+=36){var p=c-u;c=36-u,r.push(ji(zi(u+p%c,0))),c=Yi(p/c)}for(r.push(ji(zi(c,0))),h=l,f=0,a=i==e?Yi(a/700):a>>1,a+=Yi(a/h);455<a;f+=36)a=Yi(a/35);h=Yi(f+36*a/(a+38)),a=0,++i}}++a,++n}r="xn--"+r.join("")}else r=t;return r}))}(t.hostname)),n=t.port?":"+t.port:"",t.host=(t.hostname||"")+n,t.href+=t.host,s&&(t.hostname=t.hostname.substr(1,t.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!uo[o])for(n=0,e=no.length;n<e;n++)s=no[n],-1!==i.indexOf(s)&&((h=encodeURIComponent(s))===s&&(h=escape(s)),i=i.split(s).join(h));return-1!==(n=i.indexOf("#"))&&(t.hash=i.substr(n),i=i.slice(0,n)),-1!==(n=i.indexOf("?"))?(t.search=i.substr(n),t.query=i.substr(n+1),r&&(t.query=Xi(t.query)),i=i.slice(0,n)):r&&(t.search="",t.query={}),i&&(t.pathname=i),lo[o]&&t.hostname&&!t.pathname&&(t.pathname="/"),(t.pathname||t.search)&&(n=t.pathname||"",t.path=n+(t.search||"")),t.href=_o(t),t}function _o(t){var e=t.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var r=t.protocol||"",n=t.pathname||"",i=t.hash||"",o=!1,s="";return t.host?o=e+t.host:t.hostname&&(o=e+(-1===t.hostname.indexOf(":")?t.hostname:"["+this.hostname+"]"),t.port&&(o+=":"+t.port)),t.query&&rn(t.query)&&Object.keys(t.query).length&&(s=function(t,e,r){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Zi(qi(t),(function(n){var i=encodeURIComponent(Ki(n))+r;return Vi(t[n])?Zi(t[n],(function(t){return i+encodeURIComponent(Ki(t))})).join(e):i+encodeURIComponent(Ki(t[n]))})).join(e):""}(t.query)),e=t.search||s&&"?"+s||"",r&&":"!==r.substr(-1)&&(r+=":"),t.slashes||(!r||lo[r])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),e&&"?"!==e.charAt(0)&&(e="?"+e),n=n.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})),r+o+n+(e=e.replace("#","%23"))+i}function mo(t){var e=t.host,r=to.exec(e);r&&(":"!==(r=r[0])&&(t.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(t.hostname=e)}Qi.prototype.parse=function(t,e,r){return po(this,t,e,r)},Qi.prototype.format=function(){return _o(this)},Qi.prototype.resolve=function(t){return this.resolveObject(co(t,!1,!0)).format()},Qi.prototype.resolveObject=function(t){if($r(t)){var e=new Qi;e.parse(t,!1,!0),t=e}e=new Qi;for(var r=Object.keys(this),n=0;n<r.length;n++){var i=r[n];e[i]=this[i]}if(e.hash=t.hash,""===t.href)return e.href=e.format(),e;if(t.slashes&&!t.protocol){for(r=Object.keys(t),n=0;n<r.length;n++)"protocol"!==(i=r[n])&&(e[i]=t[i]);return lo[e.protocol]&&e.hostname&&!e.pathname&&(e.path=e.pathname="/"),e.href=e.format(),e}var o;if(t.protocol&&t.protocol!==e.protocol){if(!lo[t.protocol]){for(r=Object.keys(t),n=0;n<r.length;n++)e[i=r[n]]=t[i];return e.href=e.format(),e}if(e.protocol=t.protocol,t.host||fo[t.protocol])e.pathname=t.pathname;else{for(o=(t.pathname||"").split("/");o.length&&!(t.host=o.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==o[0]&&o.unshift(""),2>o.length&&o.unshift(""),e.pathname=o.join("/")}return e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,(e.pathname||e.search)&&(e.path=(e.pathname||"")+(e.search||"")),e.slashes=e.slashes||t.slashes,e.href=e.format(),e}r=e.pathname&&"/"===e.pathname.charAt(0);var s=t.host||t.pathname&&"/"===t.pathname.charAt(0),a=r=s||r||e.host&&t.pathname;if(n=e.pathname&&e.pathname.split("/")||[],i=e.protocol&&!lo[e.protocol],o=t.pathname&&t.pathname.split("/")||[],i&&(e.hostname="",e.port=null,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===o[0]?o[0]=t.host:o.unshift(t.host)),t.host=null),r=r&&(""===o[0]||""===n[0])),s)e.host=t.host||""===t.host?t.host:e.host,e.hostname=t.hostname||""===t.hostname?t.hostname:e.hostname,e.search=t.search,e.query=t.query,n=o;else if(o.length)n||(n=[]),n.pop(),n=n.concat(o),e.search=t.search,e.query=t.query;else if(null!=t.search)return i&&(e.hostname=e.host=n.shift(),i=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=i.shift(),e.host=e.hostname=i.shift()),e.search=t.search,e.query=t.query,null===e.pathname&&null===e.search||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e;if(!n.length)return e.pathname=null,e.path=e.search?"/"+e.search:null,e.href=e.format(),e;s=n.slice(-1)[0],o=(e.host||t.host||1<n.length)&&("."===s||".."===s)||""===s;for(var h=0,u=n.length;0<=u;u--)"."===(s=n[u])?n.splice(u,1):".."===s?(n.splice(u,1),h++):h&&(n.splice(u,1),h--);if(!r&&!a)for(;h--;h)n.unshift("..");return!r||""===n[0]||n[0]&&"/"===n[0].charAt(0)||n.unshift(""),o&&"/"!==n.join("/").substr(-1)&&n.push(""),a=""===n[0]||n[0]&&"/"===n[0].charAt(0),i&&(e.hostname=e.host=a?"":n.length?n.shift():"",i=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=i.shift(),e.host=e.hostname=i.shift()),(r=r||e.host&&n.length)&&!a&&n.unshift(""),n.length?e.pathname=n.join("/"):(e.pathname=null,e.path=null),null===e.pathname&&null===e.search||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes,e.href=e.format(),e},Qi.prototype.parseHost=function(){return mo(this)};var go=Re((function(t,e){function r(t,e){return t=t[e],0<e&&("/"===t||i&&"\\"===t)}function n(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(i){var n=t;if("string"!=typeof n)throw new TypeError("expected a string");if(n=n.replace(/[\\\/]+/g,"/"),!1!==e)if(2>(n=(e=n).length-1))n=e;else{for(;r(e,n);)n--;n=e.substr(0,n+1)}return n.replace(/^([a-zA-Z]+:|\.\/)/,"")}return t}Object.defineProperty(e,"__esModule",{value:!0}),e.unixify=n,e.correctPath=function(t){return n(t.replace(/^\\\\\?\\.:\\/,"\\"))};var i="win32"===Fr.platform}));Te(go);var yo=Re((function(t,e){function r(t,e){return void 0===e&&(e=Mn.default.cwd()),P(e,t)}function n(t,e){return"function"==typeof t?[i(),t]:[i(t),f(e)]}function i(t){return void 0===t&&(t={}),N({},ht,t)}function o(t){return N({},it,"number"==typeof t?{mode:t}:t)}function s(t,e,r,n,i){return void 0===e&&(e=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=Error),e=new i(function(t,e,r,n){void 0===e&&(e=""),void 0===r&&(r=""),void 0===n&&(n="");var i="";switch(r&&(i=" '"+r+"'"),n&&(i+=" -> '"+n+"'"),t){case"ENOENT":return"ENOENT: no such file or directory, "+e+i;case"EBADF":return"EBADF: bad file descriptor, "+e+i;case"EINVAL":return"EINVAL: invalid argument, "+e+i;case"EPERM":return"EPERM: operation not permitted, "+e+i;case"EPROTO":return"EPROTO: protocol error, "+e+i;case"EEXIST":return"EEXIST: file already exists, "+e+i;case"ENOTDIR":return"ENOTDIR: not a directory, "+e+i;case"EISDIR":return"EISDIR: illegal operation on a directory, "+e+i;case"EACCES":return"EACCES: permission denied, "+e+i;case"ENOTEMPTY":return"ENOTEMPTY: directory not empty, "+e+i;case"EMFILE":return"EMFILE: too many open files, "+e+i;case"ENOSYS":return"ENOSYS: function not implemented, "+e+i;default:return t+": error occurred, "+e+i}}(t,e,r,n)),e.code=t,e}function a(t){if("number"==typeof t)return t;if("string"==typeof t){var e=C[t];if(void 0!==e)return e}throw new Pn.TypeError("ERR_INVALID_OPT_VALUE","flags",t)}function h(t,e){if(!e)return t;var r=typeof e;switch(r){case"string":t=N({},t,{encoding:e});break;case"object":t=N({},t,e);break;default:throw TypeError("Expected options to be either an object or a string, but got "+r+" instead")}return"buffer"!==t.encoding&&kn.assertEncoding(t.encoding),t}function u(t){return function(e){return h(t,e)}}function f(t){if("function"!=typeof t)throw TypeError(K.CB);return t}function l(t){return function(e,r){return"function"==typeof e?[t(),e]:[t(e),f(r)]}}function c(t){if("string"!=typeof t&&!yr.Buffer.isBuffer(t)){try{if(!(t instanceof Ji.URL))throw new TypeError(K.PATH_STR)}catch(t){throw new TypeError(K.PATH_STR)}if(""!==t.hostname)throw new Pn.TypeError("ERR_INVALID_FILE_URL_HOST",Mn.default.platform);t=t.pathname;for(var e=0;e<t.length;e++)if("%"===t[e]){var r=32|t.codePointAt(e+2);if("2"===t[e+1]&&102===r)throw new Pn.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}t=decodeURIComponent(t)}return g(t=String(t)),t}function p(t,e){return(t=r(t,e).substr(1))?t.split(j):[]}function d(t){return p(c(t))}function _(t,e){return void 0===e&&(e=kn.ENCODING_UTF8),yr.Buffer.isBuffer(t)?t:t instanceof Uint8Array?yr.bufferFrom(t):yr.bufferFrom(String(t),e)}function m(t,e){return e&&"buffer"!==e?t.toString(e):t}function g(t,e){if(-1!==(""+t).indexOf("\0")){if((t=Error("Path must be a string without null bytes")).code="ENOENT","function"!=typeof e)throw t;return Mn.default.nextTick(e,t),!1}return!0}function y(t,e){if("number"!=typeof(t="number"==typeof t?t:"string"==typeof t?parseInt(t,8):e?y(e):void 0)||isNaN(t))throw new TypeError(K.MODE_INT);return t}function E(t){if(t>>>0!==t)throw TypeError(K.FD)}function w(t){if("string"==typeof t&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return 0>t?Date.now()/1e3:t;throw Error("Cannot parse time: "+t)}function S(t){if("number"!=typeof t)throw TypeError(K.UID)}function I(t){if("number"!=typeof t)throw TypeError(K.GID)}function v(t){t.emit("stop")}function A(t,e,r){if(!(this instanceof A))return new A(t,e,r);if(this._vol=t,void 0===(r=N({},h(r,{}))).highWaterMark&&(r.highWaterMark=65536),Fi.Readable.call(this,r),this.path=c(e),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"r":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=void 0,this.bytesRead=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError('"start" option must be a Number');if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw Error('"start" option must be <= "end" option');this.pos=this.start}"number"!=typeof this.fd&&this.open(),this.on("end",(function(){this.autoClose&&this.destroy&&this.destroy()}))}function b(){this.close()}function T(t,e,r){if(!(this instanceof T))return new T(t,e,r);if(this._vol=t,r=N({},h(r,{})),Fi.Writable.call(this,r),this.path=c(e),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"w":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.autoClose=void 0===r.autoClose||!!r.autoClose,this.pos=void 0,this.bytesWritten=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError('"start" option must be a Number');if(0>this.start)throw Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),"number"!=typeof this.fd&&this.open(),this.once("finish",(function(){this.autoClose&&this.close()}))}var R=be&&be.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),O=be&&be.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0});var C,N=Ui,P=Dn,k=Oe.constants.O_RDONLY,L=Oe.constants.O_WRONLY,W=Oe.constants.O_RDWR,B=Oe.constants.O_CREAT,F=Oe.constants.O_EXCL,D=Oe.constants.O_TRUNC,U=Oe.constants.O_APPEND,M=Oe.constants.O_SYNC,x=Oe.constants.O_DIRECTORY,G=Oe.constants.F_OK,H=Oe.constants.COPYFILE_EXCL,Y=Oe.constants.COPYFILE_FICLONE_FORCE,j="/",z=Fn,V="win32"===Mn.default.platform,K={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};!function(t){t[t.r=k]="r",t[t["r+"]=W]="r+",t[t.rs=k|M]="rs",t[t.sr=t.rs]="sr",t[t["rs+"]=W|M]="rs+",t[t["sr+"]=t["rs+"]]="sr+",t[t.w=L|B|D]="w",t[t.wx=L|B|D|F]="wx",t[t.xw=t.wx]="xw",t[t["w+"]=W|B|D]="w+",t[t["wx+"]=W|B|D|F]="wx+",t[t["xw+"]=t["wx+"]]="xw+",t[t.a=L|U|B]="a",t[t.ax=L|U|B|F]="ax",t[t.xa=t.ax]="xa",t[t["a+"]=W|U|B]="a+",t[t["ax+"]=W|U|B|F]="ax+",t[t["xa+"]=t["ax+"]]="xa+"}(C=e.FLAGS||(e.FLAGS={})),e.flagsToNumber=a;var Z=u(t={encoding:"utf8"}),q=l(Z),X=u({flag:"r"}),J={encoding:"utf8",mode:438,flag:C[C.w]},Q=u(J),$={encoding:"utf8",mode:438,flag:C[C.a]},tt=u($),et=l(tt),rt=u(t),nt=l(rt),it={mode:511,recursive:!1},ot={recursive:!1},st=u({encoding:"utf8",withFileTypes:!1}),at=l(st),ht={bigint:!1};if(e.pathToFilename=c,V){var ut=r,ft=go.unixify;r=function(t,e){return ft(ut(t,e))}}e.filenameToSteps=p,e.pathToSteps=d,e.dataToStr=function(t,e){return void 0===e&&(e=kn.ENCODING_UTF8),yr.Buffer.isBuffer(t)?t.toString(e):t instanceof Uint8Array?yr.bufferFrom(t).toString(e):String(t)},e.dataToBuffer=_,e.bufferToEncoding=m,e.toUnixTimestamp=w,t=function(){function t(t){void 0===t&&(t={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=Mi.default(this),this.statWatchers={},this.props=N({Node:Vn.Node,Link:Vn.Link,File:Vn.File},t),(t=this.createLink()).setNode(this.createNode(!0));var e=this;this.StatWatcher=function(t){function r(){return t.call(this,e)||this}return R(r,t),r}(ct),this.ReadStream=function(t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(this,O([e],r))||this}return R(r,t),r}(A),this.WriteStream=function(t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(this,O([e],r))||this}return R(r,t),r}(T),this.FSWatcher=function(t){function r(){return t.call(this,e)||this}return R(r,t),r}(pt),this.root=t}return t.fromJSON=function(e,r){var n=new t;return n.fromJSON(e,r),n},Object.defineProperty(t.prototype,"promises",{get:function(){if(null===this.promisesApi)throw Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!0,configurable:!0}),t.prototype.createLink=function(t,e,r,n){if(void 0===r&&(r=!1),!t)return new this.props.Link(this,null,"");if(!e)throw Error("createLink: name cannot be empty");return t.createChild(e,this.createNode(r,n))},t.prototype.deleteLink=function(t){var e=t.parent;return!!e&&(e.deleteChild(t),!0)},t.prototype.newInoNumber=function(){return this.releasedInos.pop()||(this.ino=(this.ino+1)%4294967295)},t.prototype.newFdNumber=function(){var e=this.releasedFds.pop();return"number"==typeof e?e:t.fd--},t.prototype.createNode=function(t,e){return void 0===t&&(t=!1),e=new this.props.Node(this.newInoNumber(),e),t&&e.setIsDirectory(),this.inodes[e.ino]=e},t.prototype.getNode=function(t){return this.inodes[t]},t.prototype.deleteNode=function(t){t.del(),delete this.inodes[t.ino],this.releasedInos.push(t.ino)},t.prototype.genRndStr=function(){var t=(Math.random()+1).toString(36).substr(2,6);return 6===t.length?t:this.genRndStr()},t.prototype.getLink=function(t){return this.root.walk(t)},t.prototype.getLinkOrThrow=function(t,e){var r=p(t);if(!(r=this.getLink(r)))throw s("ENOENT",e,t);return r},t.prototype.getResolvedLink=function(t){t="string"==typeof t?p(t):t;for(var e=this.root,r=0;r<t.length;){if(!(e=e.getChild(t[r])))return null;var n=e.getNode();n.isSymlink()?(t=n.symlink.concat(t.slice(r+1)),e=this.root,r=0):r++}return e},t.prototype.getResolvedLinkOrThrow=function(t,e){var r=this.getResolvedLink(t);if(!r)throw s("ENOENT",e,t);return r},t.prototype.resolveSymlinks=function(t){return this.getResolvedLink(t.steps.slice(1))},t.prototype.getLinkAsDirOrThrow=function(t,e){var r=this.getLinkOrThrow(t,e);if(!r.getNode().isDirectory())throw s("ENOTDIR",e,t);return r},t.prototype.getLinkParent=function(t){return this.root.walk(t,t.length-1)},t.prototype.getLinkParentAsDirOrThrow=function(t,e){t=t instanceof Array?t:p(t);var r=this.getLinkParent(t);if(!r)throw s("ENOENT",e,j+t.join(j));if(!r.getNode().isDirectory())throw s("ENOTDIR",e,j+t.join(j));return r},t.prototype.getFileByFd=function(t){return this.fds[String(t)]},t.prototype.getFileByFdOrThrow=function(t,e){if(t>>>0!==t)throw TypeError(K.FD);if(!(t=this.getFileByFd(t)))throw s("EBADF",e);return t},t.prototype.getNodeByIdOrCreate=function(t,e,r){if("number"==typeof t){if(!(t=this.getFileByFd(t)))throw Error("File nto found");return t.node}var n=d(t),i=this.getLink(n);if(i)return i.getNode();if(e&B&&(e=this.getLinkParent(n)))return(i=this.createLink(e,n[n.length-1],!1,r)).getNode();throw s("ENOENT","getNodeByIdOrCreate",c(t))},t.prototype.wrapAsync=function(t,e,r){var n=this;f(r),Un.default((function(){try{r(null,t.apply(n,e))}catch(t){r(t)}}))},t.prototype._toJSON=function(t,e,r){var n;void 0===t&&(t=this.root),void 0===e&&(e={});var i=!0,o=t.children;for(var s in t.getNode().isFile()&&((n={})[t.getName()]=t.parent.getChild(t.getName()),o=n,t=t.parent),o){if(i=!1,!(o=t.getChild(s)))throw Error("_toJSON: unexpected undefined");(n=o.getNode()).isFile()?(o=o.getPath(),r&&(o=z(r,o)),e[o]=n.getString()):n.isDirectory()&&this._toJSON(o,e,r)}return t=t.getPath(),r&&(t=z(r,t)),t&&i&&(e[t]=null),e},t.prototype.toJSON=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r=!1);var n=[];if(t){t instanceof Array||(t=[t]);for(var i=0;i<t.length;i++){var o=c(t[i]);(o=this.getResolvedLink(o))&&n.push(o)}}else n.push(this.root);if(!n.length)return e;for(i=0;i<n.length;i++)o=n[i],this._toJSON(o,e,r?o.getPath():"");return e},t.prototype.fromJSON=function(t,e){for(var n in void 0===e&&(e=Mn.default.cwd()),t){var i=t[n];if("string"==typeof i){var o=p(n=r(n,e));1<o.length&&(o=j+o.slice(0,o.length-1).join(j),this.mkdirpBase(o,511)),this.writeFileSync(n,i)}else this.mkdirpBase(n,511)}},t.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},t.prototype.mountSync=function(t,e){this.fromJSON(e,t)},t.prototype.openLink=function(t,e,r){if(void 0===r&&(r=!0),this.openFiles>=this.maxFiles)throw s("EMFILE","open",t.getPath());var n=t;if(r&&(n=this.resolveSymlinks(t)),!n)throw s("ENOENT","open",t.getPath());if((r=n.getNode()).isDirectory()){if((e&(k|W|L))!==k)throw s("EISDIR","open",t.getPath())}else if(e&x)throw s("ENOTDIR","open",t.getPath());if(!(e&L||r.canRead()))throw s("EACCES","open",t.getPath());return t=new this.props.File(t,r,e,this.newFdNumber()),this.fds[t.fd]=t,this.openFiles++,e&D&&t.truncate(),t},t.prototype.openFile=function(t,e,r,n){void 0===n&&(n=!0);var i=p(t),o=n?this.getResolvedLink(i):this.getLink(i);if(!o&&e&B){var a=this.getResolvedLink(i.slice(0,i.length-1));if(!a)throw s("ENOENT","open",j+i.join(j));e&B&&"number"==typeof r&&(o=this.createLink(a,i[i.length-1],!1,r))}if(o)return this.openLink(o,e,n);throw s("ENOENT","open",t)},t.prototype.openBase=function(t,e,r,n){if(void 0===n&&(n=!0),!(e=this.openFile(t,e,r,n)))throw s("ENOENT","open",t);return e.fd},t.prototype.openSync=function(t,e,r){return void 0===r&&(r=438),r=y(r),t=c(t),e=a(e),this.openBase(t,e,r)},t.prototype.open=function(t,e,r,n){var i=r;"function"==typeof r&&(i=438,n=r),r=y(i||438),t=c(t),e=a(e),this.wrapAsync(this.openBase,[t,e,r],n)},t.prototype.closeFile=function(t){this.fds[t.fd]&&(this.openFiles--,delete this.fds[t.fd],this.releasedFds.push(t.fd))},t.prototype.closeSync=function(t){E(t),t=this.getFileByFdOrThrow(t,"close"),this.closeFile(t)},t.prototype.close=function(t,e){E(t),this.wrapAsync(this.closeSync,[t],e)},t.prototype.openFileOrGetById=function(t,e,r){if("number"==typeof t){if(!(t=this.fds[t]))throw s("ENOENT");return t}return this.openFile(c(t),e,r)},t.prototype.readBase=function(t,e,r,n,i){return this.getFileByFdOrThrow(t).read(e,Number(r),Number(n),i)},t.prototype.readSync=function(t,e,r,n,i){return E(t),this.readBase(t,e,r,n,i)},t.prototype.read=function(t,e,r,n,i,o){var s=this;if(f(o),0===n)return Mn.default.nextTick((function(){o&&o(null,0,e)}));Un.default((function(){try{var a=s.readBase(t,e,r,n,i);o(null,a,e)}catch(t){o(t)}}))},t.prototype.readFileBase=function(t,e,r){var n="number"==typeof t&&t>>>0===t;if(!n){var i=c(t);if(i=p(i),(i=this.getResolvedLink(i))&&i.getNode().isDirectory())throw s("EISDIR","open",i.getPath());t=this.openSync(t,e)}try{var o=m(this.getFileByFdOrThrow(t).getBuffer(),r)}finally{n||this.closeSync(t)}return o},t.prototype.readFileSync=function(t,e){var r=a((e=X(e)).flag);return this.readFileBase(t,r,e.encoding)},t.prototype.readFile=function(t,e,r){e=(r=l(X)(e,r))[0],r=r[1];var n=a(e.flag);this.wrapAsync(this.readFileBase,[t,n,e.encoding],r)},t.prototype.writeBase=function(t,e,r,n,i){return this.getFileByFdOrThrow(t,"write").write(e,r,n,i)},t.prototype.writeSync=function(t,e,r,n,i){E(t);var o="string"!=typeof e;if(o){var s=0|(r||0),a=n;r=i}else var h=n;return e=_(e,h),o?void 0===a&&(a=e.length):(s=0,a=e.length),this.writeBase(t,e,s,a,r)},t.prototype.write=function(t,e,r,n,i,o){var s=this;E(t);var a=typeof e,h=typeof r,u=typeof n,l=typeof i;if("string"!==a)if("function"===h)var c=r;else if("function"===u){var p=0|r;c=n}else if("function"===l){p=0|r;var d=n;c=i}else{p=0|r,d=n;var m=i;c=o}else if("function"===h)c=r;else if("function"===u)m=r,c=n;else if("function"===l){m=r;var g=n;c=i}var y=_(e,g);"string"!==a?void 0===d&&(d=y.length):(p=0,d=y.length);var w=f(c);Un.default((function(){try{var r=s.writeBase(t,y,p,d,m);w(null,r,"string"!==a?y:e)}catch(t){w(t)}}))},t.prototype.writeFileBase=function(t,e,r,n){var i="number"==typeof t;t=i?t:this.openBase(c(t),r,n),n=0;var o=e.length;r=r&U?void 0:0;try{for(;0<o;){var s=this.writeSync(t,e,n,o,r);n+=s,o-=s,void 0!==r&&(r+=s)}}finally{i||this.closeSync(t)}},t.prototype.writeFileSync=function(t,e,r){var n=Q(r);r=a(n.flag);var i=y(n.mode);e=_(e,n.encoding),this.writeFileBase(t,e,r,i)},t.prototype.writeFile=function(t,e,r,n){var i=r;"function"==typeof r&&(i=J,n=r),r=f(n);var o=Q(i);i=a(o.flag),n=y(o.mode),e=_(e,o.encoding),this.wrapAsync(this.writeFileBase,[t,e,i,n],r)},t.prototype.linkBase=function(t,e){var r=p(t),n=this.getLink(r);if(!n)throw s("ENOENT","link",t,e);var i=p(e);if(!(r=this.getLinkParent(i)))throw s("ENOENT","link",t,e);if(i=i[i.length-1],r.getChild(i))throw s("EEXIST","link",t,e);(t=n.getNode()).nlink++,r.createChild(i,t)},t.prototype.copyFileBase=function(t,e,r){var n=this.readFileSync(t);if(r&H&&this.existsSync(e))throw s("EEXIST","copyFile",t,e);if(r&Y)throw s("ENOSYS","copyFile",t,e);this.writeFileBase(e,n,C.w,438)},t.prototype.copyFileSync=function(t,e,r){return t=c(t),e=c(e),this.copyFileBase(t,e,0|(r||0))},t.prototype.copyFile=function(t,e,r,n){if(t=c(t),e=c(e),"function"==typeof r)var i=0;else i=r,r=n;f(r),this.wrapAsync(this.copyFileBase,[t,e,i],r)},t.prototype.linkSync=function(t,e){t=c(t),e=c(e),this.linkBase(t,e)},t.prototype.link=function(t,e,r){t=c(t),e=c(e),this.wrapAsync(this.linkBase,[t,e],r)},t.prototype.unlinkBase=function(t){var e=p(t);if(!(e=this.getLink(e)))throw s("ENOENT","unlink",t);if(e.length)throw Error("Dir not empty...");this.deleteLink(e),(t=e.getNode()).nlink--,0>=t.nlink&&this.deleteNode(t)},t.prototype.unlinkSync=function(t){t=c(t),this.unlinkBase(t)},t.prototype.unlink=function(t,e){t=c(t),this.wrapAsync(this.unlinkBase,[t],e)},t.prototype.symlinkBase=function(t,e){var r=p(e),n=this.getLinkParent(r);if(!n)throw s("ENOENT","symlink",t,e);if(r=r[r.length-1],n.getChild(r))throw s("EEXIST","symlink",t,e);return(e=n.createChild(r)).getNode().makeSymlink(p(t)),e},t.prototype.symlinkSync=function(t,e){t=c(t),e=c(e),this.symlinkBase(t,e)},t.prototype.symlink=function(t,e,r,n){r=f("function"==typeof r?r:n),t=c(t),e=c(e),this.wrapAsync(this.symlinkBase,[t,e],r)},t.prototype.realpathBase=function(t,e){var r=p(t);if(!(r=this.getResolvedLink(r)))throw s("ENOENT","realpath",t);return kn.strToEncoding(r.getPath(),e)},t.prototype.realpathSync=function(t,e){return this.realpathBase(c(t),rt(e).encoding)},t.prototype.realpath=function(t,e,r){e=(r=nt(e,r))[0],r=r[1],t=c(t),this.wrapAsync(this.realpathBase,[t,e.encoding],r)},t.prototype.lstatBase=function(t,e){void 0===e&&(e=!1);var r=this.getLink(p(t));if(!r)throw s("ENOENT","lstat",t);return Ne.default.build(r.getNode(),e)},t.prototype.lstatSync=function(t,e){return this.lstatBase(c(t),i(e).bigint)},t.prototype.lstat=function(t,e,r){e=(r=n(e,r))[0],r=r[1],this.wrapAsync(this.lstatBase,[c(t),e.bigint],r)},t.prototype.statBase=function(t,e){void 0===e&&(e=!1);var r=this.getResolvedLink(p(t));if(!r)throw s("ENOENT","stat",t);return Ne.default.build(r.getNode(),e)},t.prototype.statSync=function(t,e){return this.statBase(c(t),i(e).bigint)},t.prototype.stat=function(t,e,r){e=(r=n(e,r))[0],r=r[1],this.wrapAsync(this.statBase,[c(t),e.bigint],r)},t.prototype.fstatBase=function(t,e){if(void 0===e&&(e=!1),!(t=this.getFileByFd(t)))throw s("EBADF","fstat");return Ne.default.build(t.node,e)},t.prototype.fstatSync=function(t,e){return this.fstatBase(t,i(e).bigint)},t.prototype.fstat=function(t,e,r){e=n(e,r),this.wrapAsync(this.fstatBase,[t,e[0].bigint],e[1])},t.prototype.renameBase=function(t,e){var r=this.getLink(p(t));if(!r)throw s("ENOENT","rename",t,e);var n=p(e),i=this.getLinkParent(n);if(!i)throw s("ENOENT","rename",t,e);(t=r.parent)&&t.deleteChild(r),r.steps=O(i.steps,[n[n.length-1]]),i.setChild(r.getName(),r)},t.prototype.renameSync=function(t,e){t=c(t),e=c(e),this.renameBase(t,e)},t.prototype.rename=function(t,e,r){t=c(t),e=c(e),this.wrapAsync(this.renameBase,[t,e],r)},t.prototype.existsBase=function(t){return!!this.statBase(t)},t.prototype.existsSync=function(t){try{return this.existsBase(c(t))}catch(t){return!1}},t.prototype.exists=function(t,e){var r=this,n=c(t);if("function"!=typeof e)throw Error(K.CB);Un.default((function(){try{e(r.existsBase(n))}catch(t){e(!1)}}))},t.prototype.accessBase=function(t){this.getLinkOrThrow(t,"access")},t.prototype.accessSync=function(t,e){void 0===e&&(e=G),t=c(t),this.accessBase(t,0|e)},t.prototype.access=function(t,e,r){var n=G;"function"!=typeof e&&(n=0|e,e=f(r)),t=c(t),this.wrapAsync(this.accessBase,[t,n],e)},t.prototype.appendFileSync=function(t,e,r){void 0===r&&(r=$),(r=tt(r)).flag&&t>>>0!==t||(r.flag="a"),this.writeFileSync(t,e,r)},t.prototype.appendFile=function(t,e,r,n){r=(n=et(r,n))[0],n=n[1],r.flag&&t>>>0!==t||(r.flag="a"),this.writeFile(t,e,r,n)},t.prototype.readdirBase=function(t,e){var r=p(t);if(!(r=this.getResolvedLink(r)))throw s("ENOENT","readdir",t);if(!r.getNode().isDirectory())throw s("ENOTDIR","scandir",t);if(e.withFileTypes){var n=[];for(i in r.children)(t=r.getChild(i))&&n.push(Ln.default.build(t,e.encoding));return V||"buffer"===e.encoding||n.sort((function(t,e){return t.name<e.name?-1:t.name>e.name?1:0})),n}var i=[];for(n in r.children)i.push(kn.strToEncoding(n,e.encoding));return V||"buffer"===e.encoding||i.sort(),i},t.prototype.readdirSync=function(t,e){return e=st(e),t=c(t),this.readdirBase(t,e)},t.prototype.readdir=function(t,e,r){e=(r=at(e,r))[0],r=r[1],t=c(t),this.wrapAsync(this.readdirBase,[t,e],r)},t.prototype.readlinkBase=function(t,e){var r=this.getLinkOrThrow(t,"readlink").getNode();if(!r.isSymlink())throw s("EINVAL","readlink",t);return t=j+r.symlink.join(j),kn.strToEncoding(t,e)},t.prototype.readlinkSync=function(t,e){return e=Z(e),t=c(t),this.readlinkBase(t,e.encoding)},t.prototype.readlink=function(t,e,r){e=(r=q(e,r))[0],r=r[1],t=c(t),this.wrapAsync(this.readlinkBase,[t,e.encoding],r)},t.prototype.fsyncBase=function(t){this.getFileByFdOrThrow(t,"fsync")},t.prototype.fsyncSync=function(t){this.fsyncBase(t)},t.prototype.fsync=function(t,e){this.wrapAsync(this.fsyncBase,[t],e)},t.prototype.fdatasyncBase=function(t){this.getFileByFdOrThrow(t,"fdatasync")},t.prototype.fdatasyncSync=function(t){this.fdatasyncBase(t)},t.prototype.fdatasync=function(t,e){this.wrapAsync(this.fdatasyncBase,[t],e)},t.prototype.ftruncateBase=function(t,e){this.getFileByFdOrThrow(t,"ftruncate").truncate(e)},t.prototype.ftruncateSync=function(t,e){this.ftruncateBase(t,e)},t.prototype.ftruncate=function(t,e,r){var n="number"==typeof e?e:0;e=f("number"==typeof e?r:e),this.wrapAsync(this.ftruncateBase,[t,n],e)},t.prototype.truncateBase=function(t,e){t=this.openSync(t,"r+");try{this.ftruncateSync(t,e)}finally{this.closeSync(t)}},t.prototype.truncateSync=function(t,e){if(t>>>0===t)return this.ftruncateSync(t,e);this.truncateBase(t,e)},t.prototype.truncate=function(t,e,r){var n="number"==typeof e?e:0;if(e=f("number"==typeof e?r:e),t>>>0===t)return this.ftruncate(t,n,e);this.wrapAsync(this.truncateBase,[t,n],e)},t.prototype.futimesBase=function(t,e,r){(t=this.getFileByFdOrThrow(t,"futimes").node).atime=new Date(1e3*e),t.mtime=new Date(1e3*r)},t.prototype.futimesSync=function(t,e,r){this.futimesBase(t,w(e),w(r))},t.prototype.futimes=function(t,e,r,n){this.wrapAsync(this.futimesBase,[t,w(e),w(r)],n)},t.prototype.utimesBase=function(t,e,r){t=this.openSync(t,"r+");try{this.futimesBase(t,e,r)}finally{this.closeSync(t)}},t.prototype.utimesSync=function(t,e,r){this.utimesBase(c(t),w(e),w(r))},t.prototype.utimes=function(t,e,r,n){this.wrapAsync(this.utimesBase,[c(t),w(e),w(r)],n)},t.prototype.mkdirBase=function(t,e){var r=p(t);if(!r.length)throw s("EISDIR","mkdir",t);var n=this.getLinkParentAsDirOrThrow(t,"mkdir");if(r=r[r.length-1],n.getChild(r))throw s("EEXIST","mkdir",t);n.createChild(r,this.createNode(!0,e))},t.prototype.mkdirpBase=function(t,e){t=p(t);for(var r=this.root,n=0;n<t.length;n++){var i=t[n];if(!r.getNode().isDirectory())throw s("ENOTDIR","mkdir",r.getPath());var o=r.getChild(i);if(o){if(!o.getNode().isDirectory())throw s("ENOTDIR","mkdir",o.getPath());r=o}else r=r.createChild(i,this.createNode(!0,e))}},t.prototype.mkdirSync=function(t,e){var r=y((e=o(e)).mode,511);t=c(t),e.recursive?this.mkdirpBase(t,r):this.mkdirBase(t,r)},t.prototype.mkdir=function(t,e,r){var n=o(e);e=f("function"==typeof e?e:r),r=y(n.mode,511),t=c(t),n.recursive?this.wrapAsync(this.mkdirpBase,[t,r],e):this.wrapAsync(this.mkdirBase,[t,r],e)},t.prototype.mkdirpSync=function(t,e){this.mkdirSync(t,{mode:e,recursive:!0})},t.prototype.mkdirp=function(t,e,r){var n="function"==typeof e?void 0:e;e=f("function"==typeof e?e:r),this.mkdir(t,{mode:n,recursive:!0},e)},t.prototype.mkdtempBase=function(t,e,r){void 0===r&&(r=5);var n=t+this.genRndStr();try{return this.mkdirBase(n,511),kn.strToEncoding(n,e)}catch(n){if("EEXIST"===n.code){if(1<r)return this.mkdtempBase(t,e,r-1);throw Error("Could not create temp dir.")}throw n}},t.prototype.mkdtempSync=function(t,e){if(e=Z(e).encoding,!t||"string"!=typeof t)throw new TypeError("filename prefix is required");return g(t),this.mkdtempBase(t,e)},t.prototype.mkdtemp=function(t,e,r){if(e=(r=q(e,r))[0].encoding,r=r[1],!t||"string"!=typeof t)throw new TypeError("filename prefix is required");g(t)&&this.wrapAsync(this.mkdtempBase,[t,e],r)},t.prototype.rmdirBase=function(t,e){e=N({},ot,e);var r=this.getLinkAsDirOrThrow(t,"rmdir");if(r.length&&!e.recursive)throw s("ENOTEMPTY","rmdir",t);this.deleteLink(r)},t.prototype.rmdirSync=function(t,e){this.rmdirBase(c(t),e)},t.prototype.rmdir=function(t,e,r){var n=N({},ot,e);e=f("function"==typeof e?e:r),this.wrapAsync(this.rmdirBase,[c(t),n],e)},t.prototype.fchmodBase=function(t,e){this.getFileByFdOrThrow(t,"fchmod").chmod(e)},t.prototype.fchmodSync=function(t,e){this.fchmodBase(t,y(e))},t.prototype.fchmod=function(t,e,r){this.wrapAsync(this.fchmodBase,[t,y(e)],r)},t.prototype.chmodBase=function(t,e){t=this.openSync(t,"r+");try{this.fchmodBase(t,e)}finally{this.closeSync(t)}},t.prototype.chmodSync=function(t,e){e=y(e),t=c(t),this.chmodBase(t,e)},t.prototype.chmod=function(t,e,r){e=y(e),t=c(t),this.wrapAsync(this.chmodBase,[t,e],r)},t.prototype.lchmodBase=function(t,e){t=this.openBase(t,W,0,!1);try{this.fchmodBase(t,e)}finally{this.closeSync(t)}},t.prototype.lchmodSync=function(t,e){e=y(e),t=c(t),this.lchmodBase(t,e)},t.prototype.lchmod=function(t,e,r){e=y(e),t=c(t),this.wrapAsync(this.lchmodBase,[t,e],r)},t.prototype.fchownBase=function(t,e,r){this.getFileByFdOrThrow(t,"fchown").chown(e,r)},t.prototype.fchownSync=function(t,e,r){S(e),I(r),this.fchownBase(t,e,r)},t.prototype.fchown=function(t,e,r,n){S(e),I(r),this.wrapAsync(this.fchownBase,[t,e,r],n)},t.prototype.chownBase=function(t,e,r){this.getResolvedLinkOrThrow(t,"chown").getNode().chown(e,r)},t.prototype.chownSync=function(t,e,r){S(e),I(r),this.chownBase(c(t),e,r)},t.prototype.chown=function(t,e,r,n){S(e),I(r),this.wrapAsync(this.chownBase,[c(t),e,r],n)},t.prototype.lchownBase=function(t,e,r){this.getLinkOrThrow(t,"lchown").getNode().chown(e,r)},t.prototype.lchownSync=function(t,e,r){S(e),I(r),this.lchownBase(c(t),e,r)},t.prototype.lchown=function(t,e,r,n){S(e),I(r),this.wrapAsync(this.lchownBase,[c(t),e,r],n)},t.prototype.watchFile=function(t,e,r){t=c(t);var n=e;if("function"==typeof n&&(r=e,n=null),"function"!=typeof r)throw Error('"watchFile()" requires a listener function');e=5007;var i=!0;return n&&"object"==typeof n&&("number"==typeof n.interval&&(e=n.interval),"boolean"==typeof n.persistent&&(i=n.persistent)),(n=this.statWatchers[t])||((n=new this.StatWatcher).start(t,i,e),this.statWatchers[t]=n),n.addListener("change",r),n},t.prototype.unwatchFile=function(t,e){t=c(t);var r=this.statWatchers[t];r&&("function"==typeof e?r.removeListener("change",e):r.removeAllListeners("change"),0===r.listenerCount("change")&&(r.stop(),delete this.statWatchers[t]))},t.prototype.createReadStream=function(t,e){return new this.ReadStream(t,e)},t.prototype.createWriteStream=function(t,e){return new this.WriteStream(t,e)},t.prototype.watch=function(t,e,r){t=c(t);var n=e;"function"==typeof e&&(r=e,n=null);var i=Z(n);e=i.persistent,n=i.recursive,i=i.encoding,void 0===e&&(e=!0),void 0===n&&(n=!1);var o=new this.FSWatcher;return o.start(t,e,n,i),r&&o.addListener("change",r),o},t.fd=2147483647,t}(),e.Volume=t;var lt,ct=function(t){function e(e){var r=t.call(this)||this;return r.onInterval=function(){try{var t=r.vol.statSync(r.filename);r.hasChanged(t)&&(r.emit("change",t,r.prev),r.prev=t)}finally{r.loop()}},r.vol=e,r}return R(e,t),e.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},e.prototype.hasChanged=function(t){return t.mtimeMs>this.prev.mtimeMs||t.nlink!==this.prev.nlink},e.prototype.start=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=5007),this.filename=c(t),this.setTimeout=e?setTimeout:Zn.default,this.interval=r,this.prev=this.vol.statSync(this.filename),this.loop()},e.prototype.stop=function(){clearTimeout(this.timeoutRef),Mn.default.nextTick(v,this)},e}(Gn.EventEmitter);e.StatWatcher=ct,ln.inherits(A,Fi.Readable),e.ReadStream=A,A.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(function(e,r){e?(t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e)):(t.fd=r,t.emit("open",r),t.read())}))},A.prototype._read=function(t){if("number"!=typeof this.fd)return this.once("open",(function(){this._read(t)}));if(!this.destroyed){(!lt||128>lt.length-lt.used)&&((lt=yr.bufferAllocUnsafe(this._readableState.highWaterMark)).used=0);var e=lt,r=Math.min(lt.length-lt.used,t),n=lt.used;if(void 0!==this.pos&&(r=Math.min(this.end-this.pos+1,r)),0>=r)return this.push(null);var i=this;this._vol.read(this.fd,lt,lt.used,r,this.pos,(function(t,r){t?(i.autoClose&&i.destroy&&i.destroy(),i.emit("error",t)):(t=null,0<r&&(i.bytesRead+=r,t=e.slice(n,n+r)),i.push(t))})),void 0!==this.pos&&(this.pos+=r),lt.used+=r}},A.prototype._destroy=function(t,e){this.close((function(r){e(t||r)}))},A.prototype.close=function(t){var e=this;if(t&&this.once("close",t),this.closed||"number"!=typeof this.fd)return"number"!=typeof this.fd?void this.once("open",b):Mn.default.nextTick((function(){return e.emit("close")}));this.closed=!0,this._vol.close(this.fd,(function(t){t?e.emit("error",t):e.emit("close")})),this.fd=null},ln.inherits(T,Fi.Writable),e.WriteStream=T,T.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(t,e){t?(this.autoClose&&this.destroy&&this.destroy(),this.emit("error",t)):(this.fd=e,this.emit("open",e))}.bind(this))},T.prototype._write=function(t,e,r){if(!(t instanceof yr.Buffer))return this.emit("error",Error("Invalid data"));if("number"!=typeof this.fd)return this.once("open",(function(){this._write(t,e,r)}));var n=this;this._vol.write(this.fd,t,0,t.length,this.pos,(function(t,e){if(t)return n.autoClose&&n.destroy&&n.destroy(),r(t);n.bytesWritten+=e,r()})),void 0!==this.pos&&(this.pos+=t.length)},T.prototype._writev=function(t,e){if("number"!=typeof this.fd)return this.once("open",(function(){this._writev(t,e)}));for(var r=this,n=t.length,i=Array(n),o=0,s=0;s<n;s++){var a=t[s].chunk;i[s]=a,o+=a.length}n=yr.Buffer.concat(i),this._vol.write(this.fd,n,0,n.length,this.pos,(function(t,n){if(t)return r.destroy&&r.destroy(),e(t);r.bytesWritten+=n,e()})),void 0!==this.pos&&(this.pos+=o)},T.prototype._destroy=A.prototype._destroy,T.prototype.close=A.prototype.close,T.prototype.destroySoon=T.prototype.end;var pt=function(t){function e(e){var r=t.call(this)||this;return r._filename="",r._filenameEncoded="",r._recursive=!1,r._encoding=kn.ENCODING_UTF8,r._onNodeChange=function(){r._emit("change")},r._onParentChild=function(t){t.getName()===r._getName()&&r._emit("rename")},r._emit=function(t){r.emit("change",t,r._filenameEncoded)},r._persist=function(){r._timer=setTimeout(r._persist,1e6)},r._vol=e,r}return R(e,t),e.prototype._getName=function(){return this._steps[this._steps.length-1]},e.prototype.start=function(t,e,r,n){void 0===e&&(e=!0),void 0===r&&(r=!1),void 0===n&&(n=kn.ENCODING_UTF8),this._filename=c(t),this._steps=p(this._filename),this._filenameEncoded=kn.strToEncoding(this._filename),this._recursive=r,this._encoding=n;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(t){throw(e=Error("watch "+this._filename+" "+t.code)).code=t.code,e.errno=t.code,e}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange),(t=this._link.parent)&&(t.setMaxListeners(t.getMaxListeners()+1),t.on("child:delete",this._onParentChild)),e&&this._persist()},e.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var t=this._link.parent;t&&t.removeListener("child:delete",this._onParentChild)},e}(Gn.EventEmitter);e.FSWatcher=pt}));Te(yo);var Eo=yo.pathToFilename,wo=yo.filenameToSteps,So=yo.Volume,Io=Re((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.fsProps="constants F_OK R_OK W_OK X_OK Stats".split(" "),e.fsSyncMethods="renameSync ftruncateSync truncateSync chownSync fchownSync lchownSync chmodSync fchmodSync lchmodSync statSync lstatSync fstatSync linkSync symlinkSync readlinkSync realpathSync unlinkSync rmdirSync mkdirSync mkdirpSync readdirSync closeSync openSync utimesSync futimesSync fsyncSync writeSync readSync readFileSync writeFileSync appendFileSync existsSync accessSync fdatasyncSync mkdtempSync copyFileSync createReadStream createWriteStream".split(" "),e.fsAsyncMethods="rename ftruncate truncate chown fchown lchown chmod fchmod lchmod stat lstat fstat link symlink readlink realpath unlink rmdir mkdir mkdirp readdir close open utimes futimes fsync write read readFile writeFile appendFile exists access fdatasync mkdtemp copyFile watchFile unwatchFile watch".split(" ")}));Te(Io);var vo=Re((function(t,e){function r(t){for(var e={F_OK:s,R_OK:a,W_OK:h,X_OK:u,constants:Oe.constants,Stats:Ne.default,Dirent:Ln.default},r=0,n=i;r<n.length;r++){var f=n[r];"function"==typeof t[f]&&(e[f]=t[f].bind(t))}for(r=0,n=o;r<n.length;r++)"function"==typeof t[f=n[r]]&&(e[f]=t[f].bind(t));return e.StatWatcher=t.StatWatcher,e.FSWatcher=t.FSWatcher,e.WriteStream=t.WriteStream,e.ReadStream=t.ReadStream,e.promises=t.promises,e._toUnixTimestamp=yo.toUnixTimestamp,e}var n=be&&be.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=Io.fsSyncMethods,o=Io.fsAsyncMethods,s=Oe.constants.F_OK,a=Oe.constants.R_OK,h=Oe.constants.W_OK,u=Oe.constants.X_OK;e.Volume=yo.Volume,e.vol=new yo.Volume,e.createFsFromVolume=r,e.fs=r(e.vol),t.exports=n(n({},t.exports),e.fs),t.exports.semantic=!0}));Te(vo);var Ao=vo.createFsFromVolume;Kn.prototype.emit=function(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];i=this.listeners(t);try{for(var o=Ie(i),s=o.next();!s.done;s=o.next()){var a=s.value;try{a.apply(void 0,Ae(n))}catch(t){console.error(t)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0<i.length};var bo=function(){function t(){this.volume=new So,this.fs=Ao(this.volume),this.fromJSON({"/dev/stdin":"","/dev/stdout":"","/dev/stderr":""})}return t.prototype._toJSON=function(t,e,r){void 0===e&&(e={});var n,i=!0;for(n in t.children){i=!1;var o=t.getChild(n);if(o){var s=o.getNode();s&&s.isFile()?(o=o.getPath(),r&&(o=Bn(r,o)),e[o]=s.getBuffer()):s&&s.isDirectory()&&this._toJSON(o,e,r)}}return t=t.getPath(),r&&(t=Bn(r,t)),t&&i&&(e[t]=null),e},t.prototype.toJSON=function(t,e,r){var n,i;void 0===e&&(e={}),void 0===r&&(r=!1);var o=[];if(t){t instanceof Array||(t=[t]);try{for(var s=Ie(t),a=s.next();!a.done;a=s.next()){var h=Eo(a.value),u=this.volume.getResolvedLink(h);u&&o.push(u)}}catch(t){var f={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(f)throw f.error}}}else o.push(this.volume.root);if(!o.length)return e;try{for(var l=Ie(o),c=l.next();!c.done;c=l.next())u=c.value,this._toJSON(u,e,r?u.getPath():"")}catch(t){var p={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(p)throw p.error}}return e},t.prototype.fromJSONFixed=function(t,e){for(var r in e){var n=e[r];if(n?null!==Object.getPrototypeOf(n):null!==n){var i=wo(r);1<i.length&&(i="/"+i.slice(0,i.length-1).join("/"),t.mkdirpBase(i,511)),t.writeFileSync(r,n||"")}else t.mkdirpBase(r,511)}},t.prototype.fromJSON=function(t){this.volume=new So,this.fromJSONFixed(this.volume,t),this.fs=Ao(this.volume),this.volume.releasedFds=[0,1,2],t=this.volume.openSync("/dev/stderr","w");var e=this.volume.openSync("/dev/stdout","w"),r=this.volume.openSync("/dev/stdin","r");if(2!==t)throw Error("invalid handle for stderr: "+t);if(1!==e)throw Error("invalid handle for stdout: "+e);if(0!==r)throw Error("invalid handle for stdin: "+r)},t.prototype.getStdOut=function(){return function(t,e,r,n){return new(r||(r=Promise))((function(e,i){function o(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,s)}a((n=n.apply(t,[])).next())}))}(this,0,void 0,(function(){var t=this;return function(t,e){function r(t){return function(e){return n([t,e])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;h;)try{if(i=1,o&&(s=2&r[0]?o.return:r[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return h.label++,{value:r[1],done:!1};case 5:h.label++,o=r[1],r=[0];continue;case 7:r=h.ops.pop(),h.trys.pop();continue;default:if(!((s=0<(s=h.trys).length&&s[s.length-1])||6!==r[0]&&2!==r[0])){h=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3]))h.label=r[1];else if(6===r[0]&&h.label<s[1])h.label=s[1],s=r;else{if(!(s&&h.label<s[2])){s[2]&&h.ops.pop(),h.trys.pop();continue}h.label=s[2],h.ops.push(r)}}r=e.call(t,h)}catch(t){r=[6,t],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,h={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}(this,(function(){return[2,new Promise((function(e){e(t.fs.readFileSync("/dev/stdout","utf8"))}))]}))}))},t}();const To=8192,Ro=class{programName;wasmModule;constructor(t,e){this.programName=t,this.wasmModule=e}run(t,e,r,n,i,o,s,a,h){console.log("wasmer runnable run:",this.programName,t),"function"!=typeof e&&(e=()=>{}),"function"!=typeof r&&(r=()=>{}),"function"!=typeof n&&(n=()=>{}),i instanceof Array||(i=[]),"function"!=typeof o&&(o=()=>{}),"function"!=typeof s&&(s=t=>{console.error(t)}),"function"!=typeof a&&(a=()=>{});const u=new bo;if(this._writeFilesToFS(u,i),u.volume.fds[0].node.read=e,h){"string"!=typeof h&&(h=(h||"").toString());let t=0;u.volume.fds[0].node.read=e=>{if(t%2!=0)return t++,0;for(let t=0;t<h.length;t++)e[t]=h.charCodeAt(t);return t++,h.length}}u.volume.fds[1].node.write=(t,e,n,i)=>(r(new TextDecoder("utf-8").decode(t)),t.length),u.volume.fds[2].node.write=(t,e,r,i)=>(n(new TextDecoder("utf-8").decode(t)),t.length);const f=u.volume.openSync("/dev/tty","w+");u.volume.fds[f].node.read=u.volume.fds[0].node.read,u.volume.fds[f].node.write=u.volume.fds[1].node.write,u.volume.fds[0].node.setModeProperty(To),u.volume.fds[1].node.setModeProperty(To),u.volume.fds[2].node.setModeProperty(To),u.volume.fds[f].node.setModeProperty(To);let l=new we({args:[this.programName,...t],env:{},bindings:{...Se.A,fs:u.fs},preopens:{".":".","/":"/"}});const c=l.getImports(this.wasmModule);WebAssembly.instantiate(this.wasmModule,{...c}).then((t=>{let e;try{this._writeFilesToFS(u,i);try{l.start(t)}catch(t){0!=t.code&&Se.A.exit(t.code)}e=this._readFilesFromFS(u),a(e)}catch(t){s(t.message)}finally{o(e||i)}}))}runHeadless(t,e,r,n,i,o){console.log("wasmer runnable run headless:",this.programName,t),"function"!=typeof r&&(r=()=>{});let s="",a="",h="";this.run(t,(()=>(console.log("called runHeadless stdin"),0)),(t=>(s+=t,a+=t,t.length)),(t=>(s+=t,h+=t,t.length)),e,(()=>r({output:s,stdout:a,stderr:h})),n,i,o)}_readFilesFromFS(t,e="/",r=!0){const n=t.volume.getLinkAsDirOrThrow(e),i=e=>{let n=[];return Object.values(e.children).forEach((e=>{let o=e.getPath(),s=e.getNode();s.isFile()&&n.push({name:o,timestamp:s.mtime.getTime(),bytes:r?t.fs.readFileSync(o):new Uint8Array}),s.isDirectory()&&(n=[...n,...i(e)])})),n};return i(n)}_writeFilesToFS(t,e=[]){e.forEach((e=>{try{if(e.bytes instanceof Uint8Array){const r=e.name.split("/").slice(0,-1).join("/");t.fs.mkdirSync(r,{recursive:!0}),t.fs.writeFileSync(e.name,e.bytes),e.timestamp instanceof Date?t.fs.utimesSync(e.name,e.timestamp,e.timestamp):"number"==typeof e.timestamp&&t.fs.utimesSync(e.name,e.timestamp/1e3,e.timestamp/1e3)}}catch(t){console.error(t.name+": "+t.message)}}))}}},316:(t,e,r)=>{"use strict";r.d(e,{A:()=>o,D:()=>s});var n=r(814),i=r(34);const o=class{outputBuffer;constructor(){this.outputBuffer=""}runCommand(t,e,r,o,s,a,h,u,f,l,c,p,d){"function"!=typeof f&&(f=()=>{}),"function"!=typeof l&&(l=t=>{console.error(t)}),"function"!=typeof c&&(c=()=>{});const _=t=>{this.outputBuffer+="number"==typeof t?String.fromCharCode(t):t},m=t=>(_(t),a(t)),g=t=>(_(t),h(t));if("emscripten"==r){console.log("wasm runner creates new emscr runnable");const r=t=>this._onEmscrStdinCall(t,s,m,g);new n.A(t,e,d).run(o,r,m,g,u,f,l,c,p)}else{if("wasmer"!=r)throw new Error("Unknown wasm module type (can only handle emscripten or wasmer)");{console.log("wasm runner creates new wasmer runnable");const r=t=>this._onWasmerStdinCall(t,s,m,g);new i.A(t,e).run(o,r,m,g,u,f,l,c,p)}}}runCommandHeadless(t,e,r,o,s,a,h,u,f,l){if("function"!=typeof a&&(a=()=>{}),"function"!=typeof h&&(h=t=>{console.error(t)}),"function"!=typeof u&&(u=()=>{}),"emscripten"==r)console.log("wasm runner creates new emscr runnable"),new n.A(t,e,l).runHeadless(o,s,a,h,u,f);else{if("wasmer"!=r)throw new Error("Unknown wasm module type (can only handle emscripten or wasmer)");new i.A(t,e).runHeadless(o,s,a,h,u,f)}}_onEmscrStdinCall(t,e,r,n){if(0==t.input.length){const e=this.outputBuffer.split(/\r?\n/g).pop(),n=window.prompt(e);if(null==n)return null;r(n),e||r("\r\n"),t.input=(n+"\n").split("").map((t=>t.charCodeAt(0))),t.input.push(null)}return t.input.shift()}_onWasmerStdinCall(t,e,r,n){const i=this.outputBuffer.split(/\r?\n/g).pop(),o=window.prompt(i);return null==o?0:(r(o),i||r("\r\n"),Array.from(o+"\n").forEach(((e,r)=>t[r]=e.charCodeAt(0))),o.length+1)}},s=t.id}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}return r.m=t,r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(437)})()));
//# sourceMappingURL=webterm.bundle.js.map