-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowser-fs-core.min.js
31 lines (28 loc) · 204 KB
/
browser-fs-core.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var BrowserFS=(()=>{var eu=Object.create;var lr=Object.defineProperty;var tu=Object.getOwnPropertyDescriptor;var ru=Object.getOwnPropertyNames;var iu=Object.getPrototypeOf,nu=Object.prototype.hasOwnProperty;var s=(r,e)=>lr(r,"name",{value:e,configurable:!0});var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Pr=(r,e)=>{for(var t in e)lr(r,t,{get:e[t],enumerable:!0})},ts=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ru(e))!nu.call(r,n)&&n!==t&&lr(r,n,{get:()=>e[n],enumerable:!(i=tu(e,n))||i.enumerable});return r};var ou=(r,e,t)=>(t=r!=null?eu(iu(r)):{},ts(e||!r||!r.__esModule?lr(t,"default",{value:r,enumerable:!0}):t,r)),su=r=>ts(lr({},"__esModule",{value:!0}),r);var gs=T(Jr=>{"use strict";Jr.byteLength=xd;Jr.toByteArray=kd;Jr.fromByteArray=Td;var Ae=[],ge=[],Ed=typeof Uint8Array<"u"?Uint8Array:Array,Cn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(mt=0,ms=Cn.length;mt<ms;++mt)Ae[mt]=Cn[mt],ge[Cn.charCodeAt(mt)]=mt;var mt,ms;ge["-".charCodeAt(0)]=62;ge["_".charCodeAt(0)]=63;function bs(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}s(bs,"getLens");function xd(r){var e=bs(r),t=e[0],i=e[1];return(t+i)*3/4-i}s(xd,"byteLength");function vd(r,e,t){return(e+t)*3/4-t}s(vd,"_byteLength");function kd(r){var e,t=bs(r),i=t[0],n=t[1],o=new Ed(vd(r,i,n)),a=0,l=n>0?i-4:i,c;for(c=0;c<l;c+=4)e=ge[r.charCodeAt(c)]<<18|ge[r.charCodeAt(c+1)]<<12|ge[r.charCodeAt(c+2)]<<6|ge[r.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=ge[r.charCodeAt(c)]<<2|ge[r.charCodeAt(c+1)]>>4,o[a++]=e&255),n===1&&(e=ge[r.charCodeAt(c)]<<10|ge[r.charCodeAt(c+1)]<<4|ge[r.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(kd,"toByteArray");function Ad(r){return Ae[r>>18&63]+Ae[r>>12&63]+Ae[r>>6&63]+Ae[r&63]}s(Ad,"tripletToBase64");function Fd(r,e,t){for(var i,n=[],o=e;o<t;o+=3)i=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),n.push(Ad(i));return n.join("")}s(Fd,"encodeChunk");function Td(r){for(var e,t=r.length,i=t%3,n=[],o=16383,a=0,l=t-i;a<l;a+=o)n.push(Fd(r,a,a+o>l?l:a+o));return i===1?(e=r[t-1],n.push(Ae[e>>2]+Ae[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(Ae[e>>10]+Ae[e>>4&63]+Ae[e<<2&63]+"=")),n.join("")}s(Td,"fromByteArray")});var ws=T(Nn=>{Nn.read=function(r,e,t,i,n){var o,a,l=n*8-i-1,c=(1<<l)-1,u=c>>1,h=-7,d=t?n-1:0,b=t?-1:1,m=r[e+d];for(d+=b,o=m&(1<<-h)-1,m>>=-h,h+=l;h>0;o=o*256+r[e+d],d+=b,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=i;h>0;a=a*256+r[e+d],d+=b,h-=8);if(o===0)o=1-u;else{if(o===c)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-u}return(m?-1:1)*a*Math.pow(2,o-i)};Nn.write=function(r,e,t,i,n,o){var a,l,c,u=o*8-n-1,h=(1<<u)-1,d=h>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:o-1,g=i?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+d>=1?e+=b/c:e+=b*Math.pow(2,1-d),e*c>=2&&(a++,c/=2),a+d>=h?(l=0,a=h):a+d>=1?(l=(e*c-1)*Math.pow(2,n),a=a+d):(l=e*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;r[t+m]=l&255,m+=g,l/=256,n-=8);for(a=a<<n|l,u+=n;u>0;r[t+m]=a&255,m+=g,a/=256,u-=8);r[t+m-g]|=y*128}});var We=T(jt=>{"use strict";var Pn=gs(),Wt=ws(),Ss=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;jt.Buffer=p;jt.SlowBuffer=Rd;jt.INSPECT_MAX_BYTES=50;var Qr=2147483647;jt.kMaxLength=Qr;p.TYPED_ARRAY_SUPPORT=Cd();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function Cd(){try{let r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}s(Cd,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function Me(r){if(r>Qr)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,p.prototype),e}s(Me,"createBuffer");function p(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return On(r)}return vs(r,e,t)}s(p,"Buffer");p.poolSize=8192;function vs(r,e,t){if(typeof r=="string")return Pd(r,e);if(ArrayBuffer.isView(r))return Id(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Fe(r,ArrayBuffer)||r&&Fe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Fe(r,SharedArrayBuffer)||r&&Fe(r.buffer,SharedArrayBuffer)))return Ln(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return p.from(i,e,t);let n=Ld(r);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return p.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}s(vs,"from");p.from=function(r,e,t){return vs(r,e,t)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function ks(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}s(ks,"assertSize");function Nd(r,e,t){return ks(r),r<=0?Me(r):e!==void 0?typeof t=="string"?Me(r).fill(e,t):Me(r).fill(e):Me(r)}s(Nd,"alloc");p.alloc=function(r,e,t){return Nd(r,e,t)};function On(r){return ks(r),Me(r<0?0:Dn(r)|0)}s(On,"allocUnsafe");p.allocUnsafe=function(r){return On(r)};p.allocUnsafeSlow=function(r){return On(r)};function Pd(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=As(r,e)|0,i=Me(t),n=i.write(r,e);return n!==t&&(i=i.slice(0,n)),i}s(Pd,"fromString");function In(r){let e=r.length<0?0:Dn(r.length)|0,t=Me(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}s(In,"fromArrayLike");function Id(r){if(Fe(r,Uint8Array)){let e=new Uint8Array(r);return Ln(e.buffer,e.byteOffset,e.byteLength)}return In(r)}s(Id,"fromArrayView");function Ln(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,p.prototype),i}s(Ln,"fromArrayBuffer");function Ld(r){if(p.isBuffer(r)){let e=Dn(r.length)|0,t=Me(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Un(r.length)?Me(0):In(r);if(r.type==="Buffer"&&Array.isArray(r.data))return In(r.data)}s(Ld,"fromObject");function Dn(r){if(r>=Qr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Qr.toString(16)+" bytes");return r|0}s(Dn,"checked");function Rd(r){return+r!=r&&(r=0),p.alloc(+r)}s(Rd,"SlowBuffer");p.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=s(function(e,t){if(Fe(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Fe(t,Uint8Array)&&(t=p.from(t,t.offset,t.byteLength)),!p.isBuffer(e)||!p.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,n=t.length;for(let o=0,a=Math.min(i,n);o<a;++o)if(e[o]!==t[o]){i=e[o],n=t[o];break}return i<n?-1:n<i?1:0},"compare");p.isEncoding=s(function(e){switch(String(e).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}},"isEncoding");p.concat=s(function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;let n=p.allocUnsafe(t),o=0;for(i=0;i<e.length;++i){let a=e[i];if(Fe(a,Uint8Array))o+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(p.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function As(r,e){if(p.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Fe(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Rn(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Os(r).length;default:if(n)return i?-1:Rn(r).length;e=(""+e).toLowerCase(),n=!0}}s(As,"byteLength");p.byteLength=As;function Od(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return zd(this,e,t);case"utf8":case"utf-8":return Ts(this,e,t);case"ascii":return $d(this,e,t);case"latin1":case"binary":return Vd(this,e,t);case"base64":return qd(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kd(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}s(Od,"slowToString");p.prototype._isBuffer=!0;function bt(r,e,t){let i=r[e];r[e]=r[t],r[t]=i}s(bt,"swap");p.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)bt(this,t,t+1);return this},"swap16");p.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)bt(this,t,t+3),bt(this,t+1,t+2);return this},"swap32");p.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)bt(this,t,t+7),bt(this,t+1,t+6),bt(this,t+2,t+5),bt(this,t+3,t+4);return this},"swap64");p.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?Ts(this,0,e):Od.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=s(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=s(function(){let e="",t=jt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Ss&&(p.prototype[Ss]=p.prototype.inspect);p.prototype.compare=s(function(e,t,i,n,o){if(Fe(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,l=i-t,c=Math.min(a,l),u=this.slice(n,o),h=e.slice(t,i);for(let d=0;d<c;++d)if(u[d]!==h[d]){a=u[d],l=h[d];break}return a<l?-1:l<a?1:0},"compare");function Fs(r,e,t,i,n){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Un(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof e=="string"&&(e=p.from(e,i)),p.isBuffer(e))return e.length===0?-1:_s(r,e,t,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):_s(r,[e],t,i,n);throw new TypeError("val must be string, number or Buffer")}s(Fs,"bidirectionalIndexOf");function _s(r,e,t,i,n){let o=1,a=r.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;o=2,a/=2,l/=2,t/=2}function c(h,d){return o===1?h[d]:h.readUInt16BE(d*o)}s(c,"read");let u;if(n){let h=-1;for(u=t;u<a;u++)if(c(r,u)===c(e,h===-1?0:u-h)){if(h===-1&&(h=u),u-h+1===l)return h*o}else h!==-1&&(u-=u-h),h=-1}else for(t+l>a&&(t=a-l),u=t;u>=0;u--){let h=!0;for(let d=0;d<l;d++)if(c(r,u+d)!==c(e,d)){h=!1;break}if(h)return u}return-1}s(_s,"arrayIndexOf");p.prototype.includes=s(function(e,t,i){return this.indexOf(e,t,i)!==-1},"includes");p.prototype.indexOf=s(function(e,t,i){return Fs(this,e,t,i,!0)},"indexOf");p.prototype.lastIndexOf=s(function(e,t,i){return Fs(this,e,t,i,!1)},"lastIndexOf");function Dd(r,e,t,i){t=Number(t)||0;let n=r.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let a;for(a=0;a<i;++a){let l=parseInt(e.substr(a*2,2),16);if(Un(l))return a;r[t+a]=l}return a}s(Dd,"hexWrite");function Bd(r,e,t,i){return Zr(Rn(e,r.length-t),r,t,i)}s(Bd,"utf8Write");function Ud(r,e,t,i){return Zr(Xd(e),r,t,i)}s(Ud,"asciiWrite");function Md(r,e,t,i){return Zr(Os(e),r,t,i)}s(Md,"base64Write");function Wd(r,e,t,i){return Zr(Jd(e,r.length-t),r,t,i)}s(Wd,"ucs2Write");p.prototype.write=s(function(e,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return Dd(this,e,t,i);case"utf8":case"utf-8":return Bd(this,e,t,i);case"ascii":case"latin1":case"binary":return Ud(this,e,t,i);case"base64":return Md(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wd(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function qd(r,e,t){return e===0&&t===r.length?Pn.fromByteArray(r):Pn.fromByteArray(r.slice(e,t))}s(qd,"base64Slice");function Ts(r,e,t){t=Math.min(r.length,t);let i=[],n=e;for(;n<t;){let o=r[n],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=t){let c,u,h,d;switch(l){case 1:o<128&&(a=o);break;case 2:c=r[n+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(a=d));break;case 3:c=r[n+1],u=r[n+2],(c&192)===128&&(u&192)===128&&(d=(o&15)<<12|(c&63)<<6|u&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:c=r[n+1],u=r[n+2],h=r[n+3],(c&192)===128&&(u&192)===128&&(h&192)===128&&(d=(o&15)<<18|(c&63)<<12|(u&63)<<6|h&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=l}return jd(i)}s(Ts,"utf8Slice");var Es=4096;function jd(r){let e=r.length;if(e<=Es)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=Es));return t}s(jd,"decodeCodePointsArray");function $d(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]&127);return i}s($d,"asciiSlice");function Vd(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]);return i}s(Vd,"latin1Slice");function zd(r,e,t){let i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let n="";for(let o=e;o<t;++o)n+=Qd[r[o]];return n}s(zd,"hexSlice");function Kd(r,e,t){let i=r.slice(e,t),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}s(Kd,"utf16leSlice");p.prototype.slice=s(function(e,t){let i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,p.prototype),n},"slice");function G(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}s(G,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=s(function(e,t,i){e=e>>>0,t=t>>>0,i||G(e,t,this.length);let n=this[e],o=1,a=0;for(;++a<t&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=s(function(e,t,i){e=e>>>0,t=t>>>0,i||G(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=s(function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=s(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=s(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=s(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=s(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=lt(s(function(e){e=e>>>0,qt(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&hr(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=lt(s(function(e){e=e>>>0,qt(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&hr(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));p.prototype.readIntLE=s(function(e,t,i){e=e>>>0,t=t>>>0,i||G(e,t,this.length);let n=this[e],o=1,a=0;for(;++a<t&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},"readIntLE");p.prototype.readIntBE=s(function(e,t,i){e=e>>>0,t=t>>>0,i||G(e,t,this.length);let n=t,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*t)),a},"readIntBE");p.prototype.readInt8=s(function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=s(function(e,t){e=e>>>0,t||G(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},"readInt16LE");p.prototype.readInt16BE=s(function(e,t){e=e>>>0,t||G(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},"readInt16BE");p.prototype.readInt32LE=s(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=s(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=lt(s(function(e){e=e>>>0,qt(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&hr(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=lt(s(function(e){e=e>>>0,qt(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&hr(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)},"readBigInt64BE"));p.prototype.readFloatLE=s(function(e,t){return e=e>>>0,t||G(e,4,this.length),Wt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=s(function(e,t){return e=e>>>0,t||G(e,4,this.length),Wt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=s(function(e,t){return e=e>>>0,t||G(e,8,this.length),Wt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=s(function(e,t){return e=e>>>0,t||G(e,8,this.length),Wt.read(this,e,!1,52,8)},"readDoubleBE");function ce(r,e,t,i,n,o){if(!p.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}s(ce,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=s(function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;ce(this,e,t,i,l,0)}let o=1,a=0;for(this[t]=e&255;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=s(function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;ce(this,e,t,i,l,0)}let o=i-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function Cs(r,e,t,i,n){Rs(e,i,n,r,t,7);let o=Number(e&BigInt(4294967295));r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]=a,t}s(Cs,"wrtBigUInt64LE");function Ns(r,e,t,i,n){Rs(e,i,n,r,t,7);let o=Number(e&BigInt(4294967295));r[t+7]=o,o=o>>8,r[t+6]=o,o=o>>8,r[t+5]=o,o=o>>8,r[t+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=a,a=a>>8,r[t+2]=a,a=a>>8,r[t+1]=a,a=a>>8,r[t]=a,t+8}s(Ns,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=lt(s(function(e,t=0){return Cs(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=lt(s(function(e,t=0){return Ns(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=s(function(e,t,i,n){if(e=+e,t=t>>>0,!n){let c=Math.pow(2,8*i-1);ce(this,e,t,i,c-1,-c)}let o=0,a=1,l=0;for(this[t]=e&255;++o<i&&(a*=256);)e<0&&l===0&&this[t+o-1]!==0&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+i},"writeIntLE");p.prototype.writeIntBE=s(function(e,t,i,n){if(e=+e,t=t>>>0,!n){let c=Math.pow(2,8*i-1);ce(this,e,t,i,c-1,-c)}let o=i-1,a=1,l=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[t+o+1]!==0&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+i},"writeIntBE");p.prototype.writeInt8=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");p.prototype.writeInt16LE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE");p.prototype.writeInt16BE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");p.prototype.writeInt32LE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");p.prototype.writeInt32BE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");p.prototype.writeBigInt64LE=lt(s(function(e,t=0){return Cs(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=lt(s(function(e,t=0){return Ns(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Ps(r,e,t,i,n,o){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}s(Ps,"checkIEEE754");function Is(r,e,t,i,n){return e=+e,t=t>>>0,n||Ps(r,e,t,4,34028234663852886e22,-34028234663852886e22),Wt.write(r,e,t,i,23,4),t+4}s(Is,"writeFloat");p.prototype.writeFloatLE=s(function(e,t,i){return Is(this,e,t,!0,i)},"writeFloatLE");p.prototype.writeFloatBE=s(function(e,t,i){return Is(this,e,t,!1,i)},"writeFloatBE");function Ls(r,e,t,i,n){return e=+e,t=t>>>0,n||Ps(r,e,t,8,17976931348623157e292,-17976931348623157e292),Wt.write(r,e,t,i,52,8),t+8}s(Ls,"writeDouble");p.prototype.writeDoubleLE=s(function(e,t,i){return Ls(this,e,t,!0,i)},"writeDoubleLE");p.prototype.writeDoubleBE=s(function(e,t,i){return Ls(this,e,t,!1,i)},"writeDoubleBE");p.prototype.copy=s(function(e,t,i,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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),e.length-t<n-i&&(n=e.length-t+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),o},"copy");p.prototype.fill=s(function(e,t,i,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o<i;++o)this[o]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-t;++o)this[o+t]=a[o%l]}return this},"fill");var Mt={};function Bn(r,e,t){Mt[r]=s(class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}},"NodeError")}s(Bn,"E");Bn("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Bn("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError);Bn("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=xs(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=xs(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function xs(r){let e="",t=r.length,i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}s(xs,"addNumericalSeparator");function Hd(r,e,t){qt(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&hr(e,r.length-(t+1))}s(Hd,"checkBounds");function Rs(r,e,t,i,n,o){if(r>t||r<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${t}${a}`,new Mt.ERR_OUT_OF_RANGE("value",l,r)}Hd(i,n,o)}s(Rs,"checkIntBI");function qt(r,e){if(typeof r!="number")throw new Mt.ERR_INVALID_ARG_TYPE(e,"number",r)}s(qt,"validateNumber");function hr(r,e,t){throw Math.floor(r)!==r?(qt(r,t),new Mt.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Mt.ERR_BUFFER_OUT_OF_BOUNDS:new Mt.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}s(hr,"boundsError");var Yd=/[^+/0-9A-Za-z-_]/g;function Gd(r){if(r=r.split("=")[0],r=r.trim().replace(Yd,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}s(Gd,"base64clean");function Rn(r,e){e=e||1/0;let t,i=r.length,n=null,o=[];for(let a=0;a<i;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}s(Rn,"utf8ToBytes");function Xd(r){let e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}s(Xd,"asciiToBytes");function Jd(r,e){let t,i,n,o=[];for(let a=0;a<r.length&&!((e-=2)<0);++a)t=r.charCodeAt(a),i=t>>8,n=t%256,o.push(n),o.push(i);return o}s(Jd,"utf16leToBytes");function Os(r){return Pn.toByteArray(Gd(r))}s(Os,"base64ToBytes");function Zr(r,e,t,i){let n;for(n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}s(Zr,"blitBuffer");function Fe(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}s(Fe,"isInstance");function Un(r){return r!==r}s(Un,"numberIsNaN");var Qd=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let n=0;n<16;++n)e[i+n]=r[t]+r[n]}return e}();function lt(r){return typeof BigInt>"u"?Zd:r}s(lt,"defineBigIntMethod");function Zd(){throw new Error("BigInt not supported")}s(Zd,"BufferBigIntNotDefined")});var O=T((_S,Ds)=>{"use strict";Ds.exports={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,e){return r.includes(e)},ArrayPrototypeIndexOf(r,e){return r.indexOf(e)},ArrayPrototypeJoin(r,e){return r.join(e)},ArrayPrototypeMap(r,e){return r.map(e)},ArrayPrototypePop(r,e){return r.pop(e)},ArrayPrototypePush(r,e){return r.push(e)},ArrayPrototypeSlice(r,e,t){return r.slice(e,t)},Error,FunctionPrototypeCall(r,e,...t){return r.call(e,...t)},FunctionPrototypeSymbolHasInstance(r,e){return Function.prototype[Symbol.hasInstance].call(r,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,e){return Object.defineProperties(r,e)},ObjectDefineProperty(r,e,t){return Object.defineProperty(r,e,t)},ObjectGetOwnPropertyDescriptor(r,e){return Object.getOwnPropertyDescriptor(r,e)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,e){return Object.setPrototypeOf(r,e)},Promise,PromisePrototypeCatch(r,e){return r.catch(e)},PromisePrototypeThen(r,e,t){return r.then(e,t)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,e){return r.test(e)},SafeSet:Set,String,StringPrototypeSlice(r,e,t){return r.slice(e,t)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,e,t){return r.set(e,t)},Boolean,Uint8Array}});var $t=T((ES,ei)=>{"use strict";var{AbortController:Bs,AbortSignal:eh}=typeof self<"u"?self:typeof window<"u"?window:void 0;ei.exports=Bs;ei.exports.AbortSignal=eh;ei.exports.default=Bs});var pr=T((xS,Mn)=>{"use strict";var Vt=typeof Reflect=="object"?Reflect:null,Us=Vt&&typeof Vt.apply=="function"?Vt.apply:s(function(e,t,i){return Function.prototype.apply.call(e,t,i)},"ReflectApply"),ti;Vt&&typeof Vt.ownKeys=="function"?ti=Vt.ownKeys:Object.getOwnPropertySymbols?ti=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):ti=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function th(r){console&&console.warn&&console.warn(r)}s(th,"ProcessEmitWarning");var Ws=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function P(){P.init.call(this)}s(P,"EventEmitter");Mn.exports=P;Mn.exports.once=oh;P.EventEmitter=P;P.prototype._events=void 0;P.prototype._eventsCount=0;P.prototype._maxListeners=void 0;var Ms=10;function ri(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}s(ri,"checkListener");Object.defineProperty(P,"defaultMaxListeners",{enumerable:!0,get:function(){return Ms},set:function(r){if(typeof r!="number"||r<0||Ws(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ms=r}});P.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};P.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Ws(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function qs(r){return r._maxListeners===void 0?P.defaultMaxListeners:r._maxListeners}s(qs,"_getMaxListeners");P.prototype.getMaxListeners=s(function(){return qs(this)},"getMaxListeners");P.prototype.emit=s(function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")Us(c,this,t);else for(var u=c.length,h=Ks(c,u),i=0;i<u;++i)Us(h[i],this,t);return!0},"emit");function js(r,e,t,i){var n,o,a;if(ri(t),o=r._events,o===void 0?(o=r._events=Object.create(null),r._eventsCount=0):(o.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),o=r._events),a=o[e]),a===void 0)a=o[e]=t,++r._eventsCount;else if(typeof a=="function"?a=o[e]=i?[t,a]:[a,t]:i?a.unshift(t):a.push(t),n=qs(r),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=e,l.count=a.length,th(l)}return r}s(js,"_addListener");P.prototype.addListener=s(function(e,t){return js(this,e,t,!1)},"addListener");P.prototype.on=P.prototype.addListener;P.prototype.prependListener=s(function(e,t){return js(this,e,t,!0)},"prependListener");function rh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}s(rh,"onceWrapper");function $s(r,e,t){var i={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},n=rh.bind(i);return n.listener=t,i.wrapFn=n,n}s($s,"_onceWrap");P.prototype.once=s(function(e,t){return ri(t),this.on(e,$s(this,e,t)),this},"once");P.prototype.prependOnceListener=s(function(e,t){return ri(t),this.prependListener(e,$s(this,e,t)),this},"prependOnceListener");P.prototype.removeListener=s(function(e,t){var i,n,o,a,l;if(ri(t),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if(typeof i!="function"){for(o=-1,a=i.length-1;a>=0;a--)if(i[a]===t||i[a].listener===t){l=i[a].listener,o=a;break}if(o<0)return this;o===0?i.shift():ih(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this},"removeListener");P.prototype.off=P.prototype.removeListener;P.prototype.removeAllListeners=s(function(e){var t,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=i[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},"removeAllListeners");function Vs(r,e,t){var i=r._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?t?[n.listener||n]:[n]:t?nh(n):Ks(n,n.length)}s(Vs,"_listeners");P.prototype.listeners=s(function(e){return Vs(this,e,!0)},"listeners");P.prototype.rawListeners=s(function(e){return Vs(this,e,!1)},"rawListeners");P.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):zs.call(r,e)};P.prototype.listenerCount=zs;function zs(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}s(zs,"listenerCount");P.prototype.eventNames=s(function(){return this._eventsCount>0?ti(this._events):[]},"eventNames");function Ks(r,e){for(var t=new Array(e),i=0;i<e;++i)t[i]=r[i];return t}s(Ks,"arrayClone");function ih(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}s(ih,"spliceOne");function nh(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}s(nh,"unwrapListeners");function oh(r,e){return new Promise(function(t,i){function n(a){r.removeListener(e,o),i(a)}s(n,"errorListener");function o(){typeof r.removeListener=="function"&&r.removeListener("error",n),t([].slice.call(arguments))}s(o,"resolver"),Hs(r,e,o,{once:!0}),e!=="error"&&sh(r,n,{once:!0})})}s(oh,"once");function sh(r,e,t){typeof r.on=="function"&&Hs(r,"error",e,t)}s(sh,"addErrorHandlerIfEventEmitter");function Hs(r,e,t,i){if(typeof r.on=="function")i.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,s(function n(o){i.once&&r.removeEventListener(e,n),t(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}s(Hs,"eventTargetAgnosticAddListener")});var re=T((kS,Wn)=>{"use strict";var ah=We(),{kResistStopPropagation:lh,SymbolDispose:ch}=O(),uh=globalThis.AbortSignal||$t().AbortSignal,fh=globalThis.AbortController||$t().AbortController,dh=Object.getPrototypeOf(async function(){}).constructor,Ys=globalThis.Blob||ah.Blob,hh=s(typeof Ys<"u"?function(e){return e instanceof Ys}:function(e){return!1},"isBlob"),Gs=s((r,e)=>{if(r!==void 0&&(r===null||typeof r!="object"||!("aborted"in r)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",r)},"validateAbortSignal"),ph=s((r,e)=>{if(typeof r!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",r)},"validateFunction"),ii=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let t="";for(let i=0;i<e.length;i++)t+=` ${e[i].stack}
`;super(t),this.name="AggregateError",this.errors=e}};s(ii,"AggregateError");Wn.exports={AggregateError:ii,kEmptyObject:Object.freeze({}),once(r){let e=!1;return function(...t){e||(e=!0,r.apply(this,t))}},createDeferredPromise:function(){let r,e;return{promise:new Promise((i,n)=>{r=i,e=n}),resolve:r,reject:e}},promisify(r){return new Promise((e,t)=>{r((i,...n)=>i?t(i):e(...n))})},debuglog(){return function(){}},format(r,...e){return r.replace(/%([sdifj])/g,function(...[t,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}},types:{isAsyncFunction(r){return r instanceof dh},isArrayBufferView(r){return ArrayBuffer.isView(r)}},isBlob:hh,deprecate(r,e){return r},addAbortListener:pr().addAbortListener||s(function(e,t){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Gs(e,"signal"),ph(t,"listener");let i;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[lh]:!0}),i=s(()=>{e.removeEventListener("abort",t)},"removeEventListener")),{__proto__:null,[ch](){var n;(n=i)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:uh.any||s(function(e){if(e.length===1)return e[0];let t=new fh,i=s(()=>t.abort(),"abort");return e.forEach(n=>{Gs(n,"signals"),n.addEventListener("abort",i,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),t.signal},"AbortSignalAny")};Wn.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var oe=T((FS,Qs)=>{"use strict";var{format:yh,inspect:oi,AggregateError:mh}=re(),bh=globalThis.AggregateError||mh,gh=Symbol("kIsNodeError"),wh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Sh=/^([A-Z][a-z0-9]*)+$/,_h="__node_internal_",si={};function gt(r,e){if(!r)throw new si.ERR_INTERNAL_ASSERTION(e)}s(gt,"assert");function Xs(r){let e="",t=r.length,i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}s(Xs,"addNumericalSeparator");function Eh(r,e,t){if(typeof e=="function")return gt(e.length<=t.length,`Code: ${r}; The provided arguments length (${t.length}) does not match the required ones (${e.length}).`),e(...t);let i=(e.match(/%[dfijoOs]/g)||[]).length;return gt(i===t.length,`Code: ${r}; The provided arguments length (${t.length}) does not match the required ones (${i}).`),t.length===0?e:yh(e,...t)}s(Eh,"getMessage");function J(r,e,t){t||(t=Error);class i extends t{constructor(...o){super(Eh(r,e,o))}toString(){return`${this.name} [${r}]: ${this.message}`}}s(i,"NodeError"),Object.defineProperties(i.prototype,{name:{value:t.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${r}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=r,i.prototype[gh]=!0,si[r]=i}s(J,"E");function Js(r){let e=_h+r.name;return Object.defineProperty(r,"name",{value:e}),r}s(Js,"hideStackFrames");function xh(r,e){if(r&&e&&r!==e){if(Array.isArray(e.errors))return e.errors.push(r),e;let t=new bh([e,r],e.message);return t.code=e.code,t}return r||e}s(xh,"aggregateTwoErrors");var ni=class extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!="object")throw new si.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};s(ni,"AbortError");J("ERR_ASSERTION","%s",Error);J("ERR_INVALID_ARG_TYPE",(r,e,t)=>{gt(typeof r=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";r.endsWith(" argument")?i+=`${r} `:i+=`"${r}" ${r.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],a=[];for(let c of e)gt(typeof c=="string","All expected entries have to be of type string"),wh.includes(c)?n.push(c.toLowerCase()):Sh.test(c)?o.push(c):(gt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let c=n.pop();i+=`one of type ${n.join(", ")}, or ${c}`}}(o.length>0||a.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();i+=`an instance of ${o.join(", ")}, or ${c}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();i+=`one of ${a.join(", ")}, or ${c}`}}if(t==null)i+=`. Received ${t}`;else if(typeof t=="function"&&t.name)i+=`. Received function ${t.name}`;else if(typeof t=="object"){var l;if((l=t.constructor)!==null&&l!==void 0&&l.name)i+=`. Received an instance of ${t.constructor.name}`;else{let c=oi(t,{depth:-1});i+=`. Received ${c}`}}else{let c=oi(t,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),i+=`. Received type ${typeof t} (${c})`}return i},TypeError);J("ERR_INVALID_ARG_VALUE",(r,e,t="is invalid")=>{let i=oi(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${r.includes(".")?"property":"argument"} '${r}' ${t}. Received ${i}`},TypeError);J("ERR_INVALID_RETURN_VALUE",(r,e,t)=>{var i;let n=t!=null&&(i=t.constructor)!==null&&i!==void 0&&i.name?`instance of ${t.constructor.name}`:`type ${typeof t}`;return`Expected ${r} to be returned from the "${e}" function but got ${n}.`},TypeError);J("ERR_MISSING_ARGS",(...r)=>{gt(r.length>0,"At least one arg needs to be specified");let e,t=r.length;switch(r=(Array.isArray(r)?r:[r]).map(i=>`"${i}"`).join(" or "),t){case 1:e+=`The ${r[0]} argument`;break;case 2:e+=`The ${r[0]} and ${r[1]} arguments`;break;default:{let i=r.pop();e+=`The ${r.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);J("ERR_OUT_OF_RANGE",(r,e,t)=>{gt(e,'Missing "range" argument');let i;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Xs(String(t)):typeof t=="bigint"?(i=String(t),(t>2n**32n||t<-(2n**32n))&&(i=Xs(i)),i+="n"):i=oi(t),`The value of "${r}" is out of range. It must be ${e}. Received ${i}`},RangeError);J("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);J("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);J("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);J("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);J("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);J("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);J("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);J("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);J("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);J("ERR_STREAM_WRITE_AFTER_END","write after end",Error);J("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Qs.exports={AbortError:ni,aggregateTwoErrors:Js(xh),hideStackFrames:Js,codes:si}});var Kt=T((CS,la)=>{"use strict";var{ArrayIsArray:jn,ArrayPrototypeIncludes:ra,ArrayPrototypeJoin:ia,ArrayPrototypeMap:vh,NumberIsInteger:$n,NumberIsNaN:kh,NumberMAX_SAFE_INTEGER:Ah,NumberMIN_SAFE_INTEGER:Fh,NumberParseInt:Th,ObjectPrototypeHasOwnProperty:Ch,RegExpPrototypeExec:na,String:Nh,StringPrototypeToUpperCase:Ph,StringPrototypeTrim:Ih}=O(),{hideStackFrames:we,codes:{ERR_SOCKET_BAD_PORT:Lh,ERR_INVALID_ARG_TYPE:ie,ERR_INVALID_ARG_VALUE:zt,ERR_OUT_OF_RANGE:wt,ERR_UNKNOWN_SIGNAL:Zs}}=oe(),{normalizeEncoding:Rh}=re(),{isAsyncFunction:Oh,isArrayBufferView:Dh}=re().types,ea={};function Bh(r){return r===(r|0)}s(Bh,"isInt32");function Uh(r){return r===r>>>0}s(Uh,"isUint32");var Mh=/^[0-7]+$/,Wh="must be a 32-bit unsigned integer or an octal string";function qh(r,e,t){if(typeof r>"u"&&(r=t),typeof r=="string"){if(na(Mh,r)===null)throw new zt(e,r,Wh);r=Th(r,8)}return oa(r,e),r}s(qh,"parseFileMode");var jh=we((r,e,t=Fh,i=Ah)=>{if(typeof r!="number")throw new ie(e,"number",r);if(!$n(r))throw new wt(e,"an integer",r);if(r<t||r>i)throw new wt(e,`>= ${t} && <= ${i}`,r)}),$h=we((r,e,t=-2147483648,i=2147483647)=>{if(typeof r!="number")throw new ie(e,"number",r);if(!$n(r))throw new wt(e,"an integer",r);if(r<t||r>i)throw new wt(e,`>= ${t} && <= ${i}`,r)}),oa=we((r,e,t=!1)=>{if(typeof r!="number")throw new ie(e,"number",r);if(!$n(r))throw new wt(e,"an integer",r);let i=t?1:0,n=4294967295;if(r<i||r>n)throw new wt(e,`>= ${i} && <= ${n}`,r)});function Vn(r,e){if(typeof r!="string")throw new ie(e,"string",r)}s(Vn,"validateString");function Vh(r,e,t=void 0,i){if(typeof r!="number")throw new ie(e,"number",r);if(t!=null&&r<t||i!=null&&r>i||(t!=null||i!=null)&&kh(r))throw new wt(e,`${t!=null?`>= ${t}`:""}${t!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,r)}s(Vh,"validateNumber");var zh=we((r,e,t)=>{if(!ra(t,r)){let n="must be one of: "+ia(vh(t,o=>typeof o=="string"?`'${o}'`:Nh(o)),", ");throw new zt(e,r,n)}});function sa(r,e){if(typeof r!="boolean")throw new ie(e,"boolean",r)}s(sa,"validateBoolean");function qn(r,e,t){return r==null||!Ch(r,e)?t:r[e]}s(qn,"getOwnPropertyValueOrDefault");var Kh=we((r,e,t=null)=>{let i=qn(t,"allowArray",!1),n=qn(t,"allowFunction",!1);if(!qn(t,"nullable",!1)&&r===null||!i&&jn(r)||typeof r!="object"&&(!n||typeof r!="function"))throw new ie(e,"Object",r)}),Hh=we((r,e)=>{if(r!=null&&typeof r!="object"&&typeof r!="function")throw new ie(e,"a dictionary",r)}),ai=we((r,e,t=0)=>{if(!jn(r))throw new ie(e,"Array",r);if(r.length<t){let i=`must be longer than ${t}`;throw new zt(e,r,i)}});function Yh(r,e){ai(r,e);for(let t=0;t<r.length;t++)Vn(r[t],`${e}[${t}]`)}s(Yh,"validateStringArray");function Gh(r,e){ai(r,e);for(let t=0;t<r.length;t++)sa(r[t],`${e}[${t}]`)}s(Gh,"validateBooleanArray");function Xh(r,e){ai(r,e);for(let t=0;t<r.length;t++){let i=r[t],n=`${e}[${t}]`;if(i==null)throw new ie(n,"AbortSignal",i);aa(i,n)}}s(Xh,"validateAbortSignalArray");function Jh(r,e="signal"){if(Vn(r,e),ea[r]===void 0)throw ea[Ph(r)]!==void 0?new Zs(r+" (signals must use all capital letters)"):new Zs(r)}s(Jh,"validateSignalName");var Qh=we((r,e="buffer")=>{if(!Dh(r))throw new ie(e,["Buffer","TypedArray","DataView"],r)});function Zh(r,e){let t=Rh(e),i=r.length;if(t==="hex"&&i%2!==0)throw new zt("encoding",e,`is invalid for data of length ${i}`)}s(Zh,"validateEncoding");function ep(r,e="Port",t=!0){if(typeof r!="number"&&typeof r!="string"||typeof r=="string"&&Ih(r).length===0||+r!==+r>>>0||r>65535||r===0&&!t)throw new Lh(e,r,t);return r|0}s(ep,"validatePort");var aa=we((r,e)=>{if(r!==void 0&&(r===null||typeof r!="object"||!("aborted"in r)))throw new ie(e,"AbortSignal",r)}),tp=we((r,e)=>{if(typeof r!="function")throw new ie(e,"Function",r)}),rp=we((r,e)=>{if(typeof r!="function"||Oh(r))throw new ie(e,"Function",r)}),ip=we((r,e)=>{if(r!==void 0)throw new ie(e,"undefined",r)});function np(r,e,t){if(!ra(t,r))throw new ie(e,`('${ia(t,"|")}')`,r)}s(np,"validateUnion");var op=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ta(r,e){if(typeof r>"u"||!na(op,r))throw new zt(e,r,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(ta,"validateLinkHeaderFormat");function sp(r){if(typeof r=="string")return ta(r,"hints"),r;if(jn(r)){let e=r.length,t="";if(e===0)return t;for(let i=0;i<e;i++){let n=r[i];ta(n,"hints"),t+=n,i!==e-1&&(t+=", ")}return t}throw new zt("hints",r,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(sp,"validateLinkHeaderValue");la.exports={isInt32:Bh,isUint32:Uh,parseFileMode:qh,validateArray:ai,validateStringArray:Yh,validateBooleanArray:Gh,validateAbortSignalArray:Xh,validateBoolean:sa,validateBuffer:Qh,validateDictionary:Hh,validateEncoding:Zh,validateFunction:tp,validateInt32:$h,validateInteger:jh,validateNumber:Vh,validateObject:Kh,validateOneOf:zh,validatePlainFunction:rp,validatePort:ep,validateSignalName:Jh,validateString:Vn,validateUint32:oa,validateUndefined:ip,validateUnion:np,validateAbortSignal:aa,validateLinkHeaderValue:sp}});var ct=T((PS,da)=>{var $=da.exports={},Te,Ce;function zn(){throw new Error("setTimeout has not been defined")}s(zn,"defaultSetTimout");function Kn(){throw new Error("clearTimeout has not been defined")}s(Kn,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Te=setTimeout:Te=zn}catch{Te=zn}try{typeof clearTimeout=="function"?Ce=clearTimeout:Ce=Kn}catch{Ce=Kn}})();function ca(r){if(Te===setTimeout)return setTimeout(r,0);if((Te===zn||!Te)&&setTimeout)return Te=setTimeout,setTimeout(r,0);try{return Te(r,0)}catch{try{return Te.call(null,r,0)}catch{return Te.call(this,r,0)}}}s(ca,"runTimeout");function ap(r){if(Ce===clearTimeout)return clearTimeout(r);if((Ce===Kn||!Ce)&&clearTimeout)return Ce=clearTimeout,clearTimeout(r);try{return Ce(r)}catch{try{return Ce.call(null,r)}catch{return Ce.call(this,r)}}}s(ap,"runClearTimeout");var qe=[],Ht=!1,St,li=-1;function lp(){!Ht||!St||(Ht=!1,St.length?qe=St.concat(qe):li=-1,qe.length&&ua())}s(lp,"cleanUpNextTick");function ua(){if(!Ht){var r=ca(lp);Ht=!0;for(var e=qe.length;e;){for(St=qe,qe=[];++li<e;)St&&St[li].run();li=-1,e=qe.length}St=null,Ht=!1,ap(r)}}s(ua,"drainQueue");$.nextTick=function(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];qe.push(new fa(r,e)),qe.length===1&&!Ht&&ca(ua)};function fa(r,e){this.fun=r,this.array=e}s(fa,"Item");fa.prototype.run=function(){this.fun.apply(null,this.array)};$.title="browser";$.browser=!0;$.env={};$.argv=[];$.version="";$.versions={};function je(){}s(je,"noop");$.on=je;$.addListener=je;$.once=je;$.off=je;$.removeListener=je;$.removeAllListeners=je;$.emit=je;$.prependListener=je;$.prependOnceListener=je;$.listeners=function(r){return[]};$.binding=function(r){throw new Error("process.binding is not supported")};$.cwd=function(){return"/"};$.chdir=function(r){throw new Error("process.chdir is not supported")};$.umask=function(){return 0}});var Pe=T((LS,Fa)=>{"use strict";var{SymbolAsyncIterator:ha,SymbolIterator:pa,SymbolFor:_t}=O(),ya=_t("nodejs.stream.destroyed"),ma=_t("nodejs.stream.errored"),Hn=_t("nodejs.stream.readable"),Yn=_t("nodejs.stream.writable"),ba=_t("nodejs.stream.disturbed"),cp=_t("nodejs.webstream.isClosedPromise"),up=_t("nodejs.webstream.controllerErrorFunction");function ci(r,e=!1){var t;return!!(r&&typeof r.pipe=="function"&&typeof r.on=="function"&&(!e||typeof r.pause=="function"&&typeof r.resume=="function")&&(!r._writableState||((t=r._readableState)===null||t===void 0?void 0:t.readable)!==!1)&&(!r._writableState||r._readableState))}s(ci,"isReadableNodeStream");function ui(r){var e;return!!(r&&typeof r.write=="function"&&typeof r.on=="function"&&(!r._readableState||((e=r._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(ui,"isWritableNodeStream");function fp(r){return!!(r&&typeof r.pipe=="function"&&r._readableState&&typeof r.on=="function"&&typeof r.write=="function")}s(fp,"isDuplexNodeStream");function Ne(r){return r&&(r._readableState||r._writableState||typeof r.write=="function"&&typeof r.on=="function"||typeof r.pipe=="function"&&typeof r.on=="function")}s(Ne,"isNodeStream");function ga(r){return!!(r&&!Ne(r)&&typeof r.pipeThrough=="function"&&typeof r.getReader=="function"&&typeof r.cancel=="function")}s(ga,"isReadableStream");function wa(r){return!!(r&&!Ne(r)&&typeof r.getWriter=="function"&&typeof r.abort=="function")}s(wa,"isWritableStream");function Sa(r){return!!(r&&!Ne(r)&&typeof r.readable=="object"&&typeof r.writable=="object")}s(Sa,"isTransformStream");function dp(r){return ga(r)||wa(r)||Sa(r)}s(dp,"isWebStream");function hp(r,e){return r==null?!1:e===!0?typeof r[ha]=="function":e===!1?typeof r[pa]=="function":typeof r[ha]=="function"||typeof r[pa]=="function"}s(hp,"isIterable");function fi(r){if(!Ne(r))return null;let e=r._writableState,t=r._readableState,i=e||t;return!!(r.destroyed||r[ya]||i!=null&&i.destroyed)}s(fi,"isDestroyed");function _a(r){if(!ui(r))return null;if(r.writableEnded===!0)return!0;let e=r._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(_a,"isWritableEnded");function pp(r,e){if(!ui(r))return null;if(r.writableFinished===!0)return!0;let t=r._writableState;return t!=null&&t.errored?!1:typeof t?.finished!="boolean"?null:!!(t.finished||e===!1&&t.ended===!0&&t.length===0)}s(pp,"isWritableFinished");function yp(r){if(!ci(r))return null;if(r.readableEnded===!0)return!0;let e=r._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(yp,"isReadableEnded");function Ea(r,e){if(!ci(r))return null;let t=r._readableState;return t!=null&&t.errored?!1:typeof t?.endEmitted!="boolean"?null:!!(t.endEmitted||e===!1&&t.ended===!0&&t.length===0)}s(Ea,"isReadableFinished");function xa(r){return r&&r[Hn]!=null?r[Hn]:typeof r?.readable!="boolean"?null:fi(r)?!1:ci(r)&&r.readable&&!Ea(r)}s(xa,"isReadable");function va(r){return r&&r[Yn]!=null?r[Yn]:typeof r?.writable!="boolean"?null:fi(r)?!1:ui(r)&&r.writable&&!_a(r)}s(va,"isWritable");function mp(r,e){return Ne(r)?fi(r)?!0:!(e?.readable!==!1&&xa(r)||e?.writable!==!1&&va(r)):null}s(mp,"isFinished");function bp(r){var e,t;return Ne(r)?r.writableErrored?r.writableErrored:(e=(t=r._writableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}s(bp,"isWritableErrored");function gp(r){var e,t;return Ne(r)?r.readableErrored?r.readableErrored:(e=(t=r._readableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}s(gp,"isReadableErrored");function wp(r){if(!Ne(r))return null;if(typeof r.closed=="boolean")return r.closed;let e=r._writableState,t=r._readableState;return typeof e?.closed=="boolean"||typeof t?.closed=="boolean"?e?.closed||t?.closed:typeof r._closed=="boolean"&&ka(r)?r._closed:null}s(wp,"isClosed");function ka(r){return typeof r._closed=="boolean"&&typeof r._defaultKeepAlive=="boolean"&&typeof r._removedConnection=="boolean"&&typeof r._removedContLen=="boolean"}s(ka,"isOutgoingMessage");function Aa(r){return typeof r._sent100=="boolean"&&ka(r)}s(Aa,"isServerResponse");function Sp(r){var e;return typeof r._consuming=="boolean"&&typeof r._dumped=="boolean"&&((e=r.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(Sp,"isServerRequest");function _p(r){if(!Ne(r))return null;let e=r._writableState,t=r._readableState,i=e||t;return!i&&Aa(r)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}s(_p,"willEmitClose");function Ep(r){var e;return!!(r&&((e=r[ba])!==null&&e!==void 0?e:r.readableDidRead||r.readableAborted))}s(Ep,"isDisturbed");function xp(r){var e,t,i,n,o,a,l,c,u,h;return!!(r&&((e=(t=(i=(n=(o=(a=r[ma])!==null&&a!==void 0?a:r.readableErrored)!==null&&o!==void 0?o:r.writableErrored)!==null&&n!==void 0?n:(l=r._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(c=r._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&t!==void 0?t:(u=r._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((h=r._writableState)===null||h===void 0)&&h.errored))}s(xp,"isErrored");Fa.exports={isDestroyed:fi,kIsDestroyed:ya,isDisturbed:Ep,kIsDisturbed:ba,isErrored:xp,kIsErrored:ma,isReadable:xa,kIsReadable:Hn,kIsClosedPromise:cp,kControllerErrorFunction:up,kIsWritable:Yn,isClosed:wp,isDuplexNodeStream:fp,isFinished:mp,isIterable:hp,isReadableNodeStream:ci,isReadableStream:ga,isReadableEnded:yp,isReadableFinished:Ea,isReadableErrored:gp,isNodeStream:Ne,isWebStream:dp,isWritable:va,isWritableNodeStream:ui,isWritableStream:wa,isWritableEnded:_a,isWritableFinished:pp,isWritableErrored:bp,isServerRequest:Sp,isServerResponse:Aa,willEmitClose:_p,isTransformStream:Sa}});var $e=T((OS,Zn)=>{var ut=ct(),{AbortError:Da,codes:vp}=oe(),{ERR_INVALID_ARG_TYPE:kp,ERR_STREAM_PREMATURE_CLOSE:Ta}=vp,{kEmptyObject:Xn,once:Jn}=re(),{validateAbortSignal:Ap,validateFunction:Fp,validateObject:Tp,validateBoolean:Cp}=Kt(),{Promise:Np,PromisePrototypeThen:Pp,SymbolDispose:Ba}=O(),{isClosed:Ip,isReadable:Ca,isReadableNodeStream:Gn,isReadableStream:Lp,isReadableFinished:Na,isReadableErrored:Pa,isWritable:Ia,isWritableNodeStream:La,isWritableStream:Rp,isWritableFinished:Ra,isWritableErrored:Oa,isNodeStream:Op,willEmitClose:Dp,kIsClosedPromise:Bp}=Pe(),Yt;function Up(r){return r.setHeader&&typeof r.abort=="function"}s(Up,"isRequest");var Qn=s(()=>{},"nop");function Ua(r,e,t){var i,n;if(arguments.length===2?(t=e,e=Xn):e==null?e=Xn:Tp(e,"options"),Fp(t,"callback"),Ap(e.signal,"options.signal"),t=Jn(t),Lp(r)||Rp(r))return Mp(r,e,t);if(!Op(r))throw new kp("stream",["ReadableStream","WritableStream","Stream"],r);let o=(i=e.readable)!==null&&i!==void 0?i:Gn(r),a=(n=e.writable)!==null&&n!==void 0?n:La(r),l=r._writableState,c=r._readableState,u=s(()=>{r.writable||b()},"onlegacyfinish"),h=Dp(r)&&Gn(r)===o&&La(r)===a,d=Ra(r,!1),b=s(()=>{d=!0,r.destroyed&&(h=!1),!(h&&(!r.readable||o))&&(!o||m)&&t.call(r)},"onfinish"),m=Na(r,!1),g=s(()=>{m=!0,r.destroyed&&(h=!1),!(h&&(!r.writable||a))&&(!a||d)&&t.call(r)},"onend"),y=s(z=>{t.call(r,z)},"onerror"),v=Ip(r),S=s(()=>{v=!0;let z=Oa(r)||Pa(r);if(z&&typeof z!="boolean")return t.call(r,z);if(o&&!m&&Gn(r,!0)&&!Na(r,!1))return t.call(r,new Ta);if(a&&!d&&!Ra(r,!1))return t.call(r,new Ta);t.call(r)},"onclose"),C=s(()=>{v=!0;let z=Oa(r)||Pa(r);if(z&&typeof z!="boolean")return t.call(r,z);t.call(r)},"onclosed"),B=s(()=>{r.req.on("finish",b)},"onrequest");Up(r)?(r.on("complete",b),h||r.on("abort",S),r.req?B():r.on("request",B)):a&&!l&&(r.on("end",u),r.on("close",u)),!h&&typeof r.aborted=="boolean"&&r.on("aborted",S),r.on("end",g),r.on("finish",b),e.error!==!1&&r.on("error",y),r.on("close",S),v?ut.nextTick(S):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?h||ut.nextTick(C):(!o&&(!h||Ca(r))&&(d||Ia(r)===!1)||!a&&(!h||Ia(r))&&(m||Ca(r)===!1)||c&&r.req&&r.aborted)&&ut.nextTick(C);let A=s(()=>{t=Qn,r.removeListener("aborted",S),r.removeListener("complete",b),r.removeListener("abort",S),r.removeListener("request",B),r.req&&r.req.removeListener("finish",b),r.removeListener("end",u),r.removeListener("close",u),r.removeListener("finish",b),r.removeListener("end",g),r.removeListener("error",y),r.removeListener("close",S)},"cleanup");if(e.signal&&!v){let z=s(()=>{let dt=t;A(),dt.call(r,new Da(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ut.nextTick(z);else{Yt=Yt||re().addAbortListener;let dt=Yt(e.signal,z),he=t;t=Jn((...Nt)=>{dt[Ba](),he.apply(r,Nt)})}}return A}s(Ua,"eos");function Mp(r,e,t){let i=!1,n=Qn;if(e.signal)if(n=s(()=>{i=!0,t.call(r,new Da(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ut.nextTick(n);else{Yt=Yt||re().addAbortListener;let a=Yt(e.signal,n),l=t;t=Jn((...c)=>{a[Ba](),l.apply(r,c)})}let o=s((...a)=>{i||ut.nextTick(()=>t.apply(r,a))},"resolverFn");return Pp(r[Bp].promise,o,o),Qn}s(Mp,"eosWeb");function Wp(r,e){var t;let i=!1;return e===null&&(e=Xn),(t=e)!==null&&t!==void 0&&t.cleanup&&(Cp(e.cleanup,"cleanup"),i=e.cleanup),new Np((n,o)=>{let a=Ua(r,e,l=>{i&&a(),l?o(l):n()})})}s(Wp,"finished");Zn.exports=Ua;Zn.exports.finished=Wp});var Et=T((BS,Ka)=>{"use strict";var Ie=ct(),{aggregateTwoErrors:qp,codes:{ERR_MULTIPLE_CALLBACK:jp},AbortError:$p}=oe(),{Symbol:qa}=O(),{kIsDestroyed:Vp,isDestroyed:zp,isFinished:Kp,isServerRequest:Hp}=Pe(),ja=qa("kDestroy"),eo=qa("kConstruct");function $a(r,e,t){r&&(r.stack,e&&!e.errored&&(e.errored=r),t&&!t.errored&&(t.errored=r))}s($a,"checkError");function Yp(r,e){let t=this._readableState,i=this._writableState,n=i||t;return i!=null&&i.destroyed||t!=null&&t.destroyed?(typeof e=="function"&&e(),this):($a(r,i,t),i&&(i.destroyed=!0),t&&(t.destroyed=!0),n.constructed?Ma(this,r,e):this.once(ja,function(o){Ma(this,qp(o,r),e)}),this)}s(Yp,"destroy");function Ma(r,e,t){let i=!1;function n(o){if(i)return;i=!0;let a=r._readableState,l=r._writableState;$a(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof t=="function"&&t(o),o?Ie.nextTick(Gp,r,o):Ie.nextTick(Va,r)}s(n,"onDestroy");try{r._destroy(e||null,n)}catch(o){n(o)}}s(Ma,"_destroy");function Gp(r,e){to(r,e),Va(r)}s(Gp,"emitErrorCloseNT");function Va(r){let e=r._readableState,t=r._writableState;t&&(t.closeEmitted=!0),e&&(e.closeEmitted=!0),(t!=null&&t.emitClose||e!=null&&e.emitClose)&&r.emit("close")}s(Va,"emitCloseNT");function to(r,e){let t=r._readableState,i=r._writableState;i!=null&&i.errorEmitted||t!=null&&t.errorEmitted||(i&&(i.errorEmitted=!0),t&&(t.errorEmitted=!0),r.emit("error",e))}s(to,"emitErrorNT");function Xp(){let r=this._readableState,e=this._writableState;r&&(r.constructed=!0,r.closed=!1,r.closeEmitted=!1,r.destroyed=!1,r.errored=null,r.errorEmitted=!1,r.reading=!1,r.ended=r.readable===!1,r.endEmitted=r.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(Xp,"undestroy");function ro(r,e,t){let i=r._readableState,n=r._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?r.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),t?Ie.nextTick(to,r,e):to(r,e))}s(ro,"errorOrDestroy");function Jp(r,e){if(typeof r._construct!="function")return;let t=r._readableState,i=r._writableState;t&&(t.constructed=!1),i&&(i.constructed=!1),r.once(eo,e),!(r.listenerCount(eo)>1)&&Ie.nextTick(Qp,r)}s(Jp,"construct");function Qp(r){let e=!1;function t(i){if(e){ro(r,i??new jp);return}e=!0;let n=r._readableState,o=r._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?r.emit(ja,i):i?ro(r,i,!0):Ie.nextTick(Zp,r)}s(t,"onConstruct");try{r._construct(i=>{Ie.nextTick(t,i)})}catch(i){Ie.nextTick(t,i)}}s(Qp,"constructNT");function Zp(r){r.emit(eo)}s(Zp,"emitConstructNT");function Wa(r){return r?.setHeader&&typeof r.abort=="function"}s(Wa,"isRequest");function za(r){r.emit("close")}s(za,"emitCloseLegacy");function ey(r,e){r.emit("error",e),Ie.nextTick(za,r)}s(ey,"emitErrorCloseLegacy");function ty(r,e){!r||zp(r)||(!e&&!Kp(r)&&(e=new $p),Hp(r)?(r.socket=null,r.destroy(e)):Wa(r)?r.abort():Wa(r.req)?r.req.abort():typeof r.destroy=="function"?r.destroy(e):typeof r.close=="function"?r.close():e?Ie.nextTick(ey,r,e):Ie.nextTick(za,r),r.destroyed||(r[Vp]=!0))}s(ty,"destroyer");Ka.exports={construct:Jp,destroyer:ty,destroy:Yp,undestroy:Xp,errorOrDestroy:ro}});var pi=T((MS,Ya)=>{"use strict";var{ArrayIsArray:ry,ObjectSetPrototypeOf:Ha}=O(),{EventEmitter:di}=pr();function hi(r){di.call(this,r)}s(hi,"Stream");Ha(hi.prototype,di.prototype);Ha(hi,di);hi.prototype.pipe=function(r,e){let t=this;function i(h){r.writable&&r.write(h)===!1&&t.pause&&t.pause()}s(i,"ondata"),t.on("data",i);function n(){t.readable&&t.resume&&t.resume()}s(n,"ondrain"),r.on("drain",n),!r._isStdio&&(!e||e.end!==!1)&&(t.on("end",a),t.on("close",l));let o=!1;function a(){o||(o=!0,r.end())}s(a,"onend");function l(){o||(o=!0,typeof r.destroy=="function"&&r.destroy())}s(l,"onclose");function c(h){u(),di.listenerCount(this,"error")===0&&this.emit("error",h)}s(c,"onerror"),io(t,"error",c),io(r,"error",c);function u(){t.removeListener("data",i),r.removeListener("drain",n),t.removeListener("end",a),t.removeListener("close",l),t.removeListener("error",c),r.removeListener("error",c),t.removeListener("end",u),t.removeListener("close",u),r.removeListener("close",u)}return s(u,"cleanup"),t.on("end",u),t.on("close",u),r.on("close",u),r.emit("pipe",t),r};function io(r,e,t){if(typeof r.prependListener=="function")return r.prependListener(e,t);!r._events||!r._events[e]?r.on(e,t):ry(r._events[e])?r._events[e].unshift(t):r._events[e]=[t,r._events[e]]}s(io,"prependListener");Ya.exports={Stream:hi,prependListener:io}});var yr=T((qS,yi)=>{"use strict";var{SymbolDispose:iy}=O(),{AbortError:Ga,codes:ny}=oe(),{isNodeStream:Xa,isWebStream:oy,kControllerErrorFunction:sy}=Pe(),ay=$e(),{ERR_INVALID_ARG_TYPE:Ja}=ny,no,ly=s((r,e)=>{if(typeof r!="object"||!("aborted"in r))throw new Ja(e,"AbortSignal",r)},"validateAbortSignal");yi.exports.addAbortSignal=s(function(e,t){if(ly(e,"signal"),!Xa(t)&&!oy(t))throw new Ja("stream",["ReadableStream","WritableStream","Stream"],t);return yi.exports.addAbortSignalNoValidate(e,t)},"addAbortSignal");yi.exports.addAbortSignalNoValidate=function(r,e){if(typeof r!="object"||!("aborted"in r))return e;let t=Xa(e)?()=>{e.destroy(new Ga(void 0,{cause:r.reason}))}:()=>{e[sy](new Ga(void 0,{cause:r.reason}))};if(r.aborted)t();else{no=no||re().addAbortListener;let i=no(r,t);ay(e,i[iy])}return e}});var el=T((VS,Za)=>{"use strict";var{StringPrototypeSlice:Qa,SymbolIterator:cy,TypedArrayPrototypeSet:mi,Uint8Array:uy}=O(),{Buffer:oo}=We(),{inspect:fy}=re();Za.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let t=this.head,i=""+t.data;for(;(t=t.next)!==null;)i+=e+t.data;return i}concat(e){if(this.length===0)return oo.alloc(0);let t=oo.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)mi(t,i.data,n),n+=i.data.length,i=i.next;return t}consume(e,t){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[cy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",i=this.head,n=0;do{let o=i.data;if(e>o.length)t+=o,e-=o.length;else{e===o.length?(t+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(t+=Qa(o,0,e),this.head=i,i.data=Qa(o,e));break}++n}while((i=i.next)!==null);return this.length-=n,t}_getBuffer(e){let t=oo.allocUnsafe(e),i=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)mi(t,a,i-e),e-=a.length;else{e===a.length?(mi(t,a,i-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(mi(t,new uy(a.buffer,a.byteOffset,e),i-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return fy(this,{...t,depth:0,customInspect:!1})}},"BufferList")});var mr=T((KS,nl)=>{"use strict";var{MathFloor:dy,NumberIsInteger:hy}=O(),{validateInteger:py}=Kt(),{ERR_INVALID_ARG_VALUE:yy}=oe().codes,tl=16*1024,rl=16;function my(r,e,t){return r.highWaterMark!=null?r.highWaterMark:e?r[t]:null}s(my,"highWaterMarkFrom");function il(r){return r?rl:tl}s(il,"getDefaultHighWaterMark");function by(r,e){py(e,"value",0),r?rl=e:tl=e}s(by,"setDefaultHighWaterMark");function gy(r,e,t,i){let n=my(e,i,t);if(n!=null){if(!hy(n)||n<0){let o=i?`options.${t}`:"options.highWaterMark";throw new yy(o,n)}return dy(n)}return il(r.objectMode)}s(gy,"getHighWaterMark");nl.exports={getHighWaterMark:gy,getDefaultHighWaterMark:il,setDefaultHighWaterMark:by}});var al=T((so,sl)=>{var bi=We(),Le=bi.Buffer;function ol(r,e){for(var t in r)e[t]=r[t]}s(ol,"copyProps");Le.from&&Le.alloc&&Le.allocUnsafe&&Le.allocUnsafeSlow?sl.exports=bi:(ol(bi,so),so.Buffer=xt);function xt(r,e,t){return Le(r,e,t)}s(xt,"SafeBuffer");xt.prototype=Object.create(Le.prototype);ol(Le,xt);xt.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Le(r,e,t)};xt.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=Le(r);return e!==void 0?typeof t=="string"?i.fill(e,t):i.fill(e):i.fill(0),i};xt.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Le(r)};xt.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return bi.SlowBuffer(r)}});var ul=T(cl=>{"use strict";var lo=al().Buffer,ll=lo.isEncoding||function(r){switch(r=""+r,r&&r.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 wy(r){if(!r)return"utf8";for(var e;;)switch(r){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return r;default:if(e)return;r=(""+r).toLowerCase(),e=!0}}s(wy,"_normalizeEncoding");function Sy(r){var e=wy(r);if(typeof e!="string"&&(lo.isEncoding===ll||!ll(r)))throw new Error("Unknown encoding: "+r);return e||r}s(Sy,"normalizeEncoding");cl.StringDecoder=br;function br(r){this.encoding=Sy(r);var e;switch(this.encoding){case"utf16le":this.text=Ay,this.end=Fy,e=4;break;case"utf8":this.fillLast=xy,e=4;break;case"base64":this.text=Ty,this.end=Cy,e=3;break;default:this.write=Ny,this.end=Py;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lo.allocUnsafe(e)}s(br,"StringDecoder");br.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(r),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<r.length?e?e+this.text(r,t):this.text(r,t):e||""};br.prototype.end=ky;br.prototype.text=vy;br.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};function ao(r){return r<=127?0:r>>5===6?2:r>>4===14?3:r>>3===30?4:r>>6===2?-1:-2}s(ao,"utf8CheckByte");function _y(r,e,t){var i=e.length-1;if(i<t)return 0;var n=ao(e[i]);return n>=0?(n>0&&(r.lastNeed=n-1),n):--i<t||n===-2?0:(n=ao(e[i]),n>=0?(n>0&&(r.lastNeed=n-2),n):--i<t||n===-2?0:(n=ao(e[i]),n>=0?(n>0&&(n===2?n=0:r.lastNeed=n-3),n):0))}s(_y,"utf8CheckIncomplete");function Ey(r,e,t){if((e[0]&192)!==128)return r.lastNeed=0,"\uFFFD";if(r.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return r.lastNeed=1,"\uFFFD";if(r.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return r.lastNeed=2,"\uFFFD"}}s(Ey,"utf8CheckExtraBytes");function xy(r){var e=this.lastTotal-this.lastNeed,t=Ey(this,r,e);if(t!==void 0)return t;if(this.lastNeed<=r.length)return r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length}s(xy,"utf8FillLast");function vy(r,e){var t=_y(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var i=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,i),r.toString("utf8",e,i)}s(vy,"utf8Text");function ky(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e}s(ky,"utf8End");function Ay(r,e){if((r.length-e)%2===0){var t=r.toString("utf16le",e);if(t){var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}s(Ay,"utf16Text");function Fy(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}s(Fy,"utf16End");function Ty(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}s(Ty,"base64Text");function Cy(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Cy,"base64End");function Ny(r){return r.toString(this.encoding)}s(Ny,"simpleWrite");function Py(r){return r&&r.length?this.write(r):""}s(Py,"simpleEnd")});var co=T((JS,pl)=>{"use strict";var fl=ct(),{PromisePrototypeThen:Iy,SymbolAsyncIterator:dl,SymbolIterator:hl}=O(),{Buffer:Ly}=We(),{ERR_INVALID_ARG_TYPE:Ry,ERR_STREAM_NULL_VALUES:Oy}=oe().codes;function Dy(r,e,t){let i;if(typeof e=="string"||e instanceof Ly)return new r({objectMode:!0,...t,read(){this.push(e),this.push(null)}});let n;if(e&&e[dl])n=!0,i=e[dl]();else if(e&&e[hl])n=!1,i=e[hl]();else throw new Ry("iterable",["Iterable"],e);let o=new r({objectMode:!0,highWaterMark:1,...t}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(u,h){Iy(l(u),()=>fl.nextTick(h,u),d=>fl.nextTick(h,d||u))};async function l(u){let h=u!=null,d=typeof i.throw=="function";if(h&&d){let{value:b,done:m}=await i.throw(u);if(await b,m)return}if(typeof i.return=="function"){let{value:b}=await i.return();await b}}s(l,"close");async function c(){for(;;){try{let{value:u,done:h}=n?await i.next():i.next();if(h)o.push(null);else{let d=u&&typeof u.then=="function"?await u:u;if(d===null)throw a=!1,new Oy;if(o.push(d))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(c,"next"),o}s(Dy,"from");pl.exports=Dy});var wr=T((ZS,Il)=>{var Ee=ct(),{ArrayPrototypeIndexOf:By,NumberIsInteger:Uy,NumberIsNaN:My,NumberParseInt:Wy,ObjectDefineProperties:go,ObjectKeys:qy,ObjectSetPrototypeOf:bl,Promise:gl,SafeSet:jy,SymbolAsyncDispose:$y,SymbolAsyncIterator:Vy,Symbol:zy}=O();Il.exports=E;E.ReadableState=_i;var{EventEmitter:Ky}=pr(),{Stream:ft,prependListener:Hy}=pi(),{Buffer:uo}=We(),{addAbortSignal:Yy}=yr(),wl=$e(),k=re().debuglog("stream",r=>{k=r}),Gy=el(),Jt=Et(),{getHighWaterMark:Xy,getDefaultHighWaterMark:Jy}=mr(),{aggregateTwoErrors:yl,codes:{ERR_INVALID_ARG_TYPE:Qy,ERR_METHOD_NOT_IMPLEMENTED:Zy,ERR_OUT_OF_RANGE:em,ERR_STREAM_PUSH_AFTER_EOF:tm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:rm},AbortError:im}=oe(),{validateObject:nm}=Kt(),vt=zy("kPaused"),{StringDecoder:Sl}=ul(),om=co();bl(E.prototype,ft.prototype);bl(E,ft);var fo=s(()=>{},"nop"),{errorOrDestroy:Gt}=Jt,Xt=1,sm=2,_l=4,gr=8,El=16,gi=32,wi=64,xl=128,am=256,lm=512,cm=1024,mo=2048,bo=4096,um=8192,fm=16384,dm=32768,vl=65536,hm=1<<17,pm=1<<18;function K(r){return{enumerable:!1,get(){return(this.state&r)!==0},set(e){e?this.state|=r:this.state&=~r}}}s(K,"makeBitMapDescriptor");go(_i.prototype,{objectMode:K(Xt),ended:K(sm),endEmitted:K(_l),reading:K(gr),constructed:K(El),sync:K(gi),needReadable:K(wi),emittedReadable:K(xl),readableListening:K(am),resumeScheduled:K(lm),errorEmitted:K(cm),emitClose:K(mo),autoDestroy:K(bo),destroyed:K(um),closed:K(fm),closeEmitted:K(dm),multiAwaitDrain:K(vl),readingMore:K(hm),dataEmitted:K(pm)});function _i(r,e,t){typeof t!="boolean"&&(t=e instanceof Re()),this.state=mo|bo|El|gi,r&&r.objectMode&&(this.state|=Xt),t&&r&&r.readableObjectMode&&(this.state|=Xt),this.highWaterMark=r?Xy(this,r,"readableHighWaterMark",t):Jy(!1),this.buffer=new Gy,this.length=0,this.pipes=[],this.flowing=null,this[vt]=null,r&&r.emitClose===!1&&(this.state&=~mo),r&&r.autoDestroy===!1&&(this.state&=~bo),this.errored=null,this.defaultEncoding=r&&r.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,r&&r.encoding&&(this.decoder=new Sl(r.encoding),this.encoding=r.encoding)}s(_i,"ReadableState");function E(r){if(!(this instanceof E))return new E(r);let e=this instanceof Re();this._readableState=new _i(r,this,e),r&&(typeof r.read=="function"&&(this._read=r.read),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.construct=="function"&&(this._construct=r.construct),r.signal&&!e&&Yy(r.signal,this)),ft.call(this,r),Jt.construct(this,()=>{this._readableState.needReadable&&Si(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=Jt.destroy;E.prototype._undestroy=Jt.undestroy;E.prototype._destroy=function(r,e){e(r)};E.prototype[Ky.captureRejectionSymbol]=function(r){this.destroy(r)};E.prototype[$y]=function(){let r;return this.destroyed||(r=this.readableEnded?null:new im,this.destroy(r)),new gl((e,t)=>wl(this,i=>i&&i!==r?t(i):e(null)))};E.prototype.push=function(r,e){return kl(this,r,e,!1)};E.prototype.unshift=function(r,e){return kl(this,r,e,!0)};function kl(r,e,t,i){k("readableAddChunk",e);let n=r._readableState,o;if(n.state&Xt||(typeof e=="string"?(t=t||n.defaultEncoding,n.encoding!==t&&(i&&n.encoding?e=uo.from(e,t).toString(n.encoding):(e=uo.from(e,t),t=""))):e instanceof uo?t="":ft._isUint8Array(e)?(e=ft._uint8ArrayToBuffer(e),t=""):e!=null&&(o=new Qy("chunk",["string","Buffer","Uint8Array"],e))),o)Gt(r,o);else if(e===null)n.state&=~gr,bm(r,n);else if(n.state&Xt||e&&e.length>0)if(i)if(n.state&_l)Gt(r,new rm);else{if(n.destroyed||n.errored)return!1;ho(r,n,e,!0)}else if(n.ended)Gt(r,new tm);else{if(n.destroyed||n.errored)return!1;n.state&=~gr,n.decoder&&!t?(e=n.decoder.write(e),n.objectMode||e.length!==0?ho(r,n,e,!1):Si(r,n)):ho(r,n,e,!1)}else i||(n.state&=~gr,Si(r,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(kl,"readableAddChunk");function ho(r,e,t,i){e.flowing&&e.length===0&&!e.sync&&r.listenerCount("data")>0?(e.state&vl?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,r.emit("data",t)):(e.length+=e.objectMode?1:t.length,i?e.buffer.unshift(t):e.buffer.push(t),e.state&wi&&Ei(r)),Si(r,e)}s(ho,"addChunk");E.prototype.isPaused=function(){let r=this._readableState;return r[vt]===!0||r.flowing===!1};E.prototype.setEncoding=function(r){let e=new Sl(r);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let t=this._readableState.buffer,i="";for(let n of t)i+=e.write(n);return t.clear(),i!==""&&t.push(i),this._readableState.length=i.length,this};var ym=1073741824;function mm(r){if(r>ym)throw new em("size","<= 1GiB",r);return r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++,r}s(mm,"computeNewHighWaterMark");function ml(r,e){return r<=0||e.length===0&&e.ended?0:e.state&Xt?1:My(r)?e.flowing&&e.length?e.buffer.first().length:e.length:r<=e.length?r:e.ended?e.length:0}s(ml,"howMuchToRead");E.prototype.read=function(r){k("read",r),r===void 0?r=NaN:Uy(r)||(r=Wy(r,10));let e=this._readableState,t=r;if(r>e.highWaterMark&&(e.highWaterMark=mm(r)),r!==0&&(e.state&=~xl),r===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return k("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?po(this):Ei(this),null;if(r=ml(r,e),r===0&&e.ended)return e.length===0&&po(this),null;let i=(e.state&wi)!==0;if(k("need readable",i),(e.length===0||e.length-r<e.highWaterMark)&&(i=!0,k("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,k("reading, ended or constructing",i);else if(i){k("do read"),e.state|=gr|gi,e.length===0&&(e.state|=wi);try{this._read(e.highWaterMark)}catch(o){Gt(this,o)}e.state&=~gi,e.reading||(r=ml(t,e))}let n;return r>0?n=Nl(r,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,r=0):(e.length-=r,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),t!==r&&e.ended&&po(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function bm(r,e){if(k("onEofChunk"),!e.ended){if(e.decoder){let t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?Ei(r):(e.needReadable=!1,e.emittedReadable=!0,Al(r))}}s(bm,"onEofChunk");function Ei(r){let e=r._readableState;k("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(k("emitReadable",e.flowing),e.emittedReadable=!0,Ee.nextTick(Al,r))}s(Ei,"emitReadable");function Al(r){let e=r._readableState;k("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(r.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Tl(r)}s(Al,"emitReadable_");function Si(r,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ee.nextTick(gm,r,e))}s(Si,"maybeReadMore");function gm(r,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let t=e.length;if(k("maybeReadMore read 0"),r.read(0),t===e.length)break}e.readingMore=!1}s(gm,"maybeReadMore_");E.prototype._read=function(r){throw new Zy("_read()")};E.prototype.pipe=function(r,e){let t=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new jy(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(r),k("pipe count=%d opts=%j",i.pipes.length,e);let o=(!e||e.end!==!1)&&r!==Ee.stdout&&r!==Ee.stderr?l:v;i.endEmitted?Ee.nextTick(o):t.once("end",o),r.on("unpipe",a);function a(S,C){k("onunpipe"),S===t&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,h())}s(a,"onunpipe");function l(){k("onend"),r.end()}s(l,"onend");let c,u=!1;function h(){k("cleanup"),r.removeListener("close",g),r.removeListener("finish",y),c&&r.removeListener("drain",c),r.removeListener("error",m),r.removeListener("unpipe",a),t.removeListener("end",l),t.removeListener("end",v),t.removeListener("data",b),u=!0,c&&i.awaitDrainWriters&&(!r._writableState||r._writableState.needDrain)&&c()}s(h,"cleanup");function d(){u||(i.pipes.length===1&&i.pipes[0]===r?(k("false write response, pause",0),i.awaitDrainWriters=r,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(r)&&(k("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(r)),t.pause()),c||(c=wm(t,r),r.on("drain",c))}s(d,"pause"),t.on("data",b);function b(S){k("ondata");let C=r.write(S);k("dest.write",C),C===!1&&d()}s(b,"ondata");function m(S){if(k("onerror",S),v(),r.removeListener("error",m),r.listenerCount("error")===0){let C=r._writableState||r._readableState;C&&!C.errorEmitted?Gt(r,S):r.emit("error",S)}}s(m,"onerror"),Hy(r,"error",m);function g(){r.removeListener("finish",y),v()}s(g,"onclose"),r.once("close",g);function y(){k("onfinish"),r.removeListener("close",g),v()}s(y,"onfinish"),r.once("finish",y);function v(){k("unpipe"),t.unpipe(r)}return s(v,"unpipe"),r.emit("pipe",t),r.writableNeedDrain===!0?d():i.flowing||(k("pipe resume"),t.resume()),r};function wm(r,e){return s(function(){let i=r._readableState;i.awaitDrainWriters===e?(k("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(k("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&r.listenerCount("data")&&r.resume()},"pipeOnDrainFunctionResult")}s(wm,"pipeOnDrain");E.prototype.unpipe=function(r){let e=this._readableState,t={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!r){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=By(e.pipes,r);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),r.emit("unpipe",this,t),this)};E.prototype.on=function(r,e){let t=ft.prototype.on.call(this,r,e),i=this._readableState;return r==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):r==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,k("on readable",i.length,i.reading),i.length?Ei(this):i.reading||Ee.nextTick(Sm,this)),t};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(r,e){let t=ft.prototype.removeListener.call(this,r,e);return r==="readable"&&Ee.nextTick(Fl,this),t};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(r){let e=ft.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&Ee.nextTick(Fl,this),e};function Fl(r){let e=r._readableState;e.readableListening=r.listenerCount("readable")>0,e.resumeScheduled&&e[vt]===!1?e.flowing=!0:r.listenerCount("data")>0?r.resume():e.readableListening||(e.flowing=null)}s(Fl,"updateReadableListening");function Sm(r){k("readable nexttick read 0"),r.read(0)}s(Sm,"nReadingNextTick");E.prototype.resume=function(){let r=this._readableState;return r.flowing||(k("resume"),r.flowing=!r.readableListening,_m(this,r)),r[vt]=!1,this};function _m(r,e){e.resumeScheduled||(e.resumeScheduled=!0,Ee.nextTick(Em,r,e))}s(_m,"resume");function Em(r,e){k("resume",e.reading),e.reading||r.read(0),e.resumeScheduled=!1,r.emit("resume"),Tl(r),e.flowing&&!e.reading&&r.read(0)}s(Em,"resume_");E.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[vt]=!0,this};function Tl(r){let e=r._readableState;for(k("flow",e.flowing);e.flowing&&r.read()!==null;);}s(Tl,"flow");E.prototype.wrap=function(r){let e=!1;r.on("data",i=>{!this.push(i)&&r.pause&&(e=!0,r.pause())}),r.on("end",()=>{this.push(null)}),r.on("error",i=>{Gt(this,i)}),r.on("close",()=>{this.destroy()}),r.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&r.resume&&(e=!1,r.resume())};let t=qy(r);for(let i=1;i<t.length;i++){let n=t[i];this[n]===void 0&&typeof r[n]=="function"&&(this[n]=r[n].bind(r))}return this};E.prototype[Vy]=function(){return Cl(this)};E.prototype.iterator=function(r){return r!==void 0&&nm(r,"options"),Cl(this,r)};function Cl(r,e){typeof r.read!="function"&&(r=E.wrap(r,{objectMode:!0}));let t=xm(r,e);return t.stream=r,t}s(Cl,"streamToAsyncIterator");async function*xm(r,e){let t=fo;function i(a){this===r?(t(),t=fo):t=a}s(i,"next"),r.on("readable",i);let n,o=wl(r,{writable:!1},a=>{n=a?yl(n,a):null,t(),t=fo});try{for(;;){let a=r.destroyed?null:r.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new gl(i)}}}catch(a){throw n=yl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||r._readableState.autoDestroy)?Jt.destroyer(r,null):(r.off("readable",i),o())}}s(xm,"createAsyncIterator");go(E.prototype,{readable:{__proto__:null,get(){let r=this._readableState;return!!r&&r.readable!==!1&&!r.destroyed&&!r.errorEmitted&&!r.endEmitted},set(r){this._readableState&&(this._readableState.readable=!!r)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(r){this._readableState&&(this._readableState.flowing=r)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(r){this._readableState&&(this._readableState.destroyed=r)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});go(_i.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[vt]!==!1},set(r){this[vt]=!!r}}});E._fromList=Nl;function Nl(r,e){if(e.length===0)return null;let t;return e.objectMode?t=e.buffer.shift():!r||r>=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.first():t=e.buffer.concat(e.length),e.buffer.clear()):t=e.buffer.consume(r,e.decoder),t}s(Nl,"fromList");function po(r){let e=r._readableState;k("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ee.nextTick(vm,e,r))}s(po,"endReadable");function vm(r,e){if(k("endReadableNT",r.endEmitted,r.length),!r.errored&&!r.closeEmitted&&!r.endEmitted&&r.length===0){if(r.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)Ee.nextTick(km,e);else if(r.autoDestroy){let t=e._writableState;(!t||t.autoDestroy&&(t.finished||t.writable===!1))&&e.destroy()}}}s(vm,"endReadableNT");function km(r){r.writable&&!r.writableEnded&&!r.destroyed&&r.end()}s(km,"endWritableNT");E.from=function(r,e){return om(E,r,e)};var yo;function Pl(){return yo===void 0&&(yo={}),yo}s(Pl,"lazyWebStreams");E.fromWeb=function(r,e){return Pl().newStreamReadableFromReadableStream(r,e)};E.toWeb=function(r,e){return Pl().newReadableStreamFromStreamReadable(r,e)};E.wrap=function(r,e){var t,i;return new E({objectMode:(t=(i=r.readableObjectMode)!==null&&i!==void 0?i:r.objectMode)!==null&&t!==void 0?t:!0,...e,destroy(n,o){Jt.destroyer(r,n),o(n)}}).wrap(r)}});var Fi=T((t_,Vl)=>{var kt=ct(),{ArrayPrototypeSlice:Ol,Error:Am,FunctionPrototypeSymbolHasInstance:Dl,ObjectDefineProperty:Bl,ObjectDefineProperties:Fm,ObjectSetPrototypeOf:Ul,StringPrototypeToLowerCase:Tm,Symbol:Cm,SymbolHasInstance:Nm}=O();Vl.exports=D;D.WritableState=Er;var{EventEmitter:Pm}=pr(),Sr=pi().Stream,{Buffer:xi}=We(),Ai=Et(),{addAbortSignal:Im}=yr(),{getHighWaterMark:Lm,getDefaultHighWaterMark:Rm}=mr(),{ERR_INVALID_ARG_TYPE:Om,ERR_METHOD_NOT_IMPLEMENTED:Dm,ERR_MULTIPLE_CALLBACK:Ml,ERR_STREAM_CANNOT_PIPE:Bm,ERR_STREAM_DESTROYED:_r,ERR_STREAM_ALREADY_FINISHED:Um,ERR_STREAM_NULL_VALUES:Mm,ERR_STREAM_WRITE_AFTER_END:Wm,ERR_UNKNOWN_ENCODING:Wl}=oe().codes,{errorOrDestroy:Qt}=Ai;Ul(D.prototype,Sr.prototype);Ul(D,Sr);function _o(){}s(_o,"nop");var Zt=Cm("kOnFinished");function Er(r,e,t){typeof t!="boolean"&&(t=e instanceof Re()),this.objectMode=!!(r&&r.objectMode),t&&(this.objectMode=this.objectMode||!!(r&&r.writableObjectMode)),this.highWaterMark=r?Lm(this,r,"writableHighWaterMark",t):Rm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(r&&r.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=r&&r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=jm.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ki(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!r||r.emitClose!==!1,this.autoDestroy=!r||r.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Zt]=[]}s(Er,"WritableState");function ki(r){r.buffered=[],r.bufferedIndex=0,r.allBuffers=!0,r.allNoop=!0}s(ki,"resetBuffer");Er.prototype.getBuffer=s(function(){return Ol(this.buffered,this.bufferedIndex)},"getBuffer");Bl(Er.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function D(r){let e=this instanceof Re();if(!e&&!Dl(D,this))return new D(r);this._writableState=new Er(r,this,e),r&&(typeof r.write=="function"&&(this._write=r.write),typeof r.writev=="function"&&(this._writev=r.writev),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.final=="function"&&(this._final=r.final),typeof r.construct=="function"&&(this._construct=r.construct),r.signal&&Im(r.signal,this)),Sr.call(this,r),Ai.construct(this,()=>{let t=this._writableState;t.writing||xo(this,t),vo(this,t)})}s(D,"Writable");Bl(D,Nm,{__proto__:null,value:function(r){return Dl(this,r)?!0:this!==D?!1:r&&r._writableState instanceof Er}});D.prototype.pipe=function(){Qt(this,new Bm)};function ql(r,e,t,i){let n=r._writableState;if(typeof t=="function")i=t,t=n.defaultEncoding;else{if(!t)t=n.defaultEncoding;else if(t!=="buffer"&&!xi.isEncoding(t))throw new Wl(t);typeof i!="function"&&(i=_o)}if(e===null)throw new Mm;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=xi.from(e,t),t="buffer");else if(e instanceof xi)t="buffer";else if(Sr._isUint8Array(e))e=Sr._uint8ArrayToBuffer(e),t="buffer";else throw new Om("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new Wm:n.destroyed&&(o=new _r("write")),o?(kt.nextTick(i,o),Qt(r,o,!0),o):(n.pendingcb++,qm(r,n,e,t,i))}s(ql,"_write");D.prototype.write=function(r,e,t){return ql(this,r,e,t)===!0};D.prototype.cork=function(){this._writableState.corked++};D.prototype.uncork=function(){let r=this._writableState;r.corked&&(r.corked--,r.writing||xo(this,r))};D.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Tm(e)),!xi.isEncoding(e))throw new Wl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function qm(r,e,t,i,n){let o=e.objectMode?1:t.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:t,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==_o&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,r._write(t,i,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(qm,"writeOrBuffer");function Ll(r,e,t,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new _r("write")):t?r._writev(n,e.onwrite):r._write(n,o,e.onwrite),e.sync=!1}s(Ll,"doWrite");function Rl(r,e,t,i){--e.pendingcb,i(t),Eo(e),Qt(r,t)}s(Rl,"onwriteError");function jm(r,e){let t=r._writableState,i=t.sync,n=t.writecb;if(typeof n!="function"){Qt(r,new Ml);return}t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0,e?(e.stack,t.errored||(t.errored=e),r._readableState&&!r._readableState.errored&&(r._readableState.errored=e),i?kt.nextTick(Rl,r,t,e,n):Rl(r,t,e,n)):(t.buffered.length>t.bufferedIndex&&xo(r,t),i?t.afterWriteTickInfo!==null&&t.afterWriteTickInfo.cb===n?t.afterWriteTickInfo.count++:(t.afterWriteTickInfo={count:1,cb:n,stream:r,state:t},kt.nextTick($m,t.afterWriteTickInfo)):jl(r,t,1,n))}s(jm,"onwrite");function $m({stream:r,state:e,count:t,cb:i}){return e.afterWriteTickInfo=null,jl(r,e,t,i)}s($m,"afterWriteTick");function jl(r,e,t,i){for(!e.ending&&!r.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,r.emit("drain"));t-- >0;)e.pendingcb--,i();e.destroyed&&Eo(e),vo(r,e)}s(jl,"afterWrite");function Eo(r){if(r.writing)return;for(let n=r.bufferedIndex;n<r.buffered.length;++n){var e;let{chunk:o,callback:a}=r.buffered[n],l=r.objectMode?1:o.length;r.length-=l,a((e=r.errored)!==null&&e!==void 0?e:new _r("write"))}let t=r[Zt].splice(0);for(let n=0;n<t.length;n++){var i;t[n]((i=r.errored)!==null&&i!==void 0?i:new _r("end"))}ki(r)}s(Eo,"errorBuffer");function xo(r,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:t,bufferedIndex:i,objectMode:n}=e,o=t.length-i;if(!o)return;let a=i;if(e.bufferProcessing=!0,o>1&&r._writev){e.pendingcb-=o-1;let l=e.allNoop?_o:u=>{for(let h=a;h<t.length;++h)t[h].callback(u)},c=e.allNoop&&a===0?t:Ol(t,a);c.allBuffers=e.allBuffers,Ll(r,e,!0,e.length,c,"",l),ki(e)}else{do{let{chunk:l,encoding:c,callback:u}=t[a];t[a++]=null;let h=n?1:l.length;Ll(r,e,!1,h,l,c,u)}while(a<t.length&&!e.writing);a===t.length?ki(e):a>256?(t.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(xo,"clearBuffer");D.prototype._write=function(r,e,t){if(this._writev)this._writev([{chunk:r,encoding:e}],t);else throw new Dm("_write()")};D.prototype._writev=null;D.prototype.end=function(r,e,t){let i=this._writableState;typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null);let n;if(r!=null){let o=ql(this,r,e);o instanceof Am&&(n=o)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,vo(this,i,!0),i.ended=!0):i.finished?n=new Um("end"):i.destroyed&&(n=new _r("end"))),typeof t=="function"&&(n||i.finished?kt.nextTick(t,n):i[Zt].push(t)),this};function vi(r){return r.ending&&!r.destroyed&&r.constructed&&r.length===0&&!r.errored&&r.buffered.length===0&&!r.finished&&!r.writing&&!r.errorEmitted&&!r.closeEmitted}s(vi,"needFinish");function Vm(r,e){let t=!1;function i(n){if(t){Qt(r,n??Ml());return}if(t=!0,e.pendingcb--,n){let o=e[Zt].splice(0);for(let a=0;a<o.length;a++)o[a](n);Qt(r,n,e.sync)}else vi(e)&&(e.prefinished=!0,r.emit("prefinish"),e.pendingcb++,kt.nextTick(So,r,e))}s(i,"onFinish"),e.sync=!0,e.pendingcb++;try{r._final(i)}catch(n){i(n)}e.sync=!1}s(Vm,"callFinal");function zm(r,e){!e.prefinished&&!e.finalCalled&&(typeof r._final=="function"&&!e.destroyed?(e.finalCalled=!0,Vm(r,e)):(e.prefinished=!0,r.emit("prefinish")))}s(zm,"prefinish");function vo(r,e,t){vi(e)&&(zm(r,e),e.pendingcb===0&&(t?(e.pendingcb++,kt.nextTick((i,n)=>{vi(n)?So(i,n):n.pendingcb--},r,e)):vi(e)&&(e.pendingcb++,So(r,e))))}s(vo,"finishMaybe");function So(r,e){e.pendingcb--,e.finished=!0;let t=e[Zt].splice(0);for(let i=0;i<t.length;i++)t[i]();if(r.emit("finish"),e.autoDestroy){let i=r._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&r.destroy()}}s(So,"finish");Fm(D.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(r){this._writableState&&(this._writableState.destroyed=r)}},writable:{__proto__:null,get(){let r=this._writableState;return!!r&&r.writable!==!1&&!r.destroyed&&!r.errored&&!r.ending&&!r.ended},set(r){this._writableState&&(this._writableState.writable=!!r)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let r=this._writableState;return r?!r.destroyed&&!r.ending&&r.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Km=Ai.destroy;D.prototype.destroy=function(r,e){let t=this._writableState;return!t.destroyed&&(t.bufferedIndex<t.buffered.length||t[Zt].length)&&kt.nextTick(Eo,t),Km.call(this,r,e),this};D.prototype._undestroy=Ai.undestroy;D.prototype._destroy=function(r,e){e(r)};D.prototype[Pm.captureRejectionSymbol]=function(r){this.destroy(r)};var wo;function $l(){return wo===void 0&&(wo={}),wo}s($l,"lazyWebStreams");D.fromWeb=function(r,e){return $l().newStreamWritableFromWritableStream(r,e)};D.toWeb=function(r){return $l().newWritableStreamFromStreamWritable(r)}});var oc=T((i_,nc)=>{var ko=ct(),Hm=We(),{isReadable:Ym,isWritable:Gm,isIterable:zl,isNodeStream:Xm,isReadableNodeStream:Kl,isWritableNodeStream:Hl,isDuplexNodeStream:Jm,isReadableStream:Yl,isWritableStream:Gl}=Pe(),Xl=$e(),{AbortError:rc,codes:{ERR_INVALID_ARG_TYPE:Qm,ERR_INVALID_RETURN_VALUE:Jl}}=oe(),{destroyer:tr}=Et(),Zm=Re(),ic=wr(),eb=Fi(),{createDeferredPromise:Ql}=re(),Zl=co(),ec=globalThis.Blob||Hm.Blob,tb=s(typeof ec<"u"?function(e){return e instanceof ec}:function(e){return!1},"isBlob"),rb=globalThis.AbortController||$t().AbortController,{FunctionPrototypeCall:tc}=O(),Ve=class extends Zm{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(Ve,"Duplexify");nc.exports=s(function r(e,t){if(Jm(e))return e;if(Kl(e))return er({readable:e});if(Hl(e))return er({writable:e});if(Xm(e))return er({writable:!1,readable:!1});if(Yl(e))return er({readable:ic.fromWeb(e)});if(Gl(e))return er({writable:eb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:l}=ib(e);if(zl(n))return Zl(Ve,n,{objectMode:!0,write:o,final:a,destroy:l});let c=n?.then;if(typeof c=="function"){let u,h=tc(c,n,d=>{if(d!=null)throw new Jl("nully","body",d)},d=>{tr(u,d)});return u=new Ve({objectMode:!0,readable:!1,write:o,final(d){a(async()=>{try{await h,ko.nextTick(d,null)}catch(b){ko.nextTick(d,b)}})},destroy:l})}throw new Jl("Iterable, AsyncIterable or AsyncFunction",t,n)}if(tb(e))return r(e.arrayBuffer());if(zl(e))return Zl(Ve,e,{objectMode:!0,writable:!1});if(Yl(e?.readable)&&Gl(e?.writable))return Ve.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?Kl(e?.readable)?e?.readable:r(e.readable):void 0,o=e!=null&&e.writable?Hl(e?.writable)?e?.writable:r(e.writable):void 0;return er({readable:n,writable:o})}let i=e?.then;if(typeof i=="function"){let n;return tc(i,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{tr(n,o)}),n=new Ve({objectMode:!0,writable:!1,read(){}})}throw new Qm(t,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function ib(r){let{promise:e,resolve:t}=Ql(),i=new rb,n=i.signal;return{value:r(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(ko.nextTick(u),c)return;if(n.aborted)throw new rc(void 0,{cause:n.reason});({promise:e,resolve:t}=Ql()),yield l}}(),{signal:n}),write(a,l,c){let u=t;t=null,u({chunk:a,done:!1,cb:c})},final(a){let l=t;t=null,l({done:!0,cb:a})},destroy(a,l){i.abort(),l(a)}}}s(ib,"fromAsyncGen");function er(r){let e=r.readable&&typeof r.readable.read!="function"?ic.wrap(r.readable):r.readable,t=r.writable,i=!!Ym(e),n=!!Gm(t),o,a,l,c,u;function h(d){let b=c;c=null,b?b(d):d&&u.destroy(d)}return s(h,"onfinished"),u=new Ve({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(t!=null&&t.writableObjectMode),readable:i,writable:n}),n&&(Xl(t,d=>{n=!1,d&&tr(e,d),h(d)}),u._write=function(d,b,m){t.write(d,b)?m():o=m},u._final=function(d){t.end(),a=d},t.on("drain",function(){if(o){let d=o;o=null,d()}}),t.on("finish",function(){if(a){let d=a;a=null,d()}})),i&&(Xl(e,d=>{i=!1,d&&tr(e,d),h(d)}),e.on("readable",function(){if(l){let d=l;l=null,d()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let d=e.read();if(d===null){l=u._read;return}if(!u.push(d))return}}),u._destroy=function(d,b){!d&&c!==null&&(d=new rc),l=null,o=null,a=null,c===null?b(d):(c=b,tr(t,d),tr(e,d))},u}s(er,"_duplexify")});var Re=T((o_,lc)=>{"use strict";var{ObjectDefineProperties:nb,ObjectGetOwnPropertyDescriptor:ze,ObjectKeys:ob,ObjectSetPrototypeOf:sc}=O();lc.exports=xe;var To=wr(),Se=Fi();sc(xe.prototype,To.prototype);sc(xe,To);{let r=ob(Se.prototype);for(let e=0;e<r.length;e++){let t=r[e];xe.prototype[t]||(xe.prototype[t]=Se.prototype[t])}}function xe(r){if(!(this instanceof xe))return new xe(r);To.call(this,r),Se.call(this,r),r?(this.allowHalfOpen=r.allowHalfOpen!==!1,r.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),r.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(xe,"Duplex");nb(xe.prototype,{writable:{__proto__:null,...ze(Se.prototype,"writable")},writableHighWaterMark:{__proto__:null,...ze(Se.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...ze(Se.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...ze(Se.prototype,"writableBuffer")},writableLength:{__proto__:null,...ze(Se.prototype,"writableLength")},writableFinished:{__proto__:null,...ze(Se.prototype,"writableFinished")},writableCorked:{__proto__:null,...ze(Se.prototype,"writableCorked")},writableEnded:{__proto__:null,...ze(Se.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...ze(Se.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(r){this._readableState&&this._writableState&&(this._readableState.destroyed=r,this._writableState.destroyed=r)}}});var Ao;function ac(){return Ao===void 0&&(Ao={}),Ao}s(ac,"lazyWebStreams");xe.fromWeb=function(r,e){return ac().newStreamDuplexFromReadableWritablePair(r,e)};xe.toWeb=function(r){return ac().newReadableWritablePairFromDuplex(r)};var Fo;xe.from=function(r){return Fo||(Fo=oc()),Fo(r,"body")}});var Po=T((a_,uc)=>{"use strict";var{ObjectSetPrototypeOf:cc,Symbol:sb}=O();uc.exports=Ke;var{ERR_METHOD_NOT_IMPLEMENTED:ab}=oe().codes,No=Re(),{getHighWaterMark:lb}=mr();cc(Ke.prototype,No.prototype);cc(Ke,No);var xr=sb("kCallback");function Ke(r){if(!(this instanceof Ke))return new Ke(r);let e=r?lb(this,r,"readableHighWaterMark",!0):null;e===0&&(r={...r,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:r.writableHighWaterMark||0}),No.call(this,r),this._readableState.sync=!1,this[xr]=null,r&&(typeof r.transform=="function"&&(this._transform=r.transform),typeof r.flush=="function"&&(this._flush=r.flush)),this.on("prefinish",cb)}s(Ke,"Transform");function Co(r){typeof this._flush=="function"&&!this.destroyed?this._flush((e,t)=>{if(e){r?r(e):this.destroy(e);return}t!=null&&this.push(t),this.push(null),r&&r()}):(this.push(null),r&&r())}s(Co,"final");function cb(){this._final!==Co&&Co.call(this)}s(cb,"prefinish");Ke.prototype._final=Co;Ke.prototype._transform=function(r,e,t){throw new ab("_transform()")};Ke.prototype._write=function(r,e,t){let i=this._readableState,n=this._writableState,o=i.length;this._transform(r,e,(a,l)=>{if(a){t(a);return}l!=null&&this.push(l),n.ended||o===i.length||i.length<i.highWaterMark?t():this[xr]=t})};Ke.prototype._read=function(){if(this[xr]){let r=this[xr];this[xr]=null,r()}}});var Lo=T((c_,dc)=>{"use strict";var{ObjectSetPrototypeOf:fc}=O();dc.exports=rr;var Io=Po();fc(rr.prototype,Io.prototype);fc(rr,Io);function rr(r){if(!(this instanceof rr))return new rr(r);Io.call(this,r)}s(rr,"PassThrough");rr.prototype._transform=function(r,e,t){t(null,r)}});var Pi=T((f_,bc)=>{var vr=ct(),{ArrayIsArray:ub,Promise:fb,SymbolAsyncIterator:db,SymbolDispose:hb}=O(),Ni=$e(),{once:pb}=re(),yb=Et(),hc=Re(),{aggregateTwoErrors:mb,codes:{ERR_INVALID_ARG_TYPE:jo,ERR_INVALID_RETURN_VALUE:Ro,ERR_MISSING_ARGS:bb,ERR_STREAM_DESTROYED:gb,ERR_STREAM_PREMATURE_CLOSE:wb},AbortError:Sb}=oe(),{validateFunction:_b,validateAbortSignal:Eb}=Kt(),{isIterable:At,isReadable:Oo,isReadableNodeStream:Ci,isNodeStream:pc,isTransformStream:ir,isWebStream:xb,isReadableStream:Do,isReadableFinished:vb}=Pe(),kb=globalThis.AbortController||$t().AbortController,Bo,Uo,Mo;function yc(r,e,t){let i=!1;r.on("close",()=>{i=!0});let n=Ni(r,{readable:e,writable:t},o=>{i=!o});return{destroy:o=>{i||(i=!0,yb.destroyer(r,o||new gb("pipe")))},cleanup:n}}s(yc,"destroyer");function Ab(r){return _b(r[r.length-1],"streams[stream.length - 1]"),r.pop()}s(Ab,"popCallback");function Wo(r){if(At(r))return r;if(Ci(r))return Fb(r);throw new jo("val",["Readable","Iterable","AsyncIterable"],r)}s(Wo,"makeAsyncIterable");async function*Fb(r){Uo||(Uo=wr()),yield*Uo.prototype[db].call(r)}s(Fb,"fromReadable");async function Ti(r,e,t,{end:i}){let n,o=null,a=s(u=>{if(u&&(n=u),o){let h=o;o=null,h()}},"resume"),l=s(()=>new fb((u,h)=>{n?h(n):o=s(()=>{n?h(n):u()},"onresolve")}),"wait");e.on("drain",a);let c=Ni(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of r)e.write(u)||await l();i&&(e.end(),await l()),t()}catch(u){t(n!==u?mb(n,u):u)}finally{c(),e.off("drain",a)}}s(Ti,"pumpToNode");async function qo(r,e,t,{end:i}){ir(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of r)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),t()}catch(o){try{await n.abort(o),t(o)}catch(a){t(a)}}}s(qo,"pumpToWeb");function Tb(...r){return mc(r,pb(Ab(r)))}s(Tb,"pipeline");function mc(r,e,t){if(r.length===1&&ub(r[0])&&(r=r[0]),r.length<2)throw new bb("streams");let i=new kb,n=i.signal,o=t?.signal,a=[];Eb(o,"options.signal");function l(){g(new Sb)}s(l,"abort"),Mo=Mo||re().addAbortListener;let c;o&&(c=Mo(o,l));let u,h,d=[],b=0;function m(B){g(B,--b===0)}s(m,"finish");function g(B,A){var z;if(B&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=B),!(!u&&!A)){for(;d.length;)d.shift()(u);(z=c)===null||z===void 0||z[hb](),i.abort(),A&&(u||a.forEach(dt=>dt()),vr.nextTick(e,u,h))}}s(g,"finishImpl");let y;for(let B=0;B<r.length;B++){let A=r[B],z=B<r.length-1,dt=B>0,he=z||t?.end!==!1,Nt=B===r.length-1;if(pc(A)){let se=function(Be){Be&&Be.name!=="AbortError"&&Be.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Be)};var C=se;if(s(se,"onError"),he){let{destroy:Be,cleanup:Ki}=yc(A,z,dt);d.push(Be),Oo(A)&&Nt&&a.push(Ki)}A.on("error",se),Oo(A)&&Nt&&a.push(()=>{A.removeListener("error",se)})}if(B===0)if(typeof A=="function"){if(y=A({signal:n}),!At(y))throw new Ro("Iterable, AsyncIterable or Stream","source",y)}else At(A)||Ci(A)||ir(A)?y=A:y=hc.from(A);else if(typeof A=="function"){if(ir(y)){var v;y=Wo((v=y)===null||v===void 0?void 0:v.readable)}else y=Wo(y);if(y=A(y,{signal:n}),z){if(!At(y,!0))throw new Ro("AsyncIterable",`transform[${B-1}]`,y)}else{var S;Bo||(Bo=Lo());let se=new Bo({objectMode:!0}),Be=(S=y)===null||S===void 0?void 0:S.then;if(typeof Be=="function")b++,Be.call(y,Je=>{h=Je,Je!=null&&se.write(Je),he&&se.end(),vr.nextTick(m)},Je=>{se.destroy(Je),vr.nextTick(m,Je)});else if(At(y,!0))b++,Ti(y,se,m,{end:he});else if(Do(y)||ir(y)){let Je=y.readable||y;b++,Ti(Je,se,m,{end:he})}else throw new Ro("AsyncIterable or Promise","destination",y);y=se;let{destroy:Ki,cleanup:Zc}=yc(y,!1,!0);d.push(Ki),Nt&&a.push(Zc)}}else if(pc(A)){if(Ci(y)){b+=2;let se=Cb(y,A,m,{end:he});Oo(A)&&Nt&&a.push(se)}else if(ir(y)||Do(y)){let se=y.readable||y;b++,Ti(se,A,m,{end:he})}else if(At(y))b++,Ti(y,A,m,{end:he});else throw new jo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=A}else if(xb(A)){if(Ci(y))b++,qo(Wo(y),A,m,{end:he});else if(Do(y)||At(y))b++,qo(y,A,m,{end:he});else if(ir(y))b++,qo(y.readable,A,m,{end:he});else throw new jo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=A}else y=hc.from(A)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&vr.nextTick(l),y}s(mc,"pipelineImpl");function Cb(r,e,t,{end:i}){let n=!1;if(e.on("close",()=>{n||t(new wb)}),r.pipe(e,{end:!1}),i){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),vb(r)?vr.nextTick(a):r.once("end",a)}else t();return Ni(r,{readable:!0,writable:!1},a=>{let l=r._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?r.once("end",t).once("error",t):t(a)}),Ni(e,{readable:!1,writable:!0},t)}s(Cb,"pipe");bc.exports={pipelineImpl:mc,pipeline:Tb}});var Vo=T((h_,xc)=>{"use strict";var{pipeline:Nb}=Pi(),Ii=Re(),{destroyer:Pb}=Et(),{isNodeStream:Li,isReadable:gc,isWritable:wc,isWebStream:$o,isTransformStream:Ft,isWritableStream:Sc,isReadableStream:_c}=Pe(),{AbortError:Ib,codes:{ERR_INVALID_ARG_VALUE:Ec,ERR_MISSING_ARGS:Lb}}=oe(),Rb=$e();xc.exports=s(function(...e){if(e.length===0)throw new Lb("streams");if(e.length===1)return Ii.from(e[0]);let t=[...e];if(typeof e[0]=="function"&&(e[0]=Ii.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=Ii.from(e[m])}for(let m=0;m<e.length;++m)if(!(!Li(e[m])&&!$o(e[m]))){if(m<e.length-1&&!(gc(e[m])||_c(e[m])||Ft(e[m])))throw new Ec(`streams[${m}]`,t[m],"must be readable");if(m>0&&!(wc(e[m])||Sc(e[m])||Ft(e[m])))throw new Ec(`streams[${m}]`,t[m],"must be writable")}let i,n,o,a,l;function c(m){let g=a;a=null,g?g(m):m?l.destroy(m):!b&&!d&&l.destroy()}s(c,"onfinished");let u=e[0],h=Nb(e,c),d=!!(wc(u)||Sc(u)||Ft(u)),b=!!(gc(h)||_c(h)||Ft(h));if(l=new Ii({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(h!=null&&h.readableObjectMode),writable:d,readable:b}),d){if(Li(u))l._write=function(g,y,v){u.write(g,y)?v():i=v},l._final=function(g){u.end(),n=g},u.on("drain",function(){if(i){let g=i;i=null,g()}});else if($o(u)){let y=(Ft(u)?u.writable:u).getWriter();l._write=async function(v,S,C){try{await y.ready,y.write(v).catch(()=>{}),C()}catch(B){C(B)}},l._final=async function(v){try{await y.ready,y.close().catch(()=>{}),n=v}catch(S){v(S)}}}let m=Ft(h)?h.readable:h;Rb(m,()=>{if(n){let g=n;n=null,g()}})}if(b){if(Li(h))h.on("readable",function(){if(o){let m=o;o=null,m()}}),h.on("end",function(){l.push(null)}),l._read=function(){for(;;){let m=h.read();if(m===null){o=l._read;return}if(!l.push(m))return}};else if($o(h)){let g=(Ft(h)?h.readable:h).getReader();l._read=async function(){for(;;)try{let{value:y,done:v}=await g.read();if(!l.push(y))return;if(v){l.push(null);return}}catch{return}}}}return l._destroy=function(m,g){!m&&a!==null&&(m=new Ib),o=null,i=null,n=null,a===null?g(m):(a=g,Li(h)&&Pb(h,m))},l},"compose")});var Lc=T((y_,Ko)=>{"use strict";var Ob=globalThis.AbortController||$t().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Db,ERR_INVALID_ARG_TYPE:kr,ERR_MISSING_ARGS:Bb,ERR_OUT_OF_RANGE:Ub},AbortError:Oe}=oe(),{validateAbortSignal:Tt,validateInteger:vc,validateObject:Ct}=Kt(),Mb=O().Symbol("kWeak"),Wb=O().Symbol("kResistStopPropagation"),{finished:qb}=$e(),jb=Vo(),{addAbortSignalNoValidate:$b}=yr(),{isWritable:Vb,isNodeStream:zb}=Pe(),{deprecate:Kb}=re(),{ArrayPrototypePush:Hb,Boolean:Yb,MathFloor:kc,Number:Gb,NumberIsNaN:Xb,Promise:Ac,PromiseReject:Fc,PromiseResolve:Jb,PromisePrototypeThen:Tc,Symbol:Nc}=O(),Oi=Nc("kEmpty"),Cc=Nc("kEof");function Qb(r,e){if(e!=null&&Ct(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),zb(r)&&!Vb(r))throw new Db("stream",r,"must be writable");let t=jb(this,r);return e!=null&&e.signal&&$b(e.signal,t),t}s(Qb,"compose");function Di(r,e){if(typeof r!="function")throw new kr("fn",["Function","AsyncFunction"],r);e!=null&&Ct(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal");let t=1;e?.concurrency!=null&&(t=kc(e.concurrency));let i=t-1;return e?.highWaterMark!=null&&(i=kc(e.highWaterMark)),vc(t,"options.concurrency",1),vc(i,"options.highWaterMark",0),i+=t,s(async function*(){let o=re().AbortSignalAny([e?.signal].filter(Yb)),a=this,l=[],c={signal:o},u,h,d=!1,b=0;function m(){d=!0,g()}s(m,"onCatch");function g(){b-=1,y()}s(g,"afterItemProcessed");function y(){h&&!d&&b<t&&l.length<i&&(h(),h=null)}s(y,"maybeResume");async function v(){try{for await(let S of a){if(d)return;if(o.aborted)throw new Oe;try{if(S=r(S,c),S===Oi)continue;S=Jb(S)}catch(C){S=Fc(C)}b+=1,Tc(S,g,m),l.push(S),u&&(u(),u=null),!d&&(l.length>=i||b>=t)&&await new Ac(C=>{h=C})}l.push(Cc)}catch(S){let C=Fc(S);Tc(C,g,m),l.push(C)}finally{d=!0,u&&(u(),u=null)}}s(v,"pump"),v();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===Cc)return;if(o.aborted)throw new Oe;S!==Oi&&(yield S),l.shift(),y()}await new Ac(S=>{u=S})}}finally{d=!0,h&&(h(),h=null)}},"map").call(this)}s(Di,"map");function Zb(r=void 0){return r!=null&&Ct(r,"options"),r?.signal!=null&&Tt(r.signal,"options.signal"),s(async function*(){let t=0;for await(let n of this){var i;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted)throw new Oe({cause:r.signal.reason});yield[t++,n]}},"asIndexedPairs").call(this)}s(Zb,"asIndexedPairs");async function Pc(r,e=void 0){for await(let t of zo.call(this,r,e))return!0;return!1}s(Pc,"some");async function eg(r,e=void 0){if(typeof r!="function")throw new kr("fn",["Function","AsyncFunction"],r);return!await Pc.call(this,async(...t)=>!await r(...t),e)}s(eg,"every");async function tg(r,e){for await(let t of zo.call(this,r,e))return t}s(tg,"find");async function rg(r,e){if(typeof r!="function")throw new kr("fn",["Function","AsyncFunction"],r);async function t(i,n){return await r(i,n),Oi}s(t,"forEachFn");for await(let i of Di.call(this,t,e));}s(rg,"forEach");function zo(r,e){if(typeof r!="function")throw new kr("fn",["Function","AsyncFunction"],r);async function t(i,n){return await r(i,n)?i:Oi}return s(t,"filterFn"),Di.call(this,t,e)}s(zo,"filter");var Ri=class extends Bb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(Ri,"ReduceAwareErrMissingArgs");async function ig(r,e,t){var i;if(typeof r!="function")throw new kr("reducer",["Function","AsyncFunction"],r);t!=null&&Ct(t,"options"),t?.signal!=null&&Tt(t.signal,"options.signal");let n=arguments.length>1;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted){let u=new Oe(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await qb(this.destroy(u)),u}let o=new Ob,a=o.signal;if(t!=null&&t.signal){let u={once:!0,[Mb]:this,[Wb]:!0};t.signal.addEventListener("abort",()=>o.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,t!=null&&(c=t.signal)!==null&&c!==void 0&&c.aborted)throw new Oe;n?e=await r(e,u,{signal:a}):(e=u,n=!0)}if(!l&&!n)throw new Ri}finally{o.abort()}return e}s(ig,"reduce");async function ng(r){r!=null&&Ct(r,"options"),r?.signal!=null&&Tt(r.signal,"options.signal");let e=[];for await(let i of this){var t;if(r!=null&&(t=r.signal)!==null&&t!==void 0&&t.aborted)throw new Oe(void 0,{cause:r.signal.reason});Hb(e,i)}return e}s(ng,"toArray");function og(r,e){let t=Di.call(this,r,e);return s(async function*(){for await(let n of t)yield*n},"flatMap").call(this)}s(og,"flatMap");function Ic(r){if(r=Gb(r),Xb(r))return 0;if(r<0)throw new Ub("number",">= 0",r);return r}s(Ic,"toIntegerOrInfinity");function sg(r,e=void 0){return e!=null&&Ct(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),r=Ic(r),s(async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Oe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;r--<=0&&(yield o)}},"drop").call(this)}s(sg,"drop");function ag(r,e=void 0){return e!=null&&Ct(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),r=Ic(r),s(async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Oe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;if(r-- >0&&(yield o),r<=0)return}},"take").call(this)}s(ag,"take");Ko.exports.streamReturningOperators={asIndexedPairs:Kb(Zb,"readable.asIndexedPairs will be removed in a future version."),drop:sg,filter:zo,flatMap:og,map:Di,take:ag,compose:Qb};Ko.exports.promiseReturningOperators={every:eg,forEach:rg,reduce:ig,toArray:ng,some:Pc,find:tg}});var Ho=T((b_,Rc)=>{"use strict";var{ArrayPrototypePop:lg,Promise:cg}=O(),{isIterable:ug,isNodeStream:fg,isWebStream:dg}=Pe(),{pipelineImpl:hg}=Pi(),{finished:pg}=$e();Yo();function yg(...r){return new cg((e,t)=>{let i,n,o=r[r.length-1];if(o&&typeof o=="object"&&!fg(o)&&!ug(o)&&!dg(o)){let a=lg(r);i=a.signal,n=a.end}hg(r,(a,l)=>{a?t(a):e(l)},{signal:i,end:n})})}s(yg,"pipeline");Rc.exports={finished:pg,pipeline:yg}});var Yo=T((w_,$c)=>{var{Buffer:mg}=We(),{ObjectDefineProperty:He,ObjectKeys:Bc,ReflectApply:Uc}=O(),{promisify:{custom:Mc}}=re(),{streamReturningOperators:Oc,promiseReturningOperators:Dc}=Lc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Wc}}=oe(),bg=Vo(),{setDefaultHighWaterMark:gg,getDefaultHighWaterMark:wg}=mr(),{pipeline:qc}=Pi(),{destroyer:Sg}=Et(),jc=$e(),Go=Ho(),Ar=Pe(),I=$c.exports=pi().Stream;I.isDestroyed=Ar.isDestroyed;I.isDisturbed=Ar.isDisturbed;I.isErrored=Ar.isErrored;I.isReadable=Ar.isReadable;I.isWritable=Ar.isWritable;I.Readable=wr();for(let r of Bc(Oc)){let t=function(...i){if(new.target)throw Wc();return I.Readable.from(Uc(e,this,i))};Eg=t,s(t,"fn");let e=Oc[r];He(t,"name",{__proto__:null,value:e.name}),He(t,"length",{__proto__:null,value:e.length}),He(I.Readable.prototype,r,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}var Eg;for(let r of Bc(Dc)){let t=function(...n){if(new.target)throw Wc();return Uc(e,this,n)};Eg=t,s(t,"fn");let e=Dc[r];He(t,"name",{__proto__:null,value:e.name}),He(t,"length",{__proto__:null,value:e.length}),He(I.Readable.prototype,r,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}var Eg;I.Writable=Fi();I.Duplex=Re();I.Transform=Po();I.PassThrough=Lo();I.pipeline=qc;var{addAbortSignal:_g}=yr();I.addAbortSignal=_g;I.finished=jc;I.destroy=Sg;I.compose=bg;I.setDefaultHighWaterMark=gg;I.getDefaultHighWaterMark=wg;He(I,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Go}});He(qc,Mc,{__proto__:null,enumerable:!0,get(){return Go.pipeline}});He(jc,Mc,{__proto__:null,enumerable:!0,get(){return Go.finished}});I.Stream=I;I._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");I._uint8ArrayToBuffer=s(function(e){return mg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Vc=T((__,V)=>{"use strict";var H=Yo(),xg=Ho(),vg=H.Readable.destroy;V.exports=H.Readable;V.exports._uint8ArrayToBuffer=H._uint8ArrayToBuffer;V.exports._isUint8Array=H._isUint8Array;V.exports.isDisturbed=H.isDisturbed;V.exports.isErrored=H.isErrored;V.exports.isReadable=H.isReadable;V.exports.Readable=H.Readable;V.exports.Writable=H.Writable;V.exports.Duplex=H.Duplex;V.exports.Transform=H.Transform;V.exports.PassThrough=H.PassThrough;V.exports.addAbortSignal=H.addAbortSignal;V.exports.finished=H.finished;V.exports.destroy=H.destroy;V.exports.destroy=vg;V.exports.pipeline=H.pipeline;V.exports.compose=H.compose;Object.defineProperty(H,"promises",{configurable:!0,enumerable:!0,get(){return xg}});V.exports.Stream=H.Stream;V.exports.default=V.exports});var Cg={};Pr(Cg,{ActionType:()=>Mr,ApiError:()=>f,AsyncKeyValueFile:()=>sr,AsyncKeyValueFileSystem:()=>zi,AsyncMirror:()=>Ye,BaseFile:()=>ur,BaseFileSystem:()=>ye,BigIntStats:()=>te,Cred:()=>U,ErrorCode:()=>Z,ErrorStrings:()=>Gi,FileFlag:()=>F,FileIndex:()=>ar,FileSystem:()=>rt,FileType:()=>R,FolderAdapter:()=>ve,InMemory:()=>me,IndexDirInode:()=>Xe,IndexFileInode:()=>Nr,NoSyncFile:()=>Ur,OverlayFS:()=>De,PreloadFile:()=>ue,ROOT_NODE_ID:()=>pe,SimpleSyncRWTransaction:()=>Dt,Stats:()=>L,StatsCommon:()=>Ot,SyncKeyValueFile:()=>Bt,SyncKeyValueFileSystem:()=>Ut,SynchronousFileSystem:()=>it,backends:()=>$i,checkOptions:()=>Yi,configure:()=>Fg,decode:()=>X,default:()=>Tg,encode:()=>x,fs:()=>Wi,getFileSystem:()=>Qc,initialize:()=>Jc,isIndexDirInode:()=>Zo,isIndexFileInode:()=>Gc,mkdirpSync:()=>ns,randomUUID:()=>pt,registerBackend:()=>Yc,setImmediate:()=>du,toPromise:()=>fu,wait:()=>uu});var Xo={};Pr(Xo,{BigIntStats:()=>te,Dir:()=>$r,Dirent:()=>at,ReadStream:()=>Bi,Stats:()=>L,WriteStream:()=>Ui,_toUnixTimestamp:()=>ss,access:()=>ud,accessSync:()=>mf,appendFile:()=>Wf,appendFileSync:()=>Hu,chmod:()=>od,chmodSync:()=>df,chown:()=>id,chownSync:()=>uf,close:()=>jf,closeSync:()=>Gu,constants:()=>cr,copyFile:()=>gd,copyFileSync:()=>wf,createReadStream:()=>pd,createWriteStream:()=>yd,exists:()=>If,existsSync:()=>fs,fchmod:()=>Gf,fchmodSync:()=>rf,fchown:()=>Yf,fchownSync:()=>tf,fdatasync:()=>zf,fdatasyncSync:()=>Qu,fstat:()=>qf,fstatSync:()=>Yu,fsync:()=>Vf,fsyncSync:()=>Ju,ftruncate:()=>$f,ftruncateSync:()=>Xu,futimes:()=>Xf,futimesSync:()=>nf,getMount:()=>ls,getMounts:()=>cs,initialize:()=>us,lchmod:()=>sd,lchmodSync:()=>hf,lchown:()=>nd,lchownSync:()=>ff,link:()=>ed,linkSync:()=>af,lstat:()=>Rf,lstatSync:()=>Vu,lutimes:()=>ld,lutimesSync:()=>yf,mkdir:()=>Qf,mkdirSync:()=>sf,mkdtemp:()=>bd,mkdtempSync:()=>gf,mount:()=>jr,open:()=>Bf,openSync:()=>Ku,opendir:()=>_d,opendirSync:()=>Ef,promises:()=>Xr,read:()=>Hf,readFile:()=>Uf,readFileSync:()=>ps,readSync:()=>ef,readdir:()=>Zf,readdirSync:()=>en,readlink:()=>rd,readlinkSync:()=>cf,readv:()=>wd,readvSync:()=>Sf,realpath:()=>cd,realpathSync:()=>tn,rename:()=>Pf,renameSync:()=>$u,rm:()=>md,rmSync:()=>bf,rmdir:()=>Jf,rmdirSync:()=>of,stat:()=>Lf,statSync:()=>ds,symlink:()=>td,symlinkSync:()=>lf,truncate:()=>Of,truncateSync:()=>zu,umount:()=>Zi,unlink:()=>Df,unlinkSync:()=>hs,unwatchFile:()=>dd,utimes:()=>ad,utimesSync:()=>pf,watch:()=>hd,watchFile:()=>fd,write:()=>Kf,writeFile:()=>Mf,writeFileSync:()=>ys,writeSync:()=>Zu,writev:()=>Sd,writevSync:()=>_f});var au="/",ht="/";function Qe(r,e){if(typeof r!="string")throw new TypeError(`"${e}" is not a string`)}s(Qe,"validateString");function rs(r,e){let t="",i=0,n=-1,o=0,a="\0";for(let l=0;l<=r.length;++l){if(l<r.length)a=r[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||o===1))if(o===2){if(t.length<2||i!==2||t.at(-1)!=="."||t.at(-2)!=="."){if(t.length>2){let c=t.lastIndexOf("/");c===-1?(t="",i=0):(t=t.slice(0,c),i=t.length-1-t.lastIndexOf("/")),n=l,o=0;continue}else if(t.length!==0){t="",i=0,n=l,o=0;continue}}e&&(t+=t.length>0?"/..":"..",i=2)}else t.length>0?t+="/"+r.slice(n+1,l):t=r.slice(n+1,l),i=l-n-1;n=l,o=0}else a==="."&&o!==-1?++o:o=-1}return t}s(rs,"normalizeString");function Q(...r){let e="",t=!1;for(let i=r.length-1;i>=-1&&!t;i--){let n=i>=0?r[i]:au;Qe(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,t=n[0]==="/")}return e=rs(e,!t),t?`/${e}`:e.length>0?e:"."}s(Q,"resolve");function lu(r){if(Qe(r,"path"),r.length===0)return".";let e=r[0]==="/",t=r.at(-1)==="/";return r=rs(r,!e),r.length===0?e?"/":t?"./":".":(t&&(r+="/"),e?`/${r}`:r)}s(lu,"normalize");function Y(...r){if(r.length===0)return".";let e;for(let t=0;t<r.length;++t){let i=r[t];Qe(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":lu(e)}s(Y,"join");function is(r,e){if(Qe(r,"from"),Qe(e,"to"),r===e||(r=Q(r),e=Q(e),r===e))return"";let t=1,i=r.length,n=i-t,o=1,a=e.length-o,l=n<a?n:a,c=-1,u=0;for(;u<l;u++){let d=r[t+u];if(d!==e[o+u])break;d==="/"&&(c=u)}if(u===l)if(a>l){if(e[o+u]==="/")return e.slice(o+u+1);if(u===0)return e.slice(o+u)}else n>l&&(r[t+u]==="/"?c=u:u===0&&(c=0));let h="";for(u=t+c+1;u<=i;++u)(u===i||r[u]==="/")&&(h+=h.length===0?"..":"/..");return`${h}${e.slice(o+c)}`}s(is,"relative");function N(r){if(Qe(r,"path"),r.length===0)return".";let e=r[0]==="/",t=-1,i=!0;for(let n=r.length-1;n>=1;--n)if(r[n]==="/"){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":r.slice(0,t)}s(N,"dirname");function ne(r,e){e!==void 0&&Qe(e,"ext"),Qe(r,"path");let t=0,i=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e===r)return"";let o=e.length-1,a=-1;for(let l=r.length-1;l>=0;--l)if(r[l]==="/"){if(!n){t=l+1;break}}else a===-1&&(n=!1,a=l+1),o>=0&&(r[l]===e[o]?--o===-1&&(i=l):(o=-1,i=a));return t===i?i=a:i===-1&&(i=r.length),r.slice(t,i)}for(let o=r.length-1;o>=0;--o)if(r[o]==="/"){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":r.slice(t,i)}s(ne,"basename");function ns(r,e,t,i){i.existsSync(r,t)||(ns(N(r),e,t,i),i.mkdirSync(r,e,t))}s(ns,"mkdirpSync");function Ir(r,e,t,i,n){return Math.min(r+1,e+1,t+1,i===n?e:e+1)}s(Ir,"_min");function cu(r,e){if(r===e)return 0;r.length>e.length&&([r,e]=[e,r]);let t=r.length,i=e.length;for(;t>0&&r.charCodeAt(t-1)===e.charCodeAt(i-1);)t--,i--;let n=0;for(;n<t&&r.charCodeAt(n)===e.charCodeAt(n);)n++;if(t-=n,i-=n,t===0||i===1)return i;let o=new Array(t<<1);for(let b=0;b<t;)o[t+b]=r.charCodeAt(n+b),o[b]=++b;let a,l,c,u,h;for(a=0;a+3<i;){let b=e.charCodeAt(n+(l=a)),m=e.charCodeAt(n+(c=a+1)),g=e.charCodeAt(n+(u=a+2)),y=e.charCodeAt(n+(h=a+3)),v=a+=4;for(let S=0;S<t;){let C=o[t+S],B=o[S];l=Ir(B,l,c,b,C),c=Ir(l,c,u,m,C),u=Ir(c,u,h,g,C),v=Ir(u,h,v,y,C),o[S++]=v,h=u,u=c,c=l,l=B}}let d=0;for(;a<i;){let b=e.charCodeAt(n+(l=a));d=++a;for(let m=0;m<t;m++){let g=o[m];o[m]=d=g<l||d<l?g>d?d+1:g+1:b===o[t+m]?l:l+1,l=g}}return d}s(cu,"levenshtein");async function Yi(r,e){let t=r.Options,i=r.Name,n=0,o=!1,a=!1;for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)){let c=t[l],u=e&&e[l];if(u==null){if(!c.optional){let h=Object.keys(e).filter(d=>!(d in t)).map(d=>({str:d,distance:cu(l,d)})).filter(d=>d.distance<5).sort((d,b)=>d.distance-b.distance);if(o)return;throw o=!0,new f(22,`[${i}] Required option '${l}' not provided.${h.length>0?` You provided unrecognized option '${h[0].str}'; perhaps you meant to type '${l}'.`:""}
Option description: ${c.description}`)}}else{let h=!1;if(Array.isArray(c.type)?h=c.type.indexOf(typeof u)!==-1:h=typeof u===c.type,h){if(c.validator){n++;try{await c.validator(u)}catch(d){if(!o){if(d)throw o=!0,d;if(n--,n===0&&a)return}}}}else{if(o)return;throw o=!0,new f(22,`[${i}] Value provided for option ${l} is not the proper type. Expected ${Array.isArray(c.type)?`one of {${c.type.join(", ")}}`:c.type}, but received ${typeof u}
Option description: ${c.description}`)}}}a=!0}s(Yi,"checkOptions");function uu(r){return new Promise(e=>{setTimeout(e,r)})}s(uu,"wait");function fu(r){return function(...e){return new Promise((t,i)=>{e.push((n,...o)=>{n?i(n):t(o[0])}),r(...e)})}}s(fu,"toPromise");var du=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:r=>setTimeout(r,0),pe="/";function x(r,e="utf8"){let t=r||"";switch(e){default:case"utf8":case"utf-8":return new TextEncoder().encode(t);case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return new Uint8Array(Uint16Array.from(t.split(""),i=>i.charCodeAt(0)).buffer);case"ascii":case"latin1":case"binary":return Uint8Array.from(t.split(""),i=>i.charCodeAt(0));case"hex":return Uint8Array.from(t.match(/../g),i=>parseInt(i,16));case"base64":case"base64url":return t=t.replaceAll("-","+").replaceAll("_","/"),Uint8Array.from(atob(t).split(""),i=>i.charCodeAt(0))}}s(x,"encode");function X(r,e="utf8"){if(!r||!r.byteLength)return"";let t=new Uint8Array("buffer"in r?r.buffer:r);switch(e){default:case"utf8":case"utf-8":return new TextDecoder("utf-8").decode(t);case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return new TextDecoder("utf-16le").decode(t);case"ascii":return new TextDecoder("utf-8").decode(t.map(i=>i&127));case"latin1":case"binary":return new TextDecoder("utf-16").decode(new Uint8Array(Uint16Array.from(t).buffer));case"hex":return Array.from(t,i=>i.toString(16).padStart(2,"0")).join("");case"base64":return btoa(new TextDecoder("utf-16").decode(new Uint8Array(Uint16Array.from(t).buffer)));case"base64url":return btoa(new TextDecoder("utf-16").decode(new Uint8Array(Uint16Array.from(t).buffer))).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}}s(X,"decode");function pt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}s(pt,"randomUUID");var Z=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EIO=5]="EIO",y[y.EBADF=9]="EBADF",y[y.EACCES=13]="EACCES",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.EROFS=30]="EROFS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ENOTSUP=95]="ENOTSUP",y))(Z||{}),Gi={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[39]:"Directory is not empty.",[95]:"Operation is not supported."},f=class extends Error{constructor(t,i=Gi[t],n){super(i);this.syscall="";this.errno=t,this.code=Z[t],this.path=n,this.message=`Error: ${this.code}: ${i}${this.path?`, '${this.path}'`:""}`}static fromJSON(t){let i=new f(t.errno,t.message,t.path);return i.code=t.code,i.stack=t.stack,i}static Derserialize(t,i=0){let n=new DataView("buffer"in t?t.buffer:t),o=X(n.buffer.slice(i+4,i+4+n.getUint32(i,!0)));return f.fromJSON(JSON.parse(o))}static FileError(t,i){return new f(t,Gi[t],i)}static EACCES(t){return this.FileError(13,t)}static ENOENT(t){return this.FileError(2,t)}static EEXIST(t){return this.FileError(17,t)}static EISDIR(t){return this.FileError(21,t)}static ENOTDIR(t){return this.FileError(20,t)}static EPERM(t){return this.FileError(1,t)}static ENOTEMPTY(t){return this.FileError(39,t)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}}serialize(t=new Uint8Array(this.bufferSize()),i=0){let n=new DataView("buffer"in t?t.buffer:t),o=new Uint8Array(n.buffer),a=x(JSON.stringify(this.toJSON()));return o.set(a),n.setUint32(i,a.byteLength,!0),o}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(f,"ApiError");var Xi=class{constructor(e,t,i,n,o,a){this.uid=e;this.gid=t;this.suid=i;this.sgid=n;this.euid=o;this.egid=a}},U=Xi;s(U,"Cred"),U.Root=new Xi(0,0,0,0,0,0);var cr={};Pr(cr,{COPYFILE_EXCL:()=>yu,COPYFILE_FICLONE:()=>mu,COPYFILE_FICLONE_FORCE:()=>bu,F_OK:()=>hu,O_APPEND:()=>Rt,O_CREAT:()=>ke,O_DIRECT:()=>vu,O_DIRECTORY:()=>wu,O_DSYNC:()=>Eu,O_EXCL:()=>It,O_NOATIME:()=>Su,O_NOCTTY:()=>gu,O_NOFOLLOW:()=>_u,O_NONBLOCK:()=>ku,O_RDONLY:()=>Lr,O_RDWR:()=>et,O_SYMLINK:()=>xu,O_SYNC:()=>Rr,O_TRUNC:()=>Lt,O_WRONLY:()=>Pt,R_OK:()=>Ue,S_IFBLK:()=>Fu,S_IFCHR:()=>Au,S_IFDIR:()=>Dr,S_IFIFO:()=>Tu,S_IFLNK:()=>Br,S_IFMT:()=>ee,S_IFREG:()=>Or,S_IFSOCK:()=>Cu,S_IRGRP:()=>Ou,S_IROTH:()=>Mu,S_IRUSR:()=>Pu,S_IRWXG:()=>Ru,S_IRWXO:()=>Uu,S_IRWXU:()=>Nu,S_IWGRP:()=>Du,S_IWOTH:()=>Wu,S_IWUSR:()=>Iu,S_IXGRP:()=>Bu,S_IXOTH:()=>qu,S_IXUSR:()=>Lu,W_OK:()=>Ze,X_OK:()=>pu});var hu=0,Ue=4,Ze=2,pu=1,yu=1,mu=2,bu=4,Lr=0,Pt=1,et=2,ke=64,It=128,gu=256,Lt=512,Rt=1024,wu=65536,Su=262144,_u=131072,Rr=1052672,Eu=4096,xu=32768,vu=16384,ku=2048,ee=61440,Or=32768,Dr=16384,Au=8192,Fu=24576,Tu=4096,Br=40960,Cu=49152,Nu=448,Pu=256,Iu=128,Lu=64,Ru=56,Ou=32,Du=16,Bu=8,Uu=7,Mu=4,Wu=2,qu=1;var R=(i=>(i[i.FILE=32768]="FILE",i[i.DIRECTORY=16384]="DIRECTORY",i[i.SYMLINK=40960]="SYMLINK",i))(R||{}),Ot=class{constructor(e=R.FILE,t=-1,i,n,o,a,l,c,u){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);this.fileData=null;let h=Date.now(),d=s((b,m)=>typeof b==this._typename?b:this._convert(typeof b==this._typename_inverse?b:m),"resolveT");if(this.atimeMs=d(n,h),this.mtimeMs=d(o,h),this.ctimeMs=d(a,h),this.birthtimeMs=d(u,h),this.uid=d(l,0),this.gid=d(c,0),this.size=this._convert(t),i)this.mode=this._convert(i);else switch(e){case R.FILE:this.mode=this._convert(420);break;case R.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(t)/512)),this.mode&61440||(this.mode=this.mode|this._convert(e))}static Deserialize(e){throw new ReferenceError("Called static abstract method: StatsCommon.Deserialize()")}get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}get atime(){return new Date(Number(this.atimeMs))}get mtime(){return new Date(Number(this.mtimeMs))}get ctime(){return new Date(Number(this.ctimeMs))}get birthtime(){return new Date(Number(this.birthtimeMs))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}hasAccess(e,t){if(t.euid===0||t.egid===0)return!0;let i=this.mode&-61441,n=15,o=15,a=15;if(t.euid==this.uid){let u=(3840&i)>>8;n=(e^u)&e}if(t.egid==this.gid){let u=(240&i)>>4;o=(e^u)&e}let l=15&i;return a=(e^l)&e,!(n&o&a)}getCred(e=Number(this.uid),t=Number(this.gid)){return new U(e,t,Number(this.uid),Number(this.gid),e,t)}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,t){e=Number(e),t=Number(t),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(t)&&0<=t&&t<2**32&&(this.gid=this._convert(t))}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}};s(Ot,"StatsCommon");var L=class extends Ot{constructor(){super(...arguments);this._isBigint=!1}static clone(t){return new L(t.mode&61440,t.size,t.mode&-61441,t.atimeMs,t.mtimeMs,t.ctimeMs,t.uid,t.gid,t.birthtimeMs)}static Deserialize(t){let i=new DataView("buffer"in t?t.buffer:t),n=i.getUint32(0,!0),o=i.getUint32(4,!0),a=i.getFloat64(8,!0),l=i.getFloat64(16,!0),c=i.getFloat64(24,!0),u=i.getUint32(32,!0),h=i.getUint32(36,!0);return new L(o&61440,n,o&-61441,a,l,c,u,h)}serialize(){let t=new Uint8Array(32),i=new DataView(t.buffer);return i.setUint32(0,this.size,!0),i.setUint32(4,this.mode,!0),i.setFloat64(8,this.atime.getTime(),!0),i.setFloat64(16,this.mtime.getTime(),!0),i.setFloat64(24,this.ctime.getTime(),!0),i.setUint32(32,this.uid,!0),i.setUint32(36,this.gid,!0),t}};s(L,"Stats");var te=class extends Ot{constructor(){super(...arguments);this._isBigint=!0}static clone(t){return new te(Number(t.mode)&61440,BigInt(t.size),BigInt(t.mode)&BigInt(-61441),BigInt(t.atimeMs),BigInt(t.mtimeMs),BigInt(t.ctimeMs),BigInt(t.uid),BigInt(t.gid),BigInt(t.birthtimeMs))}static Deserialize(t){let i=new DataView("buffer"in t?t.buffer:t),n=i.getBigUint64(0,!0),o=i.getBigUint64(4,!0),a=i.getFloat64(8,!0),l=i.getFloat64(16,!0),c=i.getFloat64(24,!0),u=i.getBigUint64(32,!0),h=i.getBigUint64(36,!0);return new L(Number(o)&61440,n,o&BigInt(-61441),a,l,c,u,h)}serialize(){let t=new Uint8Array(32),i=new DataView(t.buffer);return i.setBigUint64(0,this.size,!0),i.setBigUint64(4,this.mode,!0),i.setFloat64(8,this.atime.getTime(),!0),i.setFloat64(16,this.mtime.getTime(),!0),i.setFloat64(24,this.ctime.getTime(),!0),i.setBigUint64(32,this.uid,!0),i.setBigUint64(36,this.gid,!0),t}};s(te,"BigIntStats");var Mr=(n=>(n[n.NOP=0]="NOP",n[n.THROW_EXCEPTION=1]="THROW_EXCEPTION",n[n.TRUNCATE_FILE=2]="TRUNCATE_FILE",n[n.CREATE_FILE=3]="CREATE_FILE",n))(Mr||{}),tt=class{static getFileFlag(e){return tt.flagCache.has(e)||tt.flagCache.set(e,new tt(e)),tt.flagCache.get(e)}constructor(e){if(typeof e=="number"&&(e=tt.StringFromNumber(e)),tt.validFlagStrs.indexOf(e)<0)throw new f(22,"Invalid flag string: "+e);this.flagStr=e}static StringFromNumber(e){switch(e){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new f(22,"Invalid flag number: "+e)}}getFlagString(){return this.flagStr}getMode(){let e=0;return e<<=1,e+=+this.isReadable(),e<<=1,e+=+this.isWriteable(),e<<=1,e}isReadable(){return this.flagStr.indexOf("r")!==-1||this.flagStr.indexOf("+")!==-1}isWriteable(){return this.flagStr.indexOf("w")!==-1||this.flagStr.indexOf("a")!==-1||this.flagStr.indexOf("+")!==-1}isTruncating(){return this.flagStr.indexOf("w")!==-1}isAppendable(){return this.flagStr.indexOf("a")!==-1}isSynchronous(){return this.flagStr.indexOf("s")!==-1}isExclusive(){return this.flagStr.indexOf("x")!==-1}pathExistsAction(){return this.isExclusive()?1:this.isTruncating()?2:0}pathNotExistsAction(){return(this.isWriteable()||this.isAppendable())&&this.flagStr!=="r+"?3:1}},F=tt;s(F,"FileFlag"),F.flagCache=new Map,F.validFlagStrs=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];var ur=class{async sync(){throw new f(95)}syncSync(){throw new f(95)}async datasync(){return this.sync()}datasyncSync(){return this.syncSync()}async chown(e,t){throw new f(95)}chownSync(e,t){throw new f(95)}async chmod(e){throw new f(95)}chmodSync(e){throw new f(95)}async utimes(e,t){throw new f(95)}utimesSync(e,t){throw new f(95)}};s(ur,"BaseFile");var ue=class extends ur{constructor(t,i,n,o,a){super();this._pos=0;this._dirty=!1;if(this._fs=t,this._path=i,this._flag=n,this._stat=o,this._buffer=a||new Uint8Array(0),this._stat.size!==this._buffer.length&&this._flag.isReadable())throw new Error(`Invalid buffer: Uint8Array is ${this._buffer.length} long, yet Stats object specifies that file is ${this._stat.size} long.`)}getBuffer(){return this._buffer}getStats(){return this._stat}getFlag(){return this._flag}getPath(){return this._path}getPos(){return this._flag.isAppendable()?this._stat.size:this._pos}advancePos(t){return this._pos+=t}setPos(t){return this._pos=t}async sync(){this.syncSync()}syncSync(){throw new f(95)}async close(){this.closeSync()}closeSync(){throw new f(95)}async stat(){return L.clone(this._stat)}statSync(){return L.clone(this._stat)}truncate(t){if(this.truncateSync(t),this._flag.isSynchronous()&&!this._fs.metadata.synchronous)return this.sync()}truncateSync(t){if(this._dirty=!0,!this._flag.isWriteable())throw new f(1,"File not opened with a writeable mode.");if(this._stat.mtimeMs=Date.now(),t>this._buffer.length){let i=new Uint8Array(t-this._buffer.length);this.writeSync(i,0,i.length,this._buffer.length),this._flag.isSynchronous()&&this._fs.metadata.synchronous&&this.syncSync();return}this._stat.size=t,this._buffer=this._buffer.subarray(0,t),this._flag.isSynchronous()&&this._fs.metadata.synchronous&&this.syncSync()}async write(t,i,n,o){return this.writeSync(t,i,n,o)}writeSync(t,i,n,o){if(this._dirty=!0,o==null&&(o=this.getPos()),!this._flag.isWriteable())throw new f(1,"File not opened with a writeable mode.");let a=o+n;if(a>this._stat.size&&(this._stat.size=a,a>this._buffer.length)){let c=new Uint8Array(a);c.set(this._buffer),this._buffer=c}this._buffer.set(t.slice(i,i+n),o);let l=this._buffer.length;return this._stat.mtimeMs=Date.now(),this._flag.isSynchronous()?(this.syncSync(),l):(this.setPos(o+l),n)}async read(t,i,n,o){return{bytesRead:this.readSync(t,i,n,o),buffer:t}}readSync(t,i,n,o){if(!this._flag.isReadable())throw new f(1,"File not opened with a readable mode.");return o==null&&(o=this.getPos()),o+n>this._stat.size&&(n=this._stat.size-o),t.set(this._buffer.slice(i,i+n),o),this._stat.atimeMs=Date.now(),this._pos=o+n,n}async chmod(t){this.chmodSync(t)}chmodSync(t){if(!this._fs.metadata.supportsProperties)throw new f(95);this._dirty=!0,this._stat.chmod(t),this.syncSync()}async chown(t,i){this.chownSync(t,i)}chownSync(t,i){if(!this._fs.metadata.supportsProperties)throw new f(95);this._dirty=!0,this._stat.chown(t,i),this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}};s(ue,"PreloadFile");var Ur=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(Ur,"NoSyncFile");var rt=class{constructor(e){}};s(rt,"FileSystem");var Ji=class extends rt{constructor(t){super();this._ready=Promise.resolve(this)}get metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,supportsLinks:!1,totalSpace:0,freeSpace:0}}whenReady(){return this._ready}async openFile(t,i,n){throw new f(95)}async createFile(t,i,n,o){throw new f(95)}async open(t,i,n,o){try{let a=await this.stat(t,o);switch(i.pathExistsAction()){case 1:throw f.EEXIST(t);case 2:let l=await this.openFile(t,i,o);if(!l)throw new Error("BFS has reached an impossible code path; please file a bug.");return await l.truncate(0),await l.sync(),l;case 0:return this.openFile(t,i,o);default:throw new f(22,"Invalid FileFlag object.")}}catch{switch(i.pathNotExistsAction()){case 3:let l=await this.stat(N(t),o);if(l&&!l.isDirectory())throw f.ENOTDIR(N(t));return this.createFile(t,i,n,o);case 1:throw f.ENOENT(t);default:throw new f(22,"Invalid FileFlag object.")}}}async access(t,i,n){throw new f(95)}accessSync(t,i,n){throw new f(95)}async rename(t,i,n){throw new f(95)}renameSync(t,i,n){throw new f(95)}async stat(t,i){throw new f(95)}statSync(t,i){throw new f(95)}openFileSync(t,i,n){throw new f(95)}createFileSync(t,i,n,o){throw new f(95)}openSync(t,i,n,o){let a;try{a=this.statSync(t,o)}catch{switch(i.pathNotExistsAction()){case 3:if(!this.statSync(N(t),o).isDirectory())throw f.ENOTDIR(N(t));return this.createFileSync(t,i,n,o);case 1:throw f.ENOENT(t);default:throw new f(22,"Invalid FileFlag object.")}}if(!a.hasAccess(n,o))throw f.EACCES(t);switch(i.pathExistsAction()){case 1:throw f.EEXIST(t);case 2:return this.unlinkSync(t,o),this.createFileSync(t,i,a.mode,o);case 0:return this.openFileSync(t,i,o);default:throw new f(22,"Invalid FileFlag object.")}}async unlink(t,i){throw new f(95)}unlinkSync(t,i){throw new f(95)}async rmdir(t,i){throw new f(95)}rmdirSync(t,i){throw new f(95)}async mkdir(t,i,n){throw new f(95)}mkdirSync(t,i,n){throw new f(95)}async readdir(t,i){throw new f(95)}readdirSync(t,i){throw new f(95)}async exists(t,i){try{return await this.stat(t,i),!0}catch{return!1}}existsSync(t,i){try{return this.statSync(t,i),!0}catch{return!1}}async realpath(t,i){if(this.metadata.supportsLinks){let n=t.split(ht);for(let o=0;o<n.length;o++){let a=n.slice(0,o+1);n[o]=Y(...a)}return n.join(ht)}else{if(!await this.exists(t,i))throw f.ENOENT(t);return t}}realpathSync(t,i){if(this.metadata.supportsLinks){let n=t.split(ht);for(let o=0;o<n.length;o++){let a=n.slice(0,o+1);n[o]=Y(...a)}return n.join(ht)}else{if(this.existsSync(t,i))return t;throw f.ENOENT(t)}}async truncate(t,i,n){let o=await this.open(t,F.getFileFlag("r+"),420,n);try{await o.truncate(i)}finally{await o.close()}}truncateSync(t,i,n){let o=this.openSync(t,F.getFileFlag("r+"),420,n);try{o.truncateSync(i)}finally{o.closeSync()}}async readFile(t,i,n){let o=await this.open(t,i,420,n);try{let a=await o.stat(),l=new Uint8Array(a.size);return await o.read(l,0,a.size,0),await o.close(),l}finally{await o.close()}}readFileSync(t,i,n){let o=this.openSync(t,i,420,n);try{let a=o.statSync(),l=new Uint8Array(a.size);return o.readSync(l,0,a.size,0),o.closeSync(),l}finally{o.closeSync()}}async writeFile(t,i,n,o,a){let l=await this.open(t,n,o,a);try{typeof i=="string"&&(i=x(i)),await l.write(i,0,i.length,0)}finally{await l.close()}}writeFileSync(t,i,n,o,a){let l=this.openSync(t,n,o,a);try{typeof i=="string"&&(i=x(i)),l.writeSync(i,0,i.length,0)}finally{l.closeSync()}}async appendFile(t,i,n,o,a){let l=await this.open(t,n,o,a);try{typeof i=="string"&&(i=x(i)),await l.write(i,0,i.length,null)}finally{await l.close()}}appendFileSync(t,i,n,o,a){let l=this.openSync(t,n,o,a);try{typeof i=="string"&&(i=x(i)),l.writeSync(i,0,i.length,null)}finally{l.closeSync()}}async chmod(t,i,n){throw new f(95)}chmodSync(t,i,n){throw new f(95)}async chown(t,i,n,o){throw new f(95)}chownSync(t,i,n,o){throw new f(95)}async utimes(t,i,n,o){throw new f(95)}utimesSync(t,i,n,o){throw new f(95)}async link(t,i,n){throw new f(95)}linkSync(t,i,n){throw new f(95)}async symlink(t,i,n,o){throw new f(95)}symlinkSync(t,i,n,o){throw new f(95)}async readlink(t,i){throw new f(95)}readlinkSync(t,i){throw new f(95)}},ye=Ji;s(ye,"BaseFileSystem"),ye.Name=Ji.name;var it=class extends ye{get metadata(){return{...super.metadata,synchronous:!0}}async access(e,t,i){return this.accessSync(e,t,i)}async rename(e,t,i){return this.renameSync(e,t,i)}async stat(e,t){return this.statSync(e,t)}async open(e,t,i,n){return this.openSync(e,t,i,n)}async unlink(e,t){return this.unlinkSync(e,t)}async rmdir(e,t){return this.rmdirSync(e,t)}async mkdir(e,t,i){return this.mkdirSync(e,t,i)}async readdir(e,t){return this.readdirSync(e,t)}async chmod(e,t,i){return this.chmodSync(e,t,i)}async chown(e,t,i,n){return this.chownSync(e,t,i,n)}async utimes(e,t,i,n){return this.utimesSync(e,t,i,n)}async link(e,t,i){return this.linkSync(e,t,i)}async symlink(e,t,i,n){return this.symlinkSync(e,t,i,n)}async readlink(e,t){return this.readlinkSync(e,t)}};s(it,"SynchronousFileSystem");var ae=class{constructor(e,t,i,n,o,a,l,c){this.id=e;this.size=t;this.mode=i;this.atime=n;this.mtime=o;this.ctime=a;this.uid=l;this.gid=c}static Deserialize(e){let t=new DataView("buffer"in e?e.buffer:e);return new ae(X(t.buffer.slice(38)),t.getUint32(0,!0),t.getUint16(4,!0),t.getFloat64(6,!0),t.getFloat64(14,!0),t.getFloat64(22,!0),t.getUint32(30,!0),t.getUint32(34,!0))}toStats(){return new L((this.mode&61440)===R.DIRECTORY?R.DIRECTORY:R.FILE,this.size,this.mode,this.atime,this.mtime,this.ctime,this.uid,this.gid)}getSize(){return 38+this.id.length}serialize(e=new Uint8Array(this.getSize())){let t=new DataView("buffer"in e?e.buffer:e);t.setUint32(0,this.size,!0),t.setUint16(4,this.mode,!0),t.setFloat64(6,this.atime,!0),t.setFloat64(14,this.mtime,!0),t.setFloat64(22,this.ctime,!0),t.setUint32(30,this.uid,!0),t.setUint32(34,this.gid,!0);let i=new Uint8Array(t.buffer);return i.set(x(this.id),38),i}update(e){let t=!1;this.size!==e.size&&(this.size=e.size,t=!0),this.mode!==e.mode&&(this.mode=e.mode,t=!0);let i=e.atime.getTime();this.atime!==i&&(this.atime=i,t=!0);let n=e.mtime.getTime();this.mtime!==n&&(this.mtime=n,t=!0);let o=e.ctime.getTime();return this.ctime!==o&&(this.ctime=o,t=!0),this.uid!==e.uid&&(this.uid=e.uid,t=!0),this.uid!==e.uid&&(this.uid=e.uid,t=!0),t}isFile(){return(this.mode&61440)===R.FILE}isDirectory(){return(this.mode&61440)===R.DIRECTORY}};s(ae,"Inode");var Dt=class{constructor(e){this.store=e;this.originalData={};this.modifiedKeys=[]}get(e){let t=this.store.get(e);return this.stashOldValue(e,t),t}put(e,t,i){return this.markModified(e),this.store.put(e,t,i)}del(e){this.markModified(e),this.store.del(e)}commit(){}abort(){for(let e of this.modifiedKeys){let t=this.originalData[e];t?this.store.put(e,t,!0):this.store.del(e)}}_has(e){return Object.prototype.hasOwnProperty.call(this.originalData,e)}stashOldValue(e,t){this._has(e)||(this.originalData[e]=t)}markModified(e){this.modifiedKeys.indexOf(e)===-1&&(this.modifiedKeys.push(e),this._has(e)||(this.originalData[e]=this.store.get(e)))}};s(Dt,"SimpleSyncRWTransaction");var Bt=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}syncSync(){this.isDirty()&&(this._fs._syncSync(this.getPath(),this.getBuffer(),this.getStats()),this.resetDirty())}closeSync(){this.syncSync()}};s(Bt,"SyncKeyValueFile");var Ut=class extends it{constructor(t){super();this.store=t.store,this.makeRootDirectory()}static isAvailable(){return!0}getName(){return this.store.name()}isReadOnly(){return!1}supportsSymlinks(){return!1}supportsProps(){return!0}supportsSynch(){return!0}empty(){this.store.clear(),this.makeRootDirectory()}accessSync(t,i,n){let o=this.store.beginTransaction("readonly");if(!this.findINode(o,t).toStats().hasAccess(i,n))throw f.EACCES(t)}renameSync(t,i,n){let o=this.store.beginTransaction("readwrite"),a=N(t),l=ne(t),c=N(i),u=ne(i),h=this.findINode(o,a),d=this.getDirListing(o,a,h);if(!h.toStats().hasAccess(2,n))throw f.EACCES(t);if(!d[l])throw f.ENOENT(t);let b=d[l];if(delete d[l],(c+"/").indexOf(t+"/")===0)throw new f(16,a);let m,g;if(c===a?(m=h,g=d):(m=this.findINode(o,c),g=this.getDirListing(o,c,m)),g[u]){let y=this.getINode(o,i,g[u]);if(y.isFile())try{o.del(y.id),o.del(g[u])}catch(v){throw o.abort(),v}else throw f.EPERM(i)}g[u]=b;try{o.put(h.id,x(JSON.stringify(d)),!0),o.put(m.id,x(JSON.stringify(g)),!0)}catch(y){throw o.abort(),y}o.commit()}statSync(t,i){let n=this.findINode(this.store.beginTransaction("readonly"),t).toStats();if(!n.hasAccess(4,i))throw f.EACCES(t);return n}createFileSync(t,i,n,o){let a=this.store.beginTransaction("readwrite"),l=new Uint8Array(0),c=this.commitNewFile(a,t,R.FILE,n,o,l);return new Bt(this,t,i,c.toStats(),l)}openFileSync(t,i,n){let o=this.store.beginTransaction("readonly"),a=this.findINode(o,t),l=o.get(a.id);if(!a.toStats().hasAccess(i.getMode(),n))throw f.EACCES(t);if(l===void 0)throw f.ENOENT(t);return new Bt(this,t,i,a.toStats(),l)}unlinkSync(t,i){this.removeEntry(t,!1,i)}rmdirSync(t,i){if(this.readdirSync(t,i).length>0)throw f.ENOTEMPTY(t);this.removeEntry(t,!0,i)}mkdirSync(t,i,n){let o=this.store.beginTransaction("readwrite"),a=x("{}");this.commitNewFile(o,t,R.DIRECTORY,i,n,a)}readdirSync(t,i){let n=this.store.beginTransaction("readonly"),o=this.findINode(n,t);if(!o.toStats().hasAccess(4,i))throw f.EACCES(t);return Object.keys(this.getDirListing(n,t,o))}chmodSync(t,i,n){this.openFileSync(t,F.getFileFlag("r+"),n).chmodSync(i)}chownSync(t,i,n,o){this.openFileSync(t,F.getFileFlag("r+"),o).chownSync(i,n)}_syncSync(t,i,n){let o=this.store.beginTransaction("readwrite"),a=this._findINode(o,N(t),ne(t)),l=this.getINode(o,t,a),c=l.update(n);try{o.put(l.id,i,!0),c&&o.put(a,l.serialize(),!0)}catch(u){throw o.abort(),u}o.commit()}makeRootDirectory(){let t=this.store.beginTransaction("readwrite");if(t.get(pe)===void 0){let i=new Date().getTime(),n=new ae(pt(),4096,511|R.DIRECTORY,i,i,i,0,0);t.put(n.id,x("{}"),!1),t.put(pe,n.serialize(),!1),t.commit()}}_findINode(t,i,n,o=new Set){let a=Y(i,n);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);o.add(a);let l=s(c=>{let u=this.getDirListing(t,i,c);if(u[n])return u[n];throw f.ENOENT(Q(i,n))},"readDirectory");return i==="/"?n===""?pe:l(this.getINode(t,i,pe)):l(this.getINode(t,i+ht+n,this._findINode(t,N(i),ne(i),o)))}findINode(t,i){return this.getINode(t,i,this._findINode(t,N(i),ne(i)))}getINode(t,i,n){let o=t.get(n);if(o===void 0)throw f.ENOENT(i);return ae.Deserialize(o)}getDirListing(t,i,n){if(!n.isDirectory())throw f.ENOTDIR(i);let o=t.get(n.id);if(o===void 0)throw f.ENOENT(i);return JSON.parse(X(o))}addNewNode(t,i){let o;for(;0<5;)try{return o=pt(),t.put(o,i,!1),o}catch{}throw new f(5,"Unable to commit data to key-value store.")}commitNewFile(t,i,n,o,a,l){let c=N(i),u=ne(i),h=this.findINode(t,c),d=this.getDirListing(t,c,h),b=new Date().getTime();if(!h.toStats().hasAccess(4,a))throw f.EACCES(i);if(i==="/")throw f.EEXIST(i);if(d[u])throw f.EEXIST(i);let m;try{let g=this.addNewNode(t,l);m=new ae(g,l.length,o|n,b,b,b,a.uid,a.gid);let y=this.addNewNode(t,m.serialize());d[u]=y,t.put(h.id,x(JSON.stringify(d)),!0)}catch(g){throw t.abort(),g}return t.commit(),m}removeEntry(t,i,n){let o=this.store.beginTransaction("readwrite"),a=N(t),l=this.findINode(o,a),c=this.getDirListing(o,a,l),u=ne(t);if(!c[u])throw f.ENOENT(t);let h=c[u],d=this.getINode(o,t,h);if(!d.toStats().hasAccess(2,n))throw f.EACCES(t);if(delete c[u],!i&&d.isDirectory())throw f.EISDIR(t);if(i&&!d.isDirectory())throw f.ENOTDIR(t);try{o.del(d.id),o.del(h),o.put(l.id,x(JSON.stringify(c)),!0)}catch(b){throw o.abort(),b}o.commit()}};s(Ut,"SyncKeyValueFileSystem");function nt(r,e){e=typeof r=="function"?r:e,Yi(this,r);let t=new this(typeof r=="function"?{}:r);if(typeof e!="function")return t.whenReady();t.whenReady().then(i=>e(null,i)).catch(i=>e(i))}s(nt,"CreateBackend");var Wr=class{constructor(){this.store=new Map}name(){return me.Name}clear(){this.store.clear()}beginTransaction(e){return new Dt(this)}get(e){return this.store.get(e)}put(e,t,i){return!i&&this.store.has(e)?!1:(this.store.set(e,t),!0)}del(e){this.store.delete(e)}};s(Wr,"InMemoryStore");var Qi=class extends Ut{constructor(){super({store:new Wr})}},me=Qi;s(me,"InMemoryFileSystem"),me.Name="InMemory",me.Create=nt.bind(Qi),me.Options={};function ss(r){if(typeof r=="number")return r;if(r instanceof Date)return r.getTime()/1e3;throw new Error("Cannot parse time: "+r)}s(ss,"_toUnixTimestamp");function fe(r,e){switch(typeof r){case"number":return r;case"string":let t=parseInt(r,8);return isNaN(t)?e:t;default:return e}}s(fe,"normalizeMode");function le(r){if(r instanceof Date)return r;if(typeof r=="number")return new Date(r*1e3);throw new f(22,"Invalid time.")}s(le,"normalizeTime");function W(r){if(r.indexOf("\0")>=0)throw new f(22,"Path must be a string without null bytes.");if(r==="")throw new f(22,"Path must not be empty.");return r=r.replaceAll(/\/+/g,"/"),Q(r)}s(W,"normalizePath");function ot(r,e,t,i){switch(r===null?"null":typeof r){case"object":return{encoding:typeof r.encoding<"u"?r.encoding:e,flag:typeof r.flag<"u"?r.flag:t,mode:fe(r.mode,i)};case"string":return{encoding:r,flag:t,mode:i};case"null":case"undefined":case"function":return{encoding:e,flag:t,mode:i};default:throw new TypeError(`"options" must be a string or an object, got ${typeof r} instead.`)}}s(ot,"normalizeOptions");function _(){}s(_,"nop");var w=U.Root;function as(r){w=r}s(as,"setCred");var yt=new Map,ju=100;function qr(r){let e=ju++;return yt.set(e,r),e}s(qr,"getFdForFile");function M(r){if(!yt.has(r))throw new f(9,"Invalid file descriptor.");return yt.get(r)}s(M,"fd2file");var _e=new Map;me.Create().then(r=>jr("/",r));function ls(r){return _e.get(r)}s(ls,"getMount");function cs(){return Object.fromEntries(_e.entries())}s(cs,"getMounts");function jr(r,e){if(r[0]!=="/"&&(r="/"+r),r=Q(r),_e.has(r))throw new f(22,"Mount point "+r+" is already in use.");_e.set(r,e)}s(jr,"mount");function Zi(r){if(r[0]!=="/"&&(r=`/${r}`),r=Q(r),!_e.has(r))throw new f(22,"Mount point "+r+" is already unmounted.");_e.delete(r)}s(Zi,"umount");function be(r){let e=[..._e].sort((t,i)=>t[0].length>i[0].length?-1:1);for(let[t,i]of e)if(t.length<=r.length&&r.startsWith(t))return r=r.slice(t.length>1?t.length:0),r===""&&(r="/"),{fs:i,path:r,mountPoint:t};throw new f(5,"BrowserFS not initialized with a file system")}s(be,"resolveFS");function os(r,e){for(let[t,i]of Object.entries(e))r=r?.replaceAll(t,i);return r}s(os,"fixPaths");function st(r,e){return typeof r.stack=="string"&&(r.stack=os(r.stack,e)),r.message=os(r.message,e),r}s(st,"fixError");function us(r){r["/"]&&Zi("/");for(let[e,t]of Object.entries(r)){if(!t.constructor.isAvailable())throw new f(22,`Can not mount "${e}" since the filesystem is unavailable.`);jr(e,t)}}s(us,"initialize");var Xr={};Pr(Xr,{access:()=>Tn,appendFile:()=>an,chmod:()=>vn,chown:()=>En,close:()=>cn,constants:()=>cr,copyFile:()=>Nf,createReadStream:()=>Af,createWriteStream:()=>Ff,exists:()=>Vr,fchmod:()=>yn,fchown:()=>pn,fdatasync:()=>dn,fstat:()=>ln,fsync:()=>fn,ftruncate:()=>un,futimes:()=>mn,lchmod:()=>kn,lchown:()=>xn,link:()=>wn,lstat:()=>nn,lutimes:()=>Fn,mkdir:()=>gn,mkdtemp:()=>Cf,open:()=>sn,read:()=>hn,readFile:()=>Hr,readdir:()=>fr,readlink:()=>_n,realpath:()=>dr,rename:()=>rn,rm:()=>Tf,rmdir:()=>bn,stat:()=>zr,symlink:()=>Sn,truncate:()=>on,unlink:()=>Kr,unwatchFile:()=>vf,utimes:()=>An,watch:()=>kf,watchFile:()=>xf,write:()=>Gr,writeFile:()=>Yr});function q(...[r,e,t,...i]){t=W(t);let{fs:n,path:o}=be(e&&fs(t)?tn(t):t);try{return n[r](o,...i)}catch(a){throw st(a,{[o]:t})}}s(q,"doOp");function $u(r,e){r=W(r),e=W(e);let t=be(r),i=be(e),n={[t.path]:r,[i.path]:e};try{if(t===i)return t.fs.renameSync(t.path,i.path,w);let o=ps(r);ys(e,o),hs(r)}catch(o){throw st(o,n)}}s($u,"renameSync");function fs(r){r=W(r);try{let{fs:e,path:t}=be(r);return e.existsSync(t,w)}catch(e){if(e.errno==2)return!1;throw e}}s(fs,"existsSync");function ds(r,e){let t=q("statSync",!0,r,w);return e?.bigint?te.clone(t):t}s(ds,"statSync");function Vu(r,e){let t=q("statSync",!1,r,w);return e?.bigint?te.clone(t):t}s(Vu,"lstatSync");function zu(r,e=0){if(e<0)throw new f(22);return q("truncateSync",!0,r,e,w)}s(zu,"truncateSync");function hs(r){return q("unlinkSync",!1,r,w)}s(hs,"unlinkSync");function Ku(r,e,t=420){let i=q("openSync",!0,r,F.getFileFlag(e),fe(t,420),w);return qr(i)}s(Ku,"openSync");function ps(r,e={}){let t=ot(e,null,"r",null),i=F.getFileFlag(t.flag);if(!i.isReadable())throw new f(22,"Flag passed to readFile must allow for reading.");let n=q("readFileSync",!0,r,i,w);switch(t.encoding){case"utf8":case"utf-8":return X(n);default:return n}}s(ps,"readFileSync");function ys(r,e,t){let i=ot(t,"utf8","w",420),n=F.getFileFlag(i.flag);if(!n.isWriteable())throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!i.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?x(e):e;return q("writeFileSync",!0,r,o,n,i.mode,w)}s(ys,"writeFileSync");function Hu(r,e,t){let i=ot(t,"utf8","a",420),n=F.getFileFlag(i.flag);if(!n.isAppendable())throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?x(e):e;return q("appendFileSync",!0,r,o,n,i.mode,w)}s(Hu,"appendFileSync");function Yu(r,e){let t=M(r).statSync();return e?.bigint?te.clone(t):t}s(Yu,"fstatSync");function Gu(r){M(r).closeSync(),yt.delete(r)}s(Gu,"closeSync");function Xu(r,e=0){let t=M(r);if(e<0)throw new f(22);t.truncateSync(e)}s(Xu,"ftruncateSync");function Ju(r){M(r).syncSync()}s(Ju,"fsyncSync");function Qu(r){M(r).datasyncSync()}s(Qu,"fdatasyncSync");function Zu(r,e,t,i,n){let o,a=0,l,c;if(typeof e=="string"){c=typeof t=="number"?t:null;let h=typeof i=="string"?i:"utf8";a=0,o=x(e),l=o.length}else o=e,a=t,l=i,c=typeof n=="number"?n:null;let u=M(r);return c==null&&(c=u.getPos()),u.writeSync(o,a,l,c)}s(Zu,"writeSync");function ef(r,e,t,i,n){let o=M(r),a=t;return typeof t=="object"&&({offset:a,length:i,position:n}=t),isNaN(+n)&&(n=o.getPos()),o.readSync(e,a,i,n)}s(ef,"readSync");function tf(r,e,t){M(r).chownSync(e,t)}s(tf,"fchownSync");function rf(r,e){let t=typeof e=="string"?parseInt(e,8):e;M(r).chmodSync(t)}s(rf,"fchmodSync");function nf(r,e,t){M(r).utimesSync(le(e),le(t))}s(nf,"futimesSync");function of(r){return q("rmdirSync",!0,r,w)}s(of,"rmdirSync");function sf(r,e){let t=typeof e=="number"||typeof e=="string"?e:e?.mode,i=typeof e=="object"&&e?.recursive;q("mkdirSync",!0,r,fe(t,511),w)}s(sf,"mkdirSync");function en(r,e){r=W(r);let t=q("readdirSync",!0,r,w);for(let i of _e.keys()){if(!i.startsWith(r))continue;let n=i.slice(r.length);n.includes("/")||n.length==0||t.push(n)}return t.map(i=>typeof e=="object"&&e?.withFileTypes?new at(i,ds(Y(r,i))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?x(i):i)}s(en,"readdirSync");function af(r,e){return e=W(e),q("linkSync",!1,r,e,w)}s(af,"linkSync");function lf(r,e,t){if(!["file","dir","junction"].includes(t))throw new f(22,"Invalid type: "+t);return e=W(e),q("symlinkSync",!1,r,e,t,w)}s(lf,"symlinkSync");function cf(r,e){let t=typeof e=="object"?e.encoding:e,i=q("readlinkSync",!1,r,w);return t==="buffer"?x(i):i}s(cf,"readlinkSync");function uf(r,e,t){q("chownSync",!0,r,e,t,w)}s(uf,"chownSync");function ff(r,e,t){q("chownSync",!1,r,e,t,w)}s(ff,"lchownSync");function df(r,e){let t=fe(e,-1);if(t<0)throw new f(22,"Invalid mode.");q("chmodSync",!0,r,t,w)}s(df,"chmodSync");function hf(r,e){let t=fe(e,-1);if(t<1)throw new f(22,"Invalid mode.");q("chmodSync",!1,r,t,w)}s(hf,"lchmodSync");function pf(r,e,t){q("utimesSync",!0,r,le(e),le(t),w)}s(pf,"utimesSync");function yf(r,e,t){q("utimesSync",!1,r,le(e),le(t),w)}s(yf,"lutimesSync");function tn(r,e){r=W(r);let{fs:t,path:i,mountPoint:n}=be(r);try{if(!t.statSync(i,w).isSymbolicLink())return r;let a=W(n+t.readlinkSync(i,w));return tn(a)}catch(o){throw st(o,{[i]:r})}}s(tn,"realpathSync");function mf(r,e=384){return q("accessSync",!0,r,e,w)}s(mf,"accessSync");function bf(r){throw new f(95)}s(bf,"rmSync");function gf(r,e){throw new f(95)}s(gf,"mkdtempSync");function wf(r,e,t){throw new f(95)}s(wf,"copyFileSync");function Sf(r,e,t){throw new f(95)}s(Sf,"readvSync");function _f(r,e,t){throw new f(95)}s(_f,"writevSync");function Ef(r,e){throw new f(95)}s(Ef,"opendirSync");var at=class{constructor(e,t){this.name=e;this.stats=t}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(at,"Dirent");var $r=class{constructor(e){this.path=e;this.closed=!1}checkClosed(){if(this.closed)throw new f(9,"Can not use closed Dir")}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await fr(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(t=>e(null,t))}readSync(){return this._entries||(this._entries=en(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let t=await e._read();return t!=null?{done:!1,value:t}:(await e.close(),{done:!0,value:void 0})}}}};s($r,"Dir");async function j(...[r,e,t,...i]){t=W(t);let{fs:n,path:o}=be(e&&await Vr(t)?await dr(t):t);try{return n[r](o,...i)}catch(a){throw st(a,{[o]:t})}}s(j,"doOp");async function rn(r,e){r=W(r),e=W(e);let t=be(r),i=be(e),n={[t.path]:r,[i.path]:e};try{if(t===i)return t.fs.rename(t.path,i.path,w);let o=await Hr(r);await Yr(e,o),await Kr(r)}catch(o){throw st(o,n)}}s(rn,"rename");async function Vr(r){r=W(r);try{let{fs:e,path:t}=be(r);return e.exists(t,w)}catch(e){if(e.errno==2)return!1;throw e}}s(Vr,"exists");async function zr(r,e){let t=await j("stat",!0,r,w);return e?.bigint?te.clone(t):t}s(zr,"stat");async function nn(r,e){let t=await j("stat",!1,r,w);return e?.bigint?te.clone(t):t}s(nn,"lstat");async function on(r,e=0){if(e<0)throw new f(22);return j("truncate",!0,r,e,w)}s(on,"truncate");async function Kr(r){return j("unlink",!1,r,w)}s(Kr,"unlink");async function sn(r,e,t=420){let i=await j("open",!0,r,F.getFileFlag(e),fe(t,420),w);return qr(i)}s(sn,"open");async function Hr(r,e={}){let t=ot(e,null,"r",null),i=F.getFileFlag(t.flag);if(!i.isReadable())throw new f(22,"Flag passed to readFile must allow for reading.");let n=await j("readFile",!0,r,i,w);switch(t.encoding){case"utf8":case"utf-8":return X(n);default:return n}}s(Hr,"readFile");async function Yr(r,e,t){let i=ot(t,"utf8","w",420),n=F.getFileFlag(i.flag);if(!n.isWriteable())throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!i.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?x(e):e;return j("writeFile",!0,r,o,n,i.mode,w)}s(Yr,"writeFile");async function an(r,e,t){let i=ot(t,"utf8","a",420),n=F.getFileFlag(i.flag);if(!n.isAppendable())throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?x(e):e;return j("appendFile",!0,r,o,n,i.mode,w)}s(an,"appendFile");async function ln(r,e){let t=await M(r).stat();return e?.bigint?te.clone(t):t}s(ln,"fstat");async function cn(r){await M(r).close(),yt.delete(r)}s(cn,"close");async function un(r,e=0){let t=M(r);if(e<0)throw new f(22);return t.truncate(e)}s(un,"ftruncate");async function fn(r){return M(r).sync()}s(fn,"fsync");async function dn(r){return M(r).datasync()}s(dn,"fdatasync");async function Gr(r,e,t,i,n){let o,a=0,l,c;if(typeof e=="string"){c=typeof t=="number"?t:null;let h=typeof i=="string"?i:"utf8";a=0,o=x(e,h),l=o.length}else o=e,a=t,l=i,c=typeof n=="number"?n:null;let u=M(r);return c==null&&(c=u.getPos()),u.write(o,a,l,c)}s(Gr,"write");async function hn(r,e,t,i,n){let o=M(r);return isNaN(+n)&&(n=o.getPos()),o.read(e,t,i,n)}s(hn,"read");async function pn(r,e,t){return M(r).chown(e,t)}s(pn,"fchown");async function yn(r,e){let t=typeof e=="string"?parseInt(e,8):e;return M(r).chmod(t)}s(yn,"fchmod");async function mn(r,e,t){return M(r).utimes(le(e),le(t))}s(mn,"futimes");async function bn(r){return j("rmdir",!0,r,w)}s(bn,"rmdir");async function gn(r,e){return j("mkdir",!0,r,fe(e,511),w)}s(gn,"mkdir");async function fr(r,e){r=W(r);let t=await j("readdir",!0,r,w),i=[..._e.keys()];for(let o of i)if(o.startsWith(r)){let a=o.slice(r.length);if(a.includes("/")||a.length==0)continue;t.push(a)}let n=[];for(let o of t)n.push(e?.withFileTypes?new at(o,await zr(Y(r,o))):o);return n}s(fr,"readdir");async function wn(r,e){return e=W(e),j("link",!1,r,e,w)}s(wn,"link");async function Sn(r,e,t="file"){if(!["file","dir","junction"].includes(t))throw new f(22,"Invalid type: "+t);return e=W(e),j("symlink",!1,r,e,t,w)}s(Sn,"symlink");async function _n(r,e){let t=typeof e=="object"?e.encoding:e,i=await j("readlink",!1,r,w);return t==="buffer"?x(i):i}s(_n,"readlink");async function En(r,e,t){return j("chown",!0,r,e,t,w)}s(En,"chown");async function xn(r,e,t){return j("chown",!1,r,e,t,w)}s(xn,"lchown");async function vn(r,e){let t=fe(e,-1);if(t<0)throw new f(22,"Invalid mode.");return j("chmod",!0,r,t,w)}s(vn,"chmod");async function kn(r,e){let t=fe(e,-1);if(t<1)throw new f(22,"Invalid mode.");return j("chmod",!1,W(r),t,w)}s(kn,"lchmod");async function An(r,e,t){return j("utimes",!0,r,le(e),le(t),w)}s(An,"utimes");async function Fn(r,e,t){return j("utimes",!1,r,le(e),le(t),w)}s(Fn,"lutimes");async function dr(r,e){r=W(r);let{fs:t,path:i,mountPoint:n}=be(r);try{if(!(await t.stat(i,w)).isSymbolicLink())return r;let a=n+W(await t.readlink(i,w));return dr(a)}catch(o){throw st(o,{[i]:r})}}s(dr,"realpath");async function xf(r,e,t=_){throw new f(95)}s(xf,"watchFile");async function vf(r,e=_){throw new f(95)}s(vf,"unwatchFile");async function kf(r,e,t=_){throw new f(95)}s(kf,"watch");async function Tn(r,e=384){return j("access",!0,r,e,w)}s(Tn,"access");async function Af(r,e){throw new f(95)}s(Af,"createReadStream");async function Ff(r,e){throw new f(95)}s(Ff,"createWriteStream");async function Tf(r){throw new f(95)}s(Tf,"rm");async function Cf(r){throw new f(95)}s(Cf,"mkdtemp");async function Nf(r){throw new f(95)}s(Nf,"copyFile");function Pf(r,e,t=_){rn(r,e).then(()=>t()).catch(t)}s(Pf,"rename");function If(r,e=_){Vr(r).then(e).catch(()=>e(!1))}s(If,"exists");function Lf(r,e,t=_){t=typeof e=="function"?e:t,zr(r,typeof e!="function"?e:{}).then(i=>t(null,i)).catch(t)}s(Lf,"stat");function Rf(r,e,t=_){t=typeof e=="function"?e:t,nn(r,typeof e!="function"?e:{}).then(i=>t(null,i)).catch(t)}s(Rf,"lstat");function Of(r,e=0,t=_){t=typeof e=="function"?e:t,on(r,typeof e=="number"?e:0).then(()=>t()).catch(t)}s(Of,"truncate");function Df(r,e=_){Kr(r).then(()=>e()).catch(e)}s(Df,"unlink");function Bf(r,e,t,i=_){let n=fe(t,420);i=typeof t=="function"?t:i,sn(r,e,n).then(o=>i(null,o)).catch(i)}s(Bf,"open");function Uf(r,e={},t=_){t=typeof e=="function"?e:t,Hr(r,typeof e=="function"?null:e)}s(Uf,"readFile");function Mf(r,e,t={},i=_){i=typeof t=="function"?t:i,Yr(r,e,typeof t=="function"?void 0:t)}s(Mf,"writeFile");function Wf(r,e,t,i=_){i=typeof t=="function"?t:i,an(r,e,typeof t=="function"?null:t)}s(Wf,"appendFile");function qf(r,e,t=_){t=typeof e=="function"?e:t,ln(r,typeof e!="function"?e:{}).then(i=>t(null,i)).catch(t)}s(qf,"fstat");function jf(r,e=_){cn(r).then(()=>e()).catch(e)}s(jf,"close");function $f(r,e,t=_){let i=typeof e=="number"?e:0;t=typeof e=="function"?e:t,un(r,i)}s($f,"ftruncate");function Vf(r,e=_){fn(r).then(()=>e()).catch(e)}s(Vf,"fsync");function zf(r,e=_){dn(r).then(()=>e()).catch(e)}s(zf,"fdatasync");function Kf(r,e,t,i,n,o=_){let a,l,c,u=null,h;if(typeof e=="string"){switch(h="utf8",typeof t){case"function":o=t;break;case"number":u=t,h=typeof i=="string"?i:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof i=="function"?i:typeof n=="function"?n:o,o(new f(22,"Invalid arguments."));return}a=x(e),l=0,c=a.length;let d=o;Gr(r,a,l,c,u).then(b=>d(null,b,X(a))).catch(d)}else{a=e,l=t,c=i,u=typeof n=="number"?n:null;let d=typeof n=="function"?n:o;Gr(r,a,l,c,u).then(b=>d(null,b,a)).catch(d)}}s(Kf,"write");function Hf(r,e,t,i,n,o=_){hn(r,e,t,i,n).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(Hf,"read");function Yf(r,e,t,i=_){pn(r,e,t).then(()=>i()).catch(i)}s(Yf,"fchown");function Gf(r,e,t){yn(r,e).then(()=>t()).catch(t)}s(Gf,"fchmod");function Xf(r,e,t,i=_){mn(r,e,t).then(()=>i()).catch(i)}s(Xf,"futimes");function Jf(r,e=_){bn(r).then(()=>e()).catch(e)}s(Jf,"rmdir");function Qf(r,e,t=_){gn(r,e).then(()=>t()).catch(t)}s(Qf,"mkdir");function Zf(r,e,t=_){t=typeof e=="function"?e:t,fr(r,typeof e!="function"?e:{}).then(n=>t(null,n)).catch(t)}s(Zf,"readdir");function ed(r,e,t=_){wn(r,e).then(()=>t()).catch(t)}s(ed,"link");function td(r,e,t,i=_){let n=typeof t=="string"?t:"file";i=typeof t=="function"?t:i,Sn(r,e,typeof t=="function"?null:t).then(()=>i()).catch(i)}s(td,"symlink");function rd(r,e,t=_){t=typeof e=="function"?e:t,_n(r).then(i=>t(null,i)).catch(t)}s(rd,"readlink");function id(r,e,t,i=_){En(r,e,t).then(()=>i()).catch(i)}s(id,"chown");function nd(r,e,t,i=_){xn(r,e,t).then(()=>i()).catch(i)}s(nd,"lchown");function od(r,e,t=_){vn(r,e).then(()=>t()).catch(t)}s(od,"chmod");function sd(r,e,t=_){kn(r,e).then(()=>t()).catch(t)}s(sd,"lchmod");function ad(r,e,t,i=_){An(r,e,t).then(()=>i()).catch(i)}s(ad,"utimes");function ld(r,e,t,i=_){Fn(r,e,t).then(()=>i()).catch(i)}s(ld,"lutimes");function cd(r,e,t=_){t=typeof e=="function"?e:t,dr(r,typeof e=="function"?null:e).then(i=>t(null,i)).catch(t)}s(cd,"realpath");function ud(r,e,t=_){let i=typeof e=="number"?e:4;t=typeof e=="function"?e:t,Tn(r,typeof e=="function"?null:e).then(()=>t()).catch(t)}s(ud,"access");function fd(r,e,t=_){throw new f(95)}s(fd,"watchFile");function dd(r,e=_){throw new f(95)}s(dd,"unwatchFile");function hd(r,e,t=_){throw new f(95)}s(hd,"watch");function pd(r,e){throw new f(95)}s(pd,"createReadStream");function yd(r,e){throw new f(95)}s(yd,"createWriteStream");function md(r){new f(95)}s(md,"rm");function bd(r){new f(95)}s(bd,"mkdtemp");function gd(r,e,t,i){new f(95)}s(gd,"copyFile");function wd(r){new f(95)}s(wd,"readv");function Sd(r,e,t,i){throw new f(95)}s(Sd,"writev");function _d(r){throw new f(95)}s(_d,"opendir");var Mi=ou(Vc(),1);var Bi=class extends Mi.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(i)}}addListener(t,i){return super.addListener(t,i)}on(t,i){return super.on(t,i)}once(t,i){return super.once(t,i)}prependListener(t,i){return super.prependListener(t,i)}prependOnceListener(t,i){return super.prependOnceListener(t,i)}};s(Bi,"ReadStream");var Ui=class extends Mi.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(i)}}addListener(t,i){return super.addListener(t,i)}on(t,i){return super.on(t,i)}once(t,i){return super.once(t,i)}prependListener(t,i){return super.prependListener(t,i)}prependOnceListener(t,i){return super.prependOnceListener(t,i)}};s(Ui,"WriteStream");var kg=Xo,Wi=kg;var qi=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}syncSync(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())}closeSync(){this.syncSync()}};s(qi,"MirrorFile");var ji=class extends it{constructor({sync:t,async:i}){super();this._queue=[];this._queueRunning=!1;this._isInitialized=!1;this._initializeCallbacks=[];this._sync=t,this._async=i,this._ready=this._initialize()}static isAvailable(){return!0}get metadata(){return{...super.metadata,name:ji.Name,synchronous:!0,supportsProperties:this._sync.metadata.supportsProperties&&this._async.metadata.supportsProperties}}_syncSync(t){let i=t.getStats();this._sync.writeFileSync(t.getPath(),t.getBuffer(),F.getFileFlag("w"),i.mode,i.getCred(0,0)),this.enqueueOp({apiMethod:"writeFile",arguments:[t.getPath(),t.getBuffer(),t.getFlag(),i.mode,i.getCred(0,0)]})}renameSync(t,i,n){this._sync.renameSync(t,i,n),this.enqueueOp({apiMethod:"rename",arguments:[t,i,n]})}statSync(t,i){return this._sync.statSync(t,i)}openSync(t,i,n,o){return this._sync.openSync(t,i,n,o).closeSync(),new qi(this,t,i,this._sync.statSync(t,o),this._sync.readFileSync(t,F.getFileFlag("r"),o))}unlinkSync(t,i){this._sync.unlinkSync(t,i),this.enqueueOp({apiMethod:"unlink",arguments:[t,i]})}rmdirSync(t,i){this._sync.rmdirSync(t,i),this.enqueueOp({apiMethod:"rmdir",arguments:[t,i]})}mkdirSync(t,i,n){this._sync.mkdirSync(t,i,n),this.enqueueOp({apiMethod:"mkdir",arguments:[t,i,n]})}readdirSync(t,i){return this._sync.readdirSync(t,i)}existsSync(t,i){return this._sync.existsSync(t,i)}chmodSync(t,i,n){this._sync.chmodSync(t,i,n),this.enqueueOp({apiMethod:"chmod",arguments:[t,i,n]})}chownSync(t,i,n,o){this._sync.chownSync(t,i,n,o),this.enqueueOp({apiMethod:"chown",arguments:[t,i,n,o]})}utimesSync(t,i,n,o){this._sync.utimesSync(t,i,n,o),this.enqueueOp({apiMethod:"utimes",arguments:[t,i,n,o]})}async _initialize(){if(!this._isInitialized){let t=s(async(o,a)=>{if(o!=="/"){let c=await this._async.stat(o,U.Root);this._sync.mkdirSync(o,a,c.getCred())}let l=await this._async.readdir(o,U.Root);for(let c of l)await n(Y(o,c))},"copyDirectory"),i=s(async(o,a)=>{let l=await this._async.readFile(o,F.getFileFlag("r"),U.Root);this._sync.writeFileSync(o,l,F.getFileFlag("w"),a,U.Root)},"copyFile"),n=s(async o=>{let a=await this._async.stat(o,U.Root);a.isDirectory()?await t(o,a.mode):await i(o,a.mode)},"copyItem");try{await t("/",0),this._isInitialized=!0}catch(o){throw this._isInitialized=!1,o}}return this}enqueueOp(t){if(this._queue.push(t),!this._queueRunning){this._queueRunning=!0;let i=s(n=>{if(n)throw new Error(`WARNING: File system has desynchronized. Received following error: ${n}
$`);if(this._queue.length>0){let o=this._queue.shift();o.arguments.push(i),this._async[o.apiMethod].apply(this._async,o.arguments)}else this._queueRunning=!1},"doNextOp");i()}}},Ye=ji;s(Ye,"AsyncMirror"),Ye.Name="AsyncMirror",Ye.Create=nt.bind(ji),Ye.Options={sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if(!t?.metadata.synchronous)throw new f(22,"'sync' option must be a file system that supports synchronous operations")}},async:{type:"object",description:"The asynchronous file system to mirror."}};var Jo=class extends ye{constructor({folder:t,wrapped:i}){super();this._folder=t,this._wrapped=i,this._ready=this._initialize()}static isAvailable(){return!0}get metadata(){return{...super.metadata,...this._wrapped.metadata,supportsLinks:!1}}async _initialize(){if(!await this._wrapped.exists(this._folder,U.Root)&&this._wrapped.metadata.readonly)throw f.ENOENT(this._folder);return await this._wrapped.mkdir(this._folder,511,U.Root),this}},ve=Jo;s(ve,"FolderAdapter"),ve.Name="FolderAdapter",ve.Create=nt.bind(Jo),ve.Options={folder:{type:"string",description:"The folder to use as the root directory"},wrapped:{type:"object",description:"The file system to wrap"}};function zc(r,e){if(e!==null&&typeof e=="object"){let t=e,i=t.path;i&&(i="/"+is(r,i),t.message=t.message.replace(t.path,i),t.path=i)}return e}s(zc,"translateError");function Ag(r,e){return typeof e=="function"?function(t){arguments.length>0&&(arguments[0]=zc(r,t)),e.apply(null,arguments)}:e}s(Ag,"wrapCallback");function Kc(r,e,t){return r.slice(r.length-4)!=="Sync"?function(){return arguments.length>0&&(e&&(arguments[0]=Y(this._folder,arguments[0])),t&&(arguments[1]=Y(this._folder,arguments[1])),arguments[arguments.length-1]=Ag(this._folder,arguments[arguments.length-1])),this._wrapped[r].apply(this._wrapped,arguments)}:function(){try{return e&&(arguments[0]=Y(this._folder,arguments[0])),t&&(arguments[1]=Y(this._folder,arguments[1])),this._wrapped[r].apply(this._wrapped,arguments)}catch(i){throw zc(this._folder,i)}}}s(Kc,"wrapFunction");["diskSpace","stat","statSync","open","openSync","unlink","unlinkSync","rmdir","rmdirSync","mkdir","mkdirSync","readdir","readdirSync","exists","existsSync","realpath","realpathSync","truncate","truncateSync","readFile","readFileSync","writeFile","writeFileSync","appendFile","appendFileSync","chmod","chmodSync","chown","chownSync","utimes","utimesSync","readlink","readlinkSync"].forEach(r=>{ve.prototype[r]=Kc(r,!0,!1)});["rename","renameSync","link","linkSync","symlink","symlinkSync"].forEach(r=>{ve.prototype[r]=Kc(r,!0,!0)});var nr=class{constructor(){this._locks=new Map}lock(e){return new Promise(t=>{this._locks.has(e)?this._locks.get(e).push(t):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let t=this._locks.get(e).shift();if(t){setTimeout(t,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(nr,"Mutex");var or=class{constructor(e){this._ready=Promise.resolve(this);this._fs=e,this._mu=new nr}whenReady(){return this._ready}get metadata(){return{...this._fs.metadata,name:"LockedFS<"+this._fs.metadata.name+">"}}get fs(){return this._fs}async rename(e,t,i){await this._mu.lock(e),await this._fs.rename(e,t,i),this._mu.unlock(e)}renameSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.renameSync(e,t,i)}async stat(e,t){await this._mu.lock(e);let i=await this._fs.stat(e,t);return this._mu.unlock(e),i}statSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.statSync(e,t)}async access(e,t,i){await this._mu.lock(e),await this._fs.access(e,t,i),this._mu.unlock(e)}accessSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.accessSync(e,t,i)}async open(e,t,i,n){await this._mu.lock(e);let o=await this._fs.open(e,t,i,n);return this._mu.unlock(e),o}openSync(e,t,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.openSync(e,t,i,n)}async unlink(e,t){await this._mu.lock(e),await this._fs.unlink(e,t),this._mu.unlock(e)}unlinkSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.unlinkSync(e,t)}async rmdir(e,t){await this._mu.lock(e),await this._fs.rmdir(e,t),this._mu.unlock(e)}rmdirSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.rmdirSync(e,t)}async mkdir(e,t,i){await this._mu.lock(e),await this._fs.mkdir(e,t,i),this._mu.unlock(e)}mkdirSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.mkdirSync(e,t,i)}async readdir(e,t){await this._mu.lock(e);let i=await this._fs.readdir(e,t);return this._mu.unlock(e),i}readdirSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.readdirSync(e,t)}async exists(e,t){await this._mu.lock(e);let i=await this._fs.exists(e,t);return this._mu.unlock(e),i}existsSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.existsSync(e,t)}async realpath(e,t){await this._mu.lock(e);let i=await this._fs.realpath(e,t);return this._mu.unlock(e),i}realpathSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.realpathSync(e,t)}async truncate(e,t,i){await this._mu.lock(e),await this._fs.truncate(e,t,i),this._mu.unlock(e)}truncateSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.truncateSync(e,t,i)}async readFile(e,t,i){await this._mu.lock(e);let n=await this._fs.readFile(e,t,i);return this._mu.unlock(e),n}readFileSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.readFileSync(e,t,i)}async writeFile(e,t,i,n,o){await this._mu.lock(e),await this._fs.writeFile(e,t,i,n,o),this._mu.unlock(e)}writeFileSync(e,t,i,n,o){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.writeFileSync(e,t,i,n,o)}async appendFile(e,t,i,n,o){await this._mu.lock(e),await this._fs.appendFile(e,t,i,n,o),this._mu.unlock(e)}appendFileSync(e,t,i,n,o){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.appendFileSync(e,t,i,n,o)}async chmod(e,t,i){await this._mu.lock(e),await this._fs.chmod(e,t,i),this._mu.unlock(e)}chmodSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.chmodSync(e,t,i)}async chown(e,t,i,n){await this._mu.lock(e),await this._fs.chown(e,t,i,n),this._mu.unlock(e)}chownSync(e,t,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.chownSync(e,t,i,n)}async utimes(e,t,i,n){await this._mu.lock(e),await this._fs.utimes(e,t,i,n),this._mu.unlock(e)}utimesSync(e,t,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.utimesSync(e,t,i,n)}async link(e,t,i){await this._mu.lock(e),await this._fs.link(e,t,i),this._mu.unlock(e)}linkSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.linkSync(e,t,i)}async symlink(e,t,i,n){await this._mu.lock(e),await this._fs.symlink(e,t,i,n),this._mu.unlock(e)}symlinkSync(e,t,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.symlinkSync(e,t,i,n)}async readlink(e,t){await this._mu.lock(e);let i=await this._fs.readlink(e,t);return this._mu.unlock(e),i}readlinkSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.readlinkSync(e,t)}};s(or,"LockedFS");var Ge="/.deletedFiles.log";function Hc(r){return 146|r}s(Hc,"makeModeWritable");function de(r){return F.getFileFlag(r)}s(de,"getFlag");var Fr=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}async sync(){this.isDirty()&&(await this._fs._syncAsync(this),this.resetDirty())}syncSync(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};s(Fr,"OverlayFile");var Tr=class extends ye{constructor({writable:t,readable:i}){super();this._isInitialized=!1;this._deletedFiles={};this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;this._deleteLogError=null;if(this._writable=t,this._readable=i,this._writable.metadata.readonly)throw new f(22,"Writable file system must be writable.")}static isAvailable(){return!0}get metadata(){return{...super.metadata,name:De.Name,synchronous:this._readable.metadata.synchronous&&this._writable.metadata.synchronous,supportsProperties:this._readable.metadata.supportsProperties&&this._writable.metadata.supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async _syncAsync(t){let i=t.getStats();return await this.createParentDirectoriesAsync(t.getPath(),i.getCred(0,0)),this._writable.writeFile(t.getPath(),t.getBuffer(),de("w"),i.mode,i.getCred(0,0))}_syncSync(t){let i=t.getStats();this.createParentDirectories(t.getPath(),i.getCred(0,0)),this._writable.writeFileSync(t.getPath(),t.getBuffer(),de("w"),i.mode,i.getCred(0,0))}async _initialize(){if(!this._isInitialized){try{let t=await this._writable.readFile(Ge,de("r"),U.Root);this._deleteLog=X(t)}catch(t){if(t.errno!==2)throw t}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(t,i){this._deleteLog=t,this._reparseDeletionLog(),this.updateLog("",i)}async rename(t,i,n){if(this.checkInitialized(),this.checkPath(t),this.checkPath(i),t===Ge||i===Ge)throw f.EPERM("Cannot rename deletion log.");let o=await this.stat(t,n);if(o.isDirectory()){if(t===i)return;let a=511;if(await this.exists(i,n)){let l=await this.stat(i,n);if(a=l.mode,l.isDirectory()){if((await this.readdir(i,n)).length>0)throw f.ENOTEMPTY(i)}else throw f.ENOTDIR(i)}if(await this._writable.exists(t,n)?await this._writable.rename(t,i,n):await this._writable.exists(i,n)||await this._writable.mkdir(i,a,n),await this._readable.exists(t,n))for(let l of await this._readable.readdir(t,n))await this.rename(Q(t,l),Q(i,l),n)}else{if(await this.exists(i,n)&&(await this.stat(i,n)).isDirectory())throw f.EISDIR(i);await this.writeFile(i,await this.readFile(t,de("r"),n),de("w"),o.mode,n)}t!==i&&await this.exists(t,n)&&await this.unlink(t,n)}renameSync(t,i,n){if(this.checkInitialized(),this.checkPath(t),this.checkPath(i),t===Ge||i===Ge)throw f.EPERM("Cannot rename deletion log.");let o=this.statSync(t,n);if(o.isDirectory()){if(t===i)return;let a=511;if(this.existsSync(i,n)){let l=this.statSync(i,n);if(a=l.mode,l.isDirectory()){if(this.readdirSync(i,n).length>0)throw f.ENOTEMPTY(i)}else throw f.ENOTDIR(i)}this._writable.existsSync(t,n)?this._writable.renameSync(t,i,n):this._writable.existsSync(i,n)||this._writable.mkdirSync(i,a,n),this._readable.existsSync(t,n)&&this._readable.readdirSync(t,n).forEach(l=>{this.renameSync(Q(t,l),Q(i,l),n)})}else{if(this.existsSync(i,n)&&this.statSync(i,n).isDirectory())throw f.EISDIR(i);this.writeFileSync(i,this.readFileSync(t,de("r"),n),de("w"),o.mode,n)}t!==i&&this.existsSync(t,n)&&this.unlinkSync(t,n)}async stat(t,i){this.checkInitialized();try{return this._writable.stat(t,i)}catch{if(this._deletedFiles[t])throw f.ENOENT(t);let o=L.clone(await this._readable.stat(t,i));return o.mode=Hc(o.mode),o}}statSync(t,i){this.checkInitialized();try{return this._writable.statSync(t,i)}catch{if(this._deletedFiles[t])throw f.ENOENT(t);let o=L.clone(this._readable.statSync(t,i));return o.mode=Hc(o.mode),o}}async open(t,i,n,o){if(this.checkInitialized(),this.checkPath(t),t===Ge)throw f.EPERM("Cannot open deletion log.");if(await this.exists(t,o))switch(i.pathExistsAction()){case 2:return await this.createParentDirectoriesAsync(t,o),this._writable.open(t,i,n,o);case 0:if(await this._writable.exists(t,o))return this._writable.open(t,i,n,o);{let a=await this._readable.readFile(t,de("r"),o),l=L.clone(await this._readable.stat(t,o));return l.mode=n,new Fr(this,t,i,l,a)}default:throw f.EEXIST(t)}else switch(i.pathNotExistsAction()){case 3:return await this.createParentDirectoriesAsync(t,o),this._writable.open(t,i,n,o);default:throw f.ENOENT(t)}}openSync(t,i,n,o){if(this.checkInitialized(),this.checkPath(t),t===Ge)throw f.EPERM("Cannot open deletion log.");if(this.existsSync(t,o))switch(i.pathExistsAction()){case 2:return this.createParentDirectories(t,o),this._writable.openSync(t,i,n,o);case 0:if(this._writable.existsSync(t,o))return this._writable.openSync(t,i,n,o);{let a=this._readable.readFileSync(t,de("r"),o),l=L.clone(this._readable.statSync(t,o));return l.mode=n,new Fr(this,t,i,l,a)}default:throw f.EEXIST(t)}else switch(i.pathNotExistsAction()){case 3:return this.createParentDirectories(t,o),this._writable.openSync(t,i,n,o);default:throw f.ENOENT(t)}}async unlink(t,i){if(this.checkInitialized(),this.checkPath(t),await this.exists(t,i))await this._writable.exists(t,i)&&await this._writable.unlink(t,i),await this.exists(t,i)&&this.deletePath(t,i);else throw f.ENOENT(t)}unlinkSync(t,i){if(this.checkInitialized(),this.checkPath(t),this.existsSync(t,i))this._writable.existsSync(t,i)&&this._writable.unlinkSync(t,i),this.existsSync(t,i)&&this.deletePath(t,i);else throw f.ENOENT(t)}async rmdir(t,i){if(this.checkInitialized(),await this.exists(t,i)){if(await this._writable.exists(t,i)&&await this._writable.rmdir(t,i),await this.exists(t,i)){if((await this.readdir(t,i)).length>0)throw f.ENOTEMPTY(t);this.deletePath(t,i)}}else throw f.ENOENT(t)}rmdirSync(t,i){if(this.checkInitialized(),this.existsSync(t,i)){if(this._writable.existsSync(t,i)&&this._writable.rmdirSync(t,i),this.existsSync(t,i)){if(this.readdirSync(t,i).length>0)throw f.ENOTEMPTY(t);this.deletePath(t,i)}}else throw f.ENOENT(t)}async mkdir(t,i,n){if(this.checkInitialized(),await this.exists(t,n))throw f.EEXIST(t);await this.createParentDirectoriesAsync(t,n),await this._writable.mkdir(t,i,n)}mkdirSync(t,i,n){if(this.checkInitialized(),this.existsSync(t,n))throw f.EEXIST(t);this.createParentDirectories(t,n),this._writable.mkdirSync(t,i,n)}async readdir(t,i){if(this.checkInitialized(),!(await this.stat(t,i)).isDirectory())throw f.ENOTDIR(t);let o=[];try{o=o.concat(await this._writable.readdir(t,i))}catch{}try{o=o.concat((await this._readable.readdir(t,i)).filter(l=>!this._deletedFiles[`${t}/${l}`]))}catch{}let a={};return o.filter(l=>{let c=!a[l];return a[l]=!0,c})}readdirSync(t,i){if(this.checkInitialized(),!this.statSync(t,i).isDirectory())throw f.ENOTDIR(t);let o=[];try{o=o.concat(this._writable.readdirSync(t,i))}catch{}try{o=o.concat(this._readable.readdirSync(t,i).filter(l=>!this._deletedFiles[`${t}/${l}`]))}catch{}let a={};return o.filter(l=>{let c=!a[l];return a[l]=!0,c})}async exists(t,i){return this.checkInitialized(),await this._writable.exists(t,i)||await this._readable.exists(t,i)&&this._deletedFiles[t]!==!0}existsSync(t,i){return this.checkInitialized(),this._writable.existsSync(t,i)||this._readable.existsSync(t,i)&&this._deletedFiles[t]!==!0}async chmod(t,i,n){this.checkInitialized(),await this.operateOnWritableAsync(t,n),await this._writable.chmod(t,i,n)}chmodSync(t,i,n){this.checkInitialized(),this.operateOnWritable(t,n),this._writable.chmodSync(t,i,n)}async chown(t,i,n,o){this.checkInitialized(),await this.operateOnWritableAsync(t,o),await this._writable.chown(t,i,n,o)}chownSync(t,i,n,o){this.checkInitialized(),this.operateOnWritable(t,o),this._writable.chownSync(t,i,n,o)}async utimes(t,i,n,o){this.checkInitialized(),await this.operateOnWritableAsync(t,o),await this._writable.utimes(t,i,n,o)}utimesSync(t,i,n,o){this.checkInitialized(),this.operateOnWritable(t,o),this._writable.utimesSync(t,i,n,o)}deletePath(t,i){this._deletedFiles[t]=!0,this.updateLog(`d${t}
`,i)}updateLog(t,i){this._deleteLog+=t,this._deleteLogUpdatePending?this._deleteLogUpdateNeeded=!0:(this._deleteLogUpdatePending=!0,this._writable.writeFile(Ge,x(this._deleteLog),F.getFileFlag("w"),420,i).then(()=>{this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}).catch(n=>{this._deleteLogError=n}).finally(()=>{this._deleteLogUpdatePending=!1}))}_reparseDeletionLog(){this._deletedFiles={},this._deleteLog.split(`
`).forEach(t=>{this._deletedFiles[t.slice(1)]=t.slice(0,1)==="d"})}checkInitialized(){if(this._isInitialized){if(this._deleteLogError!==null){let t=this._deleteLogError;throw this._deleteLogError=null,t}}else throw new f(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.")}checkPath(t){if(t===Ge)throw f.EPERM(t)}createParentDirectories(t,i){let n=N(t),o=[];for(;!this._writable.existsSync(n,i);)o.push(n),n=N(n);o=o.reverse();for(let a of o)this._writable.mkdirSync(a,this.statSync(a,i).mode,i)}async createParentDirectoriesAsync(t,i){let n=N(t),o=[];for(;!await this._writable.exists(n,i);)o.push(n),n=N(n);o=o.reverse();for(let a of o){let l=await this.stat(a,i);await this._writable.mkdir(a,l.mode,i)}}operateOnWritable(t,i){if(!this.existsSync(t,i))throw f.ENOENT(t);this._writable.existsSync(t,i)||this.copyToWritable(t,i)}async operateOnWritableAsync(t,i){if(!await this.exists(t,i))throw f.ENOENT(t);if(!await this._writable.exists(t,i))return this.copyToWritableAsync(t,i)}copyToWritable(t,i){let n=this.statSync(t,i);n.isDirectory()?this._writable.mkdirSync(t,n.mode,i):this.writeFileSync(t,this._readable.readFileSync(t,de("r"),i),de("w"),n.mode,i)}async copyToWritableAsync(t,i){let n=await this.stat(t,i);n.isDirectory()?await this._writable.mkdir(t,n.mode,i):await this.writeFile(t,await this._readable.readFile(t,de("r"),i),de("w"),n.mode,i)}};s(Tr,"UnlockedOverlayFS");var Qo=class extends or{static isAvailable(){return Tr.isAvailable()}constructor(e){super(new Tr(e)),this._ready=this._initialize()}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}async _initialize(){return await super.fs._initialize(),this}},De=Qo;s(De,"OverlayFS"),De.Name="OverlayFS",De.Create=nt.bind(Qo),De.Options={writable:{type:"object",description:"The file system to write modified files to."},readable:{type:"object",description:"The file system that initially populates this file system."}};var $i={};function Yc(...r){for(let e of r)$i[e.Name]=e}s(Yc,"registerBackend");Yc(Ye,ve,me,De);var Cr=class{constructor(e,t){this.key=e;this.value=t;this.prev=null;this.next=null}};s(Cr,"LRUNode");var Vi=class{constructor(e){this.limit=e;this.size=0;this.map={};this.head=null;this.tail=null}set(e,t){let i=new Cr(e,t);this.map[e]?(this.map[e].value=i.value,this.remove(i.key)):this.size>=this.limit&&(delete this.map[this.tail.key],this.size--,this.tail=this.tail.prev,this.tail.next=null),this.setHead(i)}get(e){if(this.map[e]){let t=this.map[e].value,i=new Cr(e,t);return this.remove(e),this.setHead(i),t}else return null}remove(e){let t=this.map[e];t&&(t.prev!==null?t.prev.next=t.next:this.head=t.next,t.next!==null?t.next.prev=t.prev:this.tail=t.prev,delete this.map[e],this.size--)}removeAll(){this.size=0,this.map={},this.head=null,this.tail=null}setHead(e){e.next=this.head,e.prev=null,this.head!==null&&(this.head.prev=e),this.head=e,this.tail===null&&(this.tail=e),this.size++,this.map[e.key]=e}};s(Vi,"LRUCache");var sr=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}async sync(){this.isDirty()&&(await this._fs._sync(this.getPath(),this.getBuffer(),this.getStats()),this.resetDirty())}async close(){this.sync()}};s(sr,"AsyncKeyValueFile");var zi=class extends ye{constructor(t){super();this._cache=null;t>0&&(this._cache=new Vi(t))}static isAvailable(){return!0}async init(t){this.store=t,await this.makeRootDirectory()}getName(){return this.store.name()}isReadOnly(){return!1}supportsSymlinks(){return!1}supportsProps(){return!0}supportsSynch(){return!1}async empty(){this._cache&&this._cache.removeAll(),await this.store.clear(),await this.makeRootDirectory()}async access(t,i,n){let o=this.store.beginTransaction("readonly"),a=await this.findINode(o,t);if(!a)throw f.ENOENT(t);if(!a.toStats().hasAccess(i,n))throw f.EACCES(t)}async rename(t,i,n){let o=this._cache;this._cache&&(this._cache=null,o.removeAll());try{let a=this.store.beginTransaction("readwrite"),l=N(t),c=ne(t),u=N(i),h=ne(i),d=await this.findINode(a,l),b=await this.getDirListing(a,l,d);if(!d.toStats().hasAccess(2,n))throw f.EACCES(t);if(!b[c])throw f.ENOENT(t);let m=b[c];if(delete b[c],(u+"/").indexOf(t+"/")===0)throw new f(16,l);let g,y;if(u===l?(g=d,y=b):(g=await this.findINode(a,u),y=await this.getDirListing(a,u,g)),y[h]){let v=await this.getINode(a,i,y[h]);if(v.isFile())try{await a.del(v.id),await a.del(y[h])}catch(S){throw await a.abort(),S}else throw f.EPERM(i)}y[h]=m;try{await a.put(d.id,x(JSON.stringify(b)),!0),await a.put(g.id,x(JSON.stringify(y)),!0)}catch(v){throw await a.abort(),v}await a.commit()}finally{o&&(this._cache=o)}}async stat(t,i){let n=this.store.beginTransaction("readonly"),a=(await this.findINode(n,t)).toStats();if(!a.hasAccess(4,i))throw f.EACCES(t);return a}async createFile(t,i,n,o){let a=this.store.beginTransaction("readwrite"),l=new Uint8Array(0),c=await this.commitNewFile(a,t,R.FILE,n,o,l);return new sr(this,t,i,c.toStats(),l)}async openFile(t,i,n){let o=this.store.beginTransaction("readonly"),a=await this.findINode(o,t),l=await o.get(a.id);if(!a.toStats().hasAccess(i.getMode(),n))throw f.EACCES(t);if(l===void 0)throw f.ENOENT(t);return new sr(this,t,i,a.toStats(),l)}async unlink(t,i){return this.removeEntry(t,!1,i)}async rmdir(t,i){if((await this.readdir(t,i)).length>0)throw f.ENOTEMPTY(t);await this.removeEntry(t,!0,i)}async mkdir(t,i,n){let o=this.store.beginTransaction("readwrite"),a=x("{}");await this.commitNewFile(o,t,R.DIRECTORY,i,n,a)}async readdir(t,i){let n=this.store.beginTransaction("readonly"),o=await this.findINode(n,t);if(!o.toStats().hasAccess(4,i))throw f.EACCES(t);return Object.keys(await this.getDirListing(n,t,o))}async chmod(t,i,n){await(await this.openFile(t,F.getFileFlag("r+"),n)).chmod(i)}async chown(t,i,n,o){await(await this.openFile(t,F.getFileFlag("r+"),o)).chown(i,n)}async _sync(t,i,n){let o=this.store.beginTransaction("readwrite"),a=await this._findINode(o,N(t),ne(t)),l=await this.getINode(o,t,a),c=l.update(n);try{await o.put(l.id,i,!0),c&&await o.put(a,l.serialize(),!0)}catch(u){throw await o.abort(),u}await o.commit()}async makeRootDirectory(){let t=this.store.beginTransaction("readwrite");if(await t.get(pe)===void 0){let i=new Date().getTime(),n=new ae(pt(),4096,511|R.DIRECTORY,i,i,i,0,0);await t.put(n.id,x("{}"),!1),await t.put(pe,n.serialize(),!1),await t.commit()}}async _findINode(t,i,n,o=new Set){let a=Y(i,n);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),this._cache){let l=this._cache.get(a);if(l)return l}if(i==="/"){if(n==="")return this._cache&&this._cache.set(a,pe),pe;{let l=await this.getINode(t,i,pe),c=await this.getDirListing(t,i,l);if(c[n]){let u=c[n];return this._cache&&this._cache.set(a,u),u}else throw f.ENOENT(Q(i,n))}}else{let l=await this.findINode(t,i,o),c=await this.getDirListing(t,i,l);if(c[n]){let u=c[n];return this._cache&&this._cache.set(a,u),u}else throw f.ENOENT(Q(i,n))}}async findINode(t,i,n=new Set){let o=await this._findINode(t,N(i),ne(i),n);return this.getINode(t,i,o)}async getINode(t,i,n){let o=await t.get(n);if(!o)throw f.ENOENT(i);return ae.Deserialize(o)}async getDirListing(t,i,n){if(!n.isDirectory())throw f.ENOTDIR(i);let o=await t.get(n.id);try{return JSON.parse(X(o))}catch{throw f.ENOENT(i)}}async addNewNode(t,i){let n=0,o=s(async()=>{if(++n===5)throw new f(5,"Unable to commit data to key-value store.");{let a=pt();return await t.put(a,i,!1)?a:o()}},"reroll");return o()}async commitNewFile(t,i,n,o,a,l){let c=N(i),u=ne(i),h=await this.findINode(t,c),d=await this.getDirListing(t,c,h),b=new Date().getTime();if(!h.toStats().hasAccess(2,a))throw f.EACCES(i);if(i==="/")throw f.EEXIST(i);if(d[u])throw await t.abort(),f.EEXIST(i);try{let m=await this.addNewNode(t,l),g=new ae(m,l.length,o|n,b,b,b,a.uid,a.gid),y=await this.addNewNode(t,g.serialize());return d[u]=y,await t.put(h.id,x(JSON.stringify(d)),!0),await t.commit(),g}catch(m){throw t.abort(),m}}async removeEntry(t,i,n){this._cache&&this._cache.remove(t);let o=this.store.beginTransaction("readwrite"),a=N(t),l=await this.findINode(o,a),c=await this.getDirListing(o,a,l),u=ne(t);if(!c[u])throw f.ENOENT(t);let h=c[u],d=await this.getINode(o,t,h);if(!d.toStats().hasAccess(2,n))throw f.EACCES(t);if(delete c[u],!i&&d.isDirectory())throw f.EISDIR(t);if(i&&!d.isDirectory())throw f.ENOTDIR(t);try{await o.del(d.id),await o.del(h),await o.put(l.id,x(JSON.stringify(c)),!0)}catch(b){throw await o.abort(),b}await o.commit()}};s(zi,"AsyncKeyValueFileSystem");var ar=class{static fromListing(e){let t=new ar,i=new Xe;t._index["/"]=i;let n=[["",e,i]];for(;n.length>0;){let o,a=n.pop(),l=a[0],c=a[1],u=a[2];for(let h in c)if(Object.prototype.hasOwnProperty.call(c,h)){let d=c[h],b=`${l}/${h}`;d?(t._index[b]=o=new Xe,n.push([b,d,o])):o=new Nr(new L(R.FILE,-1,365)),u&&(u._ls[h]=o)}}return t}constructor(){this._index={},this.addPath("/",new Xe)}fileIterator(e){for(let t in this._index)if(Object.prototype.hasOwnProperty.call(this._index,t)){let i=this._index[t],n=i.getListing();for(let o of n){let a=i.getItem(o);Gc(a)&&e(a.getData())}}}addPath(e,t){if(!t)throw new Error("Inode must be specified");if(e[0]!=="/")throw new Error("Path must be absolute, got: "+e);if(Object.prototype.hasOwnProperty.call(this._index,e))return this._index[e]===t;let i=this._split_path(e),n=i[0],o=i[1],a=this._index[n];return a===void 0&&e!=="/"&&(a=new Xe,!this.addPath(n,a))||e!=="/"&&!a.addItem(o,t)?!1:(Zo(t)&&(this._index[e]=t),!0)}addPathFast(e,t){let i=e.lastIndexOf("/"),n=i===0?"/":e.substring(0,i),o=e.substring(i+1),a=this._index[n];return a===void 0&&(a=new Xe,this.addPathFast(n,a)),a.addItem(o,t)?(t.isDir()&&(this._index[e]=t),!0):!1}removePath(e){let t=this._split_path(e),i=t[0],n=t[1],o=this._index[i];if(o===void 0)return null;let a=o.remItem(n);if(a===null)return null;if(Zo(a)){let l=a.getListing();for(let c of l)this.removePath(e+"/"+c);e!=="/"&&delete this._index[e]}return a}ls(e){let t=this._index[e];return t===void 0?null:t.getListing()}getInode(e){let t=this._split_path(e),i=t[0],n=t[1],o=this._index[i];return o===void 0?null:i===e?o:o.getItem(n)}_split_path(e){let t=N(e),i=e.slice(t.length+(t==="/"?0:1));return[t,i]}};s(ar,"FileIndex");var Nr=class{constructor(e){this.data=e}isFile(){return!0}isDir(){return!1}getData(){return this.data}setData(e){this.data=e}toStats(){return new L(R.FILE,4096,438)}};s(Nr,"IndexFileInode");var Xe=class{constructor(e=null){this.data=e;this._ls={}}isFile(){return!1}isDir(){return!0}getData(){return this.data}getStats(){return new L(R.DIRECTORY,4096,365)}toStats(){return this.getStats()}getListing(){return Object.keys(this._ls)}getItem(e){let t=this._ls[e];return t||null}addItem(e,t){return e in this._ls?!1:(this._ls[e]=t,!0)}remItem(e){let t=this._ls[e];return t===void 0?null:(delete this._ls[e],t)}};s(Xe,"IndexDirInode");function Gc(r){return!!r&&r.isFile()}s(Gc,"isIndexFileInode");function Zo(r){return!!r&&r.isDir()}s(Zo,"isIndexDirInode");function Jc(r,e=0,t=0){return as(new U(e,t,e,t,e,t)),Wi.initialize(r)}s(Jc,"initialize");async function Xc(r){("fs"in r||r instanceof rt)&&(r={"/":r});for(let[e,t]of Object.entries(r))typeof t!="number"&&(t instanceof rt||(typeof t=="string"&&(t={fs:t}),r[e]=await Qc(t)));return Jc(r)}s(Xc,"_configure");function Fg(r,e){if(typeof e!="function")return Xc(r);Xc(r).then(()=>e()).catch(t=>e(t))}s(Fg,"configure");async function es({fs:r,options:e={}}){if(!r)throw new f(1,'Missing "fs" property on configuration object.');if(typeof e!="object"||e===null)throw new f(22,'Invalid "options" property on configuration object.');let t=Object.keys(e).filter(n=>n!="fs");for(let n of t){let o=e[n];if(o===null||typeof o!="object"||!("fs"in o))continue;let a=await es(o);e[n]=a}let i=$i[r];if(i)return i.Create(e);throw new f(1,`File system ${r} is not available in BrowserFS.`)}s(es,"_getFileSystem");function Qc(r,e){if(typeof e!="function")return es(r);es(r).then(t=>e(null,t)).catch(t=>e(t))}s(Qc,"getFileSystem");var Tg=Wi;return su(Cg);})();
/*! Bundled license information:
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
safe-buffer/index.js:
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
*/
(__=>(typeof module === 'object')
&& (typeof exports === 'object')
&& (module?.exports === (exports||''))
? (module.exports = __)
: (typeof define === 'function')
&& define.amd && define(__)
)(globalThis.BrowserFS = BrowserFS)
//# sourceMappingURL=browser-fs-core.min.js.map