@zenfs/core 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backends/backend.d.ts +1 -2
- package/dist/backends/backend.js +0 -6
- package/dist/backends/fetch.d.ts +1 -1
- package/dist/backends/fetch.js +13 -11
- package/dist/backends/locked.d.ts +1 -1
- package/dist/backends/locked.js +34 -34
- package/dist/backends/memory.d.ts +1 -1
- package/dist/backends/port/fs.d.ts +1 -1
- package/dist/backends/port/fs.js +2 -1
- package/dist/backends/port/rpc.js +3 -1
- package/dist/backends/store/fs.d.ts +5 -5
- package/dist/backends/store/fs.js +1 -1
- package/dist/browser.min.js +3 -3
- package/dist/browser.min.js.map +3 -3
- package/dist/config.js +1 -1
- package/dist/emulation/promises.js +1 -2
- package/dist/emulation/sync.js +24 -40
- package/dist/filesystem.d.ts +6 -6
- package/dist/filesystem.js +11 -10
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/mutex.d.ts +1 -1
- package/dist/mutex.js +11 -11
- package/package.json +1 -1
- package/scripts/make-index.js +15 -12
- package/src/backends/backend.ts +3 -8
- package/src/backends/fetch.ts +13 -12
- package/src/backends/locked.ts +34 -34
- package/src/backends/memory.ts +1 -1
- package/src/backends/port/fs.ts +2 -1
- package/src/backends/port/rpc.ts +2 -1
- package/src/backends/store/fs.ts +5 -5
- package/src/config.ts +1 -1
- package/src/emulation/promises.ts +1 -2
- package/src/emulation/sync.ts +23 -41
- package/src/filesystem.ts +18 -17
- package/src/index.ts +2 -0
- package/src/mutex.ts +11 -11
package/dist/browser.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var ZenFS=(()=>{var Ku=Object.create;var ki=Object.defineProperty;var Xu=Object.getOwnPropertyDescriptor;var Ju=Object.getOwnPropertyNames;var Qu=Object.getPrototypeOf,Zu=Object.prototype.hasOwnProperty;var s=(t,e)=>ki(t,"name",{value:e,configurable:!0});var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),yn=(t,e)=>{for(var i in e)ki(t,i,{get:e[i],enumerable:!0})},js=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ju(e))!Zu.call(t,r)&&r!==i&&ki(t,r,{get:()=>e[r],enumerable:!(n=Xu(e,r))||n.enumerable});return t};var Or=(t,e,i)=>(i=t!=null?Ku(Qu(t)):{},js(e||!t||!t.__esModule?ki(i,"default",{value:t,enumerable:!0}):i,t)),ed=t=>js(ki({},"__esModule",{value:!0}),t);var ia=A(Cn=>{"use strict";Cn.byteLength=$d;Cn.toByteArray=zd;Cn.fromByteArray=Gd;var Me=[],ge=[],jd=typeof Uint8Array<"u"?Uint8Array:Array,Yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Tt=0,ea=Yr.length;Tt<ea;++Tt)Me[Tt]=Yr[Tt],ge[Yr.charCodeAt(Tt)]=Tt;var Tt,ea;ge[45]=62;ge[95]=63;function ta(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var n=i===e?0:4-i%4;return[i,n]}s(ta,"getLens");function $d(t){var e=ta(t),i=e[0],n=e[1];return(i+n)*3/4-n}s($d,"byteLength");function Vd(t,e,i){return(e+i)*3/4-i}s(Vd,"_byteLength");function zd(t){var e,i=ta(t),n=i[0],r=i[1],o=new jd(Vd(t,n,r)),a=0,l=r>0?n-4:n,c;for(c=0;c<l;c+=4)e=ge[t.charCodeAt(c)]<<18|ge[t.charCodeAt(c+1)]<<12|ge[t.charCodeAt(c+2)]<<6|ge[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return r===2&&(e=ge[t.charCodeAt(c)]<<2|ge[t.charCodeAt(c+1)]>>4,o[a++]=e&255),r===1&&(e=ge[t.charCodeAt(c)]<<10|ge[t.charCodeAt(c+1)]<<4|ge[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(zd,"toByteArray");function Hd(t){return Me[t>>18&63]+Me[t>>12&63]+Me[t>>6&63]+Me[t&63]}s(Hd,"tripletToBase64");function Yd(t,e,i){for(var n,r=[],o=e;o<i;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),r.push(Hd(n));return r.join("")}s(Yd,"encodeChunk");function Gd(t){for(var e,i=t.length,n=i%3,r=[],o=16383,a=0,l=i-n;a<l;a+=o)r.push(Yd(t,a,a+o>l?l:a+o));return n===1?(e=t[i-1],r.push(Me[e>>2]+Me[e<<4&63]+"==")):n===2&&(e=(t[i-2]<<8)+t[i-1],r.push(Me[e>>10]+Me[e>>4&63]+Me[e<<2&63]+"=")),r.join("")}s(Gd,"fromByteArray")});var na=A(Gr=>{Gr.read=function(t,e,i,n,r){var o,a,l=r*8-n-1,c=(1<<l)-1,u=c>>1,h=-7,d=i?r-1:0,b=i?-1:1,m=t[e+d];for(d+=b,o=m&(1<<-h)-1,m>>=-h,h+=l;h>0;o=o*256+t[e+d],d+=b,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[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,n),o=o-u}return(m?-1:1)*a*Math.pow(2,o-n)};Gr.write=function(t,e,i,n,r,o){var a,l,c,u=o*8-r-1,h=(1<<u)-1,d=h>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,w=n?1:-1,g=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,r),a=a+d):(l=e*Math.pow(2,d-1)*Math.pow(2,r),a=0));r>=8;t[i+m]=l&255,m+=w,l/=256,r-=8);for(a=a<<r|l,u+=r;u>0;t[i+m]=a&255,m+=w,a/=256,u-=8);t[i+m-w]|=g*128}});var Ee=A(ei=>{"use strict";var Kr=ia(),Qt=na(),ra=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ei.Buffer=y;ei.SlowBuffer=eh;ei.INSPECT_MAX_BYTES=50;var Rn=2147483647;ei.kMaxLength=Rn;y.TYPED_ARRAY_SUPPORT=Kd();!y.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 Kd(){try{let t=new Uint8Array(1),e={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Kd,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.buffer},"get")});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function Je(t){if(t>Rn)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(Je,"createBuffer");function y(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Zr(t)}return la(t,e,i)}s(y,"Buffer");y.poolSize=8192;function la(t,e,i){if(typeof t=="string")return Jd(t,e);if(ArrayBuffer.isView(t))return Qd(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(We(t,ArrayBuffer)||t&&We(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(t,SharedArrayBuffer)||t&&We(t.buffer,SharedArrayBuffer)))return Jr(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return y.from(n,e,i);let r=Zd(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return y.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(la,"from");y.from=function(t,e,i){return la(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function ca(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(ca,"assertSize");function Xd(t,e,i){return ca(t),t<=0?Je(t):e!==void 0?typeof i=="string"?Je(t).fill(e,i):Je(t).fill(e):Je(t)}s(Xd,"alloc");y.alloc=function(t,e,i){return Xd(t,e,i)};function Zr(t){return ca(t),Je(t<0?0:eo(t)|0)}s(Zr,"allocUnsafe");y.allocUnsafe=function(t){return Zr(t)};y.allocUnsafeSlow=function(t){return Zr(t)};function Jd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=fa(t,e)|0,n=Je(i),r=n.write(t,e);return r!==i&&(n=n.slice(0,r)),n}s(Jd,"fromString");function Xr(t){let e=t.length<0?0:eo(t.length)|0,i=Je(e);for(let n=0;n<e;n+=1)i[n]=t[n]&255;return i}s(Xr,"fromArrayLike");function Qd(t){if(We(t,Uint8Array)){let e=new Uint8Array(t);return Jr(e.buffer,e.byteOffset,e.byteLength)}return Xr(t)}s(Qd,"fromArrayView");function Jr(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&i===void 0?n=new Uint8Array(t):i===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,i),Object.setPrototypeOf(n,y.prototype),n}s(Jr,"fromArrayBuffer");function Zd(t){if(y.isBuffer(t)){let e=eo(t.length)|0,i=Je(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||io(t.length)?Je(0):Xr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Xr(t.data)}s(Zd,"fromObject");function eo(t){if(t>=Rn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Rn.toString(16)+" bytes");return t|0}s(eo,"checked");function eh(t){return+t!=t&&(t=0),y.alloc(+t)}s(eh,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),We(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let n=e.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==i[o]){n=e[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");y.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");y.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<e.length;++n)i+=e[n].length;let r=y.allocUnsafe(i),o=0;for(n=0;n<e.length;++n){let a=e[n];if(We(a,Uint8Array))o+a.length>r.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(y.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function fa(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||We(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Qr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return wa(t).length;default:if(r)return n?-1:Qr(t).length;e=(""+e).toLowerCase(),r=!0}}s(fa,"byteLength");y.byteLength=fa;function th(t,e,i){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return uh(this,e,i);case"utf8":case"utf-8":return da(this,e,i);case"ascii":return ch(this,e,i);case"latin1":case"binary":return fh(this,e,i);case"base64":return ah(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dh(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s(th,"slowToString");y.prototype._isBuffer=!0;function Ot(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}s(Ot,"swap");y.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 i=0;i<e;i+=2)Ot(this,i,i+1);return this},"swap16");y.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 i=0;i<e;i+=4)Ot(this,i,i+3),Ot(this,i+1,i+2);return this},"swap32");y.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 i=0;i<e;i+=8)Ot(this,i,i+7),Ot(this,i+1,i+6),Ot(this,i+2,i+5),Ot(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?da(this,0,e):th.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},"equals");y.prototype.inspect=s(function(){let e="",i=ei.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");ra&&(y.prototype[ra]=y.prototype.inspect);y.prototype.compare=s(function(e,i,n,r,o){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;let a=o-r,l=n-i,c=Math.min(a,l),u=this.slice(r,o),h=e.slice(i,n);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 ua(t,e,i,n,r){if(t.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,io(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),y.isBuffer(e))return e.length===0?-1:oa(t,e,i,n,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):oa(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(ua,"bidirectionalIndexOf");function oa(t,e,i,n,r){let o=1,a=t.length,l=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(h,d){return o===1?h[d]:h.readUInt16BE(d*o)}s(c,"read");let u;if(r){let h=-1;for(u=i;u<a;u++)if(c(t,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(i+l>a&&(i=a-l),u=i;u>=0;u--){let h=!0;for(let d=0;d<l;d++)if(c(t,u+d)!==c(e,d)){h=!1;break}if(h)return u}return-1}s(oa,"arrayIndexOf");y.prototype.includes=s(function(e,i,n){return this.indexOf(e,i,n)!==-1},"includes");y.prototype.indexOf=s(function(e,i,n){return ua(this,e,i,n,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,n){return ua(this,e,i,n,!1)},"lastIndexOf");function ih(t,e,i,n){i=Number(i)||0;let r=t.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let l=parseInt(e.substr(a*2,2),16);if(io(l))return a;t[i+a]=l}return a}s(ih,"hexWrite");function nh(t,e,i,n){return Ln(Qr(e,t.length-i),t,i,n)}s(nh,"utf8Write");function rh(t,e,i,n){return Ln(mh(e),t,i,n)}s(rh,"asciiWrite");function oh(t,e,i,n){return Ln(wa(e),t,i,n)}s(oh,"base64Write");function sh(t,e,i,n){return Ln(bh(e,t.length-i),t,i,n)}s(sh,"ucs2Write");y.prototype.write=s(function(e,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return ih(this,e,i,n);case"utf8":case"utf-8":return nh(this,e,i,n);case"ascii":case"latin1":case"binary":return rh(this,e,i,n);case"base64":return oh(this,e,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sh(this,e,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function ah(t,e,i){return e===0&&i===t.length?Kr.fromByteArray(t):Kr.fromByteArray(t.slice(e,i))}s(ah,"base64Slice");function da(t,e,i){i=Math.min(t.length,i);let n=[],r=e;for(;r<i;){let o=t[r],a=null,l=o>239?4:o>223?3:o>191?2:1;if(r+l<=i){let c,u,h,d;switch(l){case 1:o<128&&(a=o);break;case 2:c=t[r+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(a=d));break;case 3:c=t[r+1],u=t[r+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=t[r+1],u=t[r+2],h=t[r+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,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=l}return lh(n)}s(da,"utf8Slice");var sa=4096;function lh(t){let e=t.length;if(e<=sa)return String.fromCharCode.apply(String,t);let i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=sa));return i}s(lh,"decodeCodePointsArray");function ch(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]&127);return n}s(ch,"asciiSlice");function fh(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}s(fh,"latin1Slice");function uh(t,e,i){let n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=e;o<i;++o)r+=gh[t[o]];return r}s(uh,"hexSlice");function dh(t,e,i){let n=t.slice(e,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(dh,"utf16leSlice");y.prototype.slice=s(function(e,i){let n=this.length;e=~~e,i=i===void 0?n:~~i,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<e&&(i=e);let r=this.subarray(e,i);return Object.setPrototypeOf(r,y.prototype),r},"slice");function X(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(X,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return r},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e+--i],o=1;for(;i>0&&(o*=256);)r+=this[e+--i]*o;return r},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||X(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||X(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||X(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=ft(s(function(e){e=e>>>0,Zt(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&$i(e,this.length-8);let r=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=ft(s(function(e){e=e>>>0,Zt(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&$i(e,this.length-8);let r=i*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+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");y.prototype.readIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=i,o=1,a=this[e+--r];for(;r>0&&(o*=256);)a+=this[e+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");y.prototype.readInt8=s(function(e,i){return e=e>>>0,i||X(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");y.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||X(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||X(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=ft(s(function(e){e=e>>>0,Zt(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&$i(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=ft(s(function(e){e=e>>>0,Zt(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&$i(e,this.length-8);let r=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),Qt.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),Qt.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),Qt.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),Qt.read(this,e,!1,52,8)},"readDoubleBE");function ae(t,e,i,n,r,o){if(!y.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}s(ae,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=1,a=0;for(this[i]=e&255;++a<n&&(o*=256);)this[i+a]=e/o&255;return i+n},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=n-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+n},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function ha(t,e,i,n,r){ga(e,n,r,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(ha,"wrtBigUInt64LE");function pa(t,e,i,n,r){ga(e,n,r,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(pa,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=ft(s(function(e,i=0){return ha(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=ft(s(function(e,i=0){return pa(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=0,a=1,l=0;for(this[i]=e&255;++o<n&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=n-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntBE");y.prototype.writeInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");y.prototype.writeInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");y.prototype.writeBigInt64LE=ft(s(function(e,i=0){return ha(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=ft(s(function(e,i=0){return pa(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function ya(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(ya,"checkIEEE754");function ma(t,e,i,n,r){return e=+e,i=i>>>0,r||ya(t,e,i,4,34028234663852886e22,-34028234663852886e22),Qt.write(t,e,i,n,23,4),i+4}s(ma,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,n){return ma(this,e,i,!0,n)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,n){return ma(this,e,i,!1,n)},"writeFloatBE");function ba(t,e,i,n,r){return e=+e,i=i>>>0,r||ya(t,e,i,8,17976931348623157e292,-17976931348623157e292),Qt.write(t,e,i,n,52,8),i+8}s(ba,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,n){return ba(this,e,i,!0,n)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,n){return ba(this,e,i,!1,n)},"writeDoubleBE");y.prototype.copy=s(function(e,i,n,r){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=e.length&&(i=e.length),i||(i=0),r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-i<r-n&&(r=e.length-i+n);let o=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),i),o},"copy");y.prototype.fill=s(function(e,i,n,r){if(typeof e=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!y.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(e.length===1){let a=e.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=i;o<n;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,r),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%l]}return this},"fill");var Jt={};function to(t,e,i){Jt[t]=class extends i{static{s(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}s(to,"E");to("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);to("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);to("ERR_OUT_OF_RANGE",function(t,e,i){let n=`The value of "${t}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=aa(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=aa(r)),r+="n"),n+=` It must be ${e}. Received ${r}`,n},RangeError);function aa(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(aa,"addNumericalSeparator");function hh(t,e,i){Zt(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&$i(e,t.length-(i+1))}s(hh,"checkBounds");function ga(t,e,i,n,r,o){if(t>i||t<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 <= ${i}${a}`,new Jt.ERR_OUT_OF_RANGE("value",l,t)}hh(n,r,o)}s(ga,"checkIntBI");function Zt(t,e){if(typeof t!="number")throw new Jt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(Zt,"validateNumber");function $i(t,e,i){throw Math.floor(t)!==t?(Zt(t,i),new Jt.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new Jt.ERR_BUFFER_OUT_OF_BOUNDS:new Jt.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s($i,"boundsError");var ph=/[^+/0-9A-Za-z-_]/g;function yh(t){if(t=t.split("=")[0],t=t.trim().replace(ph,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(yh,"base64clean");function Qr(t,e){e=e||1/0;let i,n=t.length,r=null,o=[];for(let a=0;a<n;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(Qr,"utf8ToBytes");function mh(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(mh,"asciiToBytes");function bh(t,e){let i,n,r,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(bh,"utf16leToBytes");function wa(t){return Kr.toByteArray(yh(t))}s(wa,"base64ToBytes");function Ln(t,e,i,n){let r;for(r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}s(Ln,"blitBuffer");function We(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(We,"isInstance");function io(t){return t!==t}s(io,"numberIsNaN");var gh=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)e[n+r]=t[i]+t[r]}return e}();function ft(t){return typeof BigInt>"u"?wh:t}s(ft,"defineBigIntMethod");function wh(){throw new Error("BigInt not supported")}s(wh,"BufferBigIntNotDefined")});var W=A((y_,Va)=>{"use strict";Va.exports={ArrayIsArray:s(function(t){return Array.isArray(t)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(t,e){return t.includes(e)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(t,e){return t.indexOf(e)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(t,e){return t.join(e)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(t,e){return t.map(e)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(t,e){return t.pop(e)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(t,e){return t.push(e)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(t,e,...i){return t.call(e,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},"FunctionPrototypeSymbolHasInstance"),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:s(function(t,e){return Object.defineProperties(t,e)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(t,e,i){return Object.defineProperty(t,e,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(t,e){return Object.getOwnPropertyDescriptor(t,e)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(t){return Object.keys(t)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(t,e){return Object.setPrototypeOf(t,e)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(t,e){return t.catch(e)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(t,e,i){return t.then(e,i)},"PromisePrototypeThen"),PromiseReject:s(function(t){return Promise.reject(t)},"PromiseReject"),PromiseResolve:s(function(t){return Promise.resolve(t)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(t,e){return t.test(e)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(t){return t.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(t){return t.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(t){return t.trim()},"StringPrototypeTrim"),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:s(function(t,e,i){return t.set(e,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var si=A((b_,jn)=>{"use strict";var{AbortController:za,AbortSignal:xh}=typeof self<"u"?self:typeof window<"u"?window:void 0;jn.exports=za;jn.exports.AbortSignal=xh;jn.exports.default=za});var Xi=A((g_,uo)=>{"use strict";var ai=typeof Reflect=="object"?Reflect:null,Ha=ai&&typeof ai.apply=="function"?ai.apply:s(function(e,i,n){return Function.prototype.apply.call(e,i,n)},"ReflectApply"),$n;ai&&typeof ai.ownKeys=="function"?$n=ai.ownKeys:Object.getOwnPropertySymbols?$n=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):$n=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function kh(t){console&&console.warn&&console.warn(t)}s(kh,"ProcessEmitWarning");var Ga=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function O(){O.init.call(this)}s(O,"EventEmitter");uo.exports=O;uo.exports.once=Ph;O.EventEmitter=O;O.prototype._events=void 0;O.prototype._eventsCount=0;O.prototype._maxListeners=void 0;var Ya=10;function Vn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Vn,"checkListener");Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Ya},"get"),set:s(function(t){if(typeof t!="number"||t<0||Ga(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ya=t},"set")});O.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};O.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Ga(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 Ka(t){return t._maxListeners===void 0?O.defaultMaxListeners:t._maxListeners}s(Ka,"_getMaxListeners");O.prototype.getMaxListeners=s(function(){return Ka(this)},"getMaxListeners");O.prototype.emit=s(function(e){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=e==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[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")Ha(c,this,i);else for(var u=c.length,h=el(c,u),n=0;n<u;++n)Ha(h[n],this,i);return!0},"emit");function Xa(t,e,i,n){var r,o,a;if(Vn(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Ka(t),r>0&&a.length>r&&!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=t,l.type=e,l.count=a.length,kh(l)}return t}s(Xa,"_addListener");O.prototype.addListener=s(function(e,i){return Xa(this,e,i,!1)},"addListener");O.prototype.on=O.prototype.addListener;O.prototype.prependListener=s(function(e,i){return Xa(this,e,i,!0)},"prependListener");function Fh(){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(Fh,"onceWrapper");function Ja(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=Fh.bind(n);return r.listener=i,n.wrapFn=r,r}s(Ja,"_onceWrap");O.prototype.once=s(function(e,i){return Vn(i),this.on(e,Ja(this,e,i)),this},"once");O.prototype.prependOnceListener=s(function(e,i){return Vn(i),this.prependListener(e,Ja(this,e,i)),this},"prependOnceListener");O.prototype.removeListener=s(function(e,i){var n,r,o,a,l;if(Vn(i),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){l=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():vh(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=s(function(e){var i,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(e,i[r]);return this},"removeAllListeners");function Qa(t,e,i){var n=t._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?Ih(r):el(r,r.length)}s(Qa,"_listeners");O.prototype.listeners=s(function(e){return Qa(this,e,!0)},"listeners");O.prototype.rawListeners=s(function(e){return Qa(this,e,!1)},"rawListeners");O.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Za.call(t,e)};O.prototype.listenerCount=Za;function Za(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(Za,"listenerCount");O.prototype.eventNames=s(function(){return this._eventsCount>0?$n(this._events):[]},"eventNames");function el(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}s(el,"arrayClone");function vh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(vh,"spliceOne");function Ih(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(Ih,"unwrapListeners");function Ph(t,e){return new Promise(function(i,n){function r(a){t.removeListener(e,o),n(a)}s(r,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),tl(t,e,o,{once:!0}),e!=="error"&&Ah(t,r,{once:!0})})}s(Ph,"once");function Ah(t,e,i){typeof t.on=="function"&&tl(t,"error",e,i)}s(Ah,"addErrorHandlerIfEventEmitter");function tl(t,e,i,n){if(typeof t.on=="function")n.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function r(o){n.once&&t.removeEventListener(e,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(tl,"eventTargetAgnosticAddListener")});var Z=A((S_,po)=>{"use strict";var Th=Ee(),{kResistStopPropagation:Oh,SymbolDispose:Ch}=W(),Rh=globalThis.AbortSignal||si().AbortSignal,Lh=globalThis.AbortController||si().AbortController,Nh=Object.getPrototypeOf(async function(){}).constructor,il=globalThis.Blob||Th.Blob,Dh=s(typeof il<"u"?function(e){return e instanceof il}:function(e){return!1},"isBlob"),nl=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Bh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),ho=class extends Error{static{s(this,"AggregateError")}constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let n=0;n<e.length;n++)i+=` ${e[n].stack}
|
|
2
|
-
`;super(i),this.name="AggregateError",this.errors=e}};po.exports={AggregateError:ho,kEmptyObject:Object.freeze({}),once:s(function(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},"once"),createDeferredPromise:s(function(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},"createDeferredPromise"),promisify:s(function(t){return new Promise((e,i)=>{t((n,...r)=>n?i(n):e(...r))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(t,...e){return t.replace(/%([sdifj])/g,function(...[i,n]){let r=e.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},"format"),inspect:s(function(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(t){return t instanceof Nh},"isAsyncFunction"),isArrayBufferView:s(function(t){return ArrayBuffer.isView(t)},"isArrayBufferView")},isBlob:Dh,deprecate:s(function(t,e){return t},"deprecate"),addAbortListener:Xi().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);nl(e,"signal"),Bh(i,"listener");let n;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Oh]:!0}),n=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Ch](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Rh.any||s(function(e){if(e.length===1)return e[0];let i=new Lh,n=s(()=>i.abort(),"abort");return e.forEach(r=>{nl(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};po.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ne=A((E_,sl)=>{"use strict";var{format:Mh,inspect:zn,AggregateError:Wh}=Z(),Uh=globalThis.AggregateError||Wh,qh=Symbol("kIsNodeError"),jh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],$h=/^([A-Z][a-z0-9]*)+$/,Vh="__node_internal_",Hn={};function Lt(t,e){if(!t)throw new Hn.ERR_INTERNAL_ASSERTION(e)}s(Lt,"assert");function rl(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(rl,"addNumericalSeparator");function zh(t,e,i){if(typeof e=="function")return Lt(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let n=(e.match(/%[dfijoOs]/g)||[]).length;return Lt(n===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?e:Mh(e,...i)}s(zh,"getMessage");function Q(t,e,i){i||(i=Error);class n extends i{static{s(this,"NodeError")}constructor(...o){super(zh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${t}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[qh]=!0,Hn[t]=n}s(Q,"E");function ol(t){let e=Vh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(ol,"hideStackFrames");function Hh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new Uh([e,t],e.message);return i.code=e.code,i}return t||e}s(Hh,"aggregateTwoErrors");var yo=class extends Error{static{s(this,"AbortError")}constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Hn.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Lt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let c of e)Lt(typeof c=="string","All expected entries have to be of type string"),jh.includes(c)?r.push(c.toLowerCase()):$h.test(c)?o.push(c):(Lt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=r.indexOf("object");c!==-1&&(r.splice(r,c,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let c=r.pop();n+=`one of type ${r.join(", ")}, or ${c}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();n+=`an instance of ${o.join(", ")}, or ${c}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();n+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${i.constructor.name}`;else{let c=zn(i,{depth:-1});n+=`. Received ${c}`}}else{let c=zn(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof i} (${c})`}return n},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let n=zn(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError);Q("ERR_INVALID_RETURN_VALUE",(t,e,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${t} to be returned from the "${e}" function but got ${r}.`},TypeError);Q("ERR_MISSING_ARGS",(...t)=>{Lt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);Q("ERR_OUT_OF_RANGE",(t,e,i)=>{Lt(e,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=rl(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=rl(n)),n+="n"):n=zn(i),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);sl.exports={AbortError:yo,aggregateTwoErrors:ol(Hh),hideStackFrames:ol,codes:Hn}});var ci=A((k_,ml)=>{"use strict";var{ArrayIsArray:bo,ArrayPrototypeIncludes:fl,ArrayPrototypeJoin:ul,ArrayPrototypeMap:Yh,NumberIsInteger:go,NumberIsNaN:Gh,NumberMAX_SAFE_INTEGER:Kh,NumberMIN_SAFE_INTEGER:Xh,NumberParseInt:Jh,ObjectPrototypeHasOwnProperty:Qh,RegExpPrototypeExec:dl,String:Zh,StringPrototypeToUpperCase:ep,StringPrototypeTrim:tp}=W(),{hideStackFrames:Se,codes:{ERR_SOCKET_BAD_PORT:ip,ERR_INVALID_ARG_TYPE:ee,ERR_INVALID_ARG_VALUE:li,ERR_OUT_OF_RANGE:Nt,ERR_UNKNOWN_SIGNAL:al}}=ne(),{normalizeEncoding:np}=Z(),{isAsyncFunction:rp,isArrayBufferView:op}=Z().types,ll={};function sp(t){return t===(t|0)}s(sp,"isInt32");function ap(t){return t===t>>>0}s(ap,"isUint32");var lp=/^[0-7]+$/,cp="must be a 32-bit unsigned integer or an octal string";function fp(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(dl(lp,t)===null)throw new li(e,t,cp);t=Jh(t,8)}return hl(t,e),t}s(fp,"parseFileMode");var up=Se((t,e,i=Xh,n=Kh)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!go(t))throw new Nt(e,"an integer",t);if(t<i||t>n)throw new Nt(e,`>= ${i} && <= ${n}`,t)}),dp=Se((t,e,i=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!go(t))throw new Nt(e,"an integer",t);if(t<i||t>n)throw new Nt(e,`>= ${i} && <= ${n}`,t)}),hl=Se((t,e,i=!1)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!go(t))throw new Nt(e,"an integer",t);let n=i?1:0,r=4294967295;if(t<n||t>r)throw new Nt(e,`>= ${n} && <= ${r}`,t)});function wo(t,e){if(typeof t!="string")throw new ee(e,"string",t)}s(wo,"validateString");function hp(t,e,i=void 0,n){if(typeof t!="number")throw new ee(e,"number",t);if(i!=null&&t<i||n!=null&&t>n||(i!=null||n!=null)&&Gh(t))throw new Nt(e,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}s(hp,"validateNumber");var pp=Se((t,e,i)=>{if(!fl(i,t)){let r="must be one of: "+ul(Yh(i,o=>typeof o=="string"?`'${o}'`:Zh(o)),", ");throw new li(e,t,r)}});function pl(t,e){if(typeof t!="boolean")throw new ee(e,"boolean",t)}s(pl,"validateBoolean");function mo(t,e,i){return t==null||!Qh(t,e)?i:t[e]}s(mo,"getOwnPropertyValueOrDefault");var yp=Se((t,e,i=null)=>{let n=mo(i,"allowArray",!1),r=mo(i,"allowFunction",!1);if(!mo(i,"nullable",!1)&&t===null||!n&&bo(t)||typeof t!="object"&&(!r||typeof t!="function"))throw new ee(e,"Object",t)}),mp=Se((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ee(e,"a dictionary",t)}),Yn=Se((t,e,i=0)=>{if(!bo(t))throw new ee(e,"Array",t);if(t.length<i){let n=`must be longer than ${i}`;throw new li(e,t,n)}});function bp(t,e){Yn(t,e);for(let i=0;i<t.length;i++)wo(t[i],`${e}[${i}]`)}s(bp,"validateStringArray");function gp(t,e){Yn(t,e);for(let i=0;i<t.length;i++)pl(t[i],`${e}[${i}]`)}s(gp,"validateBooleanArray");function wp(t,e){Yn(t,e);for(let i=0;i<t.length;i++){let n=t[i],r=`${e}[${i}]`;if(n==null)throw new ee(r,"AbortSignal",n);yl(n,r)}}s(wp,"validateAbortSignalArray");function Sp(t,e="signal"){if(wo(t,e),ll[t]===void 0)throw ll[ep(t)]!==void 0?new al(t+" (signals must use all capital letters)"):new al(t)}s(Sp,"validateSignalName");var _p=Se((t,e="buffer")=>{if(!op(t))throw new ee(e,["Buffer","TypedArray","DataView"],t)});function Ep(t,e){let i=np(e),n=t.length;if(i==="hex"&&n%2!==0)throw new li("encoding",e,`is invalid for data of length ${n}`)}s(Ep,"validateEncoding");function xp(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&tp(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new ip(e,t,i);return t|0}s(xp,"validatePort");var yl=Se((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ee(e,"AbortSignal",t)}),kp=Se((t,e)=>{if(typeof t!="function")throw new ee(e,"Function",t)}),Fp=Se((t,e)=>{if(typeof t!="function"||rp(t))throw new ee(e,"Function",t)}),vp=Se((t,e)=>{if(t!==void 0)throw new ee(e,"undefined",t)});function Ip(t,e,i){if(!fl(i,t))throw new ee(e,`('${ul(i,"|")}')`,t)}s(Ip,"validateUnion");var Pp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function cl(t,e){if(typeof t>"u"||!dl(Pp,t))throw new li(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(cl,"validateLinkHeaderFormat");function Ap(t){if(typeof t=="string")return cl(t,"hints"),t;if(bo(t)){let e=t.length,i="";if(e===0)return i;for(let n=0;n<e;n++){let r=t[n];cl(r,"hints"),i+=r,n!==e-1&&(i+=", ")}return i}throw new li("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Ap,"validateLinkHeaderValue");ml.exports={isInt32:sp,isUint32:ap,parseFileMode:fp,validateArray:Yn,validateStringArray:bp,validateBooleanArray:gp,validateAbortSignalArray:wp,validateBoolean:pl,validateBuffer:_p,validateDictionary:mp,validateEncoding:Ep,validateFunction:kp,validateInt32:dp,validateInteger:up,validateNumber:hp,validateObject:yp,validateOneOf:pp,validatePlainFunction:Fp,validatePort:xp,validateSignalName:Sp,validateString:wo,validateUint32:hl,validateUndefined:vp,validateUnion:Ip,validateAbortSignal:yl,validateLinkHeaderValue:Ap}});var pt=A((v_,Sl)=>{var j=Sl.exports={},Ue,qe;function So(){throw new Error("setTimeout has not been defined")}s(So,"defaultSetTimout");function _o(){throw new Error("clearTimeout has not been defined")}s(_o,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ue=setTimeout:Ue=So}catch{Ue=So}try{typeof clearTimeout=="function"?qe=clearTimeout:qe=_o}catch{qe=_o}})();function bl(t){if(Ue===setTimeout)return setTimeout(t,0);if((Ue===So||!Ue)&&setTimeout)return Ue=setTimeout,setTimeout(t,0);try{return Ue(t,0)}catch{try{return Ue.call(null,t,0)}catch{return Ue.call(this,t,0)}}}s(bl,"runTimeout");function Tp(t){if(qe===clearTimeout)return clearTimeout(t);if((qe===_o||!qe)&&clearTimeout)return qe=clearTimeout,clearTimeout(t);try{return qe(t)}catch{try{return qe.call(null,t)}catch{return qe.call(this,t)}}}s(Tp,"runClearTimeout");var Ze=[],fi=!1,Dt,Gn=-1;function Op(){!fi||!Dt||(fi=!1,Dt.length?Ze=Dt.concat(Ze):Gn=-1,Ze.length&&gl())}s(Op,"cleanUpNextTick");function gl(){if(!fi){var t=bl(Op);fi=!0;for(var e=Ze.length;e;){for(Dt=Ze,Ze=[];++Gn<e;)Dt&&Dt[Gn].run();Gn=-1,e=Ze.length}Dt=null,fi=!1,Tp(t)}}s(gl,"drainQueue");j.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];Ze.push(new wl(t,e)),Ze.length===1&&!fi&&bl(gl)};function wl(t,e){this.fun=t,this.array=e}s(wl,"Item");wl.prototype.run=function(){this.fun.apply(null,this.array)};j.title="browser";j.browser=!0;j.env={};j.argv=[];j.version="";j.versions={};function et(){}s(et,"noop");j.on=et;j.addListener=et;j.once=et;j.off=et;j.removeListener=et;j.removeAllListeners=et;j.emit=et;j.prependListener=et;j.prependOnceListener=et;j.listeners=function(t){return[]};j.binding=function(t){throw new Error("process.binding is not supported")};j.cwd=function(){return"/"};j.chdir=function(t){throw new Error("process.chdir is not supported")};j.umask=function(){return 0}});var $e=A((P_,Nl)=>{"use strict";var{SymbolAsyncIterator:_l,SymbolIterator:El,SymbolFor:Bt}=W(),xl=Bt("nodejs.stream.destroyed"),kl=Bt("nodejs.stream.errored"),Eo=Bt("nodejs.stream.readable"),xo=Bt("nodejs.stream.writable"),Fl=Bt("nodejs.stream.disturbed"),Cp=Bt("nodejs.webstream.isClosedPromise"),Rp=Bt("nodejs.webstream.controllerErrorFunction");function Kn(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s(Kn,"isReadableNodeStream");function Xn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(Xn,"isWritableNodeStream");function Lp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Lp,"isDuplexNodeStream");function je(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(je,"isNodeStream");function vl(t){return!!(t&&!je(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(vl,"isReadableStream");function Il(t){return!!(t&&!je(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(Il,"isWritableStream");function Pl(t){return!!(t&&!je(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(Pl,"isTransformStream");function Np(t){return vl(t)||Il(t)||Pl(t)}s(Np,"isWebStream");function Dp(t,e){return t==null?!1:e===!0?typeof t[_l]=="function":e===!1?typeof t[El]=="function":typeof t[_l]=="function"||typeof t[El]=="function"}s(Dp,"isIterable");function Jn(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!!(t.destroyed||t[xl]||n!=null&&n.destroyed)}s(Jn,"isDestroyed");function Al(t){if(!Xn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Al,"isWritableEnded");function Bp(t,e){if(!Xn(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(Bp,"isWritableFinished");function Mp(t){if(!Kn(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Mp,"isReadableEnded");function Tl(t,e){if(!Kn(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(Tl,"isReadableFinished");function Ol(t){return t&&t[Eo]!=null?t[Eo]:typeof t?.readable!="boolean"?null:Jn(t)?!1:Kn(t)&&t.readable&&!Tl(t)}s(Ol,"isReadable");function Cl(t){return t&&t[xo]!=null?t[xo]:typeof t?.writable!="boolean"?null:Jn(t)?!1:Xn(t)&&t.writable&&!Al(t)}s(Cl,"isWritable");function Wp(t,e){return je(t)?Jn(t)?!0:!(e?.readable!==!1&&Ol(t)||e?.writable!==!1&&Cl(t)):null}s(Wp,"isFinished");function Up(t){var e,i;return je(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Up,"isWritableErrored");function qp(t){var e,i;return je(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(qp,"isReadableErrored");function jp(t){if(!je(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&Rl(t)?t._closed:null}s(jp,"isClosed");function Rl(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Rl,"isOutgoingMessage");function Ll(t){return typeof t._sent100=="boolean"&&Rl(t)}s(Ll,"isServerResponse");function $p(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s($p,"isServerRequest");function Vp(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!n&&Ll(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(Vp,"willEmitClose");function zp(t){var e;return!!(t&&((e=t[Fl])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(zp,"isDisturbed");function Hp(t){var e,i,n,r,o,a,l,c,u,h;return!!(t&&((e=(i=(n=(r=(o=(a=t[kl])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&r!==void 0?r:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((h=t._writableState)===null||h===void 0)&&h.errored))}s(Hp,"isErrored");Nl.exports={isDestroyed:Jn,kIsDestroyed:xl,isDisturbed:zp,kIsDisturbed:Fl,isErrored:Hp,kIsErrored:kl,isReadable:Ol,kIsReadable:Eo,kIsClosedPromise:Cp,kControllerErrorFunction:Rp,kIsWritable:xo,isClosed:jp,isDuplexNodeStream:Lp,isFinished:Wp,isIterable:Dp,isReadableNodeStream:Kn,isReadableStream:vl,isReadableEnded:Mp,isReadableFinished:Tl,isReadableErrored:qp,isNodeStream:je,isWebStream:Np,isWritable:Cl,isWritableNodeStream:Xn,isWritableStream:Il,isWritableEnded:Al,isWritableFinished:Bp,isWritableErrored:Up,isServerRequest:$p,isServerResponse:Ll,willEmitClose:Vp,isTransformStream:Pl}});var tt=A((T_,Po)=>{var yt=pt(),{AbortError:Vl,codes:Yp}=ne(),{ERR_INVALID_ARG_TYPE:Gp,ERR_STREAM_PREMATURE_CLOSE:Dl}=Yp,{kEmptyObject:Fo,once:vo}=Z(),{validateAbortSignal:Kp,validateFunction:Xp,validateObject:Jp,validateBoolean:Qp}=ci(),{Promise:Zp,PromisePrototypeThen:ey,SymbolDispose:zl}=W(),{isClosed:ty,isReadable:Bl,isReadableNodeStream:ko,isReadableStream:iy,isReadableFinished:Ml,isReadableErrored:Wl,isWritable:Ul,isWritableNodeStream:ql,isWritableStream:ny,isWritableFinished:jl,isWritableErrored:$l,isNodeStream:ry,willEmitClose:oy,kIsClosedPromise:sy}=$e(),ui;function ay(t){return t.setHeader&&typeof t.abort=="function"}s(ay,"isRequest");var Io=s(()=>{},"nop");function Hl(t,e,i){var n,r;if(arguments.length===2?(i=e,e=Fo):e==null?e=Fo:Jp(e,"options"),Xp(i,"callback"),Kp(e.signal,"options.signal"),i=vo(i),iy(t)||ny(t))return ly(t,e,i);if(!ry(t))throw new Gp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:ko(t),a=(r=e.writable)!==null&&r!==void 0?r:ql(t),l=t._writableState,c=t._readableState,u=s(()=>{t.writable||b()},"onlegacyfinish"),h=oy(t)&&ko(t)===o&&ql(t)===a,d=jl(t,!1),b=s(()=>{d=!0,t.destroyed&&(h=!1),!(h&&(!t.readable||o))&&(!o||m)&&i.call(t)},"onfinish"),m=Ml(t,!1),w=s(()=>{m=!0,t.destroyed&&(h=!1),!(h&&(!t.writable||a))&&(!a||d)&&i.call(t)},"onend"),g=s(V=>{i.call(t,V)},"onerror"),I=ty(t),_=s(()=>{I=!0;let V=$l(t)||Wl(t);if(V&&typeof V!="boolean")return i.call(t,V);if(o&&!m&&ko(t,!0)&&!Ml(t,!1))return i.call(t,new Dl);if(a&&!d&&!jl(t,!1))return i.call(t,new Dl);i.call(t)},"onclose"),T=s(()=>{I=!0;let V=$l(t)||Wl(t);if(V&&typeof V!="boolean")return i.call(t,V);i.call(t)},"onclosed"),q=s(()=>{t.req.on("finish",b)},"onrequest");ay(t)?(t.on("complete",b),h||t.on("abort",_),t.req?q():t.on("request",q)):a&&!l&&(t.on("end",u),t.on("close",u)),!h&&typeof t.aborted=="boolean"&&t.on("aborted",_),t.on("end",w),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",_),I?yt.nextTick(_):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?h||yt.nextTick(T):(!o&&(!h||Bl(t))&&(d||Ul(t)===!1)||!a&&(!h||Ul(t))&&(m||Bl(t)===!1)||c&&t.req&&t.aborted)&&yt.nextTick(T);let P=s(()=>{i=Io,t.removeListener("aborted",_),t.removeListener("complete",b),t.removeListener("abort",_),t.removeListener("request",q),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",_)},"cleanup");if(e.signal&&!I){let V=s(()=>{let St=i;P(),St.call(t,new Vl(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)yt.nextTick(V);else{ui=ui||Z().addAbortListener;let St=ui(e.signal,V),de=i;i=vo((...Yt)=>{St[zl](),de.apply(t,Yt)})}}return P}s(Hl,"eos");function ly(t,e,i){let n=!1,r=Io;if(e.signal)if(r=s(()=>{n=!0,i.call(t,new Vl(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)yt.nextTick(r);else{ui=ui||Z().addAbortListener;let a=ui(e.signal,r),l=i;i=vo((...c)=>{a[zl](),l.apply(t,c)})}let o=s((...a)=>{n||yt.nextTick(()=>i.apply(t,a))},"resolverFn");return ey(t[sy].promise,o,o),Io}s(ly,"eosWeb");function cy(t,e){var i;let n=!1;return e===null&&(e=Fo),(i=e)!==null&&i!==void 0&&i.cleanup&&(Qp(e.cleanup,"cleanup"),n=e.cleanup),new Zp((r,o)=>{let a=Hl(t,e,l=>{n&&a(),l?o(l):r()})})}s(cy,"finished");Po.exports=Hl;Po.exports.finished=cy});var Mt=A((C_,ec)=>{"use strict";var Ve=pt(),{aggregateTwoErrors:fy,codes:{ERR_MULTIPLE_CALLBACK:uy},AbortError:dy}=ne(),{Symbol:Kl}=W(),{kIsDestroyed:hy,isDestroyed:py,isFinished:yy,isServerRequest:my}=$e(),Xl=Kl("kDestroy"),Ao=Kl("kConstruct");function Jl(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(Jl,"checkError");function by(t,e){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(Jl(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Yl(this,t,e):this.once(Xl,function(o){Yl(this,fy(o,t),e)}),this)}s(by,"destroy");function Yl(t,e,i){let n=!1;function r(o){if(n)return;n=!0;let a=t._readableState,l=t._writableState;Jl(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ve.nextTick(gy,t,o):Ve.nextTick(Ql,t)}s(r,"onDestroy");try{t._destroy(e||null,r)}catch(o){r(o)}}s(Yl,"_destroy");function gy(t,e){To(t,e),Ql(t)}s(gy,"emitErrorCloseNT");function Ql(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(Ql,"emitCloseNT");function To(t,e){let i=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(To,"emitErrorNT");function wy(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.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(wy,"undestroy");function Oo(t,e,i){let n=t._readableState,r=t._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),n&&!n.errored&&(n.errored=e),i?Ve.nextTick(To,t,e):To(t,e))}s(Oo,"errorOrDestroy");function Sy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,n=t._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),t.once(Ao,e),!(t.listenerCount(Ao)>1)&&Ve.nextTick(_y,t)}s(Sy,"construct");function _y(t){let e=!1;function i(n){if(e){Oo(t,n??new uy);return}e=!0;let r=t._readableState,o=t._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Xl,n):n?Oo(t,n,!0):Ve.nextTick(Ey,t)}s(i,"onConstruct");try{t._construct(n=>{Ve.nextTick(i,n)})}catch(n){Ve.nextTick(i,n)}}s(_y,"constructNT");function Ey(t){t.emit(Ao)}s(Ey,"emitConstructNT");function Gl(t){return t?.setHeader&&typeof t.abort=="function"}s(Gl,"isRequest");function Zl(t){t.emit("close")}s(Zl,"emitCloseLegacy");function xy(t,e){t.emit("error",e),Ve.nextTick(Zl,t)}s(xy,"emitErrorCloseLegacy");function ky(t,e){!t||py(t)||(!e&&!yy(t)&&(e=new dy),my(t)?(t.socket=null,t.destroy(e)):Gl(t)?t.abort():Gl(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ve.nextTick(xy,t,e):Ve.nextTick(Zl,t),t.destroyed||(t[hy]=!0))}s(ky,"destroyer");ec.exports={construct:Sy,destroyer:ky,destroy:by,undestroy:wy,errorOrDestroy:Oo}});var er=A((L_,ic)=>{"use strict";var{ArrayIsArray:Fy,ObjectSetPrototypeOf:tc}=W(),{EventEmitter:Qn}=Xi();function Zn(t){Qn.call(this,t)}s(Zn,"Stream");tc(Zn.prototype,Qn.prototype);tc(Zn,Qn);Zn.prototype.pipe=function(t,e){let i=this;function n(h){t.writable&&t.write(h)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),t.on("drain",r),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function c(h){u(),Qn.listenerCount(this,"error")===0&&this.emit("error",h)}s(c,"onerror"),Co(i,"error",c),Co(t,"error",c);function u(){i.removeListener("data",n),t.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",u),i.removeListener("close",u),t.removeListener("close",u)}return s(u,"cleanup"),i.on("end",u),i.on("close",u),t.on("close",u),t.emit("pipe",i),t};function Co(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):Fy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Co,"prependListener");ic.exports={Stream:Zn,prependListener:Co}});var Ji=A((D_,tr)=>{"use strict";var{SymbolDispose:vy}=W(),{AbortError:nc,codes:Iy}=ne(),{isNodeStream:rc,isWebStream:Py,kControllerErrorFunction:Ay}=$e(),Ty=tt(),{ERR_INVALID_ARG_TYPE:oc}=Iy,Ro,Oy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new oc(e,"AbortSignal",t)},"validateAbortSignal");tr.exports.addAbortSignal=s(function(e,i){if(Oy(e,"signal"),!rc(i)&&!Py(i))throw new oc("stream",["ReadableStream","WritableStream","Stream"],i);return tr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");tr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=rc(e)?()=>{e.destroy(new nc(void 0,{cause:t.reason}))}:()=>{e[Ay](new nc(void 0,{cause:t.reason}))};if(t.aborted)i();else{Ro=Ro||Z().addAbortListener;let n=Ro(t,i);Ty(e,n[vy])}return e}});var lc=A((W_,ac)=>{"use strict";var{StringPrototypeSlice:sc,SymbolIterator:Cy,TypedArrayPrototypeSet:ir,Uint8Array:Ry}=W(),{Buffer:Lo}=Ee(),{inspect:Ly}=Z();ac.exports=class{static{s(this,"BufferList")}constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++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 i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=e+i.data;return n}concat(e){if(this.length===0)return Lo.alloc(0);let i=Lo.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)ir(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(e,i){let n=this.head.data;if(e<n.length){let r=n.slice(0,e);return this.head.data=n.slice(e),r}return e===n.length?this.shift():i?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 i="",n=this.head,r=0;do{let o=n.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=sc(o,0,e),this.head=n,n.data=sc(o,e));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(e){let i=Lo.allocUnsafe(e),n=e,r=this.head,o=0;do{let a=r.data;if(e>a.length)ir(i,a,n-e),e-=a.length;else{e===a.length?(ir(i,a,n-e),++o,r.next?this.head=r.next:this.head=this.tail=null):(ir(i,new Ry(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return Ly(this,{...i,depth:0,customInspect:!1})}}});var Qi=A((q_,dc)=>{"use strict";var{MathFloor:Ny,NumberIsInteger:Dy}=W(),{validateInteger:By}=ci(),{ERR_INVALID_ARG_VALUE:My}=ne().codes,cc=16*1024,fc=16;function Wy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(Wy,"highWaterMarkFrom");function uc(t){return t?fc:cc}s(uc,"getDefaultHighWaterMark");function Uy(t,e){By(e,"value",0),t?fc=e:cc=e}s(Uy,"setDefaultHighWaterMark");function qy(t,e,i,n){let r=Wy(e,n,i);if(r!=null){if(!Dy(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new My(o,r)}return Ny(r)}return uc(t.objectMode)}s(qy,"getHighWaterMark");dc.exports={getHighWaterMark:qy,getDefaultHighWaterMark:uc,setDefaultHighWaterMark:Uy}});var yc=A((No,pc)=>{var nr=Ee(),ze=nr.Buffer;function hc(t,e){for(var i in t)e[i]=t[i]}s(hc,"copyProps");ze.from&&ze.alloc&&ze.allocUnsafe&&ze.allocUnsafeSlow?pc.exports=nr:(hc(nr,No),No.Buffer=Wt);function Wt(t,e,i){return ze(t,e,i)}s(Wt,"SafeBuffer");Wt.prototype=Object.create(ze.prototype);hc(ze,Wt);Wt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ze(t,e,i)};Wt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ze(t);return e!==void 0?typeof i=="string"?n.fill(e,i):n.fill(e):n.fill(0),n};Wt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ze(t)};Wt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return nr.SlowBuffer(t)}});var gc=A(bc=>{"use strict";var Bo=yc().Buffer,mc=Bo.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function jy(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(jy,"_normalizeEncoding");function $y(t){var e=jy(t);if(typeof e!="string"&&(Bo.isEncoding===mc||!mc(t)))throw new Error("Unknown encoding: "+t);return e||t}s($y,"normalizeEncoding");bc.StringDecoder=Zi;function Zi(t){this.encoding=$y(t);var e;switch(this.encoding){case"utf16le":this.text=Ky,this.end=Xy,e=4;break;case"utf8":this.fillLast=Hy,e=4;break;case"base64":this.text=Jy,this.end=Qy,e=3;break;default:this.write=Zy,this.end=em;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bo.allocUnsafe(e)}s(Zi,"StringDecoder");Zi.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};Zi.prototype.end=Gy;Zi.prototype.text=Yy;Zi.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Do(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Do,"utf8CheckByte");function Vy(t,e,i){var n=e.length-1;if(n<i)return 0;var r=Do(e[n]);return r>=0?(r>0&&(t.lastNeed=r-1),r):--n<i||r===-2?0:(r=Do(e[n]),r>=0?(r>0&&(t.lastNeed=r-2),r):--n<i||r===-2?0:(r=Do(e[n]),r>=0?(r>0&&(r===2?r=0:t.lastNeed=r-3),r):0))}s(Vy,"utf8CheckIncomplete");function zy(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s(zy,"utf8CheckExtraBytes");function Hy(t){var e=this.lastTotal-this.lastNeed,i=zy(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Hy,"utf8FillLast");function Yy(t,e){var i=Vy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}s(Yy,"utf8Text");function Gy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Gy,"utf8End");function Ky(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(Ky,"utf16Text");function Xy(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s(Xy,"utf16End");function Jy(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Jy,"base64Text");function Qy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Qy,"base64End");function Zy(t){return t.toString(this.encoding)}s(Zy,"simpleWrite");function em(t){return t&&t.length?this.write(t):""}s(em,"simpleEnd")});var Mo=A((H_,Ec)=>{"use strict";var wc=pt(),{PromisePrototypeThen:tm,SymbolAsyncIterator:Sc,SymbolIterator:_c}=W(),{Buffer:im}=Ee(),{ERR_INVALID_ARG_TYPE:nm,ERR_STREAM_NULL_VALUES:rm}=ne().codes;function om(t,e,i){let n;if(typeof e=="string"||e instanceof im)return new t({objectMode:!0,...i,read:s(function(){this.push(e),this.push(null)},"read")});let r;if(e&&e[Sc])r=!0,n=e[Sc]();else if(e&&e[_c])r=!1,n=e[_c]();else throw new nm("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(u,h){tm(l(u),()=>wc.nextTick(h,u),d=>wc.nextTick(h,d||u))};async function l(u){let h=u!=null,d=typeof n.throw=="function";if(h&&d){let{value:b,done:m}=await n.throw(u);if(await b,m)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}s(l,"close");async function c(){for(;;){try{let{value:u,done:h}=r?await n.next():n.next();if(h)o.push(null);else{let d=u&&typeof u.then=="function"?await u:u;if(d===null)throw a=!1,new rm;if(o.push(d))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(c,"next"),o}s(om,"from");Ec.exports=om});var tn=A((G_,Uc)=>{var xe=pt(),{ArrayPrototypeIndexOf:sm,NumberIsInteger:am,NumberIsNaN:lm,NumberParseInt:cm,ObjectDefineProperties:Ho,ObjectKeys:fm,ObjectSetPrototypeOf:Fc,Promise:vc,SafeSet:um,SymbolAsyncDispose:dm,SymbolAsyncIterator:hm,Symbol:pm}=W();Uc.exports=E;E.ReadableState=ar;var{EventEmitter:ym}=Xi(),{Stream:mt,prependListener:mm}=er(),{Buffer:Wo}=Ee(),{addAbortSignal:bm}=Ji(),Ic=tt(),F=Z().debuglog("stream",t=>{F=t}),gm=lc(),pi=Mt(),{getHighWaterMark:wm,getDefaultHighWaterMark:Sm}=Qi(),{aggregateTwoErrors:xc,codes:{ERR_INVALID_ARG_TYPE:_m,ERR_METHOD_NOT_IMPLEMENTED:Em,ERR_OUT_OF_RANGE:xm,ERR_STREAM_PUSH_AFTER_EOF:km,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Fm},AbortError:vm}=ne(),{validateObject:Im}=ci(),Ut=pm("kPaused"),{StringDecoder:Pc}=gc(),Pm=Mo();Fc(E.prototype,mt.prototype);Fc(E,mt);var Uo=s(()=>{},"nop"),{errorOrDestroy:di}=pi,hi=1,Am=2,Ac=4,en=8,Tc=16,rr=32,or=64,Oc=128,Tm=256,Om=512,Cm=1024,Vo=2048,zo=4096,Rm=8192,Lm=16384,Nm=32768,Cc=65536,Dm=1<<17,Bm=1<<18;function Y(t){return{enumerable:!1,get:s(function(){return(this.state&t)!==0},"get"),set:s(function(e){e?this.state|=t:this.state&=~t},"set")}}s(Y,"makeBitMapDescriptor");Ho(ar.prototype,{objectMode:Y(hi),ended:Y(Am),endEmitted:Y(Ac),reading:Y(en),constructed:Y(Tc),sync:Y(rr),needReadable:Y(or),emittedReadable:Y(Oc),readableListening:Y(Tm),resumeScheduled:Y(Om),errorEmitted:Y(Cm),emitClose:Y(Vo),autoDestroy:Y(zo),destroyed:Y(Rm),closed:Y(Lm),closeEmitted:Y(Nm),multiAwaitDrain:Y(Cc),readingMore:Y(Dm),dataEmitted:Y(Bm)});function ar(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.state=Vo|zo|Tc|rr,t&&t.objectMode&&(this.state|=hi),i&&t&&t.readableObjectMode&&(this.state|=hi),this.highWaterMark=t?wm(this,t,"readableHighWaterMark",i):Sm(!1),this.buffer=new gm,this.length=0,this.pipes=[],this.flowing=null,this[Ut]=null,t&&t.emitClose===!1&&(this.state&=~Vo),t&&t.autoDestroy===!1&&(this.state&=~zo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Pc(t.encoding),this.encoding=t.encoding)}s(ar,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof He();this._readableState=new ar(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&bm(t.signal,this)),mt.call(this,t),pi.construct(this,()=>{this._readableState.needReadable&&sr(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=pi.destroy;E.prototype._undestroy=pi.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[ym.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[dm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new vm,this.destroy(t)),new vc((e,i)=>Ic(this,n=>n&&n!==t?i(n):e(null)))};E.prototype.push=function(t,e){return Rc(this,t,e,!1)};E.prototype.unshift=function(t,e){return Rc(this,t,e,!0)};function Rc(t,e,i,n){F("readableAddChunk",e);let r=t._readableState,o;if(r.state&hi||(typeof e=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?e=Wo.from(e,i).toString(r.encoding):(e=Wo.from(e,i),i=""))):e instanceof Wo?i="":mt._isUint8Array(e)?(e=mt._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new _m("chunk",["string","Buffer","Uint8Array"],e))),o)di(t,o);else if(e===null)r.state&=~en,Um(t,r);else if(r.state&hi||e&&e.length>0)if(n)if(r.state&Ac)di(t,new Fm);else{if(r.destroyed||r.errored)return!1;qo(t,r,e,!0)}else if(r.ended)di(t,new km);else{if(r.destroyed||r.errored)return!1;r.state&=~en,r.decoder&&!i?(e=r.decoder.write(e),r.objectMode||e.length!==0?qo(t,r,e,!1):sr(t,r)):qo(t,r,e,!1)}else n||(r.state&=~en,sr(t,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(Rc,"readableAddChunk");function qo(t,e,i,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Cc?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.state&or&&lr(t)),sr(t,e)}s(qo,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[Ut]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new Pc(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=e.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var Mm=1073741824;function Wm(t){if(t>Mm)throw new xm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Wm,"computeNewHighWaterMark");function kc(t,e){return t<=0||e.length===0&&e.ended?0:e.state&hi?1:lm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(kc,"howMuchToRead");E.prototype.read=function(t){F("read",t),t===void 0?t=NaN:am(t)||(t=cm(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Wm(t)),t!==0&&(e.state&=~Oc),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return F("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?jo(this):lr(this),null;if(t=kc(t,e),t===0&&e.ended)return e.length===0&&jo(this),null;let n=(e.state&or)!==0;if(F("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,F("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,F("reading, ended or constructing",n);else if(n){F("do read"),e.state|=en|rr,e.length===0&&(e.state|=or);try{this._read(e.highWaterMark)}catch(o){di(this,o)}e.state&=~rr,e.reading||(t=kc(i,e))}let r;return t>0?r=Mc(t,e):r=null,r===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&jo(this)),r!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",r)),r};function Um(t,e){if(F("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?lr(t):(e.needReadable=!1,e.emittedReadable=!0,Lc(t))}}s(Um,"onEofChunk");function lr(t){let e=t._readableState;F("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(F("emitReadable",e.flowing),e.emittedReadable=!0,xe.nextTick(Lc,t))}s(lr,"emitReadable");function Lc(t){let e=t._readableState;F("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Dc(t)}s(Lc,"emitReadable_");function sr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,xe.nextTick(qm,t,e))}s(sr,"maybeReadMore");function qm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(F("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(qm,"maybeReadMore_");E.prototype._read=function(t){throw new Em("_read()")};E.prototype.pipe=function(t,e){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new um(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),F("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==xe.stdout&&t!==xe.stderr?l:I;n.endEmitted?xe.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(_,T){F("onunpipe"),_===i&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,h())}s(a,"onunpipe");function l(){F("onend"),t.end()}s(l,"onend");let c,u=!1;function h(){F("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),c&&t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",I),i.removeListener("data",b),u=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}s(h,"cleanup");function d(){u||(n.pipes.length===1&&n.pipes[0]===t?(F("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(F("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),i.pause()),c||(c=jm(i,t),t.on("drain",c))}s(d,"pause"),i.on("data",b);function b(_){F("ondata");let T=t.write(_);F("dest.write",T),T===!1&&d()}s(b,"ondata");function m(_){if(F("onerror",_),I(),t.removeListener("error",m),t.listenerCount("error")===0){let T=t._writableState||t._readableState;T&&!T.errorEmitted?di(t,_):t.emit("error",_)}}s(m,"onerror"),mm(t,"error",m);function w(){t.removeListener("finish",g),I()}s(w,"onclose"),t.once("close",w);function g(){F("onfinish"),t.removeListener("close",w),I()}s(g,"onfinish"),t.once("finish",g);function I(){F("unpipe"),i.unpipe(t)}return s(I,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?d():n.flowing||(F("pipe resume"),i.resume()),t};function jm(t,e){return s(function(){let n=t._readableState;n.awaitDrainWriters===e?(F("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(F("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(jm,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let r=e.pipes;e.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=sm(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=mt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,F("on readable",n.length,n.reading),n.length?lr(this):n.reading||xe.nextTick($m,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=mt.prototype.removeListener.call(this,t,e);return t==="readable"&&xe.nextTick(Nc,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=mt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&xe.nextTick(Nc,this),e};function Nc(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Ut]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Nc,"updateReadableListening");function $m(t){F("readable nexttick read 0"),t.read(0)}s($m,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(F("resume"),t.flowing=!t.readableListening,Vm(this,t)),t[Ut]=!1,this};function Vm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,xe.nextTick(zm,t,e))}s(Vm,"resume");function zm(t,e){F("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Dc(t),e.flowing&&!e.reading&&t.read(0)}s(zm,"resume_");E.prototype.pause=function(){return F("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(F("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Ut]=!0,this};function Dc(t){let e=t._readableState;for(F("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Dc,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{di(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=fm(t);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof t[r]=="function"&&(this[r]=t[r].bind(t))}return this};E.prototype[hm]=function(){return Bc(this)};E.prototype.iterator=function(t){return t!==void 0&&Im(t,"options"),Bc(this,t)};function Bc(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=Hm(t,e);return i.stream=t,i}s(Bc,"streamToAsyncIterator");async function*Hm(t,e){let i=Uo;function n(a){this===t?(i(),i=Uo):i=a}s(n,"next"),t.on("readable",n);let r,o=Ic(t,{writable:!1},a=>{r=a?xc(r,a):null,i(),i=Uo});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new vc(n)}}}catch(a){throw r=xc(r,a),r}finally{(r||e?.destroyOnReturn!==!1)&&(r===void 0||t._readableState.autoDestroy)?pi.destroyer(t,null):(t.off("readable",n),o())}}s(Hm,"createAsyncIterator");Ho(E.prototype,{readable:{__proto__:null,get:s(function(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},"get"),set:s(function(t){this._readableState&&(this._readableState.readable=!!t)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(t){this._readableState&&(this._readableState.flowing=t)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});Ho(ar.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Ut]!==!1},"get"),set:s(function(t){this[Ut]=!!t},"set")}});E._fromList=Mc;function Mc(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(Mc,"fromList");function jo(t){let e=t._readableState;F("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,xe.nextTick(Ym,e,t))}s(jo,"endReadable");function Ym(t,e){if(F("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)xe.nextTick(Gm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Ym,"endReadableNT");function Gm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Gm,"endWritableNT");E.from=function(t,e){return Pm(E,t,e)};var $o;function Wc(){return $o===void 0&&($o={}),$o}s(Wc,"lazyWebStreams");E.fromWeb=function(t,e){return Wc().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return Wc().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,n;return new E({objectMode:(i=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy:s(function(r,o){pi.destroyer(t,r),o(r)},"destroy")}).wrap(t)}});var hr=A((X_,Qc)=>{var qt=pt(),{ArrayPrototypeSlice:$c,Error:Km,FunctionPrototypeSymbolHasInstance:Vc,ObjectDefineProperty:zc,ObjectDefineProperties:Xm,ObjectSetPrototypeOf:Hc,StringPrototypeToLowerCase:Jm,Symbol:Qm,SymbolHasInstance:Zm}=W();Qc.exports=U;U.WritableState=on;var{EventEmitter:eb}=Xi(),nn=er().Stream,{Buffer:cr}=Ee(),dr=Mt(),{addAbortSignal:tb}=Ji(),{getHighWaterMark:ib,getDefaultHighWaterMark:nb}=Qi(),{ERR_INVALID_ARG_TYPE:rb,ERR_METHOD_NOT_IMPLEMENTED:ob,ERR_MULTIPLE_CALLBACK:Yc,ERR_STREAM_CANNOT_PIPE:sb,ERR_STREAM_DESTROYED:rn,ERR_STREAM_ALREADY_FINISHED:ab,ERR_STREAM_NULL_VALUES:lb,ERR_STREAM_WRITE_AFTER_END:cb,ERR_UNKNOWN_ENCODING:Gc}=ne().codes,{errorOrDestroy:yi}=dr;Hc(U.prototype,nn.prototype);Hc(U,nn);function Ko(){}s(Ko,"nop");var mi=Qm("kOnFinished");function on(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?ib(this,t,"writableHighWaterMark",i):nb(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ub.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ur(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[mi]=[]}s(on,"WritableState");function ur(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(ur,"resetBuffer");on.prototype.getBuffer=s(function(){return $c(this.buffered,this.bufferedIndex)},"getBuffer");zc(on.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function U(t){let e=this instanceof He();if(!e&&!Vc(U,this))return new U(t);this._writableState=new on(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&tb(t.signal,this)),nn.call(this,t),dr.construct(this,()=>{let i=this._writableState;i.writing||Jo(this,i),Qo(this,i)})}s(U,"Writable");zc(U,Zm,{__proto__:null,value:s(function(t){return Vc(this,t)?!0:this!==U?!1:t&&t._writableState instanceof on},"value")});U.prototype.pipe=function(){yi(this,new sb)};function Kc(t,e,i,n){let r=t._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!cr.isEncoding(i))throw new Gc(i);typeof n!="function"&&(n=Ko)}if(e===null)throw new lb;if(!r.objectMode)if(typeof e=="string")r.decodeStrings!==!1&&(e=cr.from(e,i),i="buffer");else if(e instanceof cr)i="buffer";else if(nn._isUint8Array(e))e=nn._uint8ArrayToBuffer(e),i="buffer";else throw new rb("chunk",["string","Buffer","Uint8Array"],e);let o;return r.ending?o=new cb:r.destroyed&&(o=new rn("write")),o?(qt.nextTick(n,o),yi(t,o,!0),o):(r.pendingcb++,fb(t,r,e,i,n))}s(Kc,"_write");U.prototype.write=function(t,e,i){return Kc(this,t,e,i)===!0};U.prototype.cork=function(){this._writableState.corked++};U.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Jo(this,t))};U.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Jm(e)),!cr.isEncoding(e))throw new Gc(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function fb(t,e,i,n,r){let o=e.objectMode?1:i.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:i,encoding:n,callback:r}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&r!==Ko&&(e.allNoop=!1)):(e.writelen=o,e.writecb=r,e.writing=!0,e.sync=!0,t._write(i,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(fb,"writeOrBuffer");function qc(t,e,i,n,r,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new rn("write")):i?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}s(qc,"doWrite");function jc(t,e,i,n){--e.pendingcb,n(i),Xo(e),yi(t,i)}s(jc,"onwriteError");function ub(t,e){let i=t._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){yi(t,new Yc);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?qt.nextTick(jc,t,i,e,r):jc(t,i,e,r)):(i.buffered.length>i.bufferedIndex&&Jo(t,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:t,state:i},qt.nextTick(db,i.afterWriteTickInfo)):Xc(t,i,1,r))}s(ub,"onwrite");function db({stream:t,state:e,count:i,cb:n}){return e.afterWriteTickInfo=null,Xc(t,e,i,n)}s(db,"afterWriteTick");function Xc(t,e,i,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,n();e.destroyed&&Xo(e),Qo(t,e)}s(Xc,"afterWrite");function Xo(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:o,callback:a}=t.buffered[r],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new rn("write"))}let i=t[mi].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=t.errored)!==null&&n!==void 0?n:new rn("end"))}ur(t)}s(Xo,"errorBuffer");function Jo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=e,o=i.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Ko:u=>{for(let h=a;h<i.length;++h)i[h].callback(u)},c=e.allNoop&&a===0?i:$c(i,a);c.allBuffers=e.allBuffers,qc(t,e,!0,e.length,c,"",l),ur(e)}else{do{let{chunk:l,encoding:c,callback:u}=i[a];i[a++]=null;let h=r?1:l.length;qc(t,e,!1,h,l,c,u)}while(a<i.length&&!e.writing);a===i.length?ur(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Jo,"clearBuffer");U.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new ob("_write()")};U.prototype._writev=null;U.prototype.end=function(t,e,i){let n=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let r;if(t!=null){let o=Kc(this,t,e);o instanceof Km&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Qo(this,n,!0),n.ended=!0):n.finished?r=new ab("end"):n.destroyed&&(r=new rn("end"))),typeof i=="function"&&(r||n.finished?qt.nextTick(i,r):n[mi].push(i)),this};function fr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s(fr,"needFinish");function hb(t,e){let i=!1;function n(r){if(i){yi(t,r??Yc());return}if(i=!0,e.pendingcb--,r){let o=e[mi].splice(0);for(let a=0;a<o.length;a++)o[a](r);yi(t,r,e.sync)}else fr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,qt.nextTick(Go,t,e))}s(n,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(n)}catch(r){n(r)}e.sync=!1}s(hb,"callFinal");function pb(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,hb(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(pb,"prefinish");function Qo(t,e,i){fr(e)&&(pb(t,e),e.pendingcb===0&&(i?(e.pendingcb++,qt.nextTick((n,r)=>{fr(r)?Go(n,r):r.pendingcb--},t,e)):fr(e)&&(e.pendingcb++,Go(t,e))))}s(Qo,"finishMaybe");function Go(t,e){e.pendingcb--,e.finished=!0;let i=e[mi].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}s(Go,"finish");Xm(U.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")},writable:{__proto__:null,get:s(function(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},"get"),set:s(function(t){this._writableState&&(this._writableState.writable=!!t)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var yb=dr.destroy;U.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[mi].length)&&qt.nextTick(Xo,i),yb.call(this,t,e),this};U.prototype._undestroy=dr.undestroy;U.prototype._destroy=function(t,e){e(t)};U.prototype[eb.captureRejectionSymbol]=function(t){this.destroy(t)};var Yo;function Jc(){return Yo===void 0&&(Yo={}),Yo}s(Jc,"lazyWebStreams");U.fromWeb=function(t,e){return Jc().newStreamWritableFromWritableStream(t,e)};U.toWeb=function(t){return Jc().newWritableStreamFromStreamWritable(t)}});var pf=A((Q_,hf)=>{var Zo=pt(),mb=Ee(),{isReadable:bb,isWritable:gb,isIterable:Zc,isNodeStream:wb,isReadableNodeStream:ef,isWritableNodeStream:tf,isDuplexNodeStream:Sb,isReadableStream:nf,isWritableStream:rf}=$e(),of=tt(),{AbortError:uf,codes:{ERR_INVALID_ARG_TYPE:_b,ERR_INVALID_RETURN_VALUE:sf}}=ne(),{destroyer:gi}=Mt(),Eb=He(),df=tn(),xb=hr(),{createDeferredPromise:af}=Z(),lf=Mo(),cf=globalThis.Blob||mb.Blob,kb=s(typeof cf<"u"?function(e){return e instanceof cf}:function(e){return!1},"isBlob"),Fb=globalThis.AbortController||si().AbortController,{FunctionPrototypeCall:ff}=W(),bt=class extends Eb{static{s(this,"Duplexify")}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)}};hf.exports=s(function t(e,i){if(Sb(e))return e;if(ef(e))return bi({readable:e});if(tf(e))return bi({writable:e});if(wb(e))return bi({writable:!1,readable:!1});if(nf(e))return bi({readable:df.fromWeb(e)});if(rf(e))return bi({writable:xb.fromWeb(e)});if(typeof e=="function"){let{value:r,write:o,final:a,destroy:l}=vb(e);if(Zc(r))return lf(bt,r,{objectMode:!0,write:o,final:a,destroy:l});let c=r?.then;if(typeof c=="function"){let u,h=ff(c,r,d=>{if(d!=null)throw new sf("nully","body",d)},d=>{gi(u,d)});return u=new bt({objectMode:!0,readable:!1,write:o,final:s(function(d){a(async()=>{try{await h,Zo.nextTick(d,null)}catch(b){Zo.nextTick(d,b)}})},"final"),destroy:l})}throw new sf("Iterable, AsyncIterable or AsyncFunction",i,r)}if(kb(e))return t(e.arrayBuffer());if(Zc(e))return lf(bt,e,{objectMode:!0,writable:!1});if(nf(e?.readable)&&rf(e?.writable))return bt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?ef(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?tf(e?.writable)?e?.writable:t(e.writable):void 0;return bi({readable:r,writable:o})}let n=e?.then;if(typeof n=="function"){let r;return ff(n,e,o=>{o!=null&&r.push(o),r.push(null)},o=>{gi(r,o)}),r=new bt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new _b(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function vb(t){let{promise:e,resolve:i}=af(),n=new Fb,r=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(Zo.nextTick(u),c)return;if(r.aborted)throw new uf(void 0,{cause:r.reason});({promise:e,resolve:i}=af()),yield l}}(),{signal:r}),write:s(function(a,l,c){let u=i;i=null,u({chunk:a,done:!1,cb:c})},"write"),final:s(function(a){let l=i;i=null,l({done:!0,cb:a})},"final"),destroy:s(function(a,l){n.abort(),l(a)},"destroy")}}s(vb,"fromAsyncGen");function bi(t){let e=t.readable&&typeof t.readable.read!="function"?df.wrap(t.readable):t.readable,i=t.writable,n=!!bb(e),r=!!gb(i),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 bt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(of(i,d=>{r=!1,d&&gi(e,d),h(d)}),u._write=function(d,b,m){i.write(d,b)?m():o=m},u._final=function(d){i.end(),a=d},i.on("drain",function(){if(o){let d=o;o=null,d()}}),i.on("finish",function(){if(a){let d=a;a=null,d()}})),n&&(of(e,d=>{n=!1,d&&gi(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 uf),l=null,o=null,a=null,c===null?b(d):(c=b,gi(i,d),gi(e,d))},u}s(bi,"_duplexify")});var He=A((eE,bf)=>{"use strict";var{ObjectDefineProperties:Ib,ObjectGetOwnPropertyDescriptor:it,ObjectKeys:Pb,ObjectSetPrototypeOf:yf}=W();bf.exports=ke;var is=tn(),_e=hr();yf(ke.prototype,is.prototype);yf(ke,is);{let t=Pb(_e.prototype);for(let e=0;e<t.length;e++){let i=t[e];ke.prototype[i]||(ke.prototype[i]=_e.prototype[i])}}function ke(t){if(!(this instanceof ke))return new ke(t);is.call(this,t),_e.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(ke,"Duplex");Ib(ke.prototype,{writable:{__proto__:null,...it(_e.prototype,"writable")},writableHighWaterMark:{__proto__:null,...it(_e.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...it(_e.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...it(_e.prototype,"writableBuffer")},writableLength:{__proto__:null,...it(_e.prototype,"writableLength")},writableFinished:{__proto__:null,...it(_e.prototype,"writableFinished")},writableCorked:{__proto__:null,...it(_e.prototype,"writableCorked")},writableEnded:{__proto__:null,...it(_e.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...it(_e.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")}});var es;function mf(){return es===void 0&&(es={}),es}s(mf,"lazyWebStreams");ke.fromWeb=function(t,e){return mf().newStreamDuplexFromReadableWritablePair(t,e)};ke.toWeb=function(t){return mf().newReadableWritablePairFromDuplex(t)};var ts;ke.from=function(t){return ts||(ts=pf()),ts(t,"body")}});var os=A((iE,wf)=>{"use strict";var{ObjectSetPrototypeOf:gf,Symbol:Ab}=W();wf.exports=nt;var{ERR_METHOD_NOT_IMPLEMENTED:Tb}=ne().codes,rs=He(),{getHighWaterMark:Ob}=Qi();gf(nt.prototype,rs.prototype);gf(nt,rs);var sn=Ab("kCallback");function nt(t){if(!(this instanceof nt))return new nt(t);let e=t?Ob(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),rs.call(this,t),this._readableState.sync=!1,this[sn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Cb)}s(nt,"Transform");function ns(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(ns,"final");function Cb(){this._final!==ns&&ns.call(this)}s(Cb,"prefinish");nt.prototype._final=ns;nt.prototype._transform=function(t,e,i){throw new Tb("_transform()")};nt.prototype._write=function(t,e,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),r.ended||o===n.length||n.length<n.highWaterMark?i():this[sn]=i})};nt.prototype._read=function(){if(this[sn]){let t=this[sn];this[sn]=null,t()}}});var as=A((rE,_f)=>{"use strict";var{ObjectSetPrototypeOf:Sf}=W();_f.exports=wi;var ss=os();Sf(wi.prototype,ss.prototype);Sf(wi,ss);function wi(t){if(!(this instanceof wi))return new wi(t);ss.call(this,t)}s(wi,"PassThrough");wi.prototype._transform=function(t,e,i){i(null,t)}});var br=A((sE,vf)=>{var an=pt(),{ArrayIsArray:Rb,Promise:Lb,SymbolAsyncIterator:Nb,SymbolDispose:Db}=W(),mr=tt(),{once:Bb}=Z(),Mb=Mt(),Ef=He(),{aggregateTwoErrors:Wb,codes:{ERR_INVALID_ARG_TYPE:ms,ERR_INVALID_RETURN_VALUE:ls,ERR_MISSING_ARGS:Ub,ERR_STREAM_DESTROYED:qb,ERR_STREAM_PREMATURE_CLOSE:jb},AbortError:$b}=ne(),{validateFunction:Vb,validateAbortSignal:zb}=ci(),{isIterable:jt,isReadable:cs,isReadableNodeStream:yr,isNodeStream:xf,isTransformStream:Si,isWebStream:Hb,isReadableStream:fs,isReadableFinished:Yb}=$e(),Gb=globalThis.AbortController||si().AbortController,us,ds,hs;function kf(t,e,i){let n=!1;t.on("close",()=>{n=!0});let r=mr(t,{readable:e,writable:i},o=>{n=!o});return{destroy:s(o=>{n||(n=!0,Mb.destroyer(t,o||new qb("pipe")))},"destroy"),cleanup:r}}s(kf,"destroyer");function Kb(t){return Vb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Kb,"popCallback");function ps(t){if(jt(t))return t;if(yr(t))return Xb(t);throw new ms("val",["Readable","Iterable","AsyncIterable"],t)}s(ps,"makeAsyncIterable");async function*Xb(t){ds||(ds=tn()),yield*ds.prototype[Nb].call(t)}s(Xb,"fromReadable");async function pr(t,e,i,{end:n}){let r,o=null,a=s(u=>{if(u&&(r=u),o){let h=o;o=null,h()}},"resume"),l=s(()=>new Lb((u,h)=>{r?h(r):o=s(()=>{r?h(r):u()},"onresolve")}),"wait");e.on("drain",a);let c=mr(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of t)e.write(u)||await l();n&&(e.end(),await l()),i()}catch(u){i(r!==u?Wb(r,u):u)}finally{c(),e.off("drain",a)}}s(pr,"pumpToNode");async function ys(t,e,i,{end:n}){Si(e)&&(e=e.writable);let r=e.getWriter();try{for await(let o of t)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(ys,"pumpToWeb");function Jb(...t){return Ff(t,Bb(Kb(t)))}s(Jb,"pipeline");function Ff(t,e,i){if(t.length===1&&Rb(t[0])&&(t=t[0]),t.length<2)throw new Ub("streams");let n=new Gb,r=n.signal,o=i?.signal,a=[];zb(o,"options.signal");function l(){w(new $b)}s(l,"abort"),hs=hs||Z().addAbortListener;let c;o&&(c=hs(o,l));let u,h,d=[],b=0;function m(q){w(q,--b===0)}s(m,"finish");function w(q,P){var V;if(q&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=q),!(!u&&!P)){for(;d.length;)d.shift()(u);(V=c)===null||V===void 0||V[Db](),n.abort(),P&&(u||a.forEach(St=>St()),an.nextTick(e,u,h))}}s(w,"finishImpl");let g;for(let q=0;q<t.length;q++){let P=t[q],V=q<t.length-1,St=q>0,de=V||i?.end!==!1,Yt=q===t.length-1;if(xf(P)){let re=function(Ge){Ge&&Ge.name!=="AbortError"&&Ge.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Ge)};var T=re;if(s(re,"onError"),de){let{destroy:Ge,cleanup:Tr}=kf(P,V,St);d.push(Ge),cs(P)&&Yt&&a.push(Tr)}P.on("error",re),cs(P)&&Yt&&a.push(()=>{P.removeListener("error",re)})}if(q===0)if(typeof P=="function"){if(g=P({signal:r}),!jt(g))throw new ls("Iterable, AsyncIterable or Stream","source",g)}else jt(P)||yr(P)||Si(P)?g=P:g=Ef.from(P);else if(typeof P=="function"){if(Si(g)){var I;g=ps((I=g)===null||I===void 0?void 0:I.readable)}else g=ps(g);if(g=P(g,{signal:r}),V){if(!jt(g,!0))throw new ls("AsyncIterable",`transform[${q-1}]`,g)}else{var _;us||(us=as());let re=new us({objectMode:!0}),Ge=(_=g)===null||_===void 0?void 0:_.then;if(typeof Ge=="function")b++,Ge.call(g,ot=>{h=ot,ot!=null&&re.write(ot),de&&re.end(),an.nextTick(m)},ot=>{re.destroy(ot),an.nextTick(m,ot)});else if(jt(g,!0))b++,pr(g,re,m,{end:de});else if(fs(g)||Si(g)){let ot=g.readable||g;b++,pr(ot,re,m,{end:de})}else throw new ls("AsyncIterable or Promise","destination",g);g=re;let{destroy:Tr,cleanup:Gu}=kf(g,!1,!0);d.push(Tr),Yt&&a.push(Gu)}}else if(xf(P)){if(yr(g)){b+=2;let re=Qb(g,P,m,{end:de});cs(P)&&Yt&&a.push(re)}else if(Si(g)||fs(g)){let re=g.readable||g;b++,pr(re,P,m,{end:de})}else if(jt(g))b++,pr(g,P,m,{end:de});else throw new ms("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=P}else if(Hb(P)){if(yr(g))b++,ys(ps(g),P,m,{end:de});else if(fs(g)||jt(g))b++,ys(g,P,m,{end:de});else if(Si(g))b++,ys(g.readable,P,m,{end:de});else throw new ms("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=P}else g=Ef.from(P)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&an.nextTick(l),g}s(Ff,"pipelineImpl");function Qb(t,e,i,{end:n}){let r=!1;if(e.on("close",()=>{r||i(new jb)}),t.pipe(e,{end:!1}),n){let a=function(){r=!0,e.end()};var o=a;s(a,"endFn"),Yb(t)?an.nextTick(a):t.once("end",a)}else i();return mr(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),mr(e,{readable:!1,writable:!0},i)}s(Qb,"pipe");vf.exports={pipelineImpl:Ff,pipeline:Jb}});var gs=A((lE,Cf)=>{"use strict";var{pipeline:Zb}=br(),gr=He(),{destroyer:eg}=Mt(),{isNodeStream:wr,isReadable:If,isWritable:Pf,isWebStream:bs,isTransformStream:$t,isWritableStream:Af,isReadableStream:Tf}=$e(),{AbortError:tg,codes:{ERR_INVALID_ARG_VALUE:Of,ERR_MISSING_ARGS:ig}}=ne(),ng=tt();Cf.exports=s(function(...e){if(e.length===0)throw new ig("streams");if(e.length===1)return gr.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=gr.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=gr.from(e[m])}for(let m=0;m<e.length;++m)if(!(!wr(e[m])&&!bs(e[m]))){if(m<e.length-1&&!(If(e[m])||Tf(e[m])||$t(e[m])))throw new Of(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(Pf(e[m])||Af(e[m])||$t(e[m])))throw new Of(`streams[${m}]`,i[m],"must be writable")}let n,r,o,a,l;function c(m){let w=a;a=null,w?w(m):m?l.destroy(m):!b&&!d&&l.destroy()}s(c,"onfinished");let u=e[0],h=Zb(e,c),d=!!(Pf(u)||Af(u)||$t(u)),b=!!(If(h)||Tf(h)||$t(h));if(l=new gr({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(h!=null&&h.readableObjectMode),writable:d,readable:b}),d){if(wr(u))l._write=function(w,g,I){u.write(w,g)?I():n=I},l._final=function(w){u.end(),r=w},u.on("drain",function(){if(n){let w=n;n=null,w()}});else if(bs(u)){let g=($t(u)?u.writable:u).getWriter();l._write=async function(I,_,T){try{await g.ready,g.write(I).catch(()=>{}),T()}catch(q){T(q)}},l._final=async function(I){try{await g.ready,g.close().catch(()=>{}),r=I}catch(_){I(_)}}}let m=$t(h)?h.readable:h;ng(m,()=>{if(r){let w=r;r=null,w()}})}if(b){if(wr(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(bs(h)){let w=($t(h)?h.readable:h).getReader();l._read=async function(){for(;;)try{let{value:g,done:I}=await w.read();if(!l.push(g))return;if(I){l.push(null);return}}catch{return}}}}return l._destroy=function(m,w){!m&&a!==null&&(m=new tg),o=null,n=null,r=null,a===null?w(m):(a=w,wr(h)&&eg(h,m))},l},"compose")});var jf=A((fE,_s)=>{"use strict";var rg=globalThis.AbortController||si().AbortController,{codes:{ERR_INVALID_ARG_VALUE:og,ERR_INVALID_ARG_TYPE:ln,ERR_MISSING_ARGS:sg,ERR_OUT_OF_RANGE:ag},AbortError:Ye}=ne(),{validateAbortSignal:Vt,validateInteger:Rf,validateObject:zt}=ci(),lg=W().Symbol("kWeak"),cg=W().Symbol("kResistStopPropagation"),{finished:fg}=tt(),ug=gs(),{addAbortSignalNoValidate:dg}=Ji(),{isWritable:hg,isNodeStream:pg}=$e(),{deprecate:yg}=Z(),{ArrayPrototypePush:mg,Boolean:bg,MathFloor:Lf,Number:gg,NumberIsNaN:wg,Promise:Nf,PromiseReject:Df,PromiseResolve:Sg,PromisePrototypeThen:Bf,Symbol:Wf}=W(),Sr=Wf("kEmpty"),Mf=Wf("kEof");function _g(t,e){if(e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),pg(t)&&!hg(t))throw new og("stream",t,"must be writable");let i=ug(this,t);return e!=null&&e.signal&&dg(e.signal,i),i}s(_g,"compose");function _r(t,e){if(typeof t!="function")throw new ln("fn",["Function","AsyncFunction"],t);e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Lf(e.concurrency));let n=i-1;return e?.highWaterMark!=null&&(n=Lf(e.highWaterMark)),Rf(i,"options.concurrency",1),Rf(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=Z().AbortSignalAny([e?.signal].filter(bg)),a=this,l=[],c={signal:o},u,h,d=!1,b=0;function m(){d=!0,w()}s(m,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){h&&!d&&b<i&&l.length<n&&(h(),h=null)}s(g,"maybeResume");async function I(){try{for await(let _ of a){if(d)return;if(o.aborted)throw new Ye;try{if(_=t(_,c),_===Sr)continue;_=Sg(_)}catch(T){_=Df(T)}b+=1,Bf(_,w,m),l.push(_),u&&(u(),u=null),!d&&(l.length>=n||b>=i)&&await new Nf(T=>{h=T})}l.push(Mf)}catch(_){let T=Df(_);Bf(T,w,m),l.push(T)}finally{d=!0,u&&(u(),u=null)}}s(I,"pump"),I();try{for(;;){for(;l.length>0;){let _=await l[0];if(_===Mf)return;if(o.aborted)throw new Ye;_!==Sr&&(yield _),l.shift(),g()}await new Nf(_=>{u=_})}}finally{d=!0,h&&(h(),h=null)}},"map").call(this)}s(_r,"map");function Eg(t=void 0){return t!=null&&zt(t,"options"),t?.signal!=null&&Vt(t.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ye({cause:t.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(Eg,"asIndexedPairs");async function Uf(t,e=void 0){for await(let i of Ss.call(this,t,e))return!0;return!1}s(Uf,"some");async function xg(t,e=void 0){if(typeof t!="function")throw new ln("fn",["Function","AsyncFunction"],t);return!await Uf.call(this,async(...i)=>!await t(...i),e)}s(xg,"every");async function kg(t,e){for await(let i of Ss.call(this,t,e))return i}s(kg,"find");async function Fg(t,e){if(typeof t!="function")throw new ln("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r),Sr}s(i,"forEachFn");for await(let n of _r.call(this,i,e));}s(Fg,"forEach");function Ss(t,e){if(typeof t!="function")throw new ln("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r)?n:Sr}return s(i,"filterFn"),_r.call(this,i,e)}s(Ss,"filter");var ws=class extends sg{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function vg(t,e,i){var n;if(typeof t!="function")throw new ln("reducer",["Function","AsyncFunction"],t);i!=null&&zt(i,"options"),i?.signal!=null&&Vt(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let u=new Ye(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await fg(this.destroy(u)),u}let o=new rg,a=o.signal;if(i!=null&&i.signal){let u={once:!0,[lg]:this,[cg]:!0};i.signal.addEventListener("abort",()=>o.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new Ye;r?e=await t(e,u,{signal:a}):(e=u,r=!0)}if(!l&&!r)throw new ws}finally{o.abort()}return e}s(vg,"reduce");async function Ig(t){t!=null&&zt(t,"options"),t?.signal!=null&&Vt(t.signal,"options.signal");let e=[];for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Ye(void 0,{cause:t.signal.reason});mg(e,n)}return e}s(Ig,"toArray");function Pg(t,e){let i=_r.call(this,t,e);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(Pg,"flatMap");function qf(t){if(t=gg(t),wg(t))return 0;if(t<0)throw new ag("number",">= 0",t);return t}s(qf,"toIntegerOrInfinity");function Ag(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),t=qf(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ye;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ye;t--<=0&&(yield o)}},"drop").call(this)}s(Ag,"drop");function Tg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),t=qf(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ye;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ye;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(Tg,"take");_s.exports.streamReturningOperators={asIndexedPairs:yg(Eg,"readable.asIndexedPairs will be removed in a future version."),drop:Ag,filter:Ss,flatMap:Pg,map:_r,take:Tg,compose:_g};_s.exports.promiseReturningOperators={every:xg,forEach:Fg,reduce:vg,toArray:Ig,some:Uf,find:kg}});var Es=A((dE,$f)=>{"use strict";var{ArrayPrototypePop:Og,Promise:Cg}=W(),{isIterable:Rg,isNodeStream:Lg,isWebStream:Ng}=$e(),{pipelineImpl:Dg}=br(),{finished:Bg}=tt();xs();function Mg(...t){return new Cg((e,i)=>{let n,r,o=t[t.length-1];if(o&&typeof o=="object"&&!Lg(o)&&!Rg(o)&&!Ng(o)){let a=Og(t);n=a.signal,r=a.end}Dg(t,(a,l)=>{a?i(a):e(l)},{signal:n,end:r})})}s(Mg,"pipeline");$f.exports={finished:Bg,pipeline:Mg}});var xs=A((pE,Qf)=>{var{Buffer:Wg}=Ee(),{ObjectDefineProperty:rt,ObjectKeys:Hf,ReflectApply:Yf}=W(),{promisify:{custom:Gf}}=Z(),{streamReturningOperators:Vf,promiseReturningOperators:zf}=jf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Kf}}=ne(),Ug=gs(),{setDefaultHighWaterMark:qg,getDefaultHighWaterMark:jg}=Qi(),{pipeline:Xf}=br(),{destroyer:$g}=Mt(),Jf=tt(),ks=Es(),cn=$e(),C=Qf.exports=er().Stream;C.isDestroyed=cn.isDestroyed;C.isDisturbed=cn.isDisturbed;C.isErrored=cn.isErrored;C.isReadable=cn.isReadable;C.isWritable=cn.isWritable;C.Readable=tn();for(let t of Hf(Vf)){let i=function(...n){if(new.target)throw Kf();return C.Readable.from(Yf(e,this,n))};Fs=i,s(i,"fn");let e=Vf[t];rt(i,"name",{__proto__:null,value:e.name}),rt(i,"length",{__proto__:null,value:e.length}),rt(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fs;for(let t of Hf(zf)){let i=function(...r){if(new.target)throw Kf();return Yf(e,this,r)};Fs=i,s(i,"fn");let e=zf[t];rt(i,"name",{__proto__:null,value:e.name}),rt(i,"length",{__proto__:null,value:e.length}),rt(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fs;C.Writable=hr();C.Duplex=He();C.Transform=os();C.PassThrough=as();C.pipeline=Xf;var{addAbortSignal:Vg}=Ji();C.addAbortSignal=Vg;C.finished=Jf;C.destroy=$g;C.compose=Ug;C.setDefaultHighWaterMark=qg;C.getDefaultHighWaterMark=jg;rt(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return ks},"get")});rt(Xf,Gf,{__proto__:null,enumerable:!0,get:s(function(){return ks.pipeline},"get")});rt(Jf,Gf,{__proto__:null,enumerable:!0,get:s(function(){return ks.finished},"get")});C.Stream=C;C._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(e){return Wg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Zf=A((mE,$)=>{"use strict";var G=xs(),zg=Es(),Hg=G.Readable.destroy;$.exports=G.Readable;$.exports._uint8ArrayToBuffer=G._uint8ArrayToBuffer;$.exports._isUint8Array=G._isUint8Array;$.exports.isDisturbed=G.isDisturbed;$.exports.isErrored=G.isErrored;$.exports.isReadable=G.isReadable;$.exports.Readable=G.Readable;$.exports.Writable=G.Writable;$.exports.Duplex=G.Duplex;$.exports.Transform=G.Transform;$.exports.PassThrough=G.PassThrough;$.exports.addAbortSignal=G.addAbortSignal;$.exports.finished=G.finished;$.exports.destroy=G.destroy;$.exports.destroy=Hg;$.exports.pipeline=G.pipeline;$.exports.compose=G.compose;Object.defineProperty(G,"promises",{configurable:!0,enumerable:!0,get:s(function(){return zg},"get")});$.exports.Stream=G.Stream;$.exports.default=$.exports});var Xg={};yn(Xg,{ActionType:()=>bn,Async:()=>Br,AsyncIndexFS:()=>Mi,BigIntStats:()=>ie,BigIntStatsFs:()=>Dr,Dir:()=>ht,Dirent:()=>dt,Errno:()=>D,ErrnoError:()=>f,Fetch:()=>Wd,FetchFS:()=>An,File:()=>vt,FileIndex:()=>At,FileSystem:()=>se,FileType:()=>z,InMemory:()=>Li,InMemoryStore:()=>kn,IndexDirInode:()=>ct,IndexFS:()=>Bi,IndexFileInode:()=>In,IndexInode:()=>Di,Inode:()=>Ne,LockedFS:()=>Ui,Mutex:()=>Wi,NoSyncFile:()=>Ke,Overlay:()=>Ud,OverlayFS:()=>qi,Port:()=>Dd,PortFS:()=>vn,PortFile:()=>Ni,PreloadFile:()=>ce,ReadStream:()=>gt,Readonly:()=>Mr,Stats:()=>R,StatsCommon:()=>Ii,StatsFs:()=>Pi,StoreFS:()=>Ri,Sync:()=>Ad,SyncIndexFS:()=>Vr,UnlockedOverlayFS:()=>Tn,WriteStream:()=>wt,_toUnixTimestamp:()=>Od,access:()=>Ru,accessSync:()=>Ma,appendFile:()=>cu,appendFileSync:()=>Fa,attachFS:()=>Ld,checkOptions:()=>On,chmod:()=>Pu,chmodSync:()=>Na,chown:()=>vu,chownSync:()=>Ra,close:()=>uu,closeSync:()=>Qe,configure:()=>Gg,constants:()=>Ft,copyFile:()=>qu,copyFileSync:()=>co,cp:()=>zu,cpSync:()=>fo,createBackend:()=>qd,createReadStream:()=>Bu,createWriteStream:()=>Mu,decode:()=>Sn,decodeDirListing:()=>_n,default:()=>Kg,detachFS:()=>Nd,encode:()=>Xe,encodeDirListing:()=>ye,errorMessages:()=>Cr,exists:()=>tu,existsSync:()=>ii,fchmod:()=>gu,fchmodSync:()=>Wn,fchown:()=>bu,fchownSync:()=>Mn,fdatasync:()=>pu,fdatasyncSync:()=>Pa,flagToMode:()=>It,flagToNumber:()=>vd,flagToString:()=>Vs,fs:()=>pn,fstat:()=>fu,fstatSync:()=>va,fsync:()=>hu,fsyncSync:()=>Ia,ftruncate:()=>du,ftruncateSync:()=>ro,futimes:()=>wu,futimesSync:()=>Un,isAppendable:()=>at,isBackend:()=>ji,isBackendConfig:()=>Hr,isExclusive:()=>Hs,isReadable:()=>st,isSynchronous:()=>Ti,isTruncating:()=>zs,isWriteable:()=>pe,lchmod:()=>Au,lchmodSync:()=>Da,lchown:()=>Iu,lchownSync:()=>La,levenshtein:()=>Wr,link:()=>xu,linkSync:()=>Oa,lopenSync:()=>Gi,lstat:()=>nu,lstatSync:()=>no,lutimes:()=>Ou,lutimesSync:()=>Ba,mkdir:()=>_u,mkdirSync:()=>qn,mkdirpSync:()=>Gs,mkdtemp:()=>Uu,mkdtempSync:()=>Wa,mount:()=>zi,mountObject:()=>Hi,mounts:()=>we,nop:()=>S,normalizeMode:()=>me,normalizeOptions:()=>be,normalizePath:()=>x,normalizeTime:()=>Pt,open:()=>su,openAsBlob:()=>Yu,openSync:()=>ri,opendir:()=>Vu,opendirSync:()=>ja,parseFlag:()=>L,pathExistsAction:()=>Oi,pathNotExistsAction:()=>Ci,promises:()=>hn,randomIno:()=>Ai,read:()=>mu,readFile:()=>au,readFileSync:()=>Bn,readSync:()=>Ta,readdir:()=>Eu,readdirSync:()=>oi,readlink:()=>Fu,readlinkSync:()=>so,readv:()=>ju,readvSync:()=>Ua,realpath:()=>Cu,realpathSync:()=>ti,rename:()=>eu,renameSync:()=>Ea,resolveMountConfig:()=>qs,rm:()=>Wu,rmSync:()=>lo,rmdir:()=>Su,rmdirSync:()=>oo,rootCred:()=>Be,rootIno:()=>De,setImmediate:()=>Td,size_max:()=>mn,stat:()=>iu,statSync:()=>Yi,statfs:()=>Hu,statfsSync:()=>$a,symlink:()=>ku,symlinkSync:()=>Ca,truncate:()=>ru,truncateSync:()=>xa,umount:()=>Nn,unlink:()=>ou,unlinkSync:()=>Dn,unwatchFile:()=>Nu,utimes:()=>Tu,utimesSync:()=>ao,watch:()=>Du,watchFile:()=>Lu,write:()=>yu,writeFile:()=>lu,writeFileSync:()=>Ki,writeSync:()=>Aa,writev:()=>$u,writevSync:()=>qa});var D=(p=>(p[p.EPERM=1]="EPERM",p[p.ENOENT=2]="ENOENT",p[p.EINTR=4]="EINTR",p[p.EIO=5]="EIO",p[p.ENXIO=6]="ENXIO",p[p.EBADF=9]="EBADF",p[p.EAGAIN=11]="EAGAIN",p[p.ENOMEM=12]="ENOMEM",p[p.EACCES=13]="EACCES",p[p.EFAULT=14]="EFAULT",p[p.ENOTBLK=15]="ENOTBLK",p[p.EBUSY=16]="EBUSY",p[p.EEXIST=17]="EEXIST",p[p.EXDEV=18]="EXDEV",p[p.ENODEV=19]="ENODEV",p[p.ENOTDIR=20]="ENOTDIR",p[p.EISDIR=21]="EISDIR",p[p.EINVAL=22]="EINVAL",p[p.ENFILE=23]="ENFILE",p[p.EMFILE=24]="EMFILE",p[p.ETXTBSY=26]="ETXTBSY",p[p.EFBIG=27]="EFBIG",p[p.ENOSPC=28]="ENOSPC",p[p.ESPIPE=29]="ESPIPE",p[p.EROFS=30]="EROFS",p[p.EMLINK=31]="EMLINK",p[p.EPIPE=32]="EPIPE",p[p.EDOM=33]="EDOM",p[p.ERANGE=34]="ERANGE",p[p.EDEADLK=35]="EDEADLK",p[p.ENAMETOOLONG=36]="ENAMETOOLONG",p[p.ENOLCK=37]="ENOLCK",p[p.ENOSYS=38]="ENOSYS",p[p.ENOTEMPTY=39]="ENOTEMPTY",p[p.ELOOP=40]="ELOOP",p[p.ENOMSG=42]="ENOMSG",p[p.EBADE=52]="EBADE",p[p.EBADR=53]="EBADR",p[p.EXFULL=54]="EXFULL",p[p.ENOANO=55]="ENOANO",p[p.EBADRQC=56]="EBADRQC",p[p.ENOSTR=60]="ENOSTR",p[p.ENODATA=61]="ENODATA",p[p.ETIME=62]="ETIME",p[p.ENOSR=63]="ENOSR",p[p.ENONET=64]="ENONET",p[p.EREMOTE=66]="EREMOTE",p[p.ENOLINK=67]="ENOLINK",p[p.ECOMM=70]="ECOMM",p[p.EPROTO=71]="EPROTO",p[p.EBADMSG=74]="EBADMSG",p[p.EOVERFLOW=75]="EOVERFLOW",p[p.EBADFD=77]="EBADFD",p[p.ESTRPIPE=86]="ESTRPIPE",p[p.ENOTSOCK=88]="ENOTSOCK",p[p.EDESTADDRREQ=89]="EDESTADDRREQ",p[p.EMSGSIZE=90]="EMSGSIZE",p[p.EPROTOTYPE=91]="EPROTOTYPE",p[p.ENOPROTOOPT=92]="ENOPROTOOPT",p[p.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",p[p.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",p[p.ENOTSUP=95]="ENOTSUP",p[p.ENETDOWN=100]="ENETDOWN",p[p.ENETUNREACH=101]="ENETUNREACH",p[p.ENETRESET=102]="ENETRESET",p[p.ETIMEDOUT=110]="ETIMEDOUT",p[p.ECONNREFUSED=111]="ECONNREFUSED",p[p.EHOSTDOWN=112]="EHOSTDOWN",p[p.EHOSTUNREACH=113]="EHOSTUNREACH",p[p.EALREADY=114]="EALREADY",p[p.EINPROGRESS=115]="EINPROGRESS",p[p.ESTALE=116]="ESTALE",p[p.EREMOTEIO=121]="EREMOTEIO",p[p.EDQUOT=122]="EDQUOT",p))(D||{}),Cr={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},f=class t extends Error{constructor(i,n=Cr[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=D[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let n=new t(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new t(D[i],Cr[D[i]],n,r)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};var Ft={};yn(Ft,{COPYFILE_EXCL:()=>vi,COPYFILE_FICLONE:()=>id,COPYFILE_FICLONE_FORCE:()=>nd,F_OK:()=>Fi,O_APPEND:()=>Oe,O_CREAT:()=>K,O_DIRECT:()=>fd,O_DIRECTORY:()=>od,O_DSYNC:()=>ld,O_EXCL:()=>Ae,O_NOATIME:()=>sd,O_NOCTTY:()=>rd,O_NOFOLLOW:()=>ad,O_NONBLOCK:()=>ud,O_RDONLY:()=>Gt,O_RDWR:()=>oe,O_SYMLINK:()=>cd,O_SYNC:()=>Kt,O_TRUNC:()=>Te,O_WRONLY:()=>Pe,R_OK:()=>Ie,S_IFBLK:()=>Et,S_IFCHR:()=>xt,S_IFDIR:()=>Le,S_IFIFO:()=>kt,S_IFLNK:()=>Ce,S_IFMT:()=>J,S_IFREG:()=>Re,S_IFSOCK:()=>_t,S_IRGRP:()=>gd,S_IROTH:()=>_d,S_IRUSR:()=>yd,S_IRWXG:()=>Lr,S_IRWXO:()=>Nr,S_IRWXU:()=>Rr,S_ISGID:()=>hd,S_ISUID:()=>dd,S_ISVTX:()=>pd,S_IWGRP:()=>wd,S_IWOTH:()=>Ed,S_IWUSR:()=>md,S_IXGRP:()=>Sd,S_IXOTH:()=>xd,S_IXUSR:()=>bd,UV_FS_O_FILEMAP:()=>kd,W_OK:()=>he,X_OK:()=>td});var Fi=0,Ie=4,he=2,td=1,vi=1,id=2,nd=4,Gt=0,Pe=1,oe=2,K=64,Ae=128,rd=256,Te=512,Oe=1024,od=65536,sd=262144,ad=131072,Kt=1052672,ld=4096,cd=32768,fd=16384,ud=2048,J=61440,_t=49152,Ce=40960,Re=32768,Et=24576,Le=16384,xt=8192,kt=4096,dd=2048,hd=1024,pd=512,Rr=448,yd=256,md=128,bd=64,Lr=56,gd=32,wd=16,Sd=8,Nr=7,_d=4,Ed=2,xd=1,kd=0;var z=(n=>(n[n.FILE=32768]="FILE",n[n.DIRECTORY=16384]="DIRECTORY",n[n.SYMLINK=40960]="SYMLINK",n))(z||{}),Ii=class{constructor({atimeMs:e,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:l,mode:c,ino: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);let h=Date.now(),d=s((m,w)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:w),"resolveT");this.atimeMs=d(e,h),this.mtimeMs=d(i,h),this.ctimeMs=d(n,h),this.birthtimeMs=d(r,h),this.uid=d(o,0),this.gid=d(a,0),this.size=d(l,0),this.ino=d(u,0);let b=Number(c)&61440||z.FILE;if(c)this.mode=this._convert(c);else switch(b){case z.FILE:this.mode=this._convert(420);break;case z.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(b))}static{s(this,"StatsCommon")}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))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let n=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&n)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)}get mtimeNs(){return BigInt(this.mtimeMs)}get ctimeNs(){return BigInt(this.ctimeMs)}get birthtimeNs(){return BigInt(this.birthtimeMs)}},R=class t extends Ii{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}static clone(i){return new t(i)}},ie=class t extends Ii{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}static clone(i){return new t(i)}},Pi=class{constructor(){this.type=0;this.bsize=0;this.blocks=0;this.bfree=0;this.bavail=0;this.files=0;this.ffree=0}static{s(this,"StatsFs")}},Dr=class{constructor(){this.type=0n;this.bsize=0n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=0n;this.ffree=0n}static{s(this,"BigIntStatsFs")}};var mn=2**32-1,De=0n;function $s(){return Math.round(Math.random()*2**32).toString(16)}s($s,"_random");function Ai(){return BigInt("0x"+$s()+$s())}s(Ai,"randomIno");var Ne=class{static{s(this,"Inode")}get data(){return new Uint8Array(this.buffer)}constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Ai(),this.nlink=1,this.size=4096;let n=Date.now();this.atimeMs=n,this.mtimeMs=n,this.ctimeMs=n,this.birthtimeMs=n}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new R(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};var bn=(r=>(r[r.NOP=0]="NOP",r[r.THROW=1]="THROW",r[r.TRUNCATE=2]="TRUNCATE",r[r.CREATE=3]="CREATE",r))(bn||{}),Fd=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function L(t){if(typeof t=="number")return Vs(t);if(!Fd.includes(t))throw new Error("Invalid flag string: "+t);return t}s(L,"parseFlag");function Vs(t){switch(t){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 Error("Invalid flag number: "+t)}}s(Vs,"flagToString");function vd(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(vd,"flagToNumber");function It(t){let e=0;return e<<=1,e+=+st(t),e<<=1,e+=+pe(t),e<<=1,e}s(It,"flagToMode");function st(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(st,"isReadable");function pe(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(pe,"isWriteable");function zs(t){return t.indexOf("w")!==-1}s(zs,"isTruncating");function at(t){return t.indexOf("a")!==-1}s(at,"isAppendable");function Ti(t){return t.indexOf("s")!==-1}s(Ti,"isSynchronous");function Hs(t){return t.indexOf("x")!==-1}s(Hs,"isExclusive");function Oi(t){return Hs(t)?1:zs(t)?2:0}s(Oi,"pathExistsAction");function Ci(t){return(pe(t)||at(t))&&t!=="r+"?3:1}s(Ci,"pathNotExistsAction");var vt=class{static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},ce=class extends vt{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:mn}))){super();this.fs=i;this.path=n;this.flag=r;this.stats=o;this._buffer=a;this._position=0;this._dirty=!1;if(this.stats.size!=a.byteLength){if(st(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return at(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this._dirty=!1)}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this._dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new R(this.stats)}statSync(){return new R(this.stats)}async truncate(i){if(this.truncateSync(i),Ti(this.flag))return this.sync()}truncateSync(i){if(this._dirty=!0,!pe(this.flag))throw new f(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length),Ti(this.flag)&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),Ti(this.flag)&&this.syncSync()}async write(i,n=0,r=this.stats.size,o=0){let a=this.writeSync(i,n,r,o);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!pe(this.flag))throw new f(1,"File not opened with a writeable mode.");let a=o+r;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let u=new Uint8Array(new ArrayBuffer(a,{maxByteLength:mn}));u.set(this._buffer),this._buffer=u}let l=i.slice(n,n+r);this._buffer.set(l,o);let c=l.byteLength;return this.stats.mtimeMs=Date.now(),Ti(this.flag)?(this.syncSync(),c):(this.position=o+c,c)}async read(i,n=0,r=this.stats.size,o=0){return{bytesRead:this.readSync(i,n,r,o),buffer:i}}readSync(i,n=0,r=this.stats.size,o){if(!st(this.flag))throw new f(1,"File not opened with a readable mode.");o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||new Uint8Array(i.buffer,n,r).set(this._buffer.slice(o,a)),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){this.chownSync(i,n)}chownSync(i,n){this._dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){this.utimesSync(i,n)}utimesSync(i,n){this._dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}},Ke=class extends ce{static{s(this,"NoSyncFile")}constructor(e,i,n,r,o){super(e,i,n,r,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};var Be={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Id="/";function Ys(t,e){let i="",n=0,r=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===l-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),r=l,o=0;continue}else if(i.length!==0){i="",n=0,r=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,l):i=t.slice(r+1,l),n=l-r-1;r=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Ys,"normalizeString");function lt(...t){let e="";for(let n of[...t.reverse(),Id])if(n.length&&(e=`${n}/${e}`,n.startsWith("/")))break;let i=e.startsWith("/");return e=Ys(e,!i),i?`/${e}`:e.length?e:"/"}s(lt,"resolve");function Pd(t){if(!t.length)return".";let e=t.startsWith("/"),i=t.endsWith("/");return t=Ys(t,!e),t.length?(i&&(t+="/"),e?`/${t}`:t):e?"/":i?"./":"."}s(Pd,"normalize");function B(...t){if(!t.length)return".";let e=t.join("/");return e?.length?Pd(e):"."}s(B,"join");function v(t){if(t.length===0)return".";let e=t[0]==="/",i=-1,n=!0;for(let r=t.length-1;r>=1;--r)if(t[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(v,"dirname");function N(t,e){let i=0,n=-1,r=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!r){i=l+1;break}}else a===-1&&(r=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(n=l):(o=-1,n=a));return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":t.slice(i,n)}s(N,"basename");function gn(t){let e=t.startsWith("/"),i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let n=e?1:0,r=-1,o=0,a=-1,l=!0,c=t.length-1,u=0;for(;c>=n;--c){if(t[c]==="/"){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t[c]==="."?r===-1?r=c:u!==1&&(u=1):r!==-1&&(u=-1)}if(a!==-1){let h=o===0&&e?1:o;r===-1||u===0||u===1&&r===a-1&&r===o+1?i.base=i.name=t.slice(h,a):(i.name=t.slice(h,r),i.base=t.slice(h,a),i.ext=t.slice(r,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(gn,"parse");var se=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name,readonly:!1,totalSpace:0,freeSpace:0}}constructor(e){}async ready(){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};function Ad(t){class e extends t{static{s(this,"_SyncFileSystem")}async exists(n,r){return this.existsSync(n,r)}async rename(n,r,o){return this.renameSync(n,r,o)}async stat(n,r){return this.statSync(n,r)}async createFile(n,r,o,a){return this.createFileSync(n,r,o,a)}async openFile(n,r,o){return this.openFileSync(n,r,o)}async unlink(n,r){return this.unlinkSync(n,r)}async rmdir(n,r){return this.rmdirSync(n,r)}async mkdir(n,r,o){return this.mkdirSync(n,r,o)}async readdir(n,r){return this.readdirSync(n,r)}async link(n,r,o){return this.linkSync(n,r,o)}async sync(n,r,o){return this.syncSync(n,r,o)}}return e}s(Ad,"Sync");function Br(t){class e extends t{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{s(this,"_AsyncFileSystem")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(r=>{let o=s(()=>this._queueRunning?setTimeout(o):r(),"check");o()})}async ready(){if(await this._sync.ready(),await super.ready(),!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(r){throw this._isInitialized=!1,r}}renameSync(r,o,a){this._sync.renameSync(r,o,a),this.queue("rename",r,o,a)}statSync(r,o){return this._sync.statSync(r,o)}createFileSync(r,o,a,l){let c=this._sync.createFileSync(r,o,a,l);this.queue("createFile",r,o,a,l);let u=c.statSync(),h=new Uint8Array(u.size);return c.readSync(h),new ce(this,r,o,u,h)}openFileSync(r,o,a){return this._sync.openFileSync(r,o,a)}unlinkSync(r,o){this._sync.unlinkSync(r,o),this.queue("unlink",r,o)}rmdirSync(r,o){this._sync.rmdirSync(r,o),this.queue("rmdir",r,o)}mkdirSync(r,o,a){this._sync.mkdirSync(r,o,a),this.queue("mkdir",r,o,a)}readdirSync(r,o){return this._sync.readdirSync(r,o)}linkSync(r,o,a){this._sync.linkSync(r,o,a),this.queue("link",r,o,a)}syncSync(r,o,a){this._sync.syncSync(r,o,a),this.queue("sync",r,o,a)}existsSync(r,o){return this._sync.existsSync(r,o)}async crossCopy(r){let o=await this.stat(r,Be);if(o.isDirectory()){if(r!=="/"){let l=await this.stat(r,Be);this._sync.mkdirSync(r,l.mode,l.cred())}let a=await this.readdir(r,Be);for(let l of a)await this.crossCopy(B(r,l))}else{let a=await this.openFile(r,L("r"),Be),l=this._sync.createFileSync(r,L("w"),o.mode,o.cred());try{let c=new Uint8Array(o.size);await a.read(c),l.writeSync(c,0,o.size)}finally{await a.close(),l.closeSync()}}}async _next(){if(!this._queueRunning)return;let[r,...o]=this._queue.shift();await this[r](...o),await this._next()}queue(...r){this._queue.push(r),this._next()}}return e}s(Br,"Async");function Mr(t){class e extends t{static{s(this,"_ReadonlyFileSystem")}metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r,o){throw new f(30)}renameSync(n,r,o){throw new f(30)}async createFile(n,r,o,a){throw new f(30)}createFileSync(n,r,o,a){throw new f(30)}async unlink(n,r){throw new f(30)}unlinkSync(n,r){throw new f(30)}async rmdir(n,r){throw new f(30)}rmdirSync(n,r){throw new f(30)}async mkdir(n,r,o){throw new f(30)}mkdirSync(n,r,o){throw new f(30)}async link(n,r,o){throw new f(30)}linkSync(n,r,o){throw new f(30)}async sync(n,r,o){throw new f(30)}syncSync(n,r,o){throw new f(30)}}return e}s(Mr,"Readonly");function Gs(t,e,i,n){n.existsSync(t,i)||(Gs(v(t),e,i,n),n.mkdirSync(t,e,i))}s(Gs,"mkdirpSync");function wn(t,e,i,n,r){return Math.min(t+1,e+1,i+1,n===r?e:e+1)}s(wn,"_min");function Wr(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,n=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=t.charCodeAt(r+b),o[b]=++b;let a,l,c,u,h;for(a=0;a+3<n;){let b=e.charCodeAt(r+(l=a)),m=e.charCodeAt(r+(c=a+1)),w=e.charCodeAt(r+(u=a+2)),g=e.charCodeAt(r+(h=a+3)),I=a+=4;for(let _=0;_<i;){let T=o[i+_],q=o[_];l=wn(q,l,c,b,T),c=wn(l,c,u,m,T),u=wn(c,u,h,w,T),I=wn(u,h,I,g,T),o[_++]=I,h=u,u=c,c=l,l=q}}let d=0;for(;a<n;){let b=e.charCodeAt(r+(l=a));d=++a;for(let m=0;m<i;m++){let w=o[m];o[m]=d=w<l||d<l?w>d?d+1:w+1:b===o[i+m]?l:l+1,l=w}}return d}s(Wr,"levenshtein");var Td=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Xe(t){if(typeof t!="string")throw new f(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Xe,"encode");function Sn(t){if(!(t instanceof Uint8Array))throw new f(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(Sn,"decode");function _n(t){return JSON.parse(Sn(t),(e,i)=>e==""?i:BigInt(i))}s(_n,"decodeDirListing");function ye(t){return Xe(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(ye,"encodeDirListing");function Od(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(Od,"_toUnixTimestamp");function me(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new f(22,"Invalid mode: "+t?.toString())}s(me,"normalizeMode");function Pt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new f(22,"Invalid time.")}s(Pt,"normalizeTime");function x(t){if(t=t.toString(),t.includes("\0"))throw new f(22,"Path can not contain null character");if(t.length==0)throw new f(22,"Path can not be empty");return lt(t.replaceAll(/[/\\]+/g,"/"))}s(x,"normalizePath");function be(t,e="utf8",i,n=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e??null,flag:i,mode:n}:{encoding:typeof t?.encoding=="string"?t.encoding:e??null,flag:typeof t?.flag=="string"?t.flag:i,mode:me("mode"in t?t?.mode:null,n)}}s(be,"normalizeOptions");function S(){}s(S,"nop");var Ks=5,Ri=class extends se{constructor(i){super();this.$store=i;this._initialized=!1;i instanceof Promise||(this._store=i,this._initialized=!0,this.makeRootDirectorySync())}static{s(this,"StoreFS")}get store(){if(!this._store)throw new f(61,"No store attached");return this._store}async ready(){await super.ready(),!this._initialized&&(this._initialized=!0,this._store=await this.$store)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.makeRootDirectory()}emptySync(){this.store.clearSync(),this.makeRootDirectorySync()}async rename(i,n,r){let o=this.store.transaction(),a=v(i),l=N(i),c=v(n),u=N(n),h=await this.findINode(o,a),d=await this.getDirListing(o,h,a);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"rename");if(!d[l])throw f.With("ENOENT",i,"rename");let b=d[l];if(delete d[l],(c+"/").indexOf(i+"/")===0)throw new f(16,a);let m,w;if(c===a?(m=h,w=d):(m=await this.findINode(o,c),w=await this.getDirListing(o,m,c)),w[u]){let g=await this.getINode(o,w[u],n);if(g.toStats().isFile())try{await o.remove(g.ino),await o.remove(w[u])}catch(I){throw await o.abort(),I}else throw f.With("EPERM",n,"rename")}w[u]=b;try{await o.set(h.ino,ye(d)),await o.set(m.ino,ye(w))}catch(g){throw await o.abort(),g}await o.commit()}renameSync(i,n,r){let o=this.store.transaction(),a=v(i),l=N(i),c=v(n),u=N(n),h=this.findINodeSync(o,a),d=this.getDirListingSync(o,h,a);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"rename");if(!d[l])throw f.With("ENOENT",i,"rename");let b=d[l];if(delete d[l],(c+"/").indexOf(i+"/")==0)throw new f(16,a);let m,w;if(c===a?(m=h,w=d):(m=this.findINodeSync(o,c),w=this.getDirListingSync(o,m,c)),w[u]){let g=this.getINodeSync(o,w[u],n);if(g.toStats().isFile())try{o.removeSync(g.ino),o.removeSync(w[u])}catch(I){throw o.abortSync(),I}else throw f.With("EPERM",n,"rename")}w[u]=b;try{o.setSync(h.ino,ye(d)),o.setSync(m.ino,ye(w))}catch(g){throw o.abortSync(),g}o.commitSync()}async stat(i,n){let r=this.store.transaction(),o=await this.findINode(r,i);if(!o)throw f.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,n))throw f.With("EACCES",i,"stat");return a}statSync(i,n){let r=this.findINodeSync(this.store.transaction(),i).toStats();if(!r.hasAccess(4,n))throw f.With("EACCES",i,"stat");return r}async createFile(i,n,r,o){let a=new Uint8Array(0),l=await this.commitNew(this.store.transaction(),i,z.FILE,r,o,a);return new ce(this,i,n,l.toStats(),a)}createFileSync(i,n,r,o){return this.commitNewSync(i,z.FILE,r,o),this.openFileSync(i,n,o)}async openFile(i,n,r){let o=this.store.transaction(),a=await this.findINode(o,i),l=await o.get(a.ino);if(!a.toStats().hasAccess(It(n),r))throw f.With("EACCES",i,"openFile");if(!l)throw f.With("ENOENT",i,"openFile");return new ce(this,i,n,a.toStats(),l)}openFileSync(i,n,r){let o=this.store.transaction(),a=this.findINodeSync(o,i),l=o.getSync(a.ino);if(!a.toStats().hasAccess(It(n),r))throw f.With("EACCES",i,"openFile");if(!l)throw f.With("ENOENT",i,"openFile");return new ce(this,i,n,a.toStats(),l)}async unlink(i,n){return this.remove(i,!1,n)}unlinkSync(i,n){this.removeSync(i,!1,n)}async rmdir(i,n){if((await this.readdir(i,n)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0,n)}rmdirSync(i,n){if(this.readdirSync(i,n).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0,n)}async mkdir(i,n,r){let o=this.store.transaction(),a=Xe("{}");await this.commitNew(o,i,z.DIRECTORY,n,r,a)}mkdirSync(i,n,r){this.commitNewSync(i,z.DIRECTORY,n,r,Xe("{}"))}async readdir(i,n){let r=this.store.transaction(),o=await this.findINode(r,i);if(!o.toStats().hasAccess(4,n))throw f.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(r,o,i))}readdirSync(i,n){let r=this.store.transaction(),o=this.findINodeSync(r,i);if(!o.toStats().hasAccess(4,n))throw f.With("EACCES",i,"readdir");return Object.keys(this.getDirListingSync(r,o,i))}async sync(i,n,r){let o=this.store.transaction(),a=await this._findINode(o,v(i),N(i)),l=await this.getINode(o,a,i),c=l.update(r);try{await o.set(l.ino,n),c&&await o.set(a,l.data)}catch(u){throw await o.abort(),u}await o.commit()}syncSync(i,n,r){let o=this.store.transaction(),a=this._findINodeSync(o,v(i),N(i)),l=this.getINodeSync(o,a,i),c=l.update(r);try{o.setSync(l.ino,n),c&&o.setSync(a,l.data)}catch(u){throw o.abortSync(),u}o.commitSync()}async link(i,n,r){let o=this.store.transaction(),a=v(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,r))throw f.With("EACCES",a,"link");let c=v(n),u=await this.findINode(o,c),h=await this.getDirListing(o,u,c);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",c,"link");let d=await this._findINode(o,a,N(i)),b=await this.getINode(o,d,i);if(!b.toStats().hasAccess(2,r))throw f.With("EACCES",n,"link");b.nlink++,h[N(n)]=d;try{o.setSync(d,b.data),o.setSync(u.ino,ye(h))}catch(m){throw o.abortSync(),m}o.commitSync()}linkSync(i,n,r){let o=this.store.transaction(),a=v(i);if(!this.findINodeSync(o,a).toStats().hasAccess(4,r))throw f.With("EACCES",a,"link");let c=v(n),u=this.findINodeSync(o,c),h=this.getDirListingSync(o,u,c);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",c,"link");let d=this._findINodeSync(o,a,N(i)),b=this.getINodeSync(o,d,i);if(!b.toStats().hasAccess(2,r))throw f.With("EACCES",n,"link");b.nlink++,h[N(n)]=d;try{o.setSync(d,b.data),o.setSync(u.ino,ye(h))}catch(m){throw o.abortSync(),m}o.commitSync()}async makeRootDirectory(){let i=this.store.transaction();if(await i.get(De))return;let n=new Ne;n.mode=511|z.DIRECTORY,await i.set(n.ino,Xe("{}")),await i.set(De,n.data),await i.commit()}makeRootDirectorySync(){let i=this.store.transaction();if(i.getSync(De))return;let n=new Ne;n.mode=511|z.DIRECTORY,i.setSync(n.ino,Xe("{}")),i.setSync(De,n.data),i.commitSync()}async _findINode(i,n,r,o=new Set){let a=B(n,r);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return De;let l=n=="/"?await this.getINode(i,De,n):await this.findINode(i,n,o),c=await this.getDirListing(i,l,n);if(!(r in c))throw f.With("ENOENT",lt(n,r),"_findINode");return c[r]}_findINodeSync(i,n,r,o=new Set){let a=B(n,r);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return De;let l=n=="/"?this.getINodeSync(i,De,n):this.findINodeSync(i,n,o),c=this.getDirListingSync(i,l,n);if(!(r in c))throw f.With("ENOENT",lt(n,r),"_findINode");return c[r]}async findINode(i,n,r=new Set){let o=await this._findINode(i,v(n),N(n),r);return this.getINode(i,o,n)}findINodeSync(i,n,r=new Set){let o=this._findINodeSync(i,v(n),N(n),r);return this.getINodeSync(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw f.With("ENOENT",r,"getINode");return new Ne(o.buffer)}getINodeSync(i,n,r){let o=i.getSync(n);if(!o)throw f.With("ENOENT",r,"getINode");return new Ne(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw f.With("ENOENT",r,"getDirListing");return _n(o)}getDirListingSync(i,n,r){if(!n.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let o=i.getSync(n.ino);if(!o)throw f.With("ENOENT",r,"getDirListing");return _n(o)}async addNew(i,n,r){for(let o=0;o<Ks;o++){let a=Ai();if(!await i.get(a))return await i.set(a,n),a}throw new f(28,"No inode IDs available",r,"addNewNode")}addNewSync(i,n,r){for(let o=0;o<Ks;o++){let a=Ai();if(!i.getSync(a))return i.setSync(a,n),a}throw new f(28,"No inode IDs available",r,"addNewNode")}async commitNew(i,n,r,o,a,l){let c=v(n),u=await this.findINode(i,c);if(!u.toStats().hasAccess(2,a))throw f.With("EACCES",n,"commitNewFile");let h=N(n),d=await this.getDirListing(i,u,c);if(n==="/")throw f.With("EEXIST",n,"commitNewFile");if(d[h])throw await i.abort(),f.With("EEXIST",n,"commitNewFile");try{let b=new Ne;return b.ino=await this.addNew(i,l,n),b.mode=o|r,b.uid=a.uid,b.gid=a.gid,b.size=l.length,d[h]=await this.addNew(i,b.data,n),await i.set(u.ino,ye(d)),await i.commit(),b}catch(b){throw i.abort(),b}}commitNewSync(i,n,r,o,a=new Uint8Array){let l=this.store.transaction(),c=v(i),u=this.findINodeSync(l,c);if(!u.toStats().hasAccess(2,o))throw f.With("EACCES",i,"commitNewFile");let h=N(i),d=this.getDirListingSync(l,u,c);if(i==="/")throw f.With("EEXIST",i,"commitNewFile");if(d[h])throw f.With("EEXIST",i,"commitNewFile");let b=new Ne;try{b.ino=this.addNewSync(l,a,i),b.size=a.length,b.mode=r|n,b.uid=o.uid,b.gid=o.gid,d[h]=this.addNewSync(l,b.data,i),l.setSync(u.ino,ye(d))}catch(m){throw l.abortSync(),m}return l.commitSync(),b}async remove(i,n,r){let o=this.store.transaction(),a=v(i),l=await this.findINode(o,a),c=await this.getDirListing(o,l,a),u=N(i);if(!c[u])throw f.With("ENOENT",i,"removeEntry");let h=c[u],d=await this.getINode(o,h,i);if(!d.toStats().hasAccess(2,r))throw f.With("EACCES",i,"removeEntry");if(delete c[u],!n&&d.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(n&&!d.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{await o.set(l.ino,ye(c)),--d.nlink<1&&(await o.remove(d.ino),await o.remove(h))}catch(b){throw await o.abort(),b}await o.commit()}removeSync(i,n,r){let o=this.store.transaction(),a=v(i),l=this.findINodeSync(o,a),c=this.getDirListingSync(o,l,a),u=N(i),h=c[u];if(!h)throw f.With("ENOENT",i,"removeEntry");let d=this.getINodeSync(o,h,i);if(!d.toStats().hasAccess(2,r))throw f.With("EACCES",i,"removeEntry");if(delete c[u],!n&&d.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(n&&!d.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{o.setSync(l.ino,ye(c)),--d.nlink<1&&(o.removeSync(d.ino),o.removeSync(h))}catch(b){throw o.abortSync(),b}o.commitSync()}};var Ur=class{constructor(){this.aborted=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.aborted||await this.commit()}[Symbol.dispose](){this.aborted||this.commitSync()}},En=class extends Ur{static{s(this,"SyncTransaction")}async get(e){return this.getSync(e)}async set(e,i){return this.setSync(e,i)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}};var xn=class extends En{constructor(i){super();this.store=i;this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let n=this.store.get(i);return this.stashOldValue(i,n),n}setSync(i,n){return this.markModified(i),this.store.set(i,n)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){}abortSync(){for(let i of this.modifiedKeys){let n=this.originalData.get(i);n?this.store.set(i,n):this.store.delete(i)}}stashOldValue(i,n){this.originalData.has(i)||this.originalData.set(i,n)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var kn=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new xn(this)}},Li={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:t}){return new Ri(new kn(t))},"create")};function Cd(t){return typeof t=="object"&&t!=null&&"fd"in t&&"path"in t&&"position"in t}s(Cd,"isFileData");function qr(t){return typeof t=="object"&&t!=null&&"_zenfs"in t&&!!t._zenfs}s(qr,"isMessage");var Xt=new Map;function jr(t,{port:e,timeout:i=1e3,fs:n}={}){let r=new Error().stack.slice(6);if(!e)throw f.With("EINVAL");return new Promise((o,a)=>{let l=Math.random().toString(16).slice(10);Xt.set(l,{resolve:o,reject:a,fs:n}),e.postMessage({...t,_zenfs:!0,id:l,stack:r}),setTimeout(()=>{let c=new f(5,"RPC Failed");c.stack+=r,a(c)},i)})}s(jr,"request");function Xs(t){if(!qr(t))return;let{id:e,value:i,error:n,stack:r}=t;if(!Xt.has(e)){let c=new f(5,"Invalid RPC id:"+e);throw c.stack+=r,c}let{resolve:o,reject:a,fs:l}=Xt.get(e);if(n){let c=f.fromJSON(i);c.stack+=r,a(c),Xt.delete(e);return}if(Cd(i)){let{fd:c,path:u,position:h}=i,d=new Ni(l,c,u,h);o(d),Xt.delete(e);return}o(i),Xt.delete(e)}s(Xs,"handleResponse");function $r(t,e){if(!t)throw f.With("EINVAL");t["on"in t?"on":"addEventListener"]("message",i=>{e("data"in i?i.data:i)})}s($r,"attach");function Js(t,e){if(!t)throw f.With("EINVAL");t["off"in t?"off":"removeEventListener"]("message",i=>{e("data"in i?i.data:i)})}s(Js,"detach");var Ni=class extends vt{constructor(i,n,r,o){super();this.fs=i;this.fd=n;this.path=r;this.position=o}static{s(this,"PortFile")}rpc(i,...n){return jr({scope:"file",fd:this.fd,method:i,args:n},this.fs.options)}stat(){return this.rpc("stat")}statSync(){throw f.With("ENOSYS",this.path,"PortFile.stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){throw f.With("ENOSYS",this.path,"PortFile.truncate")}write(i,n,r,o){return this.rpc("write",i,n,r,o)}writeSync(){throw f.With("ENOSYS",this.path,"PortFile.write")}async read(i,n,r,o){return await this.rpc("read",i,n,r,o)}readSync(){throw f.With("ENOSYS",this.path,"PortFile.read")}chown(i,n){return this.rpc("chown",i,n)}chownSync(){throw f.With("ENOSYS",this.path,"PortFile.chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){throw f.With("ENOSYS",this.path,"PortFile.chmod")}utimes(i,n){return this.rpc("utimes",i,n)}utimesSync(){throw f.With("ENOSYS",this.path,"PortFile.utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){throw f.With("ENOSYS",this.path,"PortFile._setType")}close(){return this.rpc("close")}closeSync(){throw f.With("ENOSYS",this.path,"PortFile.close")}sync(){return this.rpc("sync")}syncSync(){throw f.With("ENOSYS",this.path,"PortFile.sync")}},vn=class extends Br(se){constructor(i){super();this.options=i;this._sync=Li.create({name:"port-tmpfs"});this.port=i.port,$r(this.port,Xs)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return jr({scope:"fs",method:i,args:n},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,n,r){return this.rpc("rename",i,n,r)}async stat(i,n){return new R(await this.rpc("stat",i,n))}sync(i,n,r){return this.rpc("sync",i,n,r)}openFile(i,n,r){return this.rpc("openFile",i,n,r)}createFile(i,n,r,o){return this.rpc("createFile",i,n,r,o)}unlink(i,n){return this.rpc("unlink",i,n)}rmdir(i,n){return this.rpc("rmdir",i,n)}mkdir(i,n,r){return this.rpc("mkdir",i,n,r)}readdir(i,n){return this.rpc("readdir",i,n)}exists(i,n){return this.rpc("exists",i,n)}link(i,n,r){return this.rpc("link",i,n,r)}},Qs=0,Fn=new Map;async function Zs(t,e,i){if(!qr(i))return;let{method:n,args:r,id:o,scope:a,stack:l}=i,c,u=!1;try{switch(a){case"fs":c=await e[n](...r),c instanceof vt&&(Fn.set(++Qs,c),c={fd:Qs,path:c.path,position:c.position});break;case"file":let{fd:h}=i;if(!Fn.has(h))throw new f(9);c=await Fn.get(h)[n](...r),n=="close"&&Fn.delete(h);break;default:return}}catch(h){c=h,u=!0}t.postMessage({_zenfs:!0,scope:a,id:o,error:u,method:n,stack:l,value:c instanceof f?c.toJSON():c})}s(Zs,"handleRequest");function Ld(t,e){$r(t,i=>Zs(t,e,i))}s(Ld,"attachFS");function Nd(t,e){Js(t,i=>Zs(t,e,i))}s(Nd,"detachFS");var Dd={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(t){if(typeof t?.postMessage!="function")throw new f(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(async function(){return!0},"isAvailable"),create:s(function(t){return new vn(t)},"create")};var At=class t{constructor(){this._index=new Map;this.add("/",new ct)}static{s(this,"FileIndex")}static FromListing(e){let i=new t,n=new ct;i._index.set("/",n);let r=[{pwd:"",tree:e,parent:n}];for(;r.length>0;){let o,{tree:a,pwd:l,parent:c}=r.pop();for(let u in a){if(!Object.hasOwn(a,u))continue;let h=a[u];if(h){let d=l+"/"+u;o=new ct,i._index.set(d,o),r.push({pwd:d,tree:h,parent:o})}else o=new In(new R({mode:z.FILE|365}));c&&c._listing.set(u,o)}}return i}files(){let e=[];for(let i of this._index.values())for(let n of i.listing){let r=i.get(n);r&&r.isFile()&&e.push(r)}return e}add(e,i){if(!i)throw new f(22,"Inode must be specified",e,"FileIndex.add");if(!e.startsWith("/"))throw new f(22,"Path not absolute",e,"FileIndex.add");if(this._index.has(e))return this._index.get(e)===i;let n=v(e),r=this._index.has(n),o=r?this._index.get(n):new ct;return!r&&e!="/"&&!this.add(n,o)||e!="/"&&!o.add(N(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let n=v(e),r=N(e),o=this._index.get(n);return o||(o=new ct,this.addFast(n,o)),o.add(r,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=v(e),n=this._index.get(i);if(!n)return;let r=n.remove(N(e));if(!r)return;if(!r.isDirectory())return r;let o=r.listing;for(let a of o)this.remove(B(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=v(e),n=this._index.get(i);return i==e?n:n?.get(N(e))}},Di=class{constructor(e){this.data=e}static{s(this,"IndexInode")}},In=class extends Di{static{s(this,"IndexFileInode")}isFile(){return!0}isDirectory(){return!1}toStats(){return new R({mode:z.FILE|438,size:4096})}},ct=class extends Di{constructor(){super(...arguments);this._listing=new Map}static{s(this,"IndexDirInode")}isFile(){return!1}isDirectory(){return!0}get stats(){return new R({mode:z.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(i){return this._listing.get(i)}add(i,n){return this._listing.has(i)?!1:(this._listing.set(i,n),!0)}remove(i){let n=this._listing.get(i);if(n)return this._listing.delete(i),n}},Bi=class extends Mr(se){static{s(this,"IndexFS")}constructor(e){super(),this._index=At.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new f(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new f(22,"Invalid inode.")}async openFile(e,i,n){if(pe(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(It(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new Ke(this,e,i,o,o.fileData)}return this.openFileInode(r,e,i)}openFileSync(e,i,n){if(pe(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(It(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new Ke(this,e,i,o,o.fileData)}return this.openFileInodeSync(r,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}},Vr=class extends Bi{static{s(this,"SyncIndexFS")}async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,n){return this.openFileInodeSync(e,i,n)}},Mi=class extends Bi{static{s(this,"AsyncIndexFS")}statFileInodeSync(e,i){throw f.With("ENOSYS",i,"AsyncIndexFS.statFileInodeSync")}openFileInodeSync(e,i,n){throw f.With("ENOSYS",i,"AsyncIndexFS.openFileInodeSync")}};function Pn(t){throw new f(5,t.message)}s(Pn,"convertError");async function Bd(t,e){let i=await fetch(t).catch(Pn);if(!i.ok)throw new f(5,"fetch failed: response returned code "+i.status);switch(e){case"buffer":let n=await i.arrayBuffer().catch(Pn);return new Uint8Array(n);case"json":return i.json().catch(Pn);default:throw new f(22,"Invalid download type: "+e)}}s(Bd,"fetchFile");async function Md(t){let e=await fetch(t,{method:"HEAD"}).catch(Pn);if(!e.ok)throw new f(5,"fetch failed: HEAD response returned code "+e.status);return parseInt(e.headers.get("Content-Length")||"-1",10)}s(Md,"fetchSize");var An=class t extends Mi{static{s(this,"FetchFS")}async _initialize(e){if(typeof e!="string"){this._index=At.FromListing(e);return}try{let i=await fetch(e);this._index=At.FromListing(await i.json())}catch{throw new f(22,"Invalid or unavailable file listing tree")}}async ready(){await this._init}constructor({index:e="index.json",baseUrl:i=""}){super({}),i.at(-1)!="/"&&(i+="/"),this.prefixUrl=i,this._init=this._initialize(e)}metadata(){return{...super.metadata(),name:t.name,readonly:!0}}empty(){for(let e of this._index.files())delete e.data.fileData}preloadFile(e,i){let n=this._index.get(e);if(!n)throw f.With("ENOENT",e,"preloadFile");if(!n.isFile())throw f.With("EISDIR",e,"preloadFile");let r=n.data;r.size=i.length,r.fileData=i}async statFileInode(e,i){let n=e.data;return n.size<0&&(n.size=await this._fetchSize(i)),n}async openFileInode(e,i,n){let r=e.data;if(r.fileData)return new Ke(this,i,n,new R(r),r.fileData);let o=await this._fetchFile(i,"buffer");return r.size=o.length,r.fileData=o,new Ke(this,i,n,new R(r),o)}_getRemotePath(e){return e.charAt(0)==="/"&&(e=e.slice(1)),this.prefixUrl+e}_fetchFile(e,i){return Bd(this._getRemotePath(e),i)}_fetchSize(e){return Md(this._getRemotePath(e))}},Wd={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make_http_index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(t){return new An(t)},"create")};var Wi=class{constructor(){this._locks=new Map}static{s(this,"Mutex")}lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[i])})}unlock(e){if(!this._locks.has(e))throw new f(1,"Can not unlock an already unlocked path",e);let i=this._locks.get(e)?.shift();if(i){setTimeout(i,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)}};var Ui=class{constructor(e){this.fs=e;this._mu=new Wi}static{s(this,"LockedFS")}async ready(){await this.fs.ready()}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,n){await this._mu.lock(e),await this.fs.rename(e,i,n),this._mu.unlock(e)}renameSync(e,i,n){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"rename");return this.fs.renameSync(e,i,n)}async stat(e,i){await this._mu.lock(e);let n=await this.fs.stat(e,i);return this._mu.unlock(e),n}statSync(e,i){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"stat");return this.fs.statSync(e,i)}async openFile(e,i,n){await this._mu.lock(e);let r=await this.fs.openFile(e,i,n);return this._mu.unlock(e),r}openFileSync(e,i,n){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"openFile");return this.fs.openFileSync(e,i,n)}async createFile(e,i,n,r){await this._mu.lock(e);let o=await this.fs.createFile(e,i,n,r);return this._mu.unlock(e),o}createFileSync(e,i,n,r){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"createFile");return this.fs.createFileSync(e,i,n,r)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"unlink");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"rmdir");return this.fs.rmdirSync(e,i)}async mkdir(e,i,n){await this._mu.lock(e),await this.fs.mkdir(e,i,n),this._mu.unlock(e)}mkdirSync(e,i,n){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"mkdir");return this.fs.mkdirSync(e,i,n)}async readdir(e,i){await this._mu.lock(e);let n=await this.fs.readdir(e,i);return this._mu.unlock(e),n}readdirSync(e,i){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"readdir");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let n=await this.fs.exists(e,i);return this._mu.unlock(e),n}existsSync(e,i){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"exists");return this.fs.existsSync(e,i)}async link(e,i,n){await this._mu.lock(e),await this.fs.link(e,i,n),this._mu.unlock(e)}linkSync(e,i,n){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"link");return this.fs.linkSync(e,i,n)}async sync(e,i,n){await this._mu.lock(e),await this.fs.sync(e,i,n),this._mu.unlock(e)}syncSync(e,i,n){if(this._mu.isLocked(e))throw f.With("EBUSY",e,"sync");return this.fs.syncSync(e,i,n)}};var zr="/.deleted",Tn=class extends se{constructor({writable:i,readable:n}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this._writable=i,this._readable=n,this._writable.metadata().readonly)throw new f(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnlockedOverlayFS")}async ready(){await this._readable.ready(),await this._writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:qi.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(i,n,r){let o=r.cred(0,0);await this.createParentDirectories(i,o),await this._writable.sync(i,n,r)}syncSync(i,n,r){let o=r.cred(0,0);this.createParentDirectoriesSync(i,o),this._writable.syncSync(i,n,r)}async _initialize(){if(!this._isInitialized){try{let i=await this._writable.openFile(zr,L("r"),Be),{size:n}=await i.stat(),{buffer:r}=await i.read(new Uint8Array(n));this._deleteLog=Sn(r)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(i,n){this._deleteLog=i,this._reparseDeletionLog(),this.updateLog("",n)}async rename(i,n,r){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{await this._writable.rename(i,n,r)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"rename")}}renameSync(i,n,r){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{this._writable.renameSync(i,n,r)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"rename")}}async stat(i,n){this.checkInitialized();try{return this._writable.stat(i,n)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"stat");let o=new R(await this._readable.stat(i,n));return o.mode|=146,o}}statSync(i,n){this.checkInitialized();try{return this._writable.statSync(i,n)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"stat");let o=new R(this._readable.statSync(i,n));return o.mode|=146,o}}async openFile(i,n,r){if(await this._writable.exists(i,r))return this._writable.openFile(i,n,r);let o=await this._readable.openFile(i,L("r"),r),a=new R(await o.stat()),{buffer:l}=await o.read(new Uint8Array(a.size));return new ce(this,i,n,a,l)}openFileSync(i,n,r){if(this._writable.existsSync(i,r))return this._writable.openFileSync(i,n,r);let o=this._readable.openFileSync(i,L("r"),r),a=R.clone(o.statSync()),l=new Uint8Array(a.size);return o.readSync(l),new ce(this,i,n,a,l)}async createFile(i,n,r,o){return this.checkInitialized(),await this._writable.createFile(i,n,r,o),this.openFile(i,n,o)}createFileSync(i,n,r,o){return this.checkInitialized(),this._writable.createFileSync(i,n,r,o),this.openFileSync(i,n,o)}async link(i,n,r){this.checkInitialized(),await this._writable.link(i,n,r)}linkSync(i,n,r){this.checkInitialized(),this._writable.linkSync(i,n,r)}async unlink(i,n){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i,n))throw f.With("ENOENT",i,"unlink");await this._writable.exists(i,n)&&await this._writable.unlink(i,n),await this.exists(i,n)&&this.deletePath(i,n)}unlinkSync(i,n){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i,n))throw f.With("ENOENT",i,"unlink");this._writable.existsSync(i,n)&&this._writable.unlinkSync(i,n),this.existsSync(i,n)&&this.deletePath(i,n)}async rmdir(i,n){if(this.checkInitialized(),!await this.exists(i,n))throw f.With("ENOENT",i,"rmdir");if(await this._writable.exists(i,n)&&await this._writable.rmdir(i,n),await this.exists(i,n)){if((await this.readdir(i,n)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,n)}}rmdirSync(i,n){if(this.checkInitialized(),!this.existsSync(i,n))throw f.With("ENOENT",i,"rmdir");if(this._writable.existsSync(i,n)&&this._writable.rmdirSync(i,n),this.existsSync(i,n)){if(this.readdirSync(i,n).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,n)}}async mkdir(i,n,r){if(this.checkInitialized(),await this.exists(i,r))throw f.With("EEXIST",i,"mkdir");await this.createParentDirectories(i,r),await this._writable.mkdir(i,n,r)}mkdirSync(i,n,r){if(this.checkInitialized(),this.existsSync(i,r))throw f.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i,r),this._writable.mkdirSync(i,n,r)}async readdir(i,n){if(this.checkInitialized(),!(await this.stat(i,n)).isDirectory())throw f.With("ENOTDIR",i,"readdir");let o=[];try{o.push(...await this._writable.readdir(i,n))}catch{}try{o.push(...(await this._readable.readdir(i,n)).filter(l=>!this._deletedFiles.has(`${i}/${l}`)))}catch{}let a={};return o.filter(l=>{let c=!a[l];return a[l]=!0,c})}readdirSync(i,n){if(this.checkInitialized(),!this.statSync(i,n).isDirectory())throw f.With("ENOTDIR",i,"readdir");let o=[];try{o=o.concat(this._writable.readdirSync(i,n))}catch{}try{o=o.concat(this._readable.readdirSync(i,n).filter(l=>!this._deletedFiles.has(`${i}/${l}`)))}catch{}let a={};return o.filter(l=>{let c=!a[l];return a[l]=!0,c})}deletePath(i,n){this._deletedFiles.add(i),this.updateLog(`d${i}
|
|
1
|
+
"use strict";var ZenFS=(()=>{var Xu=Object.create;var Fi=Object.defineProperty;var Ju=Object.getOwnPropertyDescriptor;var Qu=Object.getOwnPropertyNames;var Zu=Object.getPrototypeOf,ed=Object.prototype.hasOwnProperty;var s=(t,e)=>Fi(t,"name",{value:e,configurable:!0});var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gn=(t,e)=>{for(var i in e)Fi(t,i,{get:e[i],enumerable:!0})},$s=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Qu(e))!ed.call(t,r)&&r!==i&&Fi(t,r,{get:()=>e[r],enumerable:!(n=Ju(e,r))||n.enumerable});return t};var Ar=(t,e,i)=>(i=t!=null?Xu(Zu(t)):{},$s(e||!t||!t.__esModule?Fi(i,"default",{value:t,enumerable:!0}):i,t)),td=t=>$s(Fi({},"__esModule",{value:!0}),t);var na=T(On=>{"use strict";On.byteLength=$d;On.toByteArray=zd;On.fromByteArray=Gd;var Me=[],ge=[],jd=typeof Uint8Array<"u"?Uint8Array:Array,Gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(At=0,ta=Gr.length;At<ta;++At)Me[At]=Gr[At],ge[Gr.charCodeAt(At)]=At;var At,ta;ge[45]=62;ge[95]=63;function ia(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var n=i===e?0:4-i%4;return[i,n]}s(ia,"getLens");function $d(t){var e=ia(t),i=e[0],n=e[1];return(i+n)*3/4-n}s($d,"byteLength");function Vd(t,e,i){return(e+i)*3/4-i}s(Vd,"_byteLength");function zd(t){var e,i=ia(t),n=i[0],r=i[1],o=new jd(Vd(t,n,r)),a=0,l=r>0?n-4:n,c;for(c=0;c<l;c+=4)e=ge[t.charCodeAt(c)]<<18|ge[t.charCodeAt(c+1)]<<12|ge[t.charCodeAt(c+2)]<<6|ge[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return r===2&&(e=ge[t.charCodeAt(c)]<<2|ge[t.charCodeAt(c+1)]>>4,o[a++]=e&255),r===1&&(e=ge[t.charCodeAt(c)]<<10|ge[t.charCodeAt(c+1)]<<4|ge[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(zd,"toByteArray");function Hd(t){return Me[t>>18&63]+Me[t>>12&63]+Me[t>>6&63]+Me[t&63]}s(Hd,"tripletToBase64");function Yd(t,e,i){for(var n,r=[],o=e;o<i;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),r.push(Hd(n));return r.join("")}s(Yd,"encodeChunk");function Gd(t){for(var e,i=t.length,n=i%3,r=[],o=16383,a=0,l=i-n;a<l;a+=o)r.push(Yd(t,a,a+o>l?l:a+o));return n===1?(e=t[i-1],r.push(Me[e>>2]+Me[e<<4&63]+"==")):n===2&&(e=(t[i-2]<<8)+t[i-1],r.push(Me[e>>10]+Me[e>>4&63]+Me[e<<2&63]+"=")),r.join("")}s(Gd,"fromByteArray")});var ra=T(Kr=>{Kr.read=function(t,e,i,n,r){var o,a,l=r*8-n-1,c=(1<<l)-1,u=c>>1,h=-7,d=i?r-1:0,b=i?-1:1,m=t[e+d];for(d+=b,o=m&(1<<-h)-1,m>>=-h,h+=l;h>0;o=o*256+t[e+d],d+=b,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[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,n),o=o-u}return(m?-1:1)*a*Math.pow(2,o-n)};Kr.write=function(t,e,i,n,r,o){var a,l,c,u=o*8-r-1,h=(1<<u)-1,d=h>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,w=n?1:-1,g=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,r),a=a+d):(l=e*Math.pow(2,d-1)*Math.pow(2,r),a=0));r>=8;t[i+m]=l&255,m+=w,l/=256,r-=8);for(a=a<<r|l,u+=r;u>0;t[i+m]=a&255,m+=w,a/=256,u-=8);t[i+m-w]|=g*128}});var _e=T(ti=>{"use strict";var Xr=na(),Zt=ra(),oa=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ti.Buffer=y;ti.SlowBuffer=eh;ti.INSPECT_MAX_BYTES=50;var Cn=2147483647;ti.kMaxLength=Cn;y.TYPED_ARRAY_SUPPORT=Kd();!y.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 Kd(){try{let t=new Uint8Array(1),e={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Kd,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.buffer},"get")});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function Je(t){if(t>Cn)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(Je,"createBuffer");function y(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return eo(t)}return ca(t,e,i)}s(y,"Buffer");y.poolSize=8192;function ca(t,e,i){if(typeof t=="string")return Jd(t,e);if(ArrayBuffer.isView(t))return Qd(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(We(t,ArrayBuffer)||t&&We(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(t,SharedArrayBuffer)||t&&We(t.buffer,SharedArrayBuffer)))return Qr(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return y.from(n,e,i);let r=Zd(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return y.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(ca,"from");y.from=function(t,e,i){return ca(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function fa(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(fa,"assertSize");function Xd(t,e,i){return fa(t),t<=0?Je(t):e!==void 0?typeof i=="string"?Je(t).fill(e,i):Je(t).fill(e):Je(t)}s(Xd,"alloc");y.alloc=function(t,e,i){return Xd(t,e,i)};function eo(t){return fa(t),Je(t<0?0:to(t)|0)}s(eo,"allocUnsafe");y.allocUnsafe=function(t){return eo(t)};y.allocUnsafeSlow=function(t){return eo(t)};function Jd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=ua(t,e)|0,n=Je(i),r=n.write(t,e);return r!==i&&(n=n.slice(0,r)),n}s(Jd,"fromString");function Jr(t){let e=t.length<0?0:to(t.length)|0,i=Je(e);for(let n=0;n<e;n+=1)i[n]=t[n]&255;return i}s(Jr,"fromArrayLike");function Qd(t){if(We(t,Uint8Array)){let e=new Uint8Array(t);return Qr(e.buffer,e.byteOffset,e.byteLength)}return Jr(t)}s(Qd,"fromArrayView");function Qr(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&i===void 0?n=new Uint8Array(t):i===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,i),Object.setPrototypeOf(n,y.prototype),n}s(Qr,"fromArrayBuffer");function Zd(t){if(y.isBuffer(t)){let e=to(t.length)|0,i=Je(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||no(t.length)?Je(0):Jr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Jr(t.data)}s(Zd,"fromObject");function to(t){if(t>=Cn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Cn.toString(16)+" bytes");return t|0}s(to,"checked");function eh(t){return+t!=t&&(t=0),y.alloc(+t)}s(eh,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),We(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let n=e.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==i[o]){n=e[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");y.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");y.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<e.length;++n)i+=e[n].length;let r=y.allocUnsafe(i),o=0;for(n=0;n<e.length;++n){let a=e[n];if(We(a,Uint8Array))o+a.length>r.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(y.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function ua(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||We(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Zr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Sa(t).length;default:if(r)return n?-1:Zr(t).length;e=(""+e).toLowerCase(),r=!0}}s(ua,"byteLength");y.byteLength=ua;function th(t,e,i){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return uh(this,e,i);case"utf8":case"utf-8":return ha(this,e,i);case"ascii":return ch(this,e,i);case"latin1":case"binary":return fh(this,e,i);case"base64":return ah(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dh(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s(th,"slowToString");y.prototype._isBuffer=!0;function Ot(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}s(Ot,"swap");y.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 i=0;i<e;i+=2)Ot(this,i,i+1);return this},"swap16");y.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 i=0;i<e;i+=4)Ot(this,i,i+3),Ot(this,i+1,i+2);return this},"swap32");y.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 i=0;i<e;i+=8)Ot(this,i,i+7),Ot(this,i+1,i+6),Ot(this,i+2,i+5),Ot(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?ha(this,0,e):th.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},"equals");y.prototype.inspect=s(function(){let e="",i=ti.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");oa&&(y.prototype[oa]=y.prototype.inspect);y.prototype.compare=s(function(e,i,n,r,o){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;let a=o-r,l=n-i,c=Math.min(a,l),u=this.slice(r,o),h=e.slice(i,n);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 da(t,e,i,n,r){if(t.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,no(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),y.isBuffer(e))return e.length===0?-1:sa(t,e,i,n,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):sa(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(da,"bidirectionalIndexOf");function sa(t,e,i,n,r){let o=1,a=t.length,l=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(h,d){return o===1?h[d]:h.readUInt16BE(d*o)}s(c,"read");let u;if(r){let h=-1;for(u=i;u<a;u++)if(c(t,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(i+l>a&&(i=a-l),u=i;u>=0;u--){let h=!0;for(let d=0;d<l;d++)if(c(t,u+d)!==c(e,d)){h=!1;break}if(h)return u}return-1}s(sa,"arrayIndexOf");y.prototype.includes=s(function(e,i,n){return this.indexOf(e,i,n)!==-1},"includes");y.prototype.indexOf=s(function(e,i,n){return da(this,e,i,n,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,n){return da(this,e,i,n,!1)},"lastIndexOf");function ih(t,e,i,n){i=Number(i)||0;let r=t.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let l=parseInt(e.substr(a*2,2),16);if(no(l))return a;t[i+a]=l}return a}s(ih,"hexWrite");function nh(t,e,i,n){return Rn(Zr(e,t.length-i),t,i,n)}s(nh,"utf8Write");function rh(t,e,i,n){return Rn(mh(e),t,i,n)}s(rh,"asciiWrite");function oh(t,e,i,n){return Rn(Sa(e),t,i,n)}s(oh,"base64Write");function sh(t,e,i,n){return Rn(bh(e,t.length-i),t,i,n)}s(sh,"ucs2Write");y.prototype.write=s(function(e,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return ih(this,e,i,n);case"utf8":case"utf-8":return nh(this,e,i,n);case"ascii":case"latin1":case"binary":return rh(this,e,i,n);case"base64":return oh(this,e,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sh(this,e,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function ah(t,e,i){return e===0&&i===t.length?Xr.fromByteArray(t):Xr.fromByteArray(t.slice(e,i))}s(ah,"base64Slice");function ha(t,e,i){i=Math.min(t.length,i);let n=[],r=e;for(;r<i;){let o=t[r],a=null,l=o>239?4:o>223?3:o>191?2:1;if(r+l<=i){let c,u,h,d;switch(l){case 1:o<128&&(a=o);break;case 2:c=t[r+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(a=d));break;case 3:c=t[r+1],u=t[r+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=t[r+1],u=t[r+2],h=t[r+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,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=l}return lh(n)}s(ha,"utf8Slice");var aa=4096;function lh(t){let e=t.length;if(e<=aa)return String.fromCharCode.apply(String,t);let i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=aa));return i}s(lh,"decodeCodePointsArray");function ch(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]&127);return n}s(ch,"asciiSlice");function fh(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}s(fh,"latin1Slice");function uh(t,e,i){let n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=e;o<i;++o)r+=gh[t[o]];return r}s(uh,"hexSlice");function dh(t,e,i){let n=t.slice(e,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(dh,"utf16leSlice");y.prototype.slice=s(function(e,i){let n=this.length;e=~~e,i=i===void 0?n:~~i,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<e&&(i=e);let r=this.subarray(e,i);return Object.setPrototypeOf(r,y.prototype),r},"slice");function X(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(X,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return r},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e+--i],o=1;for(;i>0&&(o*=256);)r+=this[e+--i]*o;return r},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||X(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||X(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||X(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=ft(s(function(e){e=e>>>0,ei(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Hi(e,this.length-8);let r=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=ft(s(function(e){e=e>>>0,ei(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Hi(e,this.length-8);let r=i*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+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");y.prototype.readIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=i,o=1,a=this[e+--r];for(;r>0&&(o*=256);)a+=this[e+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");y.prototype.readInt8=s(function(e,i){return e=e>>>0,i||X(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");y.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||X(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||X(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=ft(s(function(e){e=e>>>0,ei(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Hi(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=ft(s(function(e){e=e>>>0,ei(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Hi(e,this.length-8);let r=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),Zt.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),Zt.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),Zt.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),Zt.read(this,e,!1,52,8)},"readDoubleBE");function ae(t,e,i,n,r,o){if(!y.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}s(ae,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=1,a=0;for(this[i]=e&255;++a<n&&(o*=256);)this[i+a]=e/o&255;return i+n},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=n-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+n},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function pa(t,e,i,n,r){wa(e,n,r,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(pa,"wrtBigUInt64LE");function ya(t,e,i,n,r){wa(e,n,r,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(ya,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=ft(s(function(e,i=0){return pa(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=ft(s(function(e,i=0){return ya(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=0,a=1,l=0;for(this[i]=e&255;++o<n&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=n-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntBE");y.prototype.writeInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");y.prototype.writeInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");y.prototype.writeBigInt64LE=ft(s(function(e,i=0){return pa(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=ft(s(function(e,i=0){return ya(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function ma(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(ma,"checkIEEE754");function ba(t,e,i,n,r){return e=+e,i=i>>>0,r||ma(t,e,i,4,34028234663852886e22,-34028234663852886e22),Zt.write(t,e,i,n,23,4),i+4}s(ba,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,n){return ba(this,e,i,!0,n)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,n){return ba(this,e,i,!1,n)},"writeFloatBE");function ga(t,e,i,n,r){return e=+e,i=i>>>0,r||ma(t,e,i,8,17976931348623157e292,-17976931348623157e292),Zt.write(t,e,i,n,52,8),i+8}s(ga,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,n){return ga(this,e,i,!0,n)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,n){return ga(this,e,i,!1,n)},"writeDoubleBE");y.prototype.copy=s(function(e,i,n,r){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=e.length&&(i=e.length),i||(i=0),r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-i<r-n&&(r=e.length-i+n);let o=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),i),o},"copy");y.prototype.fill=s(function(e,i,n,r){if(typeof e=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!y.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(e.length===1){let a=e.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=i;o<n;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,r),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%l]}return this},"fill");var Qt={};function io(t,e,i){Qt[t]=class extends i{static{s(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}s(io,"E");io("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);io("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);io("ERR_OUT_OF_RANGE",function(t,e,i){let n=`The value of "${t}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=la(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=la(r)),r+="n"),n+=` It must be ${e}. Received ${r}`,n},RangeError);function la(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(la,"addNumericalSeparator");function hh(t,e,i){ei(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Hi(e,t.length-(i+1))}s(hh,"checkBounds");function wa(t,e,i,n,r,o){if(t>i||t<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 <= ${i}${a}`,new Qt.ERR_OUT_OF_RANGE("value",l,t)}hh(n,r,o)}s(wa,"checkIntBI");function ei(t,e){if(typeof t!="number")throw new Qt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(ei,"validateNumber");function Hi(t,e,i){throw Math.floor(t)!==t?(ei(t,i),new Qt.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new Qt.ERR_BUFFER_OUT_OF_BOUNDS:new Qt.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Hi,"boundsError");var ph=/[^+/0-9A-Za-z-_]/g;function yh(t){if(t=t.split("=")[0],t=t.trim().replace(ph,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(yh,"base64clean");function Zr(t,e){e=e||1/0;let i,n=t.length,r=null,o=[];for(let a=0;a<n;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(Zr,"utf8ToBytes");function mh(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(mh,"asciiToBytes");function bh(t,e){let i,n,r,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(bh,"utf16leToBytes");function Sa(t){return Xr.toByteArray(yh(t))}s(Sa,"base64ToBytes");function Rn(t,e,i,n){let r;for(r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}s(Rn,"blitBuffer");function We(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(We,"isInstance");function no(t){return t!==t}s(no,"numberIsNaN");var gh=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)e[n+r]=t[i]+t[r]}return e}();function ft(t){return typeof BigInt>"u"?wh:t}s(ft,"defineBigIntMethod");function wh(){throw new Error("BigInt not supported")}s(wh,"BufferBigIntNotDefined")});var W=T((hE,za)=>{"use strict";za.exports={ArrayIsArray:s(function(t){return Array.isArray(t)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(t,e){return t.includes(e)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(t,e){return t.indexOf(e)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(t,e){return t.join(e)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(t,e){return t.map(e)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(t,e){return t.pop(e)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(t,e){return t.push(e)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(t,e,...i){return t.call(e,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},"FunctionPrototypeSymbolHasInstance"),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:s(function(t,e){return Object.defineProperties(t,e)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(t,e,i){return Object.defineProperty(t,e,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(t,e){return Object.getOwnPropertyDescriptor(t,e)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(t){return Object.keys(t)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(t,e){return Object.setPrototypeOf(t,e)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(t,e){return t.catch(e)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(t,e,i){return t.then(e,i)},"PromisePrototypeThen"),PromiseReject:s(function(t){return Promise.reject(t)},"PromiseReject"),PromiseResolve:s(function(t){return Promise.resolve(t)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(t,e){return t.test(e)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(t){return t.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(t){return t.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(t){return t.trim()},"StringPrototypeTrim"),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:s(function(t,e,i){return t.set(e,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var ai=T((yE,qn)=>{"use strict";var{AbortController:Ha,AbortSignal:Eh}=typeof self<"u"?self:typeof window<"u"?window:void 0;qn.exports=Ha;qn.exports.AbortSignal=Eh;qn.exports.default=Ha});var Zi=T((mE,ho)=>{"use strict";var li=typeof Reflect=="object"?Reflect:null,Ya=li&&typeof li.apply=="function"?li.apply:s(function(e,i,n){return Function.prototype.apply.call(e,i,n)},"ReflectApply"),jn;li&&typeof li.ownKeys=="function"?jn=li.ownKeys:Object.getOwnPropertySymbols?jn=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):jn=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function _h(t){console&&console.warn&&console.warn(t)}s(_h,"ProcessEmitWarning");var Ka=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function O(){O.init.call(this)}s(O,"EventEmitter");ho.exports=O;ho.exports.once=Ih;O.EventEmitter=O;O.prototype._events=void 0;O.prototype._eventsCount=0;O.prototype._maxListeners=void 0;var Ga=10;function $n(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s($n,"checkListener");Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Ga},"get"),set:s(function(t){if(typeof t!="number"||t<0||Ka(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ga=t},"set")});O.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};O.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Ka(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 Xa(t){return t._maxListeners===void 0?O.defaultMaxListeners:t._maxListeners}s(Xa,"_getMaxListeners");O.prototype.getMaxListeners=s(function(){return Xa(this)},"getMaxListeners");O.prototype.emit=s(function(e){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=e==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[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")Ya(c,this,i);else for(var u=c.length,h=tl(c,u),n=0;n<u;++n)Ya(h[n],this,i);return!0},"emit");function Ja(t,e,i,n){var r,o,a;if($n(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Xa(t),r>0&&a.length>r&&!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=t,l.type=e,l.count=a.length,_h(l)}return t}s(Ja,"_addListener");O.prototype.addListener=s(function(e,i){return Ja(this,e,i,!1)},"addListener");O.prototype.on=O.prototype.addListener;O.prototype.prependListener=s(function(e,i){return Ja(this,e,i,!0)},"prependListener");function xh(){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(xh,"onceWrapper");function Qa(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=xh.bind(n);return r.listener=i,n.wrapFn=r,r}s(Qa,"_onceWrap");O.prototype.once=s(function(e,i){return $n(i),this.on(e,Qa(this,e,i)),this},"once");O.prototype.prependOnceListener=s(function(e,i){return $n(i),this.prependListener(e,Qa(this,e,i)),this},"prependOnceListener");O.prototype.removeListener=s(function(e,i){var n,r,o,a,l;if($n(i),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){l=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():kh(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=s(function(e){var i,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(e,i[r]);return this},"removeAllListeners");function Za(t,e,i){var n=t._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?Fh(r):tl(r,r.length)}s(Za,"_listeners");O.prototype.listeners=s(function(e){return Za(this,e,!0)},"listeners");O.prototype.rawListeners=s(function(e){return Za(this,e,!1)},"rawListeners");O.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):el.call(t,e)};O.prototype.listenerCount=el;function el(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(el,"listenerCount");O.prototype.eventNames=s(function(){return this._eventsCount>0?jn(this._events):[]},"eventNames");function tl(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}s(tl,"arrayClone");function kh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(kh,"spliceOne");function Fh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(Fh,"unwrapListeners");function Ih(t,e){return new Promise(function(i,n){function r(a){t.removeListener(e,o),n(a)}s(r,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),il(t,e,o,{once:!0}),e!=="error"&&vh(t,r,{once:!0})})}s(Ih,"once");function vh(t,e,i){typeof t.on=="function"&&il(t,"error",e,i)}s(vh,"addErrorHandlerIfEventEmitter");function il(t,e,i,n){if(typeof t.on=="function")n.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function r(o){n.once&&t.removeEventListener(e,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(il,"eventTargetAgnosticAddListener")});var Z=T((gE,yo)=>{"use strict";var Ph=_e(),{kResistStopPropagation:Th,SymbolDispose:Ah}=W(),Oh=globalThis.AbortSignal||ai().AbortSignal,Ch=globalThis.AbortController||ai().AbortController,Rh=Object.getPrototypeOf(async function(){}).constructor,nl=globalThis.Blob||Ph.Blob,Lh=s(typeof nl<"u"?function(e){return e instanceof nl}:function(e){return!1},"isBlob"),rl=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Nh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),po=class extends Error{static{s(this,"AggregateError")}constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let n=0;n<e.length;n++)i+=` ${e[n].stack}
|
|
2
|
+
`;super(i),this.name="AggregateError",this.errors=e}};yo.exports={AggregateError:po,kEmptyObject:Object.freeze({}),once:s(function(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},"once"),createDeferredPromise:s(function(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},"createDeferredPromise"),promisify:s(function(t){return new Promise((e,i)=>{t((n,...r)=>n?i(n):e(...r))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(t,...e){return t.replace(/%([sdifj])/g,function(...[i,n]){let r=e.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},"format"),inspect:s(function(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(t){return t instanceof Rh},"isAsyncFunction"),isArrayBufferView:s(function(t){return ArrayBuffer.isView(t)},"isArrayBufferView")},isBlob:Lh,deprecate:s(function(t,e){return t},"deprecate"),addAbortListener:Zi().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);rl(e,"signal"),Nh(i,"listener");let n;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Th]:!0}),n=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Ah](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Oh.any||s(function(e){if(e.length===1)return e[0];let i=new Ch,n=s(()=>i.abort(),"abort");return e.forEach(r=>{rl(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};yo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ne=T((SE,al)=>{"use strict";var{format:Dh,inspect:Vn,AggregateError:Bh}=Z(),Mh=globalThis.AggregateError||Bh,Wh=Symbol("kIsNodeError"),Uh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],qh=/^([A-Z][a-z0-9]*)+$/,jh="__node_internal_",zn={};function Lt(t,e){if(!t)throw new zn.ERR_INTERNAL_ASSERTION(e)}s(Lt,"assert");function ol(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(ol,"addNumericalSeparator");function $h(t,e,i){if(typeof e=="function")return Lt(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let n=(e.match(/%[dfijoOs]/g)||[]).length;return Lt(n===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?e:Dh(e,...i)}s($h,"getMessage");function Q(t,e,i){i||(i=Error);class n extends i{static{s(this,"NodeError")}constructor(...o){super($h(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${t}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[Wh]=!0,zn[t]=n}s(Q,"E");function sl(t){let e=jh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(sl,"hideStackFrames");function Vh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new Mh([e,t],e.message);return i.code=e.code,i}return t||e}s(Vh,"aggregateTwoErrors");var mo=class extends Error{static{s(this,"AbortError")}constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new zn.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Lt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let c of e)Lt(typeof c=="string","All expected entries have to be of type string"),Uh.includes(c)?r.push(c.toLowerCase()):qh.test(c)?o.push(c):(Lt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=r.indexOf("object");c!==-1&&(r.splice(r,c,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let c=r.pop();n+=`one of type ${r.join(", ")}, or ${c}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();n+=`an instance of ${o.join(", ")}, or ${c}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();n+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${i.constructor.name}`;else{let c=Vn(i,{depth:-1});n+=`. Received ${c}`}}else{let c=Vn(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof i} (${c})`}return n},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let n=Vn(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError);Q("ERR_INVALID_RETURN_VALUE",(t,e,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${t} to be returned from the "${e}" function but got ${r}.`},TypeError);Q("ERR_MISSING_ARGS",(...t)=>{Lt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);Q("ERR_OUT_OF_RANGE",(t,e,i)=>{Lt(e,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=ol(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=ol(n)),n+="n"):n=Vn(i),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);al.exports={AbortError:mo,aggregateTwoErrors:sl(Vh),hideStackFrames:sl,codes:zn}});var fi=T((_E,bl)=>{"use strict";var{ArrayIsArray:go,ArrayPrototypeIncludes:ul,ArrayPrototypeJoin:dl,ArrayPrototypeMap:zh,NumberIsInteger:wo,NumberIsNaN:Hh,NumberMAX_SAFE_INTEGER:Yh,NumberMIN_SAFE_INTEGER:Gh,NumberParseInt:Kh,ObjectPrototypeHasOwnProperty:Xh,RegExpPrototypeExec:hl,String:Jh,StringPrototypeToUpperCase:Qh,StringPrototypeTrim:Zh}=W(),{hideStackFrames:Se,codes:{ERR_SOCKET_BAD_PORT:ep,ERR_INVALID_ARG_TYPE:ee,ERR_INVALID_ARG_VALUE:ci,ERR_OUT_OF_RANGE:Nt,ERR_UNKNOWN_SIGNAL:ll}}=ne(),{normalizeEncoding:tp}=Z(),{isAsyncFunction:ip,isArrayBufferView:np}=Z().types,cl={};function rp(t){return t===(t|0)}s(rp,"isInt32");function op(t){return t===t>>>0}s(op,"isUint32");var sp=/^[0-7]+$/,ap="must be a 32-bit unsigned integer or an octal string";function lp(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(hl(sp,t)===null)throw new ci(e,t,ap);t=Kh(t,8)}return pl(t,e),t}s(lp,"parseFileMode");var cp=Se((t,e,i=Gh,n=Yh)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!wo(t))throw new Nt(e,"an integer",t);if(t<i||t>n)throw new Nt(e,`>= ${i} && <= ${n}`,t)}),fp=Se((t,e,i=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!wo(t))throw new Nt(e,"an integer",t);if(t<i||t>n)throw new Nt(e,`>= ${i} && <= ${n}`,t)}),pl=Se((t,e,i=!1)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!wo(t))throw new Nt(e,"an integer",t);let n=i?1:0,r=4294967295;if(t<n||t>r)throw new Nt(e,`>= ${n} && <= ${r}`,t)});function So(t,e){if(typeof t!="string")throw new ee(e,"string",t)}s(So,"validateString");function up(t,e,i=void 0,n){if(typeof t!="number")throw new ee(e,"number",t);if(i!=null&&t<i||n!=null&&t>n||(i!=null||n!=null)&&Hh(t))throw new Nt(e,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}s(up,"validateNumber");var dp=Se((t,e,i)=>{if(!ul(i,t)){let r="must be one of: "+dl(zh(i,o=>typeof o=="string"?`'${o}'`:Jh(o)),", ");throw new ci(e,t,r)}});function yl(t,e){if(typeof t!="boolean")throw new ee(e,"boolean",t)}s(yl,"validateBoolean");function bo(t,e,i){return t==null||!Xh(t,e)?i:t[e]}s(bo,"getOwnPropertyValueOrDefault");var hp=Se((t,e,i=null)=>{let n=bo(i,"allowArray",!1),r=bo(i,"allowFunction",!1);if(!bo(i,"nullable",!1)&&t===null||!n&&go(t)||typeof t!="object"&&(!r||typeof t!="function"))throw new ee(e,"Object",t)}),pp=Se((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ee(e,"a dictionary",t)}),Hn=Se((t,e,i=0)=>{if(!go(t))throw new ee(e,"Array",t);if(t.length<i){let n=`must be longer than ${i}`;throw new ci(e,t,n)}});function yp(t,e){Hn(t,e);for(let i=0;i<t.length;i++)So(t[i],`${e}[${i}]`)}s(yp,"validateStringArray");function mp(t,e){Hn(t,e);for(let i=0;i<t.length;i++)yl(t[i],`${e}[${i}]`)}s(mp,"validateBooleanArray");function bp(t,e){Hn(t,e);for(let i=0;i<t.length;i++){let n=t[i],r=`${e}[${i}]`;if(n==null)throw new ee(r,"AbortSignal",n);ml(n,r)}}s(bp,"validateAbortSignalArray");function gp(t,e="signal"){if(So(t,e),cl[t]===void 0)throw cl[Qh(t)]!==void 0?new ll(t+" (signals must use all capital letters)"):new ll(t)}s(gp,"validateSignalName");var wp=Se((t,e="buffer")=>{if(!np(t))throw new ee(e,["Buffer","TypedArray","DataView"],t)});function Sp(t,e){let i=tp(e),n=t.length;if(i==="hex"&&n%2!==0)throw new ci("encoding",e,`is invalid for data of length ${n}`)}s(Sp,"validateEncoding");function Ep(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Zh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new ep(e,t,i);return t|0}s(Ep,"validatePort");var ml=Se((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ee(e,"AbortSignal",t)}),_p=Se((t,e)=>{if(typeof t!="function")throw new ee(e,"Function",t)}),xp=Se((t,e)=>{if(typeof t!="function"||ip(t))throw new ee(e,"Function",t)}),kp=Se((t,e)=>{if(t!==void 0)throw new ee(e,"undefined",t)});function Fp(t,e,i){if(!ul(i,t))throw new ee(e,`('${dl(i,"|")}')`,t)}s(Fp,"validateUnion");var Ip=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function fl(t,e){if(typeof t>"u"||!hl(Ip,t))throw new ci(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(fl,"validateLinkHeaderFormat");function vp(t){if(typeof t=="string")return fl(t,"hints"),t;if(go(t)){let e=t.length,i="";if(e===0)return i;for(let n=0;n<e;n++){let r=t[n];fl(r,"hints"),i+=r,n!==e-1&&(i+=", ")}return i}throw new ci("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(vp,"validateLinkHeaderValue");bl.exports={isInt32:rp,isUint32:op,parseFileMode:lp,validateArray:Hn,validateStringArray:yp,validateBooleanArray:mp,validateAbortSignalArray:bp,validateBoolean:yl,validateBuffer:wp,validateDictionary:pp,validateEncoding:Sp,validateFunction:_p,validateInt32:fp,validateInteger:cp,validateNumber:up,validateObject:hp,validateOneOf:dp,validatePlainFunction:xp,validatePort:Ep,validateSignalName:gp,validateString:So,validateUint32:pl,validateUndefined:kp,validateUnion:Fp,validateAbortSignal:ml,validateLinkHeaderValue:vp}});var pt=T((kE,El)=>{var j=El.exports={},Ue,qe;function Eo(){throw new Error("setTimeout has not been defined")}s(Eo,"defaultSetTimout");function _o(){throw new Error("clearTimeout has not been defined")}s(_o,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ue=setTimeout:Ue=Eo}catch{Ue=Eo}try{typeof clearTimeout=="function"?qe=clearTimeout:qe=_o}catch{qe=_o}})();function gl(t){if(Ue===setTimeout)return setTimeout(t,0);if((Ue===Eo||!Ue)&&setTimeout)return Ue=setTimeout,setTimeout(t,0);try{return Ue(t,0)}catch{try{return Ue.call(null,t,0)}catch{return Ue.call(this,t,0)}}}s(gl,"runTimeout");function Pp(t){if(qe===clearTimeout)return clearTimeout(t);if((qe===_o||!qe)&&clearTimeout)return qe=clearTimeout,clearTimeout(t);try{return qe(t)}catch{try{return qe.call(null,t)}catch{return qe.call(this,t)}}}s(Pp,"runClearTimeout");var Ze=[],ui=!1,Dt,Yn=-1;function Tp(){!ui||!Dt||(ui=!1,Dt.length?Ze=Dt.concat(Ze):Yn=-1,Ze.length&&wl())}s(Tp,"cleanUpNextTick");function wl(){if(!ui){var t=gl(Tp);ui=!0;for(var e=Ze.length;e;){for(Dt=Ze,Ze=[];++Yn<e;)Dt&&Dt[Yn].run();Yn=-1,e=Ze.length}Dt=null,ui=!1,Pp(t)}}s(wl,"drainQueue");j.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];Ze.push(new Sl(t,e)),Ze.length===1&&!ui&&gl(wl)};function Sl(t,e){this.fun=t,this.array=e}s(Sl,"Item");Sl.prototype.run=function(){this.fun.apply(null,this.array)};j.title="browser";j.browser=!0;j.env={};j.argv=[];j.version="";j.versions={};function et(){}s(et,"noop");j.on=et;j.addListener=et;j.once=et;j.off=et;j.removeListener=et;j.removeAllListeners=et;j.emit=et;j.prependListener=et;j.prependOnceListener=et;j.listeners=function(t){return[]};j.binding=function(t){throw new Error("process.binding is not supported")};j.cwd=function(){return"/"};j.chdir=function(t){throw new Error("process.chdir is not supported")};j.umask=function(){return 0}});var $e=T((IE,Dl)=>{"use strict";var{SymbolAsyncIterator:_l,SymbolIterator:xl,SymbolFor:Bt}=W(),kl=Bt("nodejs.stream.destroyed"),Fl=Bt("nodejs.stream.errored"),xo=Bt("nodejs.stream.readable"),ko=Bt("nodejs.stream.writable"),Il=Bt("nodejs.stream.disturbed"),Ap=Bt("nodejs.webstream.isClosedPromise"),Op=Bt("nodejs.webstream.controllerErrorFunction");function Gn(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s(Gn,"isReadableNodeStream");function Kn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(Kn,"isWritableNodeStream");function Cp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Cp,"isDuplexNodeStream");function je(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(je,"isNodeStream");function vl(t){return!!(t&&!je(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(vl,"isReadableStream");function Pl(t){return!!(t&&!je(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(Pl,"isWritableStream");function Tl(t){return!!(t&&!je(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(Tl,"isTransformStream");function Rp(t){return vl(t)||Pl(t)||Tl(t)}s(Rp,"isWebStream");function Lp(t,e){return t==null?!1:e===!0?typeof t[_l]=="function":e===!1?typeof t[xl]=="function":typeof t[_l]=="function"||typeof t[xl]=="function"}s(Lp,"isIterable");function Xn(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!!(t.destroyed||t[kl]||n!=null&&n.destroyed)}s(Xn,"isDestroyed");function Al(t){if(!Kn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Al,"isWritableEnded");function Np(t,e){if(!Kn(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(Np,"isWritableFinished");function Dp(t){if(!Gn(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Dp,"isReadableEnded");function Ol(t,e){if(!Gn(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(Ol,"isReadableFinished");function Cl(t){return t&&t[xo]!=null?t[xo]:typeof t?.readable!="boolean"?null:Xn(t)?!1:Gn(t)&&t.readable&&!Ol(t)}s(Cl,"isReadable");function Rl(t){return t&&t[ko]!=null?t[ko]:typeof t?.writable!="boolean"?null:Xn(t)?!1:Kn(t)&&t.writable&&!Al(t)}s(Rl,"isWritable");function Bp(t,e){return je(t)?Xn(t)?!0:!(e?.readable!==!1&&Cl(t)||e?.writable!==!1&&Rl(t)):null}s(Bp,"isFinished");function Mp(t){var e,i;return je(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Mp,"isWritableErrored");function Wp(t){var e,i;return je(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Wp,"isReadableErrored");function Up(t){if(!je(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&Ll(t)?t._closed:null}s(Up,"isClosed");function Ll(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Ll,"isOutgoingMessage");function Nl(t){return typeof t._sent100=="boolean"&&Ll(t)}s(Nl,"isServerResponse");function qp(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(qp,"isServerRequest");function jp(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!n&&Nl(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(jp,"willEmitClose");function $p(t){var e;return!!(t&&((e=t[Il])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s($p,"isDisturbed");function Vp(t){var e,i,n,r,o,a,l,c,u,h;return!!(t&&((e=(i=(n=(r=(o=(a=t[Fl])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&r!==void 0?r:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((h=t._writableState)===null||h===void 0)&&h.errored))}s(Vp,"isErrored");Dl.exports={isDestroyed:Xn,kIsDestroyed:kl,isDisturbed:$p,kIsDisturbed:Il,isErrored:Vp,kIsErrored:Fl,isReadable:Cl,kIsReadable:xo,kIsClosedPromise:Ap,kControllerErrorFunction:Op,kIsWritable:ko,isClosed:Up,isDuplexNodeStream:Cp,isFinished:Bp,isIterable:Lp,isReadableNodeStream:Gn,isReadableStream:vl,isReadableEnded:Dp,isReadableFinished:Ol,isReadableErrored:Wp,isNodeStream:je,isWebStream:Rp,isWritable:Rl,isWritableNodeStream:Kn,isWritableStream:Pl,isWritableEnded:Al,isWritableFinished:Np,isWritableErrored:Mp,isServerRequest:qp,isServerResponse:Nl,willEmitClose:jp,isTransformStream:Tl}});var tt=T((PE,To)=>{var yt=pt(),{AbortError:zl,codes:zp}=ne(),{ERR_INVALID_ARG_TYPE:Hp,ERR_STREAM_PREMATURE_CLOSE:Bl}=zp,{kEmptyObject:Io,once:vo}=Z(),{validateAbortSignal:Yp,validateFunction:Gp,validateObject:Kp,validateBoolean:Xp}=fi(),{Promise:Jp,PromisePrototypeThen:Qp,SymbolDispose:Hl}=W(),{isClosed:Zp,isReadable:Ml,isReadableNodeStream:Fo,isReadableStream:ey,isReadableFinished:Wl,isReadableErrored:Ul,isWritable:ql,isWritableNodeStream:jl,isWritableStream:ty,isWritableFinished:$l,isWritableErrored:Vl,isNodeStream:iy,willEmitClose:ny,kIsClosedPromise:ry}=$e(),di;function oy(t){return t.setHeader&&typeof t.abort=="function"}s(oy,"isRequest");var Po=s(()=>{},"nop");function Yl(t,e,i){var n,r;if(arguments.length===2?(i=e,e=Io):e==null?e=Io:Kp(e,"options"),Gp(i,"callback"),Yp(e.signal,"options.signal"),i=vo(i),ey(t)||ty(t))return sy(t,e,i);if(!iy(t))throw new Hp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:Fo(t),a=(r=e.writable)!==null&&r!==void 0?r:jl(t),l=t._writableState,c=t._readableState,u=s(()=>{t.writable||b()},"onlegacyfinish"),h=ny(t)&&Fo(t)===o&&jl(t)===a,d=$l(t,!1),b=s(()=>{d=!0,t.destroyed&&(h=!1),!(h&&(!t.readable||o))&&(!o||m)&&i.call(t)},"onfinish"),m=Wl(t,!1),w=s(()=>{m=!0,t.destroyed&&(h=!1),!(h&&(!t.writable||a))&&(!a||d)&&i.call(t)},"onend"),g=s(V=>{i.call(t,V)},"onerror"),v=Zp(t),E=s(()=>{v=!0;let V=Vl(t)||Ul(t);if(V&&typeof V!="boolean")return i.call(t,V);if(o&&!m&&Fo(t,!0)&&!Wl(t,!1))return i.call(t,new Bl);if(a&&!d&&!$l(t,!1))return i.call(t,new Bl);i.call(t)},"onclose"),A=s(()=>{v=!0;let V=Vl(t)||Ul(t);if(V&&typeof V!="boolean")return i.call(t,V);i.call(t)},"onclosed"),q=s(()=>{t.req.on("finish",b)},"onrequest");oy(t)?(t.on("complete",b),h||t.on("abort",E),t.req?q():t.on("request",q)):a&&!l&&(t.on("end",u),t.on("close",u)),!h&&typeof t.aborted=="boolean"&&t.on("aborted",E),t.on("end",w),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",E),v?yt.nextTick(E):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?h||yt.nextTick(A):(!o&&(!h||Ml(t))&&(d||ql(t)===!1)||!a&&(!h||ql(t))&&(m||Ml(t)===!1)||c&&t.req&&t.aborted)&&yt.nextTick(A);let P=s(()=>{i=Po,t.removeListener("aborted",E),t.removeListener("complete",b),t.removeListener("abort",E),t.removeListener("request",q),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",E)},"cleanup");if(e.signal&&!v){let V=s(()=>{let St=i;P(),St.call(t,new zl(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)yt.nextTick(V);else{di=di||Z().addAbortListener;let St=di(e.signal,V),de=i;i=vo((...Yt)=>{St[Hl](),de.apply(t,Yt)})}}return P}s(Yl,"eos");function sy(t,e,i){let n=!1,r=Po;if(e.signal)if(r=s(()=>{n=!0,i.call(t,new zl(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)yt.nextTick(r);else{di=di||Z().addAbortListener;let a=di(e.signal,r),l=i;i=vo((...c)=>{a[Hl](),l.apply(t,c)})}let o=s((...a)=>{n||yt.nextTick(()=>i.apply(t,a))},"resolverFn");return Qp(t[ry].promise,o,o),Po}s(sy,"eosWeb");function ay(t,e){var i;let n=!1;return e===null&&(e=Io),(i=e)!==null&&i!==void 0&&i.cleanup&&(Xp(e.cleanup,"cleanup"),n=e.cleanup),new Jp((r,o)=>{let a=Yl(t,e,l=>{n&&a(),l?o(l):r()})})}s(ay,"finished");To.exports=Yl;To.exports.finished=ay});var Mt=T((AE,tc)=>{"use strict";var Ve=pt(),{aggregateTwoErrors:ly,codes:{ERR_MULTIPLE_CALLBACK:cy},AbortError:fy}=ne(),{Symbol:Xl}=W(),{kIsDestroyed:uy,isDestroyed:dy,isFinished:hy,isServerRequest:py}=$e(),Jl=Xl("kDestroy"),Ao=Xl("kConstruct");function Ql(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(Ql,"checkError");function yy(t,e){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(Ql(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Gl(this,t,e):this.once(Jl,function(o){Gl(this,ly(o,t),e)}),this)}s(yy,"destroy");function Gl(t,e,i){let n=!1;function r(o){if(n)return;n=!0;let a=t._readableState,l=t._writableState;Ql(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ve.nextTick(my,t,o):Ve.nextTick(Zl,t)}s(r,"onDestroy");try{t._destroy(e||null,r)}catch(o){r(o)}}s(Gl,"_destroy");function my(t,e){Oo(t,e),Zl(t)}s(my,"emitErrorCloseNT");function Zl(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(Zl,"emitCloseNT");function Oo(t,e){let i=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(Oo,"emitErrorNT");function by(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.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(by,"undestroy");function Co(t,e,i){let n=t._readableState,r=t._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),n&&!n.errored&&(n.errored=e),i?Ve.nextTick(Oo,t,e):Oo(t,e))}s(Co,"errorOrDestroy");function gy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,n=t._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),t.once(Ao,e),!(t.listenerCount(Ao)>1)&&Ve.nextTick(wy,t)}s(gy,"construct");function wy(t){let e=!1;function i(n){if(e){Co(t,n??new cy);return}e=!0;let r=t._readableState,o=t._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Jl,n):n?Co(t,n,!0):Ve.nextTick(Sy,t)}s(i,"onConstruct");try{t._construct(n=>{Ve.nextTick(i,n)})}catch(n){Ve.nextTick(i,n)}}s(wy,"constructNT");function Sy(t){t.emit(Ao)}s(Sy,"emitConstructNT");function Kl(t){return t?.setHeader&&typeof t.abort=="function"}s(Kl,"isRequest");function ec(t){t.emit("close")}s(ec,"emitCloseLegacy");function Ey(t,e){t.emit("error",e),Ve.nextTick(ec,t)}s(Ey,"emitErrorCloseLegacy");function _y(t,e){!t||dy(t)||(!e&&!hy(t)&&(e=new fy),py(t)?(t.socket=null,t.destroy(e)):Kl(t)?t.abort():Kl(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ve.nextTick(Ey,t,e):Ve.nextTick(ec,t),t.destroyed||(t[uy]=!0))}s(_y,"destroyer");tc.exports={construct:gy,destroyer:_y,destroy:yy,undestroy:by,errorOrDestroy:Co}});var Zn=T((CE,nc)=>{"use strict";var{ArrayIsArray:xy,ObjectSetPrototypeOf:ic}=W(),{EventEmitter:Jn}=Zi();function Qn(t){Jn.call(this,t)}s(Qn,"Stream");ic(Qn.prototype,Jn.prototype);ic(Qn,Jn);Qn.prototype.pipe=function(t,e){let i=this;function n(h){t.writable&&t.write(h)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),t.on("drain",r),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function c(h){u(),Jn.listenerCount(this,"error")===0&&this.emit("error",h)}s(c,"onerror"),Ro(i,"error",c),Ro(t,"error",c);function u(){i.removeListener("data",n),t.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",u),i.removeListener("close",u),t.removeListener("close",u)}return s(u,"cleanup"),i.on("end",u),i.on("close",u),t.on("close",u),t.emit("pipe",i),t};function Ro(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):xy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Ro,"prependListener");nc.exports={Stream:Qn,prependListener:Ro}});var en=T((LE,er)=>{"use strict";var{SymbolDispose:ky}=W(),{AbortError:rc,codes:Fy}=ne(),{isNodeStream:oc,isWebStream:Iy,kControllerErrorFunction:vy}=$e(),Py=tt(),{ERR_INVALID_ARG_TYPE:sc}=Fy,Lo,Ty=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new sc(e,"AbortSignal",t)},"validateAbortSignal");er.exports.addAbortSignal=s(function(e,i){if(Ty(e,"signal"),!oc(i)&&!Iy(i))throw new sc("stream",["ReadableStream","WritableStream","Stream"],i);return er.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");er.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=oc(e)?()=>{e.destroy(new rc(void 0,{cause:t.reason}))}:()=>{e[vy](new rc(void 0,{cause:t.reason}))};if(t.aborted)i();else{Lo=Lo||Z().addAbortListener;let n=Lo(t,i);Py(e,n[ky])}return e}});var cc=T((BE,lc)=>{"use strict";var{StringPrototypeSlice:ac,SymbolIterator:Ay,TypedArrayPrototypeSet:tr,Uint8Array:Oy}=W(),{Buffer:No}=_e(),{inspect:Cy}=Z();lc.exports=class{static{s(this,"BufferList")}constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++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 i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=e+i.data;return n}concat(e){if(this.length===0)return No.alloc(0);let i=No.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)tr(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(e,i){let n=this.head.data;if(e<n.length){let r=n.slice(0,e);return this.head.data=n.slice(e),r}return e===n.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Ay](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",n=this.head,r=0;do{let o=n.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=ac(o,0,e),this.head=n,n.data=ac(o,e));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(e){let i=No.allocUnsafe(e),n=e,r=this.head,o=0;do{let a=r.data;if(e>a.length)tr(i,a,n-e),e-=a.length;else{e===a.length?(tr(i,a,n-e),++o,r.next?this.head=r.next:this.head=this.tail=null):(tr(i,new Oy(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return Cy(this,{...i,depth:0,customInspect:!1})}}});var tn=T((WE,hc)=>{"use strict";var{MathFloor:Ry,NumberIsInteger:Ly}=W(),{validateInteger:Ny}=fi(),{ERR_INVALID_ARG_VALUE:Dy}=ne().codes,fc=16*1024,uc=16;function By(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(By,"highWaterMarkFrom");function dc(t){return t?uc:fc}s(dc,"getDefaultHighWaterMark");function My(t,e){Ny(e,"value",0),t?uc=e:fc=e}s(My,"setDefaultHighWaterMark");function Wy(t,e,i,n){let r=By(e,n,i);if(r!=null){if(!Ly(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Dy(o,r)}return Ry(r)}return dc(t.objectMode)}s(Wy,"getHighWaterMark");hc.exports={getHighWaterMark:Wy,getDefaultHighWaterMark:dc,setDefaultHighWaterMark:My}});var mc=T((Do,yc)=>{var ir=_e(),ze=ir.Buffer;function pc(t,e){for(var i in t)e[i]=t[i]}s(pc,"copyProps");ze.from&&ze.alloc&&ze.allocUnsafe&&ze.allocUnsafeSlow?yc.exports=ir:(pc(ir,Do),Do.Buffer=Wt);function Wt(t,e,i){return ze(t,e,i)}s(Wt,"SafeBuffer");Wt.prototype=Object.create(ze.prototype);pc(ze,Wt);Wt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ze(t,e,i)};Wt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ze(t);return e!==void 0?typeof i=="string"?n.fill(e,i):n.fill(e):n.fill(0),n};Wt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ze(t)};Wt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ir.SlowBuffer(t)}});var wc=T(gc=>{"use strict";var Mo=mc().Buffer,bc=Mo.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Uy(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Uy,"_normalizeEncoding");function qy(t){var e=Uy(t);if(typeof e!="string"&&(Mo.isEncoding===bc||!bc(t)))throw new Error("Unknown encoding: "+t);return e||t}s(qy,"normalizeEncoding");gc.StringDecoder=nn;function nn(t){this.encoding=qy(t);var e;switch(this.encoding){case"utf16le":this.text=Yy,this.end=Gy,e=4;break;case"utf8":this.fillLast=Vy,e=4;break;case"base64":this.text=Ky,this.end=Xy,e=3;break;default:this.write=Jy,this.end=Qy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Mo.allocUnsafe(e)}s(nn,"StringDecoder");nn.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};nn.prototype.end=Hy;nn.prototype.text=zy;nn.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Bo(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Bo,"utf8CheckByte");function jy(t,e,i){var n=e.length-1;if(n<i)return 0;var r=Bo(e[n]);return r>=0?(r>0&&(t.lastNeed=r-1),r):--n<i||r===-2?0:(r=Bo(e[n]),r>=0?(r>0&&(t.lastNeed=r-2),r):--n<i||r===-2?0:(r=Bo(e[n]),r>=0?(r>0&&(r===2?r=0:t.lastNeed=r-3),r):0))}s(jy,"utf8CheckIncomplete");function $y(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s($y,"utf8CheckExtraBytes");function Vy(t){var e=this.lastTotal-this.lastNeed,i=$y(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Vy,"utf8FillLast");function zy(t,e){var i=jy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}s(zy,"utf8Text");function Hy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Hy,"utf8End");function Yy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(Yy,"utf16Text");function Gy(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s(Gy,"utf16End");function Ky(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Ky,"base64Text");function Xy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Xy,"base64End");function Jy(t){return t.toString(this.encoding)}s(Jy,"simpleWrite");function Qy(t){return t&&t.length?this.write(t):""}s(Qy,"simpleEnd")});var Wo=T((VE,xc)=>{"use strict";var Sc=pt(),{PromisePrototypeThen:Zy,SymbolAsyncIterator:Ec,SymbolIterator:_c}=W(),{Buffer:em}=_e(),{ERR_INVALID_ARG_TYPE:tm,ERR_STREAM_NULL_VALUES:im}=ne().codes;function nm(t,e,i){let n;if(typeof e=="string"||e instanceof em)return new t({objectMode:!0,...i,read:s(function(){this.push(e),this.push(null)},"read")});let r;if(e&&e[Ec])r=!0,n=e[Ec]();else if(e&&e[_c])r=!1,n=e[_c]();else throw new tm("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(u,h){Zy(l(u),()=>Sc.nextTick(h,u),d=>Sc.nextTick(h,d||u))};async function l(u){let h=u!=null,d=typeof n.throw=="function";if(h&&d){let{value:b,done:m}=await n.throw(u);if(await b,m)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}s(l,"close");async function c(){for(;;){try{let{value:u,done:h}=r?await n.next():n.next();if(h)o.push(null);else{let d=u&&typeof u.then=="function"?await u:u;if(d===null)throw a=!1,new im;if(o.push(d))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(c,"next"),o}s(nm,"from");xc.exports=nm});var on=T((HE,qc)=>{var xe=pt(),{ArrayPrototypeIndexOf:rm,NumberIsInteger:om,NumberIsNaN:sm,NumberParseInt:am,ObjectDefineProperties:Yo,ObjectKeys:lm,ObjectSetPrototypeOf:Ic,Promise:vc,SafeSet:cm,SymbolAsyncDispose:fm,SymbolAsyncIterator:um,Symbol:dm}=W();qc.exports=_;_.ReadableState=sr;var{EventEmitter:hm}=Zi(),{Stream:mt,prependListener:pm}=Zn(),{Buffer:Uo}=_e(),{addAbortSignal:ym}=en(),Pc=tt(),F=Z().debuglog("stream",t=>{F=t}),mm=cc(),yi=Mt(),{getHighWaterMark:bm,getDefaultHighWaterMark:gm}=tn(),{aggregateTwoErrors:kc,codes:{ERR_INVALID_ARG_TYPE:wm,ERR_METHOD_NOT_IMPLEMENTED:Sm,ERR_OUT_OF_RANGE:Em,ERR_STREAM_PUSH_AFTER_EOF:_m,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:xm},AbortError:km}=ne(),{validateObject:Fm}=fi(),Ut=dm("kPaused"),{StringDecoder:Tc}=wc(),Im=Wo();Ic(_.prototype,mt.prototype);Ic(_,mt);var qo=s(()=>{},"nop"),{errorOrDestroy:hi}=yi,pi=1,vm=2,Ac=4,rn=8,Oc=16,nr=32,rr=64,Cc=128,Pm=256,Tm=512,Am=1024,zo=2048,Ho=4096,Om=8192,Cm=16384,Rm=32768,Rc=65536,Lm=1<<17,Nm=1<<18;function Y(t){return{enumerable:!1,get:s(function(){return(this.state&t)!==0},"get"),set:s(function(e){e?this.state|=t:this.state&=~t},"set")}}s(Y,"makeBitMapDescriptor");Yo(sr.prototype,{objectMode:Y(pi),ended:Y(vm),endEmitted:Y(Ac),reading:Y(rn),constructed:Y(Oc),sync:Y(nr),needReadable:Y(rr),emittedReadable:Y(Cc),readableListening:Y(Pm),resumeScheduled:Y(Tm),errorEmitted:Y(Am),emitClose:Y(zo),autoDestroy:Y(Ho),destroyed:Y(Om),closed:Y(Cm),closeEmitted:Y(Rm),multiAwaitDrain:Y(Rc),readingMore:Y(Lm),dataEmitted:Y(Nm)});function sr(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.state=zo|Ho|Oc|nr,t&&t.objectMode&&(this.state|=pi),i&&t&&t.readableObjectMode&&(this.state|=pi),this.highWaterMark=t?bm(this,t,"readableHighWaterMark",i):gm(!1),this.buffer=new mm,this.length=0,this.pipes=[],this.flowing=null,this[Ut]=null,t&&t.emitClose===!1&&(this.state&=~zo),t&&t.autoDestroy===!1&&(this.state&=~Ho),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Tc(t.encoding),this.encoding=t.encoding)}s(sr,"ReadableState");function _(t){if(!(this instanceof _))return new _(t);let e=this instanceof He();this._readableState=new sr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&ym(t.signal,this)),mt.call(this,t),yi.construct(this,()=>{this._readableState.needReadable&&or(this,this._readableState)})}s(_,"Readable");_.prototype.destroy=yi.destroy;_.prototype._undestroy=yi.undestroy;_.prototype._destroy=function(t,e){e(t)};_.prototype[hm.captureRejectionSymbol]=function(t){this.destroy(t)};_.prototype[fm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new km,this.destroy(t)),new vc((e,i)=>Pc(this,n=>n&&n!==t?i(n):e(null)))};_.prototype.push=function(t,e){return Lc(this,t,e,!1)};_.prototype.unshift=function(t,e){return Lc(this,t,e,!0)};function Lc(t,e,i,n){F("readableAddChunk",e);let r=t._readableState,o;if(r.state&pi||(typeof e=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?e=Uo.from(e,i).toString(r.encoding):(e=Uo.from(e,i),i=""))):e instanceof Uo?i="":mt._isUint8Array(e)?(e=mt._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new wm("chunk",["string","Buffer","Uint8Array"],e))),o)hi(t,o);else if(e===null)r.state&=~rn,Mm(t,r);else if(r.state&pi||e&&e.length>0)if(n)if(r.state&Ac)hi(t,new xm);else{if(r.destroyed||r.errored)return!1;jo(t,r,e,!0)}else if(r.ended)hi(t,new _m);else{if(r.destroyed||r.errored)return!1;r.state&=~rn,r.decoder&&!i?(e=r.decoder.write(e),r.objectMode||e.length!==0?jo(t,r,e,!1):or(t,r)):jo(t,r,e,!1)}else n||(r.state&=~rn,or(t,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(Lc,"readableAddChunk");function jo(t,e,i,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Rc?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.state&rr&&ar(t)),or(t,e)}s(jo,"addChunk");_.prototype.isPaused=function(){let t=this._readableState;return t[Ut]===!0||t.flowing===!1};_.prototype.setEncoding=function(t){let e=new Tc(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=e.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var Dm=1073741824;function Bm(t){if(t>Dm)throw new Em("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Bm,"computeNewHighWaterMark");function Fc(t,e){return t<=0||e.length===0&&e.ended?0:e.state&pi?1:sm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(Fc,"howMuchToRead");_.prototype.read=function(t){F("read",t),t===void 0?t=NaN:om(t)||(t=am(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Bm(t)),t!==0&&(e.state&=~Cc),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return F("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?$o(this):ar(this),null;if(t=Fc(t,e),t===0&&e.ended)return e.length===0&&$o(this),null;let n=(e.state&rr)!==0;if(F("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,F("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,F("reading, ended or constructing",n);else if(n){F("do read"),e.state|=rn|nr,e.length===0&&(e.state|=rr);try{this._read(e.highWaterMark)}catch(o){hi(this,o)}e.state&=~nr,e.reading||(t=Fc(i,e))}let r;return t>0?r=Wc(t,e):r=null,r===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&$o(this)),r!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",r)),r};function Mm(t,e){if(F("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?ar(t):(e.needReadable=!1,e.emittedReadable=!0,Nc(t))}}s(Mm,"onEofChunk");function ar(t){let e=t._readableState;F("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(F("emitReadable",e.flowing),e.emittedReadable=!0,xe.nextTick(Nc,t))}s(ar,"emitReadable");function Nc(t){let e=t._readableState;F("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Bc(t)}s(Nc,"emitReadable_");function or(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,xe.nextTick(Wm,t,e))}s(or,"maybeReadMore");function Wm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(F("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(Wm,"maybeReadMore_");_.prototype._read=function(t){throw new Sm("_read()")};_.prototype.pipe=function(t,e){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new cm(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),F("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==xe.stdout&&t!==xe.stderr?l:v;n.endEmitted?xe.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(E,A){F("onunpipe"),E===i&&A&&A.hasUnpiped===!1&&(A.hasUnpiped=!0,h())}s(a,"onunpipe");function l(){F("onend"),t.end()}s(l,"onend");let c,u=!1;function h(){F("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),c&&t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",v),i.removeListener("data",b),u=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}s(h,"cleanup");function d(){u||(n.pipes.length===1&&n.pipes[0]===t?(F("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(F("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),i.pause()),c||(c=Um(i,t),t.on("drain",c))}s(d,"pause"),i.on("data",b);function b(E){F("ondata");let A=t.write(E);F("dest.write",A),A===!1&&d()}s(b,"ondata");function m(E){if(F("onerror",E),v(),t.removeListener("error",m),t.listenerCount("error")===0){let A=t._writableState||t._readableState;A&&!A.errorEmitted?hi(t,E):t.emit("error",E)}}s(m,"onerror"),pm(t,"error",m);function w(){t.removeListener("finish",g),v()}s(w,"onclose"),t.once("close",w);function g(){F("onfinish"),t.removeListener("close",w),v()}s(g,"onfinish"),t.once("finish",g);function v(){F("unpipe"),i.unpipe(t)}return s(v,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?d():n.flowing||(F("pipe resume"),i.resume()),t};function Um(t,e){return s(function(){let n=t._readableState;n.awaitDrainWriters===e?(F("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(F("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Um,"pipeOnDrain");_.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let r=e.pipes;e.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=rm(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};_.prototype.on=function(t,e){let i=mt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,F("on readable",n.length,n.reading),n.length?ar(this):n.reading||xe.nextTick(qm,this)),i};_.prototype.addListener=_.prototype.on;_.prototype.removeListener=function(t,e){let i=mt.prototype.removeListener.call(this,t,e);return t==="readable"&&xe.nextTick(Dc,this),i};_.prototype.off=_.prototype.removeListener;_.prototype.removeAllListeners=function(t){let e=mt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&xe.nextTick(Dc,this),e};function Dc(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Ut]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Dc,"updateReadableListening");function qm(t){F("readable nexttick read 0"),t.read(0)}s(qm,"nReadingNextTick");_.prototype.resume=function(){let t=this._readableState;return t.flowing||(F("resume"),t.flowing=!t.readableListening,jm(this,t)),t[Ut]=!1,this};function jm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,xe.nextTick($m,t,e))}s(jm,"resume");function $m(t,e){F("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Bc(t),e.flowing&&!e.reading&&t.read(0)}s($m,"resume_");_.prototype.pause=function(){return F("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(F("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Ut]=!0,this};function Bc(t){let e=t._readableState;for(F("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Bc,"flow");_.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{hi(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=lm(t);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof t[r]=="function"&&(this[r]=t[r].bind(t))}return this};_.prototype[um]=function(){return Mc(this)};_.prototype.iterator=function(t){return t!==void 0&&Fm(t,"options"),Mc(this,t)};function Mc(t,e){typeof t.read!="function"&&(t=_.wrap(t,{objectMode:!0}));let i=Vm(t,e);return i.stream=t,i}s(Mc,"streamToAsyncIterator");async function*Vm(t,e){let i=qo;function n(a){this===t?(i(),i=qo):i=a}s(n,"next"),t.on("readable",n);let r,o=Pc(t,{writable:!1},a=>{r=a?kc(r,a):null,i(),i=qo});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new vc(n)}}}catch(a){throw r=kc(r,a),r}finally{(r||e?.destroyOnReturn!==!1)&&(r===void 0||t._readableState.autoDestroy)?yi.destroyer(t,null):(t.off("readable",n),o())}}s(Vm,"createAsyncIterator");Yo(_.prototype,{readable:{__proto__:null,get:s(function(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},"get"),set:s(function(t){this._readableState&&(this._readableState.readable=!!t)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(t){this._readableState&&(this._readableState.flowing=t)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});Yo(sr.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Ut]!==!1},"get"),set:s(function(t){this[Ut]=!!t},"set")}});_._fromList=Wc;function Wc(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(Wc,"fromList");function $o(t){let e=t._readableState;F("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,xe.nextTick(zm,e,t))}s($o,"endReadable");function zm(t,e){if(F("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)xe.nextTick(Hm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(zm,"endReadableNT");function Hm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Hm,"endWritableNT");_.from=function(t,e){return Im(_,t,e)};var Vo;function Uc(){return Vo===void 0&&(Vo={}),Vo}s(Uc,"lazyWebStreams");_.fromWeb=function(t,e){return Uc().newStreamReadableFromReadableStream(t,e)};_.toWeb=function(t,e){return Uc().newReadableStreamFromStreamReadable(t,e)};_.wrap=function(t,e){var i,n;return new _({objectMode:(i=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy:s(function(r,o){yi.destroyer(t,r),o(r)},"destroy")}).wrap(t)}});var dr=T((GE,Zc)=>{var qt=pt(),{ArrayPrototypeSlice:Vc,Error:Ym,FunctionPrototypeSymbolHasInstance:zc,ObjectDefineProperty:Hc,ObjectDefineProperties:Gm,ObjectSetPrototypeOf:Yc,StringPrototypeToLowerCase:Km,Symbol:Xm,SymbolHasInstance:Jm}=W();Zc.exports=U;U.WritableState=ln;var{EventEmitter:Qm}=Zi(),sn=Zn().Stream,{Buffer:lr}=_e(),ur=Mt(),{addAbortSignal:Zm}=en(),{getHighWaterMark:eb,getDefaultHighWaterMark:tb}=tn(),{ERR_INVALID_ARG_TYPE:ib,ERR_METHOD_NOT_IMPLEMENTED:nb,ERR_MULTIPLE_CALLBACK:Gc,ERR_STREAM_CANNOT_PIPE:rb,ERR_STREAM_DESTROYED:an,ERR_STREAM_ALREADY_FINISHED:ob,ERR_STREAM_NULL_VALUES:sb,ERR_STREAM_WRITE_AFTER_END:ab,ERR_UNKNOWN_ENCODING:Kc}=ne().codes,{errorOrDestroy:mi}=ur;Yc(U.prototype,sn.prototype);Yc(U,sn);function Xo(){}s(Xo,"nop");var bi=Xm("kOnFinished");function ln(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?eb(this,t,"writableHighWaterMark",i):tb(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=cb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,fr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[bi]=[]}s(ln,"WritableState");function fr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(fr,"resetBuffer");ln.prototype.getBuffer=s(function(){return Vc(this.buffered,this.bufferedIndex)},"getBuffer");Hc(ln.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function U(t){let e=this instanceof He();if(!e&&!zc(U,this))return new U(t);this._writableState=new ln(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Zm(t.signal,this)),sn.call(this,t),ur.construct(this,()=>{let i=this._writableState;i.writing||Qo(this,i),Zo(this,i)})}s(U,"Writable");Hc(U,Jm,{__proto__:null,value:s(function(t){return zc(this,t)?!0:this!==U?!1:t&&t._writableState instanceof ln},"value")});U.prototype.pipe=function(){mi(this,new rb)};function Xc(t,e,i,n){let r=t._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!lr.isEncoding(i))throw new Kc(i);typeof n!="function"&&(n=Xo)}if(e===null)throw new sb;if(!r.objectMode)if(typeof e=="string")r.decodeStrings!==!1&&(e=lr.from(e,i),i="buffer");else if(e instanceof lr)i="buffer";else if(sn._isUint8Array(e))e=sn._uint8ArrayToBuffer(e),i="buffer";else throw new ib("chunk",["string","Buffer","Uint8Array"],e);let o;return r.ending?o=new ab:r.destroyed&&(o=new an("write")),o?(qt.nextTick(n,o),mi(t,o,!0),o):(r.pendingcb++,lb(t,r,e,i,n))}s(Xc,"_write");U.prototype.write=function(t,e,i){return Xc(this,t,e,i)===!0};U.prototype.cork=function(){this._writableState.corked++};U.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Qo(this,t))};U.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Km(e)),!lr.isEncoding(e))throw new Kc(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function lb(t,e,i,n,r){let o=e.objectMode?1:i.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:i,encoding:n,callback:r}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&r!==Xo&&(e.allNoop=!1)):(e.writelen=o,e.writecb=r,e.writing=!0,e.sync=!0,t._write(i,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(lb,"writeOrBuffer");function jc(t,e,i,n,r,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new an("write")):i?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}s(jc,"doWrite");function $c(t,e,i,n){--e.pendingcb,n(i),Jo(e),mi(t,i)}s($c,"onwriteError");function cb(t,e){let i=t._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){mi(t,new Gc);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?qt.nextTick($c,t,i,e,r):$c(t,i,e,r)):(i.buffered.length>i.bufferedIndex&&Qo(t,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:t,state:i},qt.nextTick(fb,i.afterWriteTickInfo)):Jc(t,i,1,r))}s(cb,"onwrite");function fb({stream:t,state:e,count:i,cb:n}){return e.afterWriteTickInfo=null,Jc(t,e,i,n)}s(fb,"afterWriteTick");function Jc(t,e,i,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,n();e.destroyed&&Jo(e),Zo(t,e)}s(Jc,"afterWrite");function Jo(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:o,callback:a}=t.buffered[r],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new an("write"))}let i=t[bi].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=t.errored)!==null&&n!==void 0?n:new an("end"))}fr(t)}s(Jo,"errorBuffer");function Qo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=e,o=i.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Xo:u=>{for(let h=a;h<i.length;++h)i[h].callback(u)},c=e.allNoop&&a===0?i:Vc(i,a);c.allBuffers=e.allBuffers,jc(t,e,!0,e.length,c,"",l),fr(e)}else{do{let{chunk:l,encoding:c,callback:u}=i[a];i[a++]=null;let h=r?1:l.length;jc(t,e,!1,h,l,c,u)}while(a<i.length&&!e.writing);a===i.length?fr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Qo,"clearBuffer");U.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new nb("_write()")};U.prototype._writev=null;U.prototype.end=function(t,e,i){let n=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let r;if(t!=null){let o=Xc(this,t,e);o instanceof Ym&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Zo(this,n,!0),n.ended=!0):n.finished?r=new ob("end"):n.destroyed&&(r=new an("end"))),typeof i=="function"&&(r||n.finished?qt.nextTick(i,r):n[bi].push(i)),this};function cr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s(cr,"needFinish");function ub(t,e){let i=!1;function n(r){if(i){mi(t,r??Gc());return}if(i=!0,e.pendingcb--,r){let o=e[bi].splice(0);for(let a=0;a<o.length;a++)o[a](r);mi(t,r,e.sync)}else cr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,qt.nextTick(Ko,t,e))}s(n,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(n)}catch(r){n(r)}e.sync=!1}s(ub,"callFinal");function db(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,ub(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(db,"prefinish");function Zo(t,e,i){cr(e)&&(db(t,e),e.pendingcb===0&&(i?(e.pendingcb++,qt.nextTick((n,r)=>{cr(r)?Ko(n,r):r.pendingcb--},t,e)):cr(e)&&(e.pendingcb++,Ko(t,e))))}s(Zo,"finishMaybe");function Ko(t,e){e.pendingcb--,e.finished=!0;let i=e[bi].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}s(Ko,"finish");Gm(U.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")},writable:{__proto__:null,get:s(function(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},"get"),set:s(function(t){this._writableState&&(this._writableState.writable=!!t)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var hb=ur.destroy;U.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[bi].length)&&qt.nextTick(Jo,i),hb.call(this,t,e),this};U.prototype._undestroy=ur.undestroy;U.prototype._destroy=function(t,e){e(t)};U.prototype[Qm.captureRejectionSymbol]=function(t){this.destroy(t)};var Go;function Qc(){return Go===void 0&&(Go={}),Go}s(Qc,"lazyWebStreams");U.fromWeb=function(t,e){return Qc().newStreamWritableFromWritableStream(t,e)};U.toWeb=function(t){return Qc().newWritableStreamFromStreamWritable(t)}});var yf=T((XE,pf)=>{var es=pt(),pb=_e(),{isReadable:yb,isWritable:mb,isIterable:ef,isNodeStream:bb,isReadableNodeStream:tf,isWritableNodeStream:nf,isDuplexNodeStream:gb,isReadableStream:rf,isWritableStream:of}=$e(),sf=tt(),{AbortError:df,codes:{ERR_INVALID_ARG_TYPE:wb,ERR_INVALID_RETURN_VALUE:af}}=ne(),{destroyer:wi}=Mt(),Sb=He(),hf=on(),Eb=dr(),{createDeferredPromise:lf}=Z(),cf=Wo(),ff=globalThis.Blob||pb.Blob,_b=s(typeof ff<"u"?function(e){return e instanceof ff}:function(e){return!1},"isBlob"),xb=globalThis.AbortController||ai().AbortController,{FunctionPrototypeCall:uf}=W(),bt=class extends Sb{static{s(this,"Duplexify")}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)}};pf.exports=s(function t(e,i){if(gb(e))return e;if(tf(e))return gi({readable:e});if(nf(e))return gi({writable:e});if(bb(e))return gi({writable:!1,readable:!1});if(rf(e))return gi({readable:hf.fromWeb(e)});if(of(e))return gi({writable:Eb.fromWeb(e)});if(typeof e=="function"){let{value:r,write:o,final:a,destroy:l}=kb(e);if(ef(r))return cf(bt,r,{objectMode:!0,write:o,final:a,destroy:l});let c=r?.then;if(typeof c=="function"){let u,h=uf(c,r,d=>{if(d!=null)throw new af("nully","body",d)},d=>{wi(u,d)});return u=new bt({objectMode:!0,readable:!1,write:o,final:s(function(d){a(async()=>{try{await h,es.nextTick(d,null)}catch(b){es.nextTick(d,b)}})},"final"),destroy:l})}throw new af("Iterable, AsyncIterable or AsyncFunction",i,r)}if(_b(e))return t(e.arrayBuffer());if(ef(e))return cf(bt,e,{objectMode:!0,writable:!1});if(rf(e?.readable)&&of(e?.writable))return bt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?tf(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?nf(e?.writable)?e?.writable:t(e.writable):void 0;return gi({readable:r,writable:o})}let n=e?.then;if(typeof n=="function"){let r;return uf(n,e,o=>{o!=null&&r.push(o),r.push(null)},o=>{wi(r,o)}),r=new bt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new wb(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function kb(t){let{promise:e,resolve:i}=lf(),n=new xb,r=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(es.nextTick(u),c)return;if(r.aborted)throw new df(void 0,{cause:r.reason});({promise:e,resolve:i}=lf()),yield l}}(),{signal:r}),write:s(function(a,l,c){let u=i;i=null,u({chunk:a,done:!1,cb:c})},"write"),final:s(function(a){let l=i;i=null,l({done:!0,cb:a})},"final"),destroy:s(function(a,l){n.abort(),l(a)},"destroy")}}s(kb,"fromAsyncGen");function gi(t){let e=t.readable&&typeof t.readable.read!="function"?hf.wrap(t.readable):t.readable,i=t.writable,n=!!yb(e),r=!!mb(i),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 bt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(sf(i,d=>{r=!1,d&&wi(e,d),h(d)}),u._write=function(d,b,m){i.write(d,b)?m():o=m},u._final=function(d){i.end(),a=d},i.on("drain",function(){if(o){let d=o;o=null,d()}}),i.on("finish",function(){if(a){let d=a;a=null,d()}})),n&&(sf(e,d=>{n=!1,d&&wi(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 df),l=null,o=null,a=null,c===null?b(d):(c=b,wi(i,d),wi(e,d))},u}s(gi,"_duplexify")});var He=T((QE,gf)=>{"use strict";var{ObjectDefineProperties:Fb,ObjectGetOwnPropertyDescriptor:it,ObjectKeys:Ib,ObjectSetPrototypeOf:mf}=W();gf.exports=ke;var ns=on(),Ee=dr();mf(ke.prototype,ns.prototype);mf(ke,ns);{let t=Ib(Ee.prototype);for(let e=0;e<t.length;e++){let i=t[e];ke.prototype[i]||(ke.prototype[i]=Ee.prototype[i])}}function ke(t){if(!(this instanceof ke))return new ke(t);ns.call(this,t),Ee.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(ke,"Duplex");Fb(ke.prototype,{writable:{__proto__:null,...it(Ee.prototype,"writable")},writableHighWaterMark:{__proto__:null,...it(Ee.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...it(Ee.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...it(Ee.prototype,"writableBuffer")},writableLength:{__proto__:null,...it(Ee.prototype,"writableLength")},writableFinished:{__proto__:null,...it(Ee.prototype,"writableFinished")},writableCorked:{__proto__:null,...it(Ee.prototype,"writableCorked")},writableEnded:{__proto__:null,...it(Ee.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...it(Ee.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")}});var ts;function bf(){return ts===void 0&&(ts={}),ts}s(bf,"lazyWebStreams");ke.fromWeb=function(t,e){return bf().newStreamDuplexFromReadableWritablePair(t,e)};ke.toWeb=function(t){return bf().newReadableWritablePairFromDuplex(t)};var is;ke.from=function(t){return is||(is=yf()),is(t,"body")}});var ss=T((e_,Sf)=>{"use strict";var{ObjectSetPrototypeOf:wf,Symbol:vb}=W();Sf.exports=nt;var{ERR_METHOD_NOT_IMPLEMENTED:Pb}=ne().codes,os=He(),{getHighWaterMark:Tb}=tn();wf(nt.prototype,os.prototype);wf(nt,os);var cn=vb("kCallback");function nt(t){if(!(this instanceof nt))return new nt(t);let e=t?Tb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),os.call(this,t),this._readableState.sync=!1,this[cn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Ab)}s(nt,"Transform");function rs(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(rs,"final");function Ab(){this._final!==rs&&rs.call(this)}s(Ab,"prefinish");nt.prototype._final=rs;nt.prototype._transform=function(t,e,i){throw new Pb("_transform()")};nt.prototype._write=function(t,e,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),r.ended||o===n.length||n.length<n.highWaterMark?i():this[cn]=i})};nt.prototype._read=function(){if(this[cn]){let t=this[cn];this[cn]=null,t()}}});var ls=T((i_,_f)=>{"use strict";var{ObjectSetPrototypeOf:Ef}=W();_f.exports=Si;var as=ss();Ef(Si.prototype,as.prototype);Ef(Si,as);function Si(t){if(!(this instanceof Si))return new Si(t);as.call(this,t)}s(Si,"PassThrough");Si.prototype._transform=function(t,e,i){i(null,t)}});var mr=T((r_,vf)=>{var fn=pt(),{ArrayIsArray:Ob,Promise:Cb,SymbolAsyncIterator:Rb,SymbolDispose:Lb}=W(),yr=tt(),{once:Nb}=Z(),Db=Mt(),xf=He(),{aggregateTwoErrors:Bb,codes:{ERR_INVALID_ARG_TYPE:bs,ERR_INVALID_RETURN_VALUE:cs,ERR_MISSING_ARGS:Mb,ERR_STREAM_DESTROYED:Wb,ERR_STREAM_PREMATURE_CLOSE:Ub},AbortError:qb}=ne(),{validateFunction:jb,validateAbortSignal:$b}=fi(),{isIterable:jt,isReadable:fs,isReadableNodeStream:pr,isNodeStream:kf,isTransformStream:Ei,isWebStream:Vb,isReadableStream:us,isReadableFinished:zb}=$e(),Hb=globalThis.AbortController||ai().AbortController,ds,hs,ps;function Ff(t,e,i){let n=!1;t.on("close",()=>{n=!0});let r=yr(t,{readable:e,writable:i},o=>{n=!o});return{destroy:s(o=>{n||(n=!0,Db.destroyer(t,o||new Wb("pipe")))},"destroy"),cleanup:r}}s(Ff,"destroyer");function Yb(t){return jb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Yb,"popCallback");function ys(t){if(jt(t))return t;if(pr(t))return Gb(t);throw new bs("val",["Readable","Iterable","AsyncIterable"],t)}s(ys,"makeAsyncIterable");async function*Gb(t){hs||(hs=on()),yield*hs.prototype[Rb].call(t)}s(Gb,"fromReadable");async function hr(t,e,i,{end:n}){let r,o=null,a=s(u=>{if(u&&(r=u),o){let h=o;o=null,h()}},"resume"),l=s(()=>new Cb((u,h)=>{r?h(r):o=s(()=>{r?h(r):u()},"onresolve")}),"wait");e.on("drain",a);let c=yr(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of t)e.write(u)||await l();n&&(e.end(),await l()),i()}catch(u){i(r!==u?Bb(r,u):u)}finally{c(),e.off("drain",a)}}s(hr,"pumpToNode");async function ms(t,e,i,{end:n}){Ei(e)&&(e=e.writable);let r=e.getWriter();try{for await(let o of t)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(ms,"pumpToWeb");function Kb(...t){return If(t,Nb(Yb(t)))}s(Kb,"pipeline");function If(t,e,i){if(t.length===1&&Ob(t[0])&&(t=t[0]),t.length<2)throw new Mb("streams");let n=new Hb,r=n.signal,o=i?.signal,a=[];$b(o,"options.signal");function l(){w(new qb)}s(l,"abort"),ps=ps||Z().addAbortListener;let c;o&&(c=ps(o,l));let u,h,d=[],b=0;function m(q){w(q,--b===0)}s(m,"finish");function w(q,P){var V;if(q&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=q),!(!u&&!P)){for(;d.length;)d.shift()(u);(V=c)===null||V===void 0||V[Lb](),n.abort(),P&&(u||a.forEach(St=>St()),fn.nextTick(e,u,h))}}s(w,"finishImpl");let g;for(let q=0;q<t.length;q++){let P=t[q],V=q<t.length-1,St=q>0,de=V||i?.end!==!1,Yt=q===t.length-1;if(kf(P)){let re=function(Ge){Ge&&Ge.name!=="AbortError"&&Ge.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Ge)};var A=re;if(s(re,"onError"),de){let{destroy:Ge,cleanup:Tr}=Ff(P,V,St);d.push(Ge),fs(P)&&Yt&&a.push(Tr)}P.on("error",re),fs(P)&&Yt&&a.push(()=>{P.removeListener("error",re)})}if(q===0)if(typeof P=="function"){if(g=P({signal:r}),!jt(g))throw new cs("Iterable, AsyncIterable or Stream","source",g)}else jt(P)||pr(P)||Ei(P)?g=P:g=xf.from(P);else if(typeof P=="function"){if(Ei(g)){var v;g=ys((v=g)===null||v===void 0?void 0:v.readable)}else g=ys(g);if(g=P(g,{signal:r}),V){if(!jt(g,!0))throw new cs("AsyncIterable",`transform[${q-1}]`,g)}else{var E;ds||(ds=ls());let re=new ds({objectMode:!0}),Ge=(E=g)===null||E===void 0?void 0:E.then;if(typeof Ge=="function")b++,Ge.call(g,ot=>{h=ot,ot!=null&&re.write(ot),de&&re.end(),fn.nextTick(m)},ot=>{re.destroy(ot),fn.nextTick(m,ot)});else if(jt(g,!0))b++,hr(g,re,m,{end:de});else if(us(g)||Ei(g)){let ot=g.readable||g;b++,hr(ot,re,m,{end:de})}else throw new cs("AsyncIterable or Promise","destination",g);g=re;let{destroy:Tr,cleanup:Ku}=Ff(g,!1,!0);d.push(Tr),Yt&&a.push(Ku)}}else if(kf(P)){if(pr(g)){b+=2;let re=Xb(g,P,m,{end:de});fs(P)&&Yt&&a.push(re)}else if(Ei(g)||us(g)){let re=g.readable||g;b++,hr(re,P,m,{end:de})}else if(jt(g))b++,hr(g,P,m,{end:de});else throw new bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=P}else if(Vb(P)){if(pr(g))b++,ms(ys(g),P,m,{end:de});else if(us(g)||jt(g))b++,ms(g,P,m,{end:de});else if(Ei(g))b++,ms(g.readable,P,m,{end:de});else throw new bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=P}else g=xf.from(P)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&fn.nextTick(l),g}s(If,"pipelineImpl");function Xb(t,e,i,{end:n}){let r=!1;if(e.on("close",()=>{r||i(new Ub)}),t.pipe(e,{end:!1}),n){let a=function(){r=!0,e.end()};var o=a;s(a,"endFn"),zb(t)?fn.nextTick(a):t.once("end",a)}else i();return yr(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),yr(e,{readable:!1,writable:!0},i)}s(Xb,"pipe");vf.exports={pipelineImpl:If,pipeline:Kb}});var ws=T((s_,Rf)=>{"use strict";var{pipeline:Jb}=mr(),br=He(),{destroyer:Qb}=Mt(),{isNodeStream:gr,isReadable:Pf,isWritable:Tf,isWebStream:gs,isTransformStream:$t,isWritableStream:Af,isReadableStream:Of}=$e(),{AbortError:Zb,codes:{ERR_INVALID_ARG_VALUE:Cf,ERR_MISSING_ARGS:eg}}=ne(),tg=tt();Rf.exports=s(function(...e){if(e.length===0)throw new eg("streams");if(e.length===1)return br.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=br.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=br.from(e[m])}for(let m=0;m<e.length;++m)if(!(!gr(e[m])&&!gs(e[m]))){if(m<e.length-1&&!(Pf(e[m])||Of(e[m])||$t(e[m])))throw new Cf(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(Tf(e[m])||Af(e[m])||$t(e[m])))throw new Cf(`streams[${m}]`,i[m],"must be writable")}let n,r,o,a,l;function c(m){let w=a;a=null,w?w(m):m?l.destroy(m):!b&&!d&&l.destroy()}s(c,"onfinished");let u=e[0],h=Jb(e,c),d=!!(Tf(u)||Af(u)||$t(u)),b=!!(Pf(h)||Of(h)||$t(h));if(l=new br({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(h!=null&&h.readableObjectMode),writable:d,readable:b}),d){if(gr(u))l._write=function(w,g,v){u.write(w,g)?v():n=v},l._final=function(w){u.end(),r=w},u.on("drain",function(){if(n){let w=n;n=null,w()}});else if(gs(u)){let g=($t(u)?u.writable:u).getWriter();l._write=async function(v,E,A){try{await g.ready,g.write(v).catch(()=>{}),A()}catch(q){A(q)}},l._final=async function(v){try{await g.ready,g.close().catch(()=>{}),r=v}catch(E){v(E)}}}let m=$t(h)?h.readable:h;tg(m,()=>{if(r){let w=r;r=null,w()}})}if(b){if(gr(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(gs(h)){let w=($t(h)?h.readable:h).getReader();l._read=async function(){for(;;)try{let{value:g,done:v}=await w.read();if(!l.push(g))return;if(v){l.push(null);return}}catch{return}}}}return l._destroy=function(m,w){!m&&a!==null&&(m=new Zb),o=null,n=null,r=null,a===null?w(m):(a=w,gr(h)&&Qb(h,m))},l},"compose")});var $f=T((l_,_s)=>{"use strict";var ig=globalThis.AbortController||ai().AbortController,{codes:{ERR_INVALID_ARG_VALUE:ng,ERR_INVALID_ARG_TYPE:un,ERR_MISSING_ARGS:rg,ERR_OUT_OF_RANGE:og},AbortError:Ye}=ne(),{validateAbortSignal:Vt,validateInteger:Lf,validateObject:zt}=fi(),sg=W().Symbol("kWeak"),ag=W().Symbol("kResistStopPropagation"),{finished:lg}=tt(),cg=ws(),{addAbortSignalNoValidate:fg}=en(),{isWritable:ug,isNodeStream:dg}=$e(),{deprecate:hg}=Z(),{ArrayPrototypePush:pg,Boolean:yg,MathFloor:Nf,Number:mg,NumberIsNaN:bg,Promise:Df,PromiseReject:Bf,PromiseResolve:gg,PromisePrototypeThen:Mf,Symbol:Uf}=W(),wr=Uf("kEmpty"),Wf=Uf("kEof");function wg(t,e){if(e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),dg(t)&&!ug(t))throw new ng("stream",t,"must be writable");let i=cg(this,t);return e!=null&&e.signal&&fg(e.signal,i),i}s(wg,"compose");function Sr(t,e){if(typeof t!="function")throw new un("fn",["Function","AsyncFunction"],t);e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Nf(e.concurrency));let n=i-1;return e?.highWaterMark!=null&&(n=Nf(e.highWaterMark)),Lf(i,"options.concurrency",1),Lf(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=Z().AbortSignalAny([e?.signal].filter(yg)),a=this,l=[],c={signal:o},u,h,d=!1,b=0;function m(){d=!0,w()}s(m,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){h&&!d&&b<i&&l.length<n&&(h(),h=null)}s(g,"maybeResume");async function v(){try{for await(let E of a){if(d)return;if(o.aborted)throw new Ye;try{if(E=t(E,c),E===wr)continue;E=gg(E)}catch(A){E=Bf(A)}b+=1,Mf(E,w,m),l.push(E),u&&(u(),u=null),!d&&(l.length>=n||b>=i)&&await new Df(A=>{h=A})}l.push(Wf)}catch(E){let A=Bf(E);Mf(A,w,m),l.push(A)}finally{d=!0,u&&(u(),u=null)}}s(v,"pump"),v();try{for(;;){for(;l.length>0;){let E=await l[0];if(E===Wf)return;if(o.aborted)throw new Ye;E!==wr&&(yield E),l.shift(),g()}await new Df(E=>{u=E})}}finally{d=!0,h&&(h(),h=null)}},"map").call(this)}s(Sr,"map");function Sg(t=void 0){return t!=null&&zt(t,"options"),t?.signal!=null&&Vt(t.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ye({cause:t.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(Sg,"asIndexedPairs");async function qf(t,e=void 0){for await(let i of Es.call(this,t,e))return!0;return!1}s(qf,"some");async function Eg(t,e=void 0){if(typeof t!="function")throw new un("fn",["Function","AsyncFunction"],t);return!await qf.call(this,async(...i)=>!await t(...i),e)}s(Eg,"every");async function _g(t,e){for await(let i of Es.call(this,t,e))return i}s(_g,"find");async function xg(t,e){if(typeof t!="function")throw new un("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r),wr}s(i,"forEachFn");for await(let n of Sr.call(this,i,e));}s(xg,"forEach");function Es(t,e){if(typeof t!="function")throw new un("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r)?n:wr}return s(i,"filterFn"),Sr.call(this,i,e)}s(Es,"filter");var Ss=class extends rg{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function kg(t,e,i){var n;if(typeof t!="function")throw new un("reducer",["Function","AsyncFunction"],t);i!=null&&zt(i,"options"),i?.signal!=null&&Vt(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let u=new Ye(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await lg(this.destroy(u)),u}let o=new ig,a=o.signal;if(i!=null&&i.signal){let u={once:!0,[sg]:this,[ag]:!0};i.signal.addEventListener("abort",()=>o.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new Ye;r?e=await t(e,u,{signal:a}):(e=u,r=!0)}if(!l&&!r)throw new Ss}finally{o.abort()}return e}s(kg,"reduce");async function Fg(t){t!=null&&zt(t,"options"),t?.signal!=null&&Vt(t.signal,"options.signal");let e=[];for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Ye(void 0,{cause:t.signal.reason});pg(e,n)}return e}s(Fg,"toArray");function Ig(t,e){let i=Sr.call(this,t,e);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(Ig,"flatMap");function jf(t){if(t=mg(t),bg(t))return 0;if(t<0)throw new og("number",">= 0",t);return t}s(jf,"toIntegerOrInfinity");function vg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),t=jf(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ye;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ye;t--<=0&&(yield o)}},"drop").call(this)}s(vg,"drop");function Pg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),t=jf(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ye;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ye;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(Pg,"take");_s.exports.streamReturningOperators={asIndexedPairs:hg(Sg,"readable.asIndexedPairs will be removed in a future version."),drop:vg,filter:Es,flatMap:Ig,map:Sr,take:Pg,compose:wg};_s.exports.promiseReturningOperators={every:Eg,forEach:xg,reduce:kg,toArray:Fg,some:qf,find:_g}});var xs=T((f_,Vf)=>{"use strict";var{ArrayPrototypePop:Tg,Promise:Ag}=W(),{isIterable:Og,isNodeStream:Cg,isWebStream:Rg}=$e(),{pipelineImpl:Lg}=mr(),{finished:Ng}=tt();ks();function Dg(...t){return new Ag((e,i)=>{let n,r,o=t[t.length-1];if(o&&typeof o=="object"&&!Cg(o)&&!Og(o)&&!Rg(o)){let a=Tg(t);n=a.signal,r=a.end}Lg(t,(a,l)=>{a?i(a):e(l)},{signal:n,end:r})})}s(Dg,"pipeline");Vf.exports={finished:Ng,pipeline:Dg}});var ks=T((d_,Zf)=>{var{Buffer:Bg}=_e(),{ObjectDefineProperty:rt,ObjectKeys:Yf,ReflectApply:Gf}=W(),{promisify:{custom:Kf}}=Z(),{streamReturningOperators:zf,promiseReturningOperators:Hf}=$f(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Xf}}=ne(),Mg=ws(),{setDefaultHighWaterMark:Wg,getDefaultHighWaterMark:Ug}=tn(),{pipeline:Jf}=mr(),{destroyer:qg}=Mt(),Qf=tt(),Fs=xs(),dn=$e(),C=Zf.exports=Zn().Stream;C.isDestroyed=dn.isDestroyed;C.isDisturbed=dn.isDisturbed;C.isErrored=dn.isErrored;C.isReadable=dn.isReadable;C.isWritable=dn.isWritable;C.Readable=on();for(let t of Yf(zf)){let i=function(...n){if(new.target)throw Xf();return C.Readable.from(Gf(e,this,n))};Is=i,s(i,"fn");let e=zf[t];rt(i,"name",{__proto__:null,value:e.name}),rt(i,"length",{__proto__:null,value:e.length}),rt(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Is;for(let t of Yf(Hf)){let i=function(...r){if(new.target)throw Xf();return Gf(e,this,r)};Is=i,s(i,"fn");let e=Hf[t];rt(i,"name",{__proto__:null,value:e.name}),rt(i,"length",{__proto__:null,value:e.length}),rt(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Is;C.Writable=dr();C.Duplex=He();C.Transform=ss();C.PassThrough=ls();C.pipeline=Jf;var{addAbortSignal:jg}=en();C.addAbortSignal=jg;C.finished=Qf;C.destroy=qg;C.compose=Mg;C.setDefaultHighWaterMark=Wg;C.getDefaultHighWaterMark=Ug;rt(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return Fs},"get")});rt(Jf,Kf,{__proto__:null,enumerable:!0,get:s(function(){return Fs.pipeline},"get")});rt(Qf,Kf,{__proto__:null,enumerable:!0,get:s(function(){return Fs.finished},"get")});C.Stream=C;C._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(e){return Bg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var eu=T((p_,$)=>{"use strict";var G=ks(),$g=xs(),Vg=G.Readable.destroy;$.exports=G.Readable;$.exports._uint8ArrayToBuffer=G._uint8ArrayToBuffer;$.exports._isUint8Array=G._isUint8Array;$.exports.isDisturbed=G.isDisturbed;$.exports.isErrored=G.isErrored;$.exports.isReadable=G.isReadable;$.exports.Readable=G.Readable;$.exports.Writable=G.Writable;$.exports.Duplex=G.Duplex;$.exports.Transform=G.Transform;$.exports.PassThrough=G.PassThrough;$.exports.addAbortSignal=G.addAbortSignal;$.exports.finished=G.finished;$.exports.destroy=G.destroy;$.exports.destroy=Vg;$.exports.pipeline=G.pipeline;$.exports.compose=G.compose;Object.defineProperty(G,"promises",{configurable:!0,enumerable:!0,get:s(function(){return $g},"get")});$.exports.Stream=G.Stream;$.exports.default=$.exports});var Gg={};gn(Gg,{ActionType:()=>Sn,Async:()=>Dr,AsyncIndexFS:()=>qi,AsyncTransaction:()=>Wr,BigIntStats:()=>ie,BigIntStatsFs:()=>Nr,Dir:()=>ht,Dirent:()=>dt,Errno:()=>D,ErrnoError:()=>f,Fetch:()=>Ud,FetchFS:()=>Tn,File:()=>It,FileIndex:()=>Tt,FileSystem:()=>se,FileType:()=>z,InMemory:()=>Bi,InMemoryStore:()=>Fn,IndexDirInode:()=>ct,IndexFS:()=>Ui,IndexFileInode:()=>Pn,IndexInode:()=>Wi,Inode:()=>Ne,LockedFS:()=>$i,Mutex:()=>ji,NoSyncFile:()=>Ke,Overlay:()=>qd,OverlayFS:()=>Vi,Port:()=>Bd,PortFS:()=>vn,PortFile:()=>Mi,PreloadFile:()=>ce,ReadStream:()=>gt,Readonly:()=>Br,SimpleAsyncStore:()=>Ur,SimpleTransaction:()=>Xt,Stats:()=>R,StatsCommon:()=>Pi,StatsFs:()=>Ti,StoreFS:()=>Li,Sync:()=>Ad,SyncIndexFS:()=>Vr,SyncTransaction:()=>Di,Transaction:()=>Ni,UnlockedOverlayFS:()=>An,WriteStream:()=>wt,_toUnixTimestamp:()=>Cd,access:()=>Lu,accessSync:()=>Wa,appendFile:()=>fu,appendFileSync:()=>Ia,attachFS:()=>Nd,checkOptions:()=>Hr,chmod:()=>Tu,chmodSync:()=>Da,chown:()=>vu,chownSync:()=>La,close:()=>du,closeSync:()=>Qe,configure:()=>Hg,constants:()=>Ft,copyFile:()=>ju,copyFileSync:()=>fo,cp:()=>Hu,cpSync:()=>uo,createReadStream:()=>Mu,createWriteStream:()=>Wu,decode:()=>xn,decodeDirListing:()=>kn,default:()=>Yg,detachFS:()=>Dd,encode:()=>Xe,encodeDirListing:()=>ye,errorMessages:()=>Or,exists:()=>iu,existsSync:()=>ni,fchmod:()=>wu,fchmodSync:()=>Mn,fchown:()=>gu,fchownSync:()=>Bn,fdatasync:()=>yu,fdatasyncSync:()=>Ta,flagToMode:()=>vt,flagToNumber:()=>vd,flagToString:()=>zs,fs:()=>bn,fstat:()=>uu,fstatSync:()=>va,fsync:()=>pu,fsyncSync:()=>Pa,ftruncate:()=>hu,ftruncateSync:()=>oo,futimes:()=>Su,futimesSync:()=>Wn,isAppendable:()=>at,isBackend:()=>zi,isBackendConfig:()=>Yr,isExclusive:()=>Ys,isReadable:()=>st,isSynchronous:()=>Oi,isTruncating:()=>Hs,isWriteable:()=>pe,lchmod:()=>Au,lchmodSync:()=>Ba,lchown:()=>Pu,lchownSync:()=>Na,levenshtein:()=>Mr,link:()=>ku,linkSync:()=>Ca,lopenSync:()=>Ji,lstat:()=>ru,lstatSync:()=>ro,lutimes:()=>Cu,lutimesSync:()=>Ma,mkdir:()=>_u,mkdirSync:()=>Un,mkdirpSync:()=>Ks,mkdtemp:()=>qu,mkdtempSync:()=>Ua,mount:()=>Gi,mountObject:()=>Ki,mounts:()=>we,nop:()=>S,normalizeMode:()=>me,normalizeOptions:()=>be,normalizePath:()=>x,normalizeTime:()=>Pt,open:()=>au,openAsBlob:()=>Gu,openSync:()=>oi,opendir:()=>zu,opendirSync:()=>$a,parseFlag:()=>L,pathExistsAction:()=>Ci,pathNotExistsAction:()=>Ri,promises:()=>mn,randomIno:()=>Ai,read:()=>bu,readFile:()=>lu,readFileSync:()=>Dn,readSync:()=>Oa,readdir:()=>xu,readdirSync:()=>si,readlink:()=>Iu,readlinkSync:()=>ao,readv:()=>$u,readvSync:()=>qa,realpath:()=>Ru,realpathSync:()=>ii,rename:()=>tu,renameSync:()=>xa,resolveMountConfig:()=>js,rm:()=>Uu,rmSync:()=>co,rmdir:()=>Eu,rmdirSync:()=>so,rootCred:()=>Be,rootIno:()=>De,setImmediate:()=>Od,size_max:()=>wn,stat:()=>nu,statSync:()=>Xi,statfs:()=>Yu,statfsSync:()=>Va,symlink:()=>Fu,symlinkSync:()=>Ra,truncate:()=>ou,truncateSync:()=>ka,umount:()=>Ln,unlink:()=>su,unlinkSync:()=>Nn,unwatchFile:()=>Du,utimes:()=>Ou,utimesSync:()=>lo,watch:()=>Bu,watchFile:()=>Nu,write:()=>mu,writeFile:()=>cu,writeFileSync:()=>Qi,writeSync:()=>Aa,writev:()=>Vu,writevSync:()=>ja});var D=(p=>(p[p.EPERM=1]="EPERM",p[p.ENOENT=2]="ENOENT",p[p.EINTR=4]="EINTR",p[p.EIO=5]="EIO",p[p.ENXIO=6]="ENXIO",p[p.EBADF=9]="EBADF",p[p.EAGAIN=11]="EAGAIN",p[p.ENOMEM=12]="ENOMEM",p[p.EACCES=13]="EACCES",p[p.EFAULT=14]="EFAULT",p[p.ENOTBLK=15]="ENOTBLK",p[p.EBUSY=16]="EBUSY",p[p.EEXIST=17]="EEXIST",p[p.EXDEV=18]="EXDEV",p[p.ENODEV=19]="ENODEV",p[p.ENOTDIR=20]="ENOTDIR",p[p.EISDIR=21]="EISDIR",p[p.EINVAL=22]="EINVAL",p[p.ENFILE=23]="ENFILE",p[p.EMFILE=24]="EMFILE",p[p.ETXTBSY=26]="ETXTBSY",p[p.EFBIG=27]="EFBIG",p[p.ENOSPC=28]="ENOSPC",p[p.ESPIPE=29]="ESPIPE",p[p.EROFS=30]="EROFS",p[p.EMLINK=31]="EMLINK",p[p.EPIPE=32]="EPIPE",p[p.EDOM=33]="EDOM",p[p.ERANGE=34]="ERANGE",p[p.EDEADLK=35]="EDEADLK",p[p.ENAMETOOLONG=36]="ENAMETOOLONG",p[p.ENOLCK=37]="ENOLCK",p[p.ENOSYS=38]="ENOSYS",p[p.ENOTEMPTY=39]="ENOTEMPTY",p[p.ELOOP=40]="ELOOP",p[p.ENOMSG=42]="ENOMSG",p[p.EBADE=52]="EBADE",p[p.EBADR=53]="EBADR",p[p.EXFULL=54]="EXFULL",p[p.ENOANO=55]="ENOANO",p[p.EBADRQC=56]="EBADRQC",p[p.ENOSTR=60]="ENOSTR",p[p.ENODATA=61]="ENODATA",p[p.ETIME=62]="ETIME",p[p.ENOSR=63]="ENOSR",p[p.ENONET=64]="ENONET",p[p.EREMOTE=66]="EREMOTE",p[p.ENOLINK=67]="ENOLINK",p[p.ECOMM=70]="ECOMM",p[p.EPROTO=71]="EPROTO",p[p.EBADMSG=74]="EBADMSG",p[p.EOVERFLOW=75]="EOVERFLOW",p[p.EBADFD=77]="EBADFD",p[p.ESTRPIPE=86]="ESTRPIPE",p[p.ENOTSOCK=88]="ENOTSOCK",p[p.EDESTADDRREQ=89]="EDESTADDRREQ",p[p.EMSGSIZE=90]="EMSGSIZE",p[p.EPROTOTYPE=91]="EPROTOTYPE",p[p.ENOPROTOOPT=92]="ENOPROTOOPT",p[p.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",p[p.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",p[p.ENOTSUP=95]="ENOTSUP",p[p.ENETDOWN=100]="ENETDOWN",p[p.ENETUNREACH=101]="ENETUNREACH",p[p.ENETRESET=102]="ENETRESET",p[p.ETIMEDOUT=110]="ETIMEDOUT",p[p.ECONNREFUSED=111]="ECONNREFUSED",p[p.EHOSTDOWN=112]="EHOSTDOWN",p[p.EHOSTUNREACH=113]="EHOSTUNREACH",p[p.EALREADY=114]="EALREADY",p[p.EINPROGRESS=115]="EINPROGRESS",p[p.ESTALE=116]="ESTALE",p[p.EREMOTEIO=121]="EREMOTEIO",p[p.EDQUOT=122]="EDQUOT",p))(D||{}),Or={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},f=class t extends Error{constructor(i,n=Or[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=D[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let n=new t(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new t(D[i],Or[D[i]],n,r)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};var Ft={};gn(Ft,{COPYFILE_EXCL:()=>vi,COPYFILE_FICLONE:()=>nd,COPYFILE_FICLONE_FORCE:()=>rd,F_OK:()=>Ii,O_APPEND:()=>Oe,O_CREAT:()=>K,O_DIRECT:()=>ud,O_DIRECTORY:()=>sd,O_DSYNC:()=>cd,O_EXCL:()=>Te,O_NOATIME:()=>ad,O_NOCTTY:()=>od,O_NOFOLLOW:()=>ld,O_NONBLOCK:()=>dd,O_RDONLY:()=>Gt,O_RDWR:()=>oe,O_SYMLINK:()=>fd,O_SYNC:()=>Kt,O_TRUNC:()=>Ae,O_WRONLY:()=>Pe,R_OK:()=>ve,S_IFBLK:()=>_t,S_IFCHR:()=>xt,S_IFDIR:()=>Le,S_IFIFO:()=>kt,S_IFLNK:()=>Ce,S_IFMT:()=>J,S_IFREG:()=>Re,S_IFSOCK:()=>Et,S_IRGRP:()=>wd,S_IROTH:()=>_d,S_IRUSR:()=>md,S_IRWXG:()=>Rr,S_IRWXO:()=>Lr,S_IRWXU:()=>Cr,S_ISGID:()=>pd,S_ISUID:()=>hd,S_ISVTX:()=>yd,S_IWGRP:()=>Sd,S_IWOTH:()=>xd,S_IWUSR:()=>bd,S_IXGRP:()=>Ed,S_IXOTH:()=>kd,S_IXUSR:()=>gd,UV_FS_O_FILEMAP:()=>Fd,W_OK:()=>he,X_OK:()=>id});var Ii=0,ve=4,he=2,id=1,vi=1,nd=2,rd=4,Gt=0,Pe=1,oe=2,K=64,Te=128,od=256,Ae=512,Oe=1024,sd=65536,ad=262144,ld=131072,Kt=1052672,cd=4096,fd=32768,ud=16384,dd=2048,J=61440,Et=49152,Ce=40960,Re=32768,_t=24576,Le=16384,xt=8192,kt=4096,hd=2048,pd=1024,yd=512,Cr=448,md=256,bd=128,gd=64,Rr=56,wd=32,Sd=16,Ed=8,Lr=7,_d=4,xd=2,kd=1,Fd=0;var z=(n=>(n[n.FILE=32768]="FILE",n[n.DIRECTORY=16384]="DIRECTORY",n[n.SYMLINK=40960]="SYMLINK",n))(z||{}),Pi=class{constructor({atimeMs:e,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:l,mode:c,ino: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);let h=Date.now(),d=s((m,w)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:w),"resolveT");this.atimeMs=d(e,h),this.mtimeMs=d(i,h),this.ctimeMs=d(n,h),this.birthtimeMs=d(r,h),this.uid=d(o,0),this.gid=d(a,0),this.size=d(l,0),this.ino=d(u,0);let b=Number(c)&61440||z.FILE;if(c)this.mode=this._convert(c);else switch(b){case z.FILE:this.mode=this._convert(420);break;case z.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(b))}static{s(this,"StatsCommon")}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))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let n=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&n)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)}get mtimeNs(){return BigInt(this.mtimeMs)}get ctimeNs(){return BigInt(this.ctimeMs)}get birthtimeNs(){return BigInt(this.birthtimeMs)}},R=class t extends Pi{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}static clone(i){return new t(i)}},ie=class t extends Pi{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}static clone(i){return new t(i)}},Ti=class{constructor(){this.type=0;this.bsize=0;this.blocks=0;this.bfree=0;this.bavail=0;this.files=0;this.ffree=0}static{s(this,"StatsFs")}},Nr=class{constructor(){this.type=0n;this.bsize=0n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=0n;this.ffree=0n}static{s(this,"BigIntStatsFs")}};var wn=2**32-1,De=0n;function Vs(){return Math.round(Math.random()*2**32).toString(16)}s(Vs,"_random");function Ai(){return BigInt("0x"+Vs()+Vs())}s(Ai,"randomIno");var Ne=class{static{s(this,"Inode")}get data(){return new Uint8Array(this.buffer)}constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Ai(),this.nlink=1,this.size=4096;let n=Date.now();this.atimeMs=n,this.mtimeMs=n,this.ctimeMs=n,this.birthtimeMs=n}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new R(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};var Sn=(r=>(r[r.NOP=0]="NOP",r[r.THROW=1]="THROW",r[r.TRUNCATE=2]="TRUNCATE",r[r.CREATE=3]="CREATE",r))(Sn||{}),Id=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function L(t){if(typeof t=="number")return zs(t);if(!Id.includes(t))throw new Error("Invalid flag string: "+t);return t}s(L,"parseFlag");function zs(t){switch(t){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 Error("Invalid flag number: "+t)}}s(zs,"flagToString");function vd(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(vd,"flagToNumber");function vt(t){let e=0;return e<<=1,e+=+st(t),e<<=1,e+=+pe(t),e<<=1,e}s(vt,"flagToMode");function st(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(st,"isReadable");function pe(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(pe,"isWriteable");function Hs(t){return t.indexOf("w")!==-1}s(Hs,"isTruncating");function at(t){return t.indexOf("a")!==-1}s(at,"isAppendable");function Oi(t){return t.indexOf("s")!==-1}s(Oi,"isSynchronous");function Ys(t){return t.indexOf("x")!==-1}s(Ys,"isExclusive");function Ci(t){return Ys(t)?1:Hs(t)?2:0}s(Ci,"pathExistsAction");function Ri(t){return(pe(t)||at(t))&&t!=="r+"?3:1}s(Ri,"pathNotExistsAction");var It=class{static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},ce=class extends It{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:wn}))){super();this.fs=i;this.path=n;this.flag=r;this.stats=o;this._buffer=a;this._position=0;this._dirty=!1;if(this.stats.size!=a.byteLength){if(st(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return at(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this._dirty=!1)}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this._dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new R(this.stats)}statSync(){return new R(this.stats)}async truncate(i){if(this.truncateSync(i),Oi(this.flag))return this.sync()}truncateSync(i){if(this._dirty=!0,!pe(this.flag))throw new f(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length),Oi(this.flag)&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),Oi(this.flag)&&this.syncSync()}async write(i,n=0,r=this.stats.size,o=0){let a=this.writeSync(i,n,r,o);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!pe(this.flag))throw new f(1,"File not opened with a writeable mode.");let a=o+r;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let u=new Uint8Array(new ArrayBuffer(a,{maxByteLength:wn}));u.set(this._buffer),this._buffer=u}let l=i.slice(n,n+r);this._buffer.set(l,o);let c=l.byteLength;return this.stats.mtimeMs=Date.now(),Oi(this.flag)?(this.syncSync(),c):(this.position=o+c,c)}async read(i,n=0,r=this.stats.size,o=0){return{bytesRead:this.readSync(i,n,r,o),buffer:i}}readSync(i,n=0,r=this.stats.size,o){if(!st(this.flag))throw new f(1,"File not opened with a readable mode.");o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||new Uint8Array(i.buffer,n,r).set(this._buffer.slice(o,a)),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){this.chownSync(i,n)}chownSync(i,n){this._dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){this.utimesSync(i,n)}utimesSync(i,n){this._dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}},Ke=class extends ce{static{s(this,"NoSyncFile")}constructor(e,i,n,r,o){super(e,i,n,r,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};var Be={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Pd="/";function Gs(t,e){let i="",n=0,r=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===l-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),r=l,o=0;continue}else if(i.length!==0){i="",n=0,r=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,l):i=t.slice(r+1,l),n=l-r-1;r=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Gs,"normalizeString");function lt(...t){let e="";for(let n of[...t.reverse(),Pd])if(n.length&&(e=`${n}/${e}`,n.startsWith("/")))break;let i=e.startsWith("/");return e=Gs(e,!i),i?`/${e}`:e.length?e:"/"}s(lt,"resolve");function Td(t){if(!t.length)return".";let e=t.startsWith("/"),i=t.endsWith("/");return t=Gs(t,!e),t.length?(i&&(t+="/"),e?`/${t}`:t):e?"/":i?"./":"."}s(Td,"normalize");function B(...t){if(!t.length)return".";let e=t.join("/");return e?.length?Td(e):"."}s(B,"join");function I(t){if(t.length===0)return".";let e=t[0]==="/",i=-1,n=!0;for(let r=t.length-1;r>=1;--r)if(t[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(I,"dirname");function N(t,e){let i=0,n=-1,r=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!r){i=l+1;break}}else a===-1&&(r=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(n=l):(o=-1,n=a));return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":t.slice(i,n)}s(N,"basename");function En(t){let e=t.startsWith("/"),i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let n=e?1:0,r=-1,o=0,a=-1,l=!0,c=t.length-1,u=0;for(;c>=n;--c){if(t[c]==="/"){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t[c]==="."?r===-1?r=c:u!==1&&(u=1):r!==-1&&(u=-1)}if(a!==-1){let h=o===0&&e?1:o;r===-1||u===0||u===1&&r===a-1&&r===o+1?i.base=i.name=t.slice(h,a):(i.name=t.slice(h,r),i.base=t.slice(h,a),i.ext=t.slice(r,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(En,"parse");var se=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name,readonly:!1,totalSpace:0,freeSpace:0}}constructor(e){}async ready(){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};function Ad(t){class e extends t{static{s(this,"_SyncFS")}async exists(n,r){return this.existsSync(n,r)}async rename(n,r,o){return this.renameSync(n,r,o)}async stat(n,r){return this.statSync(n,r)}async createFile(n,r,o,a){return this.createFileSync(n,r,o,a)}async openFile(n,r,o){return this.openFileSync(n,r,o)}async unlink(n,r){return this.unlinkSync(n,r)}async rmdir(n,r){return this.rmdirSync(n,r)}async mkdir(n,r,o){return this.mkdirSync(n,r,o)}async readdir(n,r){return this.readdirSync(n,r)}async link(n,r,o){return this.linkSync(n,r,o)}async sync(n,r,o){return this.syncSync(n,r,o)}}return e}s(Ad,"Sync");function Dr(t){class e extends t{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{s(this,"_AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(r=>{let o=s(()=>this._queueRunning?setTimeout(o):r(),"check");o()})}async ready(){if(await this._sync.ready(),await super.ready(),!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(r){throw this._isInitialized=!1,r}}renameSync(r,o,a){this._sync.renameSync(r,o,a),this.queue("rename",r,o,a)}statSync(r,o){return this._sync.statSync(r,o)}createFileSync(r,o,a,l){return this._sync.createFileSync(r,o,a,l),this.queue("createFile",r,o,a,l),this.openFileSync(r,o,l)}openFileSync(r,o,a){let l=this._sync.openFileSync(r,o,a),c=l.statSync(),u=new Uint8Array(c.size);return l.readSync(u),new ce(this,r,o,c,u)}unlinkSync(r,o){this._sync.unlinkSync(r,o),this.queue("unlink",r,o)}rmdirSync(r,o){this._sync.rmdirSync(r,o),this.queue("rmdir",r,o)}mkdirSync(r,o,a){this._sync.mkdirSync(r,o,a),this.queue("mkdir",r,o,a)}readdirSync(r,o){return this._sync.readdirSync(r,o)}linkSync(r,o,a){this._sync.linkSync(r,o,a),this.queue("link",r,o,a)}syncSync(r,o,a){this._sync.syncSync(r,o,a),this.queue("sync",r,o,a)}existsSync(r,o){return this._sync.existsSync(r,o)}async crossCopy(r){let o=await this.stat(r,Be);if(o.isDirectory()){if(r!=="/"){let l=await this.stat(r,Be);this._sync.mkdirSync(r,l.mode,l.cred())}let a=await this.readdir(r,Be);for(let l of a)await this.crossCopy(B(r,l))}else{let a=await this.openFile(r,L("r"),Be),l=this._sync.createFileSync(r,L("w"),o.mode,o.cred());try{let c=new Uint8Array(o.size);await a.read(c),l.writeSync(c,0,o.size)}finally{await a.close(),l.closeSync()}}}async _next(){if(!this._queueRunning)return;let[r,...o]=this._queue.shift();await this[r](...o),await this._next()}queue(...r){this._queue.push(r),this._next()}}return e}s(Dr,"Async");function Br(t){class e extends t{static{s(this,"_ReadonlyFS")}metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r,o){throw new f(30)}renameSync(n,r,o){throw new f(30)}async createFile(n,r,o,a){throw new f(30)}createFileSync(n,r,o,a){throw new f(30)}async unlink(n,r){throw new f(30)}unlinkSync(n,r){throw new f(30)}async rmdir(n,r){throw new f(30)}rmdirSync(n,r){throw new f(30)}async mkdir(n,r,o){throw new f(30)}mkdirSync(n,r,o){throw new f(30)}async link(n,r,o){throw new f(30)}linkSync(n,r,o){throw new f(30)}async sync(n,r,o){throw new f(30)}syncSync(n,r,o){throw new f(30)}}return e}s(Br,"Readonly");function Ks(t,e,i,n){n.existsSync(t,i)||(Ks(I(t),e,i,n),n.mkdirSync(t,e,i))}s(Ks,"mkdirpSync");function _n(t,e,i,n,r){return Math.min(t+1,e+1,i+1,n===r?e:e+1)}s(_n,"_min");function Mr(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,n=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=t.charCodeAt(r+b),o[b]=++b;let a,l,c,u,h;for(a=0;a+3<n;){let b=e.charCodeAt(r+(l=a)),m=e.charCodeAt(r+(c=a+1)),w=e.charCodeAt(r+(u=a+2)),g=e.charCodeAt(r+(h=a+3)),v=a+=4;for(let E=0;E<i;){let A=o[i+E],q=o[E];l=_n(q,l,c,b,A),c=_n(l,c,u,m,A),u=_n(c,u,h,w,A),v=_n(u,h,v,g,A),o[E++]=v,h=u,u=c,c=l,l=q}}let d=0;for(;a<n;){let b=e.charCodeAt(r+(l=a));d=++a;for(let m=0;m<i;m++){let w=o[m];o[m]=d=w<l||d<l?w>d?d+1:w+1:b===o[i+m]?l:l+1,l=w}}return d}s(Mr,"levenshtein");var Od=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Xe(t){if(typeof t!="string")throw new f(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Xe,"encode");function xn(t){if(!(t instanceof Uint8Array))throw new f(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(xn,"decode");function kn(t){return JSON.parse(xn(t),(e,i)=>e==""?i:BigInt(i))}s(kn,"decodeDirListing");function ye(t){return Xe(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(ye,"encodeDirListing");function Cd(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(Cd,"_toUnixTimestamp");function me(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new f(22,"Invalid mode: "+t?.toString())}s(me,"normalizeMode");function Pt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new f(22,"Invalid time.")}s(Pt,"normalizeTime");function x(t){if(t=t.toString(),t.includes("\0"))throw new f(22,"Path can not contain null character");if(t.length==0)throw new f(22,"Path can not be empty");return lt(t.replaceAll(/[/\\]+/g,"/"))}s(x,"normalizePath");function be(t,e="utf8",i,n=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e??null,flag:i,mode:n}:{encoding:typeof t?.encoding=="string"?t.encoding:e??null,flag:typeof t?.flag=="string"?t.flag:i,mode:me("mode"in t?t?.mode:null,n)}}s(be,"normalizeOptions");function S(){}s(S,"nop");var Xs=5,Li=class extends se{constructor(i){super();this.$store=i;this._initialized=!1;i instanceof Promise||(this._store=i,this._initialized=!0,this.makeRootDirectorySync())}static{s(this,"StoreFS")}get store(){if(!this._store)throw new f(61,"No store attached");return this._store}async ready(){await super.ready(),!this._initialized&&(this._initialized=!0,this._store=await this.$store)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.makeRootDirectory()}emptySync(){this.store.clearSync(),this.makeRootDirectorySync()}async rename(i,n,r){let o=this.store.transaction(),a=I(i),l=N(i),c=I(n),u=N(n),h=await this.findINode(o,a),d=await this.getDirListing(o,h,a);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"rename");if(!d[l])throw f.With("ENOENT",i,"rename");let b=d[l];if(delete d[l],(c+"/").indexOf(i+"/")===0)throw new f(16,a);let m,w;if(c===a?(m=h,w=d):(m=await this.findINode(o,c),w=await this.getDirListing(o,m,c)),w[u]){let g=await this.getINode(o,w[u],n);if(g.toStats().isFile())try{await o.remove(g.ino),await o.remove(w[u])}catch(v){throw await o.abort(),v}else throw f.With("EPERM",n,"rename")}w[u]=b;try{await o.set(h.ino,ye(d)),await o.set(m.ino,ye(w))}catch(g){throw await o.abort(),g}await o.commit()}renameSync(i,n,r){let o=this.store.transaction(),a=I(i),l=N(i),c=I(n),u=N(n),h=this.findINodeSync(o,a),d=this.getDirListingSync(o,h,a);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"rename");if(!d[l])throw f.With("ENOENT",i,"rename");let b=d[l];if(delete d[l],(c+"/").indexOf(i+"/")==0)throw new f(16,a);let m,w;if(c===a?(m=h,w=d):(m=this.findINodeSync(o,c),w=this.getDirListingSync(o,m,c)),w[u]){let g=this.getINodeSync(o,w[u],n);if(g.toStats().isFile())try{o.removeSync(g.ino),o.removeSync(w[u])}catch(v){throw o.abortSync(),v}else throw f.With("EPERM",n,"rename")}w[u]=b;try{o.setSync(h.ino,ye(d)),o.setSync(m.ino,ye(w))}catch(g){throw o.abortSync(),g}o.commitSync()}async stat(i,n){let r=this.store.transaction(),o=await this.findINode(r,i);if(!o)throw f.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,n))throw f.With("EACCES",i,"stat");return a}statSync(i,n){let r=this.findINodeSync(this.store.transaction(),i).toStats();if(!r.hasAccess(4,n))throw f.With("EACCES",i,"stat");return r}async createFile(i,n,r,o){let a=new Uint8Array(0),l=await this.commitNew(this.store.transaction(),i,z.FILE,r,o,a);return new ce(this,i,n,l.toStats(),a)}createFileSync(i,n,r,o){return this.commitNewSync(i,z.FILE,r,o),this.openFileSync(i,n,o)}async openFile(i,n,r){let o=this.store.transaction(),a=await this.findINode(o,i),l=await o.get(a.ino);if(!a.toStats().hasAccess(vt(n),r))throw f.With("EACCES",i,"openFile");if(!l)throw f.With("ENOENT",i,"openFile");return new ce(this,i,n,a.toStats(),l)}openFileSync(i,n,r){let o=this.store.transaction(),a=this.findINodeSync(o,i),l=o.getSync(a.ino);if(!a.toStats().hasAccess(vt(n),r))throw f.With("EACCES",i,"openFile");if(!l)throw f.With("ENOENT",i,"openFile");return new ce(this,i,n,a.toStats(),l)}async unlink(i,n){return this.remove(i,!1,n)}unlinkSync(i,n){this.removeSync(i,!1,n)}async rmdir(i,n){if((await this.readdir(i,n)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0,n)}rmdirSync(i,n){if(this.readdirSync(i,n).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0,n)}async mkdir(i,n,r){let o=this.store.transaction(),a=Xe("{}");await this.commitNew(o,i,z.DIRECTORY,n,r,a)}mkdirSync(i,n,r){this.commitNewSync(i,z.DIRECTORY,n,r,Xe("{}"))}async readdir(i,n){let r=this.store.transaction(),o=await this.findINode(r,i);if(!o.toStats().hasAccess(4,n))throw f.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(r,o,i))}readdirSync(i,n){let r=this.store.transaction(),o=this.findINodeSync(r,i);if(!o.toStats().hasAccess(4,n))throw f.With("EACCES",i,"readdir");return Object.keys(this.getDirListingSync(r,o,i))}async sync(i,n,r){let o=this.store.transaction(),a=await this._findINode(o,I(i),N(i)),l=await this.getINode(o,a,i),c=l.update(r);try{await o.set(l.ino,n),c&&await o.set(a,l.data)}catch(u){throw await o.abort(),u}await o.commit()}syncSync(i,n,r){let o=this.store.transaction(),a=this._findINodeSync(o,I(i),N(i)),l=this.getINodeSync(o,a,i),c=l.update(r);try{o.setSync(l.ino,n),c&&o.setSync(a,l.data)}catch(u){throw o.abortSync(),u}o.commitSync()}async link(i,n,r){let o=this.store.transaction(),a=I(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,r))throw f.With("EACCES",a,"link");let c=I(n),u=await this.findINode(o,c),h=await this.getDirListing(o,u,c);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",c,"link");let d=await this._findINode(o,a,N(i)),b=await this.getINode(o,d,i);if(!b.toStats().hasAccess(2,r))throw f.With("EACCES",n,"link");b.nlink++,h[N(n)]=d;try{o.setSync(d,b.data),o.setSync(u.ino,ye(h))}catch(m){throw o.abortSync(),m}o.commitSync()}linkSync(i,n,r){let o=this.store.transaction(),a=I(i);if(!this.findINodeSync(o,a).toStats().hasAccess(4,r))throw f.With("EACCES",a,"link");let c=I(n),u=this.findINodeSync(o,c),h=this.getDirListingSync(o,u,c);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",c,"link");let d=this._findINodeSync(o,a,N(i)),b=this.getINodeSync(o,d,i);if(!b.toStats().hasAccess(2,r))throw f.With("EACCES",n,"link");b.nlink++,h[N(n)]=d;try{o.setSync(d,b.data),o.setSync(u.ino,ye(h))}catch(m){throw o.abortSync(),m}o.commitSync()}async makeRootDirectory(){let i=this.store.transaction();if(await i.get(De))return;let n=new Ne;n.mode=511|z.DIRECTORY,await i.set(n.ino,Xe("{}")),await i.set(De,n.data),await i.commit()}makeRootDirectorySync(){let i=this.store.transaction();if(i.getSync(De))return;let n=new Ne;n.mode=511|z.DIRECTORY,i.setSync(n.ino,Xe("{}")),i.setSync(De,n.data),i.commitSync()}async _findINode(i,n,r,o=new Set){let a=B(n,r);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return De;let l=n=="/"?await this.getINode(i,De,n):await this.findINode(i,n,o),c=await this.getDirListing(i,l,n);if(!(r in c))throw f.With("ENOENT",lt(n,r),"_findINode");return c[r]}_findINodeSync(i,n,r,o=new Set){let a=B(n,r);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return De;let l=n=="/"?this.getINodeSync(i,De,n):this.findINodeSync(i,n,o),c=this.getDirListingSync(i,l,n);if(!(r in c))throw f.With("ENOENT",lt(n,r),"_findINode");return c[r]}async findINode(i,n,r=new Set){let o=await this._findINode(i,I(n),N(n),r);return this.getINode(i,o,n)}findINodeSync(i,n,r=new Set){let o=this._findINodeSync(i,I(n),N(n),r);return this.getINodeSync(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw f.With("ENOENT",r,"getINode");return new Ne(o.buffer)}getINodeSync(i,n,r){let o=i.getSync(n);if(!o)throw f.With("ENOENT",r,"getINode");return new Ne(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw f.With("ENOENT",r,"getDirListing");return kn(o)}getDirListingSync(i,n,r){if(!n.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let o=i.getSync(n.ino);if(!o)throw f.With("ENOENT",r,"getDirListing");return kn(o)}async addNew(i,n,r){for(let o=0;o<Xs;o++){let a=Ai();if(!await i.get(a))return await i.set(a,n),a}throw new f(28,"No inode IDs available",r,"addNewNode")}addNewSync(i,n,r){for(let o=0;o<Xs;o++){let a=Ai();if(!i.getSync(a))return i.setSync(a,n),a}throw new f(28,"No inode IDs available",r,"addNewNode")}async commitNew(i,n,r,o,a,l){let c=I(n),u=await this.findINode(i,c);if(!u.toStats().hasAccess(2,a))throw f.With("EACCES",n,"commitNewFile");let h=N(n),d=await this.getDirListing(i,u,c);if(n==="/")throw f.With("EEXIST",n,"commitNewFile");if(d[h])throw await i.abort(),f.With("EEXIST",n,"commitNewFile");try{let b=new Ne;return b.ino=await this.addNew(i,l,n),b.mode=o|r,b.uid=a.uid,b.gid=a.gid,b.size=l.length,d[h]=await this.addNew(i,b.data,n),await i.set(u.ino,ye(d)),await i.commit(),b}catch(b){throw i.abort(),b}}commitNewSync(i,n,r,o,a=new Uint8Array){let l=this.store.transaction(),c=I(i),u=this.findINodeSync(l,c);if(!u.toStats().hasAccess(2,o))throw f.With("EACCES",i,"commitNewFile");let h=N(i),d=this.getDirListingSync(l,u,c);if(i==="/")throw f.With("EEXIST",i,"commitNewFile");if(d[h])throw f.With("EEXIST",i,"commitNewFile");let b=new Ne;try{b.ino=this.addNewSync(l,a,i),b.size=a.length,b.mode=r|n,b.uid=o.uid,b.gid=o.gid,d[h]=this.addNewSync(l,b.data,i),l.setSync(u.ino,ye(d))}catch(m){throw l.abortSync(),m}return l.commitSync(),b}async remove(i,n,r){let o=this.store.transaction(),a=I(i),l=await this.findINode(o,a),c=await this.getDirListing(o,l,a),u=N(i);if(!c[u])throw f.With("ENOENT",i,"removeEntry");let h=c[u],d=await this.getINode(o,h,i);if(!d.toStats().hasAccess(2,r))throw f.With("EACCES",i,"removeEntry");if(delete c[u],!n&&d.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(n&&!d.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{await o.set(l.ino,ye(c)),--d.nlink<1&&(await o.remove(d.ino),await o.remove(h))}catch(b){throw await o.abort(),b}await o.commit()}removeSync(i,n,r){let o=this.store.transaction(),a=I(i),l=this.findINodeSync(o,a),c=this.getDirListingSync(o,l,a),u=N(i),h=c[u];if(!h)throw f.With("ENOENT",i,"removeEntry");let d=this.getINodeSync(o,h,i);if(!d.toStats().hasAccess(2,r))throw f.With("EACCES",i,"removeEntry");if(delete c[u],!n&&d.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(n&&!d.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{o.setSync(l.ino,ye(c)),--d.nlink<1&&(o.removeSync(d.ino),o.removeSync(h))}catch(b){throw o.abortSync(),b}o.commitSync()}};var Ni=class{constructor(){this.aborted=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.aborted||await this.commit()}[Symbol.dispose](){this.aborted||this.commitSync()}},Di=class extends Ni{static{s(this,"SyncTransaction")}async get(e){return this.getSync(e)}async set(e,i){return this.setSync(e,i)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},Wr=class extends Ni{static{s(this,"AsyncTransaction")}getSync(e){throw f.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(e,i){throw f.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(e){throw f.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw f.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw f.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};var Ur=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}get(e){return this.cache.get(e)}set(e,i){this.cache.set(e,i),this.queue.add(this._set(e,i))}delete(e){this.cache.delete(e),this.queue.add(this._delete(e))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[e,i]of await this.entries())this.cache.has(e)||this.cache.set(e,i);for(let e of this.queue)await e}transaction(){return new Xt(this)}},Xt=class extends Di{constructor(i){super();this.store=i;this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let n=this.store.get(i);return this.stashOldValue(i,n),n}setSync(i,n){return this.markModified(i),this.store.set(i,n)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){}abortSync(){for(let i of this.modifiedKeys){let n=this.originalData.get(i);n?this.store.set(i,n):this.store.delete(i)}}stashOldValue(i,n){this.originalData.has(i)||this.originalData.set(i,n)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var Fn=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new Xt(this)}},Bi={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:t}){return new Li(new Fn(t))},"create")};function Rd(t){return typeof t=="object"&&t!=null&&"fd"in t&&"path"in t&&"position"in t}s(Rd,"isFileData");function qr(t){return typeof t=="object"&&t!=null&&"_zenfs"in t&&!!t._zenfs}s(qr,"isMessage");var Jt=new Map;function jr(t,{port:e,timeout:i=1e3,fs:n}={}){let r=new Error().stack.slice(6);if(!e)throw f.With("EINVAL");return new Promise((o,a)=>{let l=Math.random().toString(16).slice(10);Jt.set(l,{resolve:o,reject:a,fs:n}),e.postMessage({...t,_zenfs:!0,id:l,stack:r});let c=setTimeout(()=>{let u=new f(5,"RPC Failed");u.stack+=r,a(u),typeof c=="object"&&c.unref()},i)})}s(jr,"request");function Js(t){if(!qr(t))return;let{id:e,value:i,error:n,stack:r}=t;if(!Jt.has(e)){let c=new f(5,"Invalid RPC id:"+e);throw c.stack+=r,c}let{resolve:o,reject:a,fs:l}=Jt.get(e);if(n){let c=f.fromJSON(i);c.stack+=r,a(c),Jt.delete(e);return}if(Rd(i)){let{fd:c,path:u,position:h}=i,d=new Mi(l,c,u,h);o(d),Jt.delete(e);return}o(i),Jt.delete(e)}s(Js,"handleResponse");function $r(t,e){if(!t)throw f.With("EINVAL");t["on"in t?"on":"addEventListener"]("message",i=>{e("data"in i?i.data:i)})}s($r,"attach");function Qs(t,e){if(!t)throw f.With("EINVAL");t["off"in t?"off":"removeEventListener"]("message",i=>{e("data"in i?i.data:i)})}s(Qs,"detach");var Mi=class extends It{constructor(i,n,r,o){super();this.fs=i;this.fd=n;this.path=r;this.position=o}static{s(this,"PortFile")}rpc(i,...n){return jr({scope:"file",fd:this.fd,method:i,args:n},this.fs.options)}stat(){return this.rpc("stat")}statSync(){throw f.With("ENOSYS",this.path,"PortFile.stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){throw f.With("ENOSYS",this.path,"PortFile.truncate")}write(i,n,r,o){return this.rpc("write",i,n,r,o)}writeSync(){throw f.With("ENOSYS",this.path,"PortFile.write")}async read(i,n,r,o){return await this.rpc("read",i,n,r,o)}readSync(){throw f.With("ENOSYS",this.path,"PortFile.read")}chown(i,n){return this.rpc("chown",i,n)}chownSync(){throw f.With("ENOSYS",this.path,"PortFile.chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){throw f.With("ENOSYS",this.path,"PortFile.chmod")}utimes(i,n){return this.rpc("utimes",i,n)}utimesSync(){throw f.With("ENOSYS",this.path,"PortFile.utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){throw f.With("ENOSYS",this.path,"PortFile._setType")}close(){return this.rpc("close")}closeSync(){throw f.With("ENOSYS",this.path,"PortFile.close")}sync(){return this.rpc("sync")}syncSync(){throw f.With("ENOSYS",this.path,"PortFile.sync")}},vn=class extends Dr(se){constructor(i){super();this.options=i;this._sync=Bi.create({name:"port-tmpfs"});this.port=i.port,$r(this.port,Js)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return jr({scope:"fs",method:i,args:n},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,n,r){return this.rpc("rename",i,n,r)}async stat(i,n){return new R(await this.rpc("stat",i,n))}sync(i,n,r){return this.rpc("sync",i,n,r)}openFile(i,n,r){return this.rpc("openFile",i,n,r)}createFile(i,n,r,o){return this.rpc("createFile",i,n,r,o)}unlink(i,n){return this.rpc("unlink",i,n)}rmdir(i,n){return this.rpc("rmdir",i,n)}mkdir(i,n,r){return this.rpc("mkdir",i,n,r)}readdir(i,n){return this.rpc("readdir",i,n)}exists(i,n){return this.rpc("exists",i,n)}link(i,n,r){return this.rpc("link",i,n,r)}},Zs=0,In=new Map;async function ea(t,e,i){if(!qr(i))return;let{method:n,args:r,id:o,scope:a,stack:l}=i,c,u=!1;try{switch(a){case"fs":c=await e[n](...r),c instanceof It&&(In.set(++Zs,c),c={fd:Zs,path:c.path,position:c.position});break;case"file":let{fd:h}=i;if(!In.has(h))throw new f(9);c=await In.get(h)[n](...r),n=="close"&&In.delete(h);break;default:return}}catch(h){c=h,u=!0}t.postMessage({_zenfs:!0,scope:a,id:o,error:u,method:n,stack:l,value:c instanceof f?c.toJSON():c})}s(ea,"handleRequest");function Nd(t,e){$r(t,i=>ea(t,e,i))}s(Nd,"attachFS");function Dd(t,e){Qs(t,i=>ea(t,e,i))}s(Dd,"detachFS");var Bd={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(t){if(typeof t?.postMessage!="function")throw new f(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(async function(){return!0},"isAvailable"),create:s(function(t){return new vn(t)},"create")};var Tt=class t{constructor(){this._index=new Map;this.add("/",new ct)}static{s(this,"FileIndex")}static FromListing(e){let i=new t,n=new ct;i._index.set("/",n);let r=[{pwd:"",tree:e,parent:n}];for(;r.length>0;){let o,{tree:a,pwd:l,parent:c}=r.pop();for(let u in a){if(!Object.hasOwn(a,u))continue;let h=a[u];if(h){let d=l+"/"+u;o=new ct,i._index.set(d,o),r.push({pwd:d,tree:h,parent:o})}else o=new Pn(new R({mode:z.FILE|365}));c&&c._listing.set(u,o)}}return i}files(){let e=[];for(let i of this._index.values())for(let n of i.listing){let r=i.get(n);r&&r.isFile()&&e.push(r)}return e}add(e,i){if(!i)throw new f(22,"Inode must be specified",e,"FileIndex.add");if(!e.startsWith("/"))throw new f(22,"Path not absolute",e,"FileIndex.add");if(this._index.has(e))return this._index.get(e)===i;let n=I(e),r=this._index.has(n),o=r?this._index.get(n):new ct;return!r&&e!="/"&&!this.add(n,o)||e!="/"&&!o.add(N(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let n=I(e),r=N(e),o=this._index.get(n);return o||(o=new ct,this.addFast(n,o)),o.add(r,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=I(e),n=this._index.get(i);if(!n)return;let r=n.remove(N(e));if(!r)return;if(!r.isDirectory())return r;let o=r.listing;for(let a of o)this.remove(B(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=I(e),n=this._index.get(i);return i==e?n:n?.get(N(e))}},Wi=class{constructor(e){this.data=e}static{s(this,"IndexInode")}},Pn=class extends Wi{static{s(this,"IndexFileInode")}isFile(){return!0}isDirectory(){return!1}toStats(){return new R({mode:z.FILE|438,size:4096})}},ct=class extends Wi{constructor(){super(...arguments);this._listing=new Map}static{s(this,"IndexDirInode")}isFile(){return!1}isDirectory(){return!0}get stats(){return new R({mode:z.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(i){return this._listing.get(i)}add(i,n){return this._listing.has(i)?!1:(this._listing.set(i,n),!0)}remove(i){let n=this._listing.get(i);if(n)return this._listing.delete(i),n}},Ui=class extends Br(se){static{s(this,"IndexFS")}constructor(e){super(),this._index=Tt.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new f(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new f(22,"Invalid inode.")}async openFile(e,i,n){if(pe(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(vt(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new Ke(this,e,i,o,o.fileData)}return this.openFileInode(r,e,i)}openFileSync(e,i,n){if(pe(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(vt(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new Ke(this,e,i,o,o.fileData)}return this.openFileInodeSync(r,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}},Vr=class extends Ui{static{s(this,"SyncIndexFS")}async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,n){return this.openFileInodeSync(e,i,n)}},qi=class extends Ui{static{s(this,"AsyncIndexFS")}statFileInodeSync(e,i){throw f.With("ENOSYS",i,"AsyncIndexFS.statFileInodeSync")}openFileInodeSync(e,i,n){throw f.With("ENOSYS",i,"AsyncIndexFS.openFileInodeSync")}};async function Md(t,e){let i=await fetch(t).catch(n=>{throw new f(5,n.message)});if(!i.ok)throw new f(5,"fetch failed: response returned code "+i.status);switch(e){case"buffer":let n=await i.arrayBuffer().catch(r=>{throw new f(5,r.message)});return new Uint8Array(n);case"json":return i.json().catch(r=>{throw new f(5,r.message)});default:throw new f(22,"Invalid download type: "+e)}}s(Md,"fetchFile");async function Wd(t){let e=await fetch(t,{method:"HEAD"}).catch(i=>{throw new f(5,i.message)});if(!e.ok)throw new f(5,"fetch failed: HEAD response returned code "+e.status);return parseInt(e.headers.get("Content-Length")||"-1",10)}s(Wd,"fetchSize");var Tn=class t extends qi{static{s(this,"FetchFS")}async _initialize(e){if(typeof e!="string"){this._index=Tt.FromListing(e);return}try{let i=await fetch(e);this._index=Tt.FromListing(await i.json())}catch{throw new f(22,"Invalid or unavailable file listing tree")}}async ready(){await this._init}constructor({index:e="index.json",baseUrl:i=""}){super({}),i.at(-1)!="/"&&(i+="/"),this.prefixUrl=i,this._init=this._initialize(e)}metadata(){return{...super.metadata(),name:t.name,readonly:!0}}empty(){for(let e of this._index.files())delete e.data.fileData}preloadFile(e,i){let n=this._index.get(e);if(!n)throw f.With("ENOENT",e,"preloadFile");if(!n.isFile())throw f.With("EISDIR",e,"preloadFile");let r=n.data;r.size=i.length,r.fileData=i}async statFileInode(e,i){let n=e.data;return n.size<0&&(n.size=await this._fetchSize(i)),n}async openFileInode(e,i,n){let r=e.data;if(r.fileData)return new Ke(this,i,n,new R(r),r.fileData);let o=await this._fetchFile(i,"buffer");return r.size=o.length,r.fileData=o,new Ke(this,i,n,new R(r),o)}_getRemotePath(e){return e.charAt(0)==="/"&&(e=e.slice(1)),this.prefixUrl+e}_fetchFile(e,i){return Md(this._getRemotePath(e),i)}_fetchSize(e){return Wd(this._getRemotePath(e))}},Ud={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(t){return new Tn(t)},"create")};var ji=class{constructor(){this.locks=new Map}static{s(this,"Mutex")}lock(e){return new Promise(i=>{this.locks.has(e)?this.locks.get(e).push(i):this.locks.set(e,[i])})}unlock(e){if(!this.locks.has(e))throw new f(1,"Can not unlock an already unlocked path",e);let i=this.locks.get(e)?.shift();if(i){setTimeout(i);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)}};var $i=class{constructor(e){this.fs=e;this.mutex=new ji}static{s(this,"LockedFS")}async ready(){await this.fs.ready()}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,n){await this.mutex.lock(e),await this.fs.rename(e,i,n),this.mutex.unlock(e)}renameSync(e,i,n){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"rename");return this.fs.renameSync(e,i,n)}async stat(e,i){await this.mutex.lock(e);let n=await this.fs.stat(e,i);return this.mutex.unlock(e),n}statSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"stat");return this.fs.statSync(e,i)}async openFile(e,i,n){await this.mutex.lock(e);let r=await this.fs.openFile(e,i,n);return this.mutex.unlock(e),r}openFileSync(e,i,n){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"openFile");return this.fs.openFileSync(e,i,n)}async createFile(e,i,n,r){await this.mutex.lock(e);let o=await this.fs.createFile(e,i,n,r);return this.mutex.unlock(e),o}createFileSync(e,i,n,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"createFile");return this.fs.createFileSync(e,i,n,r)}async unlink(e,i){await this.mutex.lock(e),await this.fs.unlink(e,i),this.mutex.unlock(e)}unlinkSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"unlink");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this.mutex.lock(e),await this.fs.rmdir(e,i),this.mutex.unlock(e)}rmdirSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"rmdir");return this.fs.rmdirSync(e,i)}async mkdir(e,i,n){await this.mutex.lock(e),await this.fs.mkdir(e,i,n),this.mutex.unlock(e)}mkdirSync(e,i,n){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"mkdir");return this.fs.mkdirSync(e,i,n)}async readdir(e,i){await this.mutex.lock(e);let n=await this.fs.readdir(e,i);return this.mutex.unlock(e),n}readdirSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"readdir");return this.fs.readdirSync(e,i)}async exists(e,i){await this.mutex.lock(e);let n=await this.fs.exists(e,i);return this.mutex.unlock(e),n}existsSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"exists");return this.fs.existsSync(e,i)}async link(e,i,n){await this.mutex.lock(e),await this.fs.link(e,i,n),this.mutex.unlock(e)}linkSync(e,i,n){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"link");return this.fs.linkSync(e,i,n)}async sync(e,i,n){await this.mutex.lock(e),await this.fs.sync(e,i,n),this.mutex.unlock(e)}syncSync(e,i,n){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"sync");return this.fs.syncSync(e,i,n)}};var zr="/.deleted",An=class extends se{constructor({writable:i,readable:n}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this._writable=i,this._readable=n,this._writable.metadata().readonly)throw new f(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnlockedOverlayFS")}async ready(){await this._readable.ready(),await this._writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:Vi.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(i,n,r){let o=r.cred(0,0);await this.createParentDirectories(i,o),await this._writable.sync(i,n,r)}syncSync(i,n,r){let o=r.cred(0,0);this.createParentDirectoriesSync(i,o),this._writable.syncSync(i,n,r)}async _initialize(){if(!this._isInitialized){try{let i=await this._writable.openFile(zr,L("r"),Be),{size:n}=await i.stat(),{buffer:r}=await i.read(new Uint8Array(n));this._deleteLog=xn(r)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(i,n){this._deleteLog=i,this._reparseDeletionLog(),this.updateLog("",n)}async rename(i,n,r){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{await this._writable.rename(i,n,r)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"rename")}}renameSync(i,n,r){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{this._writable.renameSync(i,n,r)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"rename")}}async stat(i,n){this.checkInitialized();try{return this._writable.stat(i,n)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"stat");let o=new R(await this._readable.stat(i,n));return o.mode|=146,o}}statSync(i,n){this.checkInitialized();try{return this._writable.statSync(i,n)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"stat");let o=new R(this._readable.statSync(i,n));return o.mode|=146,o}}async openFile(i,n,r){if(await this._writable.exists(i,r))return this._writable.openFile(i,n,r);let o=await this._readable.openFile(i,L("r"),r),a=new R(await o.stat()),{buffer:l}=await o.read(new Uint8Array(a.size));return new ce(this,i,n,a,l)}openFileSync(i,n,r){if(this._writable.existsSync(i,r))return this._writable.openFileSync(i,n,r);let o=this._readable.openFileSync(i,L("r"),r),a=R.clone(o.statSync()),l=new Uint8Array(a.size);return o.readSync(l),new ce(this,i,n,a,l)}async createFile(i,n,r,o){return this.checkInitialized(),await this._writable.createFile(i,n,r,o),this.openFile(i,n,o)}createFileSync(i,n,r,o){return this.checkInitialized(),this._writable.createFileSync(i,n,r,o),this.openFileSync(i,n,o)}async link(i,n,r){this.checkInitialized(),await this._writable.link(i,n,r)}linkSync(i,n,r){this.checkInitialized(),this._writable.linkSync(i,n,r)}async unlink(i,n){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i,n))throw f.With("ENOENT",i,"unlink");await this._writable.exists(i,n)&&await this._writable.unlink(i,n),await this.exists(i,n)&&this.deletePath(i,n)}unlinkSync(i,n){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i,n))throw f.With("ENOENT",i,"unlink");this._writable.existsSync(i,n)&&this._writable.unlinkSync(i,n),this.existsSync(i,n)&&this.deletePath(i,n)}async rmdir(i,n){if(this.checkInitialized(),!await this.exists(i,n))throw f.With("ENOENT",i,"rmdir");if(await this._writable.exists(i,n)&&await this._writable.rmdir(i,n),await this.exists(i,n)){if((await this.readdir(i,n)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,n)}}rmdirSync(i,n){if(this.checkInitialized(),!this.existsSync(i,n))throw f.With("ENOENT",i,"rmdir");if(this._writable.existsSync(i,n)&&this._writable.rmdirSync(i,n),this.existsSync(i,n)){if(this.readdirSync(i,n).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,n)}}async mkdir(i,n,r){if(this.checkInitialized(),await this.exists(i,r))throw f.With("EEXIST",i,"mkdir");await this.createParentDirectories(i,r),await this._writable.mkdir(i,n,r)}mkdirSync(i,n,r){if(this.checkInitialized(),this.existsSync(i,r))throw f.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i,r),this._writable.mkdirSync(i,n,r)}async readdir(i,n){if(this.checkInitialized(),!(await this.stat(i,n)).isDirectory())throw f.With("ENOTDIR",i,"readdir");let o=[];try{o.push(...await this._writable.readdir(i,n))}catch{}try{o.push(...(await this._readable.readdir(i,n)).filter(l=>!this._deletedFiles.has(`${i}/${l}`)))}catch{}let a={};return o.filter(l=>{let c=!a[l];return a[l]=!0,c})}readdirSync(i,n){if(this.checkInitialized(),!this.statSync(i,n).isDirectory())throw f.With("ENOTDIR",i,"readdir");let o=[];try{o=o.concat(this._writable.readdirSync(i,n))}catch{}try{o=o.concat(this._readable.readdirSync(i,n).filter(l=>!this._deletedFiles.has(`${i}/${l}`)))}catch{}let a={};return o.filter(l=>{let c=!a[l];return a[l]=!0,c})}deletePath(i,n){this._deletedFiles.add(i),this.updateLog(`d${i}
|
|
3
3
|
`,n)}async updateLog(i,n){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let r=await this._writable.openFile(zr,L("w"),n);try{await r.write(Xe(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",n))}catch(o){this._deleteLogError=o}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let i of this._deleteLog.split(`
|
|
4
|
-
`))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new f(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==zr)throw f.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i,n){let r=v(i),o=[];for(;!this._writable.existsSync(r,n);)o.push(r),r=v(r);o=o.reverse();for(let a of o)this._writable.mkdirSync(a,this.statSync(a,n).mode,n)}async createParentDirectories(i,n){let r=v(i),o=[];for(;!await this._writable.exists(r,n);)o.push(r),r=v(r);o=o.reverse();for(let a of o){let l=await this.stat(a,n);await this._writable.mkdir(a,l.mode,n)}}operateOnWritable(i,n){if(!this.existsSync(i,n))throw f.With("ENOENT",i,"operateOnWriteable");this._writable.existsSync(i,n)||this.copyToWritableSync(i,n)}async operateOnWritableAsync(i,n){if(!await this.exists(i,n))throw f.With("ENOENT",i,"operateOnWritable");if(!await this._writable.exists(i,n))return this.copyToWritable(i,n)}copyToWritableSync(i,n){let r=this.statSync(i,n);if(r.isDirectory()){this._writable.mkdirSync(i,r.mode,n);return}let o=new Uint8Array(r.size),a=this._readable.openFileSync(i,L("r"),n);a.readSync(o),a.closeSync();let l=this._writable.openFileSync(i,L("w"),n);l.writeSync(o),l.closeSync()}async copyToWritable(i,n){let r=await this.stat(i,n);if(r.isDirectory()){await this._writable.mkdir(i,r.mode,n);return}let o=new Uint8Array(r.size),a=await this._readable.openFile(i,L("r"),n);await a.read(o),await a.close();let l=await this._writable.openFile(i,L("w"),n);await l.write(o),await l.close()}},qi=class extends Ui{static{s(this,"OverlayFS")}constructor(e){super(new Tn(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}},Ud={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function(t){return new qi(t)},"create")};function ji(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(ji,"isBackend");async function On(t,e){if(typeof e!="object"||e===null)throw new f(22,"Invalid options");for(let[i,n]of Object.entries(t.options)){let r=e?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:Wr(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new f(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new f(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(On,"checkOptions");async function qd(t,e={}){await On(t,e);let i=t.create(e);return await i.ready(),i}s(qd,"createBackend");function Hr(t){return t!=null&&typeof t=="object"&&"backend"in t&&ji(t.backend)}s(Hr,"isBackendConfig");var pn={};yn(pn,{BigIntStats:()=>ie,Dir:()=>ht,Dirent:()=>dt,ReadStream:()=>gt,Stats:()=>R,StatsFs:()=>Pi,WriteStream:()=>wt,access:()=>Ru,accessSync:()=>Ma,appendFile:()=>cu,appendFileSync:()=>Fa,chmod:()=>Pu,chmodSync:()=>Na,chown:()=>vu,chownSync:()=>Ra,close:()=>uu,closeSync:()=>Qe,constants:()=>Ft,copyFile:()=>qu,copyFileSync:()=>co,cp:()=>zu,cpSync:()=>fo,createReadStream:()=>Bu,createWriteStream:()=>Mu,exists:()=>tu,existsSync:()=>ii,fchmod:()=>gu,fchmodSync:()=>Wn,fchown:()=>bu,fchownSync:()=>Mn,fdatasync:()=>pu,fdatasyncSync:()=>Pa,fstat:()=>fu,fstatSync:()=>va,fsync:()=>hu,fsyncSync:()=>Ia,ftruncate:()=>du,ftruncateSync:()=>ro,futimes:()=>wu,futimesSync:()=>Un,lchmod:()=>Au,lchmodSync:()=>Da,lchown:()=>Iu,lchownSync:()=>La,link:()=>xu,linkSync:()=>Oa,lopenSync:()=>Gi,lstat:()=>nu,lstatSync:()=>no,lutimes:()=>Ou,lutimesSync:()=>Ba,mkdir:()=>_u,mkdirSync:()=>qn,mkdtemp:()=>Uu,mkdtempSync:()=>Wa,mount:()=>zi,mountObject:()=>Hi,mounts:()=>we,open:()=>su,openAsBlob:()=>Yu,openSync:()=>ri,opendir:()=>Vu,opendirSync:()=>ja,promises:()=>hn,read:()=>mu,readFile:()=>au,readFileSync:()=>Bn,readSync:()=>Ta,readdir:()=>Eu,readdirSync:()=>oi,readlink:()=>Fu,readlinkSync:()=>so,readv:()=>ju,readvSync:()=>Ua,realpath:()=>Cu,realpathSync:()=>ti,rename:()=>eu,renameSync:()=>Ea,rm:()=>Wu,rmSync:()=>lo,rmdir:()=>Su,rmdirSync:()=>oo,stat:()=>iu,statSync:()=>Yi,statfs:()=>Hu,statfsSync:()=>$a,symlink:()=>ku,symlinkSync:()=>Ca,truncate:()=>ru,truncateSync:()=>xa,umount:()=>Nn,unlink:()=>ou,unlinkSync:()=>Dn,unwatchFile:()=>Nu,utimes:()=>Tu,utimesSync:()=>ao,watch:()=>Du,watchFile:()=>Lu,write:()=>yu,writeFile:()=>lu,writeFileSync:()=>Ki,writeSync:()=>Aa,writev:()=>$u,writevSync:()=>qa});var hn={};yn(hn,{FileHandle:()=>te,access:()=>Ds,appendFile:()=>Ps,chmod:()=>Rs,chown:()=>Os,constants:()=>Ft,copyFile:()=>Pr,cp:()=>Ar,exists:()=>ve,lchmod:()=>Ls,lchown:()=>Cs,link:()=>As,lstat:()=>xr,lutimes:()=>Ns,mkdir:()=>dn,mkdtemp:()=>Bs,open:()=>ue,opendir:()=>Ms,readFile:()=>un,readdir:()=>Rt,readlink:()=>Fr,realpath:()=>Fe,rename:()=>vs,rm:()=>Ir,rmdir:()=>kr,stat:()=>_i,statfs:()=>Ws,symlink:()=>Ts,truncate:()=>Is,unlink:()=>fn,utimes:()=>vr,watch:()=>Yg,writeFile:()=>xi});var Ht=Or(Ee(),1);var ut=Or(Ee(),1);var k=Be;function _a(t){k=t}s(_a,"setCred");var Ct=new Map,Sh=100;function Vi(t){let e=Sh++;return Ct.set(e,t),e}s(Vi,"file2fd");function M(t){if(!Ct.has(t))throw new f(9);return Ct.get(t)}s(M,"fd2file");var we=new Map;zi("/",Li.create({name:"root"}));function zi(t,e){if(t[0]!=="/"&&(t="/"+t),t=lt(t),we.has(t))throw new f(22,"Mount point "+t+" is already in use.");we.set(t,e)}s(zi,"mount");function Nn(t){if(t[0]!=="/"&&(t=`/${t}`),t=lt(t),!we.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");we.delete(t)}s(Nn,"umount");function H(t){t=x(t);let e=[...we].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:n,path:t,mountPoint:i};throw new f(5,"ZenFS not initialized with a file system")}s(H,"resolveMount");function Sa(t,e){for(let[i,n]of Object.entries(e))t=t?.replaceAll(i,n);return t}s(Sa,"fixPaths");function le(t,e){return typeof t.stack=="string"&&(t.stack=Sa(t.stack,e)),t.message=Sa(t.message,e),t}s(le,"fixError");function Hi(t){"/"in t&&Nn("/");for(let[e,i]of Object.entries(t))zi(e,i)}s(Hi,"mountObject");function fe(...[t,e,i,...n]){i=x(i);let{fs:r,path:o}=H(e&&ii(i)?ti(i):i);try{return r[t](o,...n)}catch(a){throw le(a,{[o]:i})}}s(fe,"doOp");function Ea(t,e){t=x(t),e=x(e);let i=H(t),n=H(e),r={[i.path]:t,[n.path]:e};try{if(i===n)return i.fs.renameSync(i.path,n.path,k);Ki(e,Bn(t)),Dn(t)}catch(o){throw le(o,r)}}s(Ea,"renameSync");function ii(t){t=x(t);try{let{fs:e,path:i}=H(ti(t));return e.existsSync(i,k)}catch(e){if(e.errno==2)return!1;throw e}}s(ii,"existsSync");function Yi(t,e){let i=fe("statSync",!0,t.toString(),k);return e?.bigint?new ie(i):i}s(Yi,"statSync");function no(t,e){let i=fe("statSync",!1,t.toString(),k);return e?.bigint?new ie(i):i}s(no,"lstatSync");function xa(t,e=0){let i=ri(t,"r+");try{ro(i,e)}finally{Qe(i)}}s(xa,"truncateSync");function Dn(t){return fe("unlinkSync",!1,t.toString(),k)}s(Dn,"unlinkSync");function ni(t,e,i,n=!0){let r=x(t),o=me(i,420),a=L(e),l;try{l=fe("statSync",n,r,k)}catch{switch(Ci(a)){case 3:if(!fe("statSync",n,v(r),k).isDirectory())throw f.With("ENOTDIR",v(r),"_open");return fe("createFileSync",n,r,a,o,k);case 1:throw f.With("ENOENT",r,"_open");default:throw new f(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,k))throw f.With("EACCES",r,"_open");switch(Oi(a)){case 1:throw f.With("EEXIST",r,"_open");case 2:return fe("unlinkSync",n,r,k),fe("createFileSync",n,r,a,l.mode,k);case 0:return fe("openFileSync",n,r,a,k);default:throw new f(22,"Invalid FileFlag object.")}}s(ni,"_openSync");function ri(t,e,i=0){return Vi(ni(t,e,i,!0))}s(ri,"openSync");function Gi(t,e,i){return Vi(ni(t,e,i,!1))}s(Gi,"lopenSync");function ka(t,e,i){let n=ni(t,e,420,i);try{let r=n.statSync(),o=new Uint8Array(r.size);return n.readSync(o,0,r.size,0),n.closeSync(),o}finally{n.closeSync()}}s(ka,"_readFileSync");function Bn(t,e={}){let i=be(e,null,"r",420),n=L(i.flag);if(!st(n))throw new f(22,"Flag passed to readFile must allow for reading.");let r=ut.Buffer.from(ka(typeof t=="number"?M(t).path:t.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(Bn,"readFileSync");function _h(t,e,i,n,r){let o=ni(t,i,n,r);try{o.writeSync(e,0,e.byteLength,0)}finally{o.closeSync()}}s(_h,"_writeFileSync");function Ki(t,e,i={}){let n=be(i,"utf8","w+",420),r=L(n.flag);if(!pe(r))throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ut.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!o)throw new f(22,"Data not specified");_h(typeof t=="number"?M(t).path:t.toString(),o,n.flag,n.mode,!0)}s(Ki,"writeFileSync");function Eh(t,e,i,n,r){let o=ni(t,i,n,r);try{o.writeSync(e,0,e.byteLength,null)}finally{o.closeSync()}}s(Eh,"_appendFileSync");function Fa(t,e,i={}){let n=be(i,"utf8","a",420),r=L(n.flag);if(!at(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ut.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);Eh(typeof t=="number"?M(t).path:t.toString(),o,n.flag,n.mode,!0)}s(Fa,"appendFileSync");function va(t,e){let i=M(t).statSync();return e?.bigint?new ie(i):i}s(va,"fstatSync");function Qe(t){M(t).closeSync(),Ct.delete(t)}s(Qe,"closeSync");function ro(t,e=0){if(e||=0,e<0)throw new f(22);M(t).truncateSync(e)}s(ro,"ftruncateSync");function Ia(t){M(t).syncSync()}s(Ia,"fsyncSync");function Pa(t){M(t).datasyncSync()}s(Pa,"fdatasyncSync");function Aa(t,e,i,n,r){let o,a,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let h=typeof n=="string"?n:"utf8";a=0,o=ut.Buffer.from(e,h),l=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,l=n,c=typeof r=="number"?r:null;let u=M(t);return c??=u.position,u.writeSync(o,a,l,c)}s(Aa,"writeSync");function Ta(t,e,i,n,r){let o=M(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=o.position),o.readSync(e,a,n,r)}s(Ta,"readSync");function Mn(t,e,i){M(t).chownSync(e,i)}s(Mn,"fchownSync");function Wn(t,e){let i=me(e,-1);if(i<0)throw new f(22,"Invalid mode.");M(t).chmodSync(i)}s(Wn,"fchmodSync");function Un(t,e,i){M(t).utimesSync(Pt(e),Pt(i))}s(Un,"futimesSync");function oo(t){return fe("rmdirSync",!0,t.toString(),k)}s(oo,"rmdirSync");function qn(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,n=typeof e=="object"&&e?.recursive;fe("mkdirSync",!0,t.toString(),me(i,511),k)}s(qn,"mkdirSync");function oi(t,e){t=x(t);let i=fe("readdirSync",!0,t,k);for(let n of we.keys()){if(!n.startsWith(t))continue;let r=n.slice(t.length);r.includes("/")||r.length==0||i.push(r)}return i.map(n=>typeof e=="object"&&e?.withFileTypes?new dt(n,Yi(B(t.toString(),n))):e=="buffer"||typeof e=="object"&&e?.encoding=="buffer"?ut.Buffer.from(n):n)}s(oi,"readdirSync");function Oa(t,e){return e=x(e),fe("linkSync",!1,t.toString(),e.toString(),k)}s(Oa,"linkSync");function Ca(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(ii(e))throw f.With("EEXIST",e.toString(),"symlink");Ki(e,t.toString()),ni(e,"r+",420,!1)._setTypeSync(z.SYMLINK)}s(Ca,"symlinkSync");function so(t,e){let i=ut.Buffer.from(ka(t.toString(),"r",!1)),n=typeof e=="object"?e?.encoding:e;return n=="buffer"?i:i.toString(n)}s(so,"readlinkSync");function Ra(t,e,i){let n=ri(t,"r+");Mn(n,e,i),Qe(n)}s(Ra,"chownSync");function La(t,e,i){let n=Gi(t,"r+");Mn(n,e,i),Qe(n)}s(La,"lchownSync");function Na(t,e){let i=ri(t,"r+");Wn(i,e),Qe(i)}s(Na,"chmodSync");function Da(t,e){let i=Gi(t,"r+");Wn(i,e),Qe(i)}s(Da,"lchmodSync");function ao(t,e,i){let n=ri(t,"r+");Un(n,e,i),Qe(n)}s(ao,"utimesSync");function Ba(t,e,i){let n=Gi(t,"r+");Un(n,e,i),Qe(n)}s(Ba,"lutimesSync");function ti(t,e){t=x(t);let{base:i,dir:n}=gn(t),r=B(n=="/"?"/":ti(n),i),{fs:o,path:a,mountPoint:l}=H(r);try{return o.statSync(a,k).isSymbolicLink()?ti(l+so(r)):r}catch(c){throw le(c,{[a]:r})}}s(ti,"realpathSync");function Ma(t,e=384){if(!Yi(t).hasAccess(e,k))throw new f(13)}s(Ma,"accessSync");function lo(t,e){switch(t=x(t),Yi(t).mode&61440){case 16384:if(e?.recursive)for(let n of oi(t))lo(B(t,n));oo(t);return;case 32768:case 40960:Dn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(lo,"rmSync");function Wa(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return qn(r),i=="buffer"?ut.Buffer.from(r):r}s(Wa,"mkdtempSync");function co(t,e,i){if(t=x(t),e=x(e),i&&i&1&&ii(e))throw new f(17,"Destination file already exists.",e,"copyFile");Ki(e,Bn(t))}s(co,"copyFileSync");function Ua(t,e,i){let n=M(t),r=0;for(let o of e)r+=n.readSync(o,0,o.byteLength,i+r);return r}s(Ua,"readvSync");function qa(t,e,i){let n=M(t),r=0;for(let o of e)r+=n.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+r);return r}s(qa,"writevSync");function ja(t,e){return t=x(t),new ht(t)}s(ja,"opendirSync");function fo(t,e,i){t=x(t),e=x(e);let n=no(t);if(i?.errorOnExist&&ii(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");qn(e,{recursive:!0});for(let r of oi(t,{withFileTypes:!0}))i.filter&&!i.filter(B(t,r.name),B(e,r.name))||fo(B(t,r.name),B(e,r.name),i);break;case 32768:case 40960:co(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&ao(e,n.atime,n.mtime)}s(fo,"cpSync");function $a(t,e){throw f.With("ENOSYS",t.toString(),"statfs")}s($a,"statfsSync");var dt=class{constructor(e,i){this.path=e;this.stats=i}static{s(this,"Dirent")}get name(){return N(this.path)}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()}},ht=class{constructor(e){this.path=e;this.closed=!1;this._entries=[]}static{s(this,"Dir")}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 Rt(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}read(e){if(!e)return this._read();this._read().then(i=>e(void 0,i))}readSync(){return this._entries||(this._entries=oi(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],next:s(async function(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})},"next")}}};var Er=Or(Zf(),1);var gt=class extends Er.Readable{static{s(this,"ReadStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new f(5,i.toString()))}}},wt=class extends Er.Writable{static{s(this,"WriteStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new f(5,i.toString()))}}};var te=class{static{s(this,"FileHandle")}constructor(e){let i=typeof e!="number";this.fd=i?Vi(e):e,this.file=i?e:M(e)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=me(e,-1);if(i<0)throw new f(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e||=0,e<0)throw new f(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Pt(e),Pt(i))}async appendFile(e,i={}){let n=be(i,"utf8","a",420),r=L(n.flag);if(!at(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?Ht.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,null)}read(e,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(e,i,n,r)}async readFile(e){let i=be(e,null,"r",292),n=L(i.flag);if(!st(n))throw new f(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),o=new Uint8Array(r);await this.file.read(o,0,r,0);let a=Ht.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e={}){let i=s(async({close:n,enqueue:r,error:o})=>{try{let c=0,u=0,h=NaN;for(;h>0;){let d=await this.read(new Uint8Array(65536),0,65536,u);if(!d.bytesRead){n();return}if(r(d.buffer.slice(0,d.bytesRead)),u+=d.bytesRead,++c>=1e7)throw new f(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");h=d.bytesRead}}catch(a){o(a)}},"start");return new globalThis.ReadableStream({start:i,type:e.type})}readLines(e){throw f.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();return e?.bigint?new ie(i):i}async write(e,i,n,r){let o,a,l;if(typeof e=="string"){r=typeof i=="number"?i:null;let u=typeof n=="string"?n:"utf8";a=0,o=Ht.Buffer.from(e,u),l=o.length}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,l=n,r=typeof r=="number"?r:null;r??=this.file.position;let c=await this.file.write(o,a,l,r);return{buffer:o,bytesWritten:c}}async writeFile(e,i={}){let n=be(i,"utf8","w",420),r=L(n.flag);if(!pe(r))throw new f(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?Ht.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Ct.delete(this.fd)}async writev(e,i){let n=0;for(let r of e)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,i){let n=0;for(let r of e)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){let i=new gt({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:s(async n=>{try{let r=await this.read(new Uint8Array(n),0,n,this.file.position);i.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),this.file.position+=r.bytesRead}catch(r){i.destroy(r)}},"read")});return i.path=this.file.path,i}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:s(async(r,o,a)=>{try{let{bytesWritten:l}=await this.write(r,null,o);a(l==r.length?null:new Error("Failed to write full chunk"))}catch(l){a(l)}},"write")},n=new wt(i);return n.path=this.file.path,n}};async function vs(t,e){t=x(t),e=x(e);let i=H(t),n=H(e);try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path,k);return}await xi(e,await un(t)),await fn(t)}catch(r){throw le(r,{[i.path]:t,[n.path]:e})}}s(vs,"rename");async function ve(t){try{let{fs:e,path:i}=H(await Fe(t));return await e.exists(i,k)}catch(e){if(e instanceof f&&e.code=="ENOENT")return!1;throw e}}s(ve,"exists");async function _i(t,e){t=x(t);let{fs:i,path:n}=H(await ve(t)?await Fe(t):t);try{let r=await i.stat(n,k);return e?.bigint?new ie(r):r}catch(r){throw le(r,{[n]:t})}}s(_i,"stat");async function xr(t,e){t=x(t);let{fs:i,path:n}=H(t);try{let r=await i.stat(n,k);return e?.bigint?new ie(r):r}catch(r){throw le(r,{[n]:t})}}s(xr,"lstat");async function Is(t,e=0){let i=await ue(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(Is,"truncate");async function fn(t){t=x(t);let{fs:e,path:i}=H(t);try{await e.unlink(i,k)}catch(n){throw le(n,{[i]:t})}}s(fn,"unlink");async function Ei(t,e,i=420,n){t=x(t);let r=me(i,420),o=L(e);t=n&&await ve(t)?await Fe(t):t;let{fs:a,path:l}=H(t);try{switch(Oi(o)){case 1:throw f.With("EEXIST",t,"_open");case 2:let c=await a.openFile(l,o,k);return await c.truncate(0),await c.sync(),new te(c);case 0:return new te(await a.openFile(l,o,k));default:throw new f(22,"Invalid file flag")}}catch{switch(Ci(o)){case 3:let u=await a.stat(v(l),k);if(u&&!u.isDirectory())throw f.With("ENOTDIR",v(t),"_open");return new te(await a.createFile(l,o,r,k));case 1:throw f.With("ENOENT",t,"_open");default:throw new f(22,"Invalid file flag")}}}s(Ei,"_open");async function ue(t,e="r",i=420){return await Ei(t,e,i,!0)}s(ue,"open");async function un(t,e){let i=be(e,null,"r",420),n=typeof t=="object"&&"fd"in t?t:await ue(t,i.flag,i.mode);try{return await n.readFile(i)}finally{await n.close()}}s(un,"readFile");async function xi(t,e,i){let n=be(i,"utf8","w+",420),r=t instanceof te?t:await ue(t.toString(),n.flag,n.mode);try{let o=e;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new f(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,n)}finally{await r.close()}}s(xi,"writeFile");async function Ps(t,e,i){let n=be(i,"utf8","a",420),r=L(n.flag);if(!at(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?Ht.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=typeof t=="object"&&"fd"in t?t:await ue(t,n.flag,n.mode);try{await a.appendFile(o,n)}finally{await a.close()}}s(Ps,"appendFile");async function kr(t){t=x(t),t=await ve(t)?await Fe(t):t;let{fs:e,path:i}=H(t);try{await e.rmdir(i,k)}catch(n){throw le(n,{[i]:t})}}s(kr,"rmdir");async function dn(t,e){t=x(t),t=await ve(t)?await Fe(t):t;let{fs:i,path:n}=H(t);try{await i.mkdir(n,me(typeof e=="object"?e?.mode:e,511),k)}catch(r){throw le(r,{[n]:t})}}s(dn,"mkdir");async function Rt(t,e){t=x(t),t=await ve(t)?await Fe(t):t;let{fs:i,path:n}=H(t),r;try{r=await i.readdir(n,k)}catch(a){throw le(a,{[n]:t})}for(let a of we.keys())if(a.startsWith(t)){let l=a.slice(t.length);if(l.includes("/")||l.length==0)continue;r.push(l)}let o=[];for(let a of r)o.push(typeof e=="object"&&e?.withFileTypes?new dt(a,await _i(B(t,a))):a);return o}s(Rt,"readdir");async function As(t,e){t=x(t),e=x(e);let{fs:i,path:n}=H(e);try{return await i.link(t,e,k)}catch(r){throw le(r,{[n]:e})}}s(As,"link");async function Ts(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await ve(e))throw f.With("EEXIST",e.toString(),"symlink");await xi(e,t.toString()),await(await Ei(e,"r+",420,!1)).file._setType(z.SYMLINK)}s(Ts,"symlink");async function Fr(t,e){let i=await Ei(x(t),"r",420,!1);try{let n=await i.readFile(),r=typeof e=="object"?e?.encoding:e;return r=="buffer"?n:n.toString(r)}finally{await i.close()}}s(Fr,"readlink");async function Os(t,e,i){let n=await ue(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(Os,"chown");async function Cs(t,e,i){let n=await Ei(t,"r+",420,!1);try{await n.chown(e,i)}finally{await n.close()}}s(Cs,"lchown");async function Rs(t,e){let i=await ue(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(Rs,"chmod");async function Ls(t,e){let i=await Ei(t,"r+",420,!1);try{await i.chmod(e)}finally{await i.close()}}s(Ls,"lchmod");async function vr(t,e,i){let n=await ue(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(vr,"utimes");async function Ns(t,e,i){let n=await Ei(t,"r+",420,!1);try{await n.utimes(new Date(e),new Date(i))}finally{await n.close()}}s(Ns,"lutimes");async function Fe(t,e){t=x(t);let{base:i,dir:n}=gn(t),r=B(n=="/"?"/":await Fe(n),i),{fs:o,path:a,mountPoint:l}=H(r);try{return(await o.stat(a,k)).isSymbolicLink()?Fe(l+await Fr(r)):r}catch(c){throw le(c,{[a]:r})}}s(Fe,"realpath");function Yg(t,e={}){throw f.With("ENOSYS",t.toString(),"watch")}s(Yg,"watch");async function Ds(t,e=0){if(!(await _i(t)).hasAccess(e,k))throw new f(13)}s(Ds,"access");async function Ir(t,e){switch(t=x(t),(await _i(t)).mode&61440){case 16384:if(e?.recursive)for(let n of await Rt(t))await Ir(B(t,n));await kr(t);return;case 32768:case 40960:await fn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(Ir,"rm");async function Bs(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await dn(r),i=="buffer"?Ht.Buffer.from(r):r}s(Bs,"mkdtemp");async function Pr(t,e,i){if(t=x(t),e=x(e),i&&i&1&&await ve(e))throw new f(17,"Destination file already exists.",e,"copyFile");await xi(e,await un(t))}s(Pr,"copyFile");async function Ms(t,e){return t=x(t),new ht(t)}s(Ms,"opendir");async function Ar(t,e,i){t=x(t),e=x(e);let n=await xr(t);if(i?.errorOnExist&&await ve(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");await dn(e,{recursive:!0});for(let r of await Rt(t,{withFileTypes:!0}))i.filter&&!i.filter(B(t,r.name),B(e,r.name))||await Ar(B(t,r.name),B(e,r.name),i);break;case 32768:case 40960:await Pr(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await vr(e,n.atime,n.mtime)}s(Ar,"cp");async function Ws(t,e){throw f.With("ENOSYS",t.toString(),"statfs")}s(Ws,"statfs");function eu(t,e,i=S){vs(t,e).then(()=>i()).catch(i)}s(eu,"rename");function tu(t,e=S){ve(t).then(e).catch(()=>e(!1))}s(tu,"exists");function iu(t,e,i=S){i=typeof e=="function"?e:i,_i(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(iu,"stat");function nu(t,e,i=S){i=typeof e=="function"?e:i,xr(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(nu,"lstat");function ru(t,e=0,i=S){i=typeof e=="function"?e:i,Is(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(ru,"truncate");function ou(t,e=S){fn(t).then(()=>e()).catch(e)}s(ou,"unlink");function su(t,e,i,n=S){let r=me(i,420);n=typeof i=="function"?i:n,ue(t,e,r).then(o=>n(void 0,o.fd)).catch(n)}s(su,"open");function au(t,e,i=S){i=typeof e=="function"?e:i,un(t,typeof e=="function"?null:e).then(n=>i(void 0,n)).catch(i)}s(au,"readFile");function lu(t,e,i,n=S){n=typeof i=="function"?i:n,xi(t,e,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(lu,"writeFile");function cu(t,e,i,n=S){n=typeof i=="function"?i:n,Ps(t,e,typeof i=="function"?null:i).then(()=>n()).catch(n)}s(cu,"appendFile");function fu(t,e,i=S){i=typeof e=="function"?e:i,M(t).stat().then(n=>i(void 0,typeof e=="object"&&e?.bigint?new ie(n):n)).catch(i)}s(fu,"fstat");function uu(t,e=S){new te(t).close().then(()=>e()).catch(e)}s(uu,"close");function du(t,e,i=S){let n=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let r=M(t);if(n<0)throw new f(22);r.truncate(n).then(()=>i()).catch(i)}s(du,"ftruncate");function hu(t,e=S){M(t).sync().then(()=>e()).catch(e)}s(hu,"fsync");function pu(t,e=S){M(t).datasync().then(()=>e()).catch(e)}s(pu,"fdatasync");function yu(t,e,i,n,r,o=S){let a,l,c,u,h,d=new te(t);if(typeof e=="string"){switch(h="utf8",typeof i){case"function":o=i;break;case"number":u=i,h=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new f(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,c=a.length;let b=o;d.write(a,l,c,u).then(({bytesWritten:m})=>b(void 0,m,a.toString(h))).catch(b)}else{a=Buffer.from(e.buffer),l=i,c=n,u=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;d.write(a,l,c,u).then(({bytesWritten:m})=>b(void 0,m,a)).catch(b)}}s(yu,"write");function mu(t,e,i,n,r,o=S){new te(t).read(e,i,n,r).then(({bytesRead:a,buffer:l})=>o(void 0,a,l)).catch(o)}s(mu,"read");function bu(t,e,i,n=S){new te(t).chown(e,i).then(()=>n()).catch(n)}s(bu,"fchown");function gu(t,e,i){new te(t).chmod(e).then(()=>i()).catch(i)}s(gu,"fchmod");function wu(t,e,i,n=S){new te(t).utimes(e,i).then(()=>n()).catch(n)}s(wu,"futimes");function Su(t,e=S){kr(t).then(()=>e()).catch(e)}s(Su,"rmdir");function _u(t,e,i=S){dn(t,e).then(()=>i()).catch(i)}s(_u,"mkdir");function Eu(t,e,i=S){i=typeof e=="function"?e:i,Rt(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(Eu,"readdir");function xu(t,e,i=S){As(t,e).then(()=>i()).catch(i)}s(xu,"link");function ku(t,e,i,n=S){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,Ts(t,e,r).then(()=>n()).catch(n)}s(ku,"symlink");function Fu(t,e,i=S){i=typeof e=="function"?e:i,Fr(t).then(n=>i(void 0,n)).catch(i)}s(Fu,"readlink");function vu(t,e,i,n=S){Os(t,e,i).then(()=>n()).catch(n)}s(vu,"chown");function Iu(t,e,i,n=S){Cs(t,e,i).then(()=>n()).catch(n)}s(Iu,"lchown");function Pu(t,e,i=S){Rs(t,e).then(()=>i()).catch(i)}s(Pu,"chmod");function Au(t,e,i=S){Ls(t,e).then(()=>i()).catch(i)}s(Au,"lchmod");function Tu(t,e,i,n=S){vr(t,e,i).then(()=>n()).catch(n)}s(Tu,"utimes");function Ou(t,e,i,n=S){Ns(t,e,i).then(()=>n()).catch(n)}s(Ou,"lutimes");function Cu(t,e,i=S){i=typeof e=="function"?e:i,Fe(t,typeof e=="function"?null:e).then(n=>i(void 0,n)).catch(i)}s(Cu,"realpath");function Ru(t,e,i=S){let n=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Ds(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(Ru,"access");function Lu(t,e,i=S){throw f.With("ENOSYS",t.toString(),"watchFile")}s(Lu,"watchFile");function Nu(t,e=S){throw f.With("ENOSYS",t.toString(),"unwatchFile")}s(Nu,"unwatchFile");function Du(t,e,i=S){throw f.With("ENOSYS",t.toString(),"watch")}s(Du,"watch");function Bu(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new gt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{n||=await ue(t,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},"read"),destroy:s(function(o,a){n?.close().then(()=>a(o)).catch(a)},"destroy")});return r.path=t.toString(),r}s(Bu,"createReadStream");function Mu(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new wt({highWaterMark:i?.highWaterMark,write:s(async function(o,a,l){try{n||=await ue(t,"w",i?.mode||438),await n.write(o,0,a),l(void 0)}catch(c){await n?.close(),l(c)}},"write"),destroy:s(function(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){n?.close().then(()=>o()).catch(o)},"final")});return r.path=t.toString(),r}s(Mu,"createWriteStream");function Wu(t,e,i=S){i=typeof e=="function"?e:i,Ir(t,typeof e=="function"?void 0:e).then(()=>i(void 0)).catch(i)}s(Wu,"rm");function Uu(t,e,i=S){i=typeof e=="function"?e:i,Bs(t,typeof e!="function"?e:null).then(n=>i(void 0,n)).catch(i)}s(Uu,"mkdtemp");function qu(t,e,i,n=S){n=typeof i=="function"?i:n,Pr(t,e,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(qu,"copyFile");function ju(t,e,i,n=S){n=typeof i=="function"?i:n,new te(t).readv(e,typeof i=="function"?void 0:i).then(({buffers:r,bytesRead:o})=>n(void 0,o,r)).catch(n)}s(ju,"readv");function $u(t,e,i,n=S){n=typeof i=="function"?i:n,new te(t).writev(e,typeof i=="function"?void 0:i).then(({buffers:r,bytesWritten:o})=>n(void 0,o,r)).catch(n)}s($u,"writev");function Vu(t,e,i=S){i=typeof e=="function"?e:i,Ms(t,typeof e=="function"?void 0:e).then(n=>i(void 0,n)).catch(i)}s(Vu,"opendir");function zu(t,e,i,n=S){n=typeof i=="function"?i:n,Ar(t,e,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(zu,"cp");function Hu(t,e,i=S){i=typeof e=="function"?e:i,Ws(t,typeof e=="function"?void 0:e).then(n=>i(void 0,n)).catch(i)}s(Hu,"statfs");async function Yu(t,e){let i=await ue(t.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],e)}s(Yu,"openAsBlob");function Us(t){return Hr(t)||ji(t)||t instanceof se}s(Us,"isMountConfig");async function qs(t,e=0){if(typeof t!="object"||t==null)throw new f(22,"Invalid options on mount configuration");if(!Us(t))throw new f(22,"Invalid mount configuration");if(t instanceof se)return t;ji(t)&&(t={backend:t});for(let[r,o]of Object.entries(t))if(r!="backend"&&Us(o)){if(e>10)throw new f(22,"Invalid configuration, too deep and possibly infinite");t[r]=await qs(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new f(1,"Backend not available: "+i);On(i,t);let n=i.create(t);return await n.ready(),n}s(qs,"resolveMountConfig");async function Gg(t){let e="uid"in t&&t.uid||0,i="gid"in t&&t.gid||0;Us(t)&&(t={mounts:{"/":t}});for(let[n,r]of Object.entries(t.mounts)){if(!n.startsWith("/"))throw new f(22,"Mount points must have absolute paths");t.mounts[n]=await qs(r)}Hi(t.mounts),_a({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i})}s(Gg,"configure");var Kg=pn;return ed(Xg);})();
|
|
4
|
+
`))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new f(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==zr)throw f.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i,n){let r=I(i),o=[];for(;!this._writable.existsSync(r,n);)o.push(r),r=I(r);o=o.reverse();for(let a of o)this._writable.mkdirSync(a,this.statSync(a,n).mode,n)}async createParentDirectories(i,n){let r=I(i),o=[];for(;!await this._writable.exists(r,n);)o.push(r),r=I(r);o=o.reverse();for(let a of o){let l=await this.stat(a,n);await this._writable.mkdir(a,l.mode,n)}}operateOnWritable(i,n){if(!this.existsSync(i,n))throw f.With("ENOENT",i,"operateOnWriteable");this._writable.existsSync(i,n)||this.copyToWritableSync(i,n)}async operateOnWritableAsync(i,n){if(!await this.exists(i,n))throw f.With("ENOENT",i,"operateOnWritable");if(!await this._writable.exists(i,n))return this.copyToWritable(i,n)}copyToWritableSync(i,n){let r=this.statSync(i,n);if(r.isDirectory()){this._writable.mkdirSync(i,r.mode,n);return}let o=new Uint8Array(r.size),a=this._readable.openFileSync(i,L("r"),n);a.readSync(o),a.closeSync();let l=this._writable.openFileSync(i,L("w"),n);l.writeSync(o),l.closeSync()}async copyToWritable(i,n){let r=await this.stat(i,n);if(r.isDirectory()){await this._writable.mkdir(i,r.mode,n);return}let o=new Uint8Array(r.size),a=await this._readable.openFile(i,L("r"),n);await a.read(o),await a.close();let l=await this._writable.openFile(i,L("w"),n);await l.write(o),await l.close()}},Vi=class extends $i{static{s(this,"OverlayFS")}constructor(e){super(new An(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}},qd={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function(t){return new Vi(t)},"create")};function zi(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(zi,"isBackend");async function Hr(t,e){if(typeof e!="object"||e===null)throw new f(22,"Invalid options");for(let[i,n]of Object.entries(t.options)){let r=e?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:Mr(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new f(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new f(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(Hr,"checkOptions");function Yr(t){return t!=null&&typeof t=="object"&&"backend"in t&&zi(t.backend)}s(Yr,"isBackendConfig");var bn={};gn(bn,{BigIntStats:()=>ie,Dir:()=>ht,Dirent:()=>dt,ReadStream:()=>gt,Stats:()=>R,StatsFs:()=>Ti,WriteStream:()=>wt,access:()=>Lu,accessSync:()=>Wa,appendFile:()=>fu,appendFileSync:()=>Ia,chmod:()=>Tu,chmodSync:()=>Da,chown:()=>vu,chownSync:()=>La,close:()=>du,closeSync:()=>Qe,constants:()=>Ft,copyFile:()=>ju,copyFileSync:()=>fo,cp:()=>Hu,cpSync:()=>uo,createReadStream:()=>Mu,createWriteStream:()=>Wu,exists:()=>iu,existsSync:()=>ni,fchmod:()=>wu,fchmodSync:()=>Mn,fchown:()=>gu,fchownSync:()=>Bn,fdatasync:()=>yu,fdatasyncSync:()=>Ta,fstat:()=>uu,fstatSync:()=>va,fsync:()=>pu,fsyncSync:()=>Pa,ftruncate:()=>hu,ftruncateSync:()=>oo,futimes:()=>Su,futimesSync:()=>Wn,lchmod:()=>Au,lchmodSync:()=>Ba,lchown:()=>Pu,lchownSync:()=>Na,link:()=>ku,linkSync:()=>Ca,lopenSync:()=>Ji,lstat:()=>ru,lstatSync:()=>ro,lutimes:()=>Cu,lutimesSync:()=>Ma,mkdir:()=>_u,mkdirSync:()=>Un,mkdtemp:()=>qu,mkdtempSync:()=>Ua,mount:()=>Gi,mountObject:()=>Ki,mounts:()=>we,open:()=>au,openAsBlob:()=>Gu,openSync:()=>oi,opendir:()=>zu,opendirSync:()=>$a,promises:()=>mn,read:()=>bu,readFile:()=>lu,readFileSync:()=>Dn,readSync:()=>Oa,readdir:()=>xu,readdirSync:()=>si,readlink:()=>Iu,readlinkSync:()=>ao,readv:()=>$u,readvSync:()=>qa,realpath:()=>Ru,realpathSync:()=>ii,rename:()=>tu,renameSync:()=>xa,rm:()=>Uu,rmSync:()=>co,rmdir:()=>Eu,rmdirSync:()=>so,stat:()=>nu,statSync:()=>Xi,statfs:()=>Yu,statfsSync:()=>Va,symlink:()=>Fu,symlinkSync:()=>Ra,truncate:()=>ou,truncateSync:()=>ka,umount:()=>Ln,unlink:()=>su,unlinkSync:()=>Nn,unwatchFile:()=>Du,utimes:()=>Ou,utimesSync:()=>lo,watch:()=>Bu,watchFile:()=>Nu,write:()=>mu,writeFile:()=>cu,writeFileSync:()=>Qi,writeSync:()=>Aa,writev:()=>Vu,writevSync:()=>ja});var mn={};gn(mn,{FileHandle:()=>te,access:()=>Bs,appendFile:()=>Ts,chmod:()=>Ls,chown:()=>Cs,constants:()=>Ft,copyFile:()=>vr,cp:()=>Pr,exists:()=>Ie,lchmod:()=>Ns,lchown:()=>Rs,link:()=>As,lstat:()=>_r,lutimes:()=>Ds,mkdir:()=>yn,mkdtemp:()=>Ms,open:()=>ue,opendir:()=>Ws,readFile:()=>pn,readdir:()=>Rt,readlink:()=>kr,realpath:()=>Fe,rename:()=>vs,rm:()=>Ir,rmdir:()=>xr,stat:()=>_i,statfs:()=>Us,symlink:()=>Os,truncate:()=>Ps,unlink:()=>hn,utimes:()=>Fr,watch:()=>zg,writeFile:()=>ki});var Ht=Ar(_e(),1);var ut=Ar(_e(),1);var k=Be;function _a(t){k=t}s(_a,"setCred");var Ct=new Map,Sh=100;function Yi(t){let e=Sh++;return Ct.set(e,t),e}s(Yi,"file2fd");function M(t){if(!Ct.has(t))throw new f(9);return Ct.get(t)}s(M,"fd2file");var we=new Map;Gi("/",Bi.create({name:"root"}));function Gi(t,e){if(t[0]!=="/"&&(t="/"+t),t=lt(t),we.has(t))throw new f(22,"Mount point "+t+" is already in use.");we.set(t,e)}s(Gi,"mount");function Ln(t){if(t[0]!=="/"&&(t=`/${t}`),t=lt(t),!we.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");we.delete(t)}s(Ln,"umount");function H(t){t=x(t);let e=[...we].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:n,path:t,mountPoint:i};throw new f(5,"ZenFS not initialized with a file system")}s(H,"resolveMount");function Ea(t,e){for(let[i,n]of Object.entries(e))t=t?.replaceAll(i,n);return t}s(Ea,"fixPaths");function le(t,e){return typeof t.stack=="string"&&(t.stack=Ea(t.stack,e)),t.message=Ea(t.message,e),t}s(le,"fixError");function Ki(t){"/"in t&&Ln("/");for(let[e,i]of Object.entries(t))Gi(e,i)}s(Ki,"mountObject");function fe(...[t,e,i,...n]){i=x(i);let{fs:r,path:o}=H(e&&ni(i)?ii(i):i);try{return r[t](o,...n)}catch(a){throw le(a,{[o]:i})}}s(fe,"wrap");function xa(t,e){t=x(t),e=x(e);let i=H(t),n=H(e),r={[i.path]:t,[n.path]:e};try{if(i===n)return i.fs.renameSync(i.path,n.path,k);Qi(e,Dn(t)),Nn(t)}catch(o){throw le(o,r)}}s(xa,"renameSync");function ni(t){t=x(t);try{let{fs:e,path:i}=H(ii(t));return e.existsSync(i,k)}catch(e){if(e.errno==2)return!1;throw e}}s(ni,"existsSync");function Xi(t,e){let i=fe("statSync",!0,t.toString(),k);return e?.bigint?new ie(i):i}s(Xi,"statSync");function ro(t,e){let i=fe("statSync",!1,t.toString(),k);return e?.bigint?new ie(i):i}s(ro,"lstatSync");function ka(t,e=0){let i=oi(t,"r+");try{oo(i,e)}finally{Qe(i)}}s(ka,"truncateSync");function Nn(t){return fe("unlinkSync",!1,t.toString(),k)}s(Nn,"unlinkSync");function ri(t,e,i,n=!0){let r=x(t),o=me(i,420),a=L(e),l;try{l=fe("statSync",n,r,k)}catch{switch(Ri(a)){case 3:if(!fe("statSync",n,I(r),k).isDirectory())throw f.With("ENOTDIR",I(r),"_open");return fe("createFileSync",n,r,a,o,k);case 1:throw f.With("ENOENT",r,"_open");default:throw new f(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,k))throw f.With("EACCES",r,"_open");switch(Ci(a)){case 1:throw f.With("EEXIST",r,"_open");case 2:return fe("unlinkSync",n,r,k),fe("createFileSync",n,r,a,l.mode,k);case 0:return fe("openFileSync",n,r,a,k);default:throw new f(22,"Invalid FileFlag object.")}}s(ri,"_openSync");function oi(t,e,i=0){return Yi(ri(t,e,i,!0))}s(oi,"openSync");function Ji(t,e,i){return Yi(ri(t,e,i,!1))}s(Ji,"lopenSync");function Fa(t,e,i){let n=ri(t,e,420,i);try{let r=n.statSync(),o=new Uint8Array(r.size);return n.readSync(o,0,r.size,0),n.closeSync(),o}finally{n.closeSync()}}s(Fa,"_readFileSync");function Dn(t,e={}){let i=be(e,null,"r",420),n=L(i.flag);if(!st(n))throw new f(22,"Flag passed to readFile must allow for reading.");let r=ut.Buffer.from(Fa(typeof t=="number"?M(t).path:t.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(Dn,"readFileSync");function Qi(t,e,i={}){let n=be(i,"utf8","w+",420),r=L(n.flag);if(!pe(r))throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ut.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!o)throw new f(22,"Data not specified");let a=ri(typeof t=="number"?M(t).path:t.toString(),r,n.mode,!0);try{a.writeSync(o,0,o.byteLength,0)}finally{a.closeSync()}}s(Qi,"writeFileSync");function Ia(t,e,i={}){let n=be(i,"utf8","a",420),r=L(n.flag);if(!at(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ut.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=ri(typeof t=="number"?M(t).path:t.toString(),r,n.mode,!0);try{a.writeSync(o,0,o.byteLength,null)}finally{a.closeSync()}}s(Ia,"appendFileSync");function va(t,e){let i=M(t).statSync();return e?.bigint?new ie(i):i}s(va,"fstatSync");function Qe(t){M(t).closeSync(),Ct.delete(t)}s(Qe,"closeSync");function oo(t,e=0){if(e||=0,e<0)throw new f(22);M(t).truncateSync(e)}s(oo,"ftruncateSync");function Pa(t){M(t).syncSync()}s(Pa,"fsyncSync");function Ta(t){M(t).datasyncSync()}s(Ta,"fdatasyncSync");function Aa(t,e,i,n,r){let o,a,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let h=typeof n=="string"?n:"utf8";a=0,o=ut.Buffer.from(e,h),l=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,l=n,c=typeof r=="number"?r:null;let u=M(t);return c??=u.position,u.writeSync(o,a,l,c)}s(Aa,"writeSync");function Oa(t,e,i,n,r){let o=M(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=o.position),o.readSync(e,a,n,r)}s(Oa,"readSync");function Bn(t,e,i){M(t).chownSync(e,i)}s(Bn,"fchownSync");function Mn(t,e){let i=me(e,-1);if(i<0)throw new f(22,"Invalid mode.");M(t).chmodSync(i)}s(Mn,"fchmodSync");function Wn(t,e,i){M(t).utimesSync(Pt(e),Pt(i))}s(Wn,"futimesSync");function so(t){return fe("rmdirSync",!0,t.toString(),k)}s(so,"rmdirSync");function Un(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,n=typeof e=="object"&&e?.recursive;fe("mkdirSync",!0,t.toString(),me(i,511),k)}s(Un,"mkdirSync");function si(t,e){t=x(t);let i=fe("readdirSync",!0,t,k);for(let n of we.keys()){if(!n.startsWith(t))continue;let r=n.slice(t.length);r.includes("/")||r.length==0||i.push(r)}return i.map(n=>typeof e=="object"&&e?.withFileTypes?new dt(n,Xi(B(t.toString(),n))):e=="buffer"||typeof e=="object"&&e?.encoding=="buffer"?ut.Buffer.from(n):n)}s(si,"readdirSync");function Ca(t,e){return e=x(e),fe("linkSync",!1,t.toString(),e.toString(),k)}s(Ca,"linkSync");function Ra(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(ni(e))throw f.With("EEXIST",e.toString(),"symlink");Qi(e,t.toString()),ri(e,"r+",420,!1)._setTypeSync(z.SYMLINK)}s(Ra,"symlinkSync");function ao(t,e){let i=ut.Buffer.from(Fa(t.toString(),"r",!1)),n=typeof e=="object"?e?.encoding:e;return n=="buffer"?i:i.toString(n)}s(ao,"readlinkSync");function La(t,e,i){let n=oi(t,"r+");Bn(n,e,i),Qe(n)}s(La,"chownSync");function Na(t,e,i){let n=Ji(t,"r+");Bn(n,e,i),Qe(n)}s(Na,"lchownSync");function Da(t,e){let i=oi(t,"r+");Mn(i,e),Qe(i)}s(Da,"chmodSync");function Ba(t,e){let i=Ji(t,"r+");Mn(i,e),Qe(i)}s(Ba,"lchmodSync");function lo(t,e,i){let n=oi(t,"r+");Wn(n,e,i),Qe(n)}s(lo,"utimesSync");function Ma(t,e,i){let n=Ji(t,"r+");Wn(n,e,i),Qe(n)}s(Ma,"lutimesSync");function ii(t,e){t=x(t);let{base:i,dir:n}=En(t),r=B(n=="/"?"/":ii(n),i),{fs:o,path:a,mountPoint:l}=H(r);try{return o.statSync(a,k).isSymbolicLink()?ii(l+ao(r)):r}catch(c){throw le(c,{[a]:r})}}s(ii,"realpathSync");function Wa(t,e=384){if(!Xi(t).hasAccess(e,k))throw new f(13)}s(Wa,"accessSync");function co(t,e){switch(t=x(t),Xi(t).mode&61440){case 16384:if(e?.recursive)for(let n of si(t))co(B(t,n));so(t);return;case 32768:case 40960:Nn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(co,"rmSync");function Ua(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Un(r),i=="buffer"?ut.Buffer.from(r):r}s(Ua,"mkdtempSync");function fo(t,e,i){if(t=x(t),e=x(e),i&&i&1&&ni(e))throw new f(17,"Destination file already exists.",e,"copyFile");Qi(e,Dn(t))}s(fo,"copyFileSync");function qa(t,e,i){let n=M(t),r=0;for(let o of e)r+=n.readSync(o,0,o.byteLength,i+r);return r}s(qa,"readvSync");function ja(t,e,i){let n=M(t),r=0;for(let o of e)r+=n.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+r);return r}s(ja,"writevSync");function $a(t,e){return t=x(t),new ht(t)}s($a,"opendirSync");function uo(t,e,i){t=x(t),e=x(e);let n=ro(t);if(i?.errorOnExist&&ni(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");Un(e,{recursive:!0});for(let r of si(t,{withFileTypes:!0}))i.filter&&!i.filter(B(t,r.name),B(e,r.name))||uo(B(t,r.name),B(e,r.name),i);break;case 32768:case 40960:fo(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&lo(e,n.atime,n.mtime)}s(uo,"cpSync");function Va(t,e){throw f.With("ENOSYS",t.toString(),"statfs")}s(Va,"statfsSync");var dt=class{constructor(e,i){this.path=e;this.stats=i}static{s(this,"Dirent")}get name(){return N(this.path)}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()}},ht=class{constructor(e){this.path=e;this.closed=!1;this._entries=[]}static{s(this,"Dir")}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 Rt(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}read(e){if(!e)return this._read();this._read().then(i=>e(void 0,i))}readSync(){return this._entries||(this._entries=si(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],next:s(async function(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})},"next")}}};var Er=Ar(eu(),1);var gt=class extends Er.Readable{static{s(this,"ReadStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new f(5,i.toString()))}}},wt=class extends Er.Writable{static{s(this,"WriteStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new f(5,i.toString()))}}};var te=class{static{s(this,"FileHandle")}constructor(e){let i=typeof e!="number";this.fd=i?Yi(e):e,this.file=i?e:M(e)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=me(e,-1);if(i<0)throw new f(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e||=0,e<0)throw new f(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Pt(e),Pt(i))}async appendFile(e,i={}){let n=be(i,"utf8","a",420),r=L(n.flag);if(!at(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?Ht.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,null)}read(e,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(e,i,n,r)}async readFile(e){let i=be(e,null,"r",292),n=L(i.flag);if(!st(n))throw new f(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(r),0,r,0),a=Ht.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e={}){let i=s(async({close:n,enqueue:r,error:o})=>{try{let c=0,u=0,h=NaN;for(;h>0;){let d=await this.read(new Uint8Array(65536),0,65536,u);if(!d.bytesRead){n();return}if(r(d.buffer.slice(0,d.bytesRead)),u+=d.bytesRead,++c>=1e7)throw new f(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");h=d.bytesRead}}catch(a){o(a)}},"start");return new globalThis.ReadableStream({start:i,type:e.type})}readLines(e){throw f.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();return e?.bigint?new ie(i):i}async write(e,i,n,r){let o,a,l;if(typeof e=="string"){r=typeof i=="number"?i:null;let u=typeof n=="string"?n:"utf8";a=0,o=Ht.Buffer.from(e,u),l=o.length}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,l=n,r=typeof r=="number"?r:null;r??=this.file.position;let c=await this.file.write(o,a,l,r);return{buffer:o,bytesWritten:c}}async writeFile(e,i={}){let n=be(i,"utf8","w",420),r=L(n.flag);if(!pe(r))throw new f(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?Ht.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Ct.delete(this.fd)}async writev(e,i){let n=0;for(let r of e)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,i){let n=0;for(let r of e)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){let i=new gt({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:s(async n=>{try{let r=await this.read(new Uint8Array(n),0,n,this.file.position);i.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),this.file.position+=r.bytesRead}catch(r){i.destroy(r)}},"read")});return i.path=this.file.path,i}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:s(async(r,o,a)=>{try{let{bytesWritten:l}=await this.write(r,null,o);a(l==r.length?null:new Error("Failed to write full chunk"))}catch(l){a(l)}},"write")},n=new wt(i);return n.path=this.file.path,n}};async function vs(t,e){t=x(t),e=x(e);let i=H(t),n=H(e);try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path,k);return}await ki(e,await pn(t)),await hn(t)}catch(r){throw le(r,{[i.path]:t,[n.path]:e})}}s(vs,"rename");async function Ie(t){try{let{fs:e,path:i}=H(await Fe(t));return await e.exists(i,k)}catch(e){if(e instanceof f&&e.code=="ENOENT")return!1;throw e}}s(Ie,"exists");async function _i(t,e){t=x(t);let{fs:i,path:n}=H(await Ie(t)?await Fe(t):t);try{let r=await i.stat(n,k);return e?.bigint?new ie(r):r}catch(r){throw le(r,{[n]:t})}}s(_i,"stat");async function _r(t,e){t=x(t);let{fs:i,path:n}=H(t);try{let r=await i.stat(n,k);return e?.bigint?new ie(r):r}catch(r){throw le(r,{[n]:t})}}s(_r,"lstat");async function Ps(t,e=0){let i=await ue(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(Ps,"truncate");async function hn(t){t=x(t);let{fs:e,path:i}=H(t);try{await e.unlink(i,k)}catch(n){throw le(n,{[i]:t})}}s(hn,"unlink");async function xi(t,e,i=420,n){t=x(t);let r=me(i,420),o=L(e);t=n&&await Ie(t)?await Fe(t):t;let{fs:a,path:l}=H(t);try{switch(Ci(o)){case 1:throw f.With("EEXIST",t,"_open");case 2:let c=await a.openFile(l,o,k);return await c.truncate(0),await c.sync(),new te(c);case 0:return new te(await a.openFile(l,o,k));default:throw new f(22,"Invalid file flag")}}catch{switch(Ri(o)){case 3:let u=await a.stat(I(l),k);if(u&&!u.isDirectory())throw f.With("ENOTDIR",I(t),"_open");return new te(await a.createFile(l,o,r,k));case 1:throw f.With("ENOENT",t,"_open");default:throw new f(22,"Invalid file flag")}}}s(xi,"_open");async function ue(t,e="r",i=420){return await xi(t,e,i,!0)}s(ue,"open");async function pn(t,e){let i=be(e,null,"r",420),n=typeof t=="object"&&"fd"in t?t:await ue(t,i.flag,i.mode);try{return await n.readFile(i)}finally{await n.close()}}s(pn,"readFile");async function ki(t,e,i){let n=be(i,"utf8","w+",420),r=t instanceof te?t:await ue(t.toString(),n.flag,n.mode);try{let o=e;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new f(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,n)}finally{await r.close()}}s(ki,"writeFile");async function Ts(t,e,i){let n=be(i,"utf8","a",420),r=L(n.flag);if(!at(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?Ht.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=typeof t=="object"&&"fd"in t?t:await ue(t,n.flag,n.mode);try{await a.appendFile(o,n)}finally{await a.close()}}s(Ts,"appendFile");async function xr(t){t=x(t),t=await Ie(t)?await Fe(t):t;let{fs:e,path:i}=H(t);try{await e.rmdir(i,k)}catch(n){throw le(n,{[i]:t})}}s(xr,"rmdir");async function yn(t,e){t=x(t),t=await Ie(t)?await Fe(t):t;let{fs:i,path:n}=H(t);try{await i.mkdir(n,me(typeof e=="object"?e?.mode:e,511),k)}catch(r){throw le(r,{[n]:t})}}s(yn,"mkdir");async function Rt(t,e){t=x(t),t=await Ie(t)?await Fe(t):t;let{fs:i,path:n}=H(t),r;try{r=await i.readdir(n,k)}catch(a){throw le(a,{[n]:t})}for(let a of we.keys())if(a.startsWith(t)){let l=a.slice(t.length);if(l.includes("/")||l.length==0)continue;r.push(l)}let o=[];for(let a of r)o.push(typeof e=="object"&&e?.withFileTypes?new dt(a,await _i(B(t,a))):a);return o}s(Rt,"readdir");async function As(t,e){t=x(t),e=x(e);let{fs:i,path:n}=H(e);try{return await i.link(t,e,k)}catch(r){throw le(r,{[n]:e})}}s(As,"link");async function Os(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await Ie(e))throw f.With("EEXIST",e.toString(),"symlink");await ki(e,t.toString()),await(await xi(e,"r+",420,!1)).file._setType(z.SYMLINK)}s(Os,"symlink");async function kr(t,e){let i=await xi(x(t),"r",420,!1);try{let n=await i.readFile(),r=typeof e=="object"?e?.encoding:e;return r=="buffer"?n:n.toString(r)}finally{await i.close()}}s(kr,"readlink");async function Cs(t,e,i){let n=await ue(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(Cs,"chown");async function Rs(t,e,i){let n=await xi(t,"r+",420,!1);try{await n.chown(e,i)}finally{await n.close()}}s(Rs,"lchown");async function Ls(t,e){let i=await ue(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(Ls,"chmod");async function Ns(t,e){let i=await xi(t,"r+",420,!1);try{await i.chmod(e)}finally{await i.close()}}s(Ns,"lchmod");async function Fr(t,e,i){let n=await ue(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(Fr,"utimes");async function Ds(t,e,i){let n=await xi(t,"r+",420,!1);try{await n.utimes(new Date(e),new Date(i))}finally{await n.close()}}s(Ds,"lutimes");async function Fe(t,e){t=x(t);let{base:i,dir:n}=En(t),r=B(n=="/"?"/":await Fe(n),i),{fs:o,path:a,mountPoint:l}=H(r);try{return(await o.stat(a,k)).isSymbolicLink()?Fe(l+await kr(r)):r}catch(c){throw le(c,{[a]:r})}}s(Fe,"realpath");function zg(t,e={}){throw f.With("ENOSYS",t.toString(),"watch")}s(zg,"watch");async function Bs(t,e=0){if(!(await _i(t)).hasAccess(e,k))throw new f(13)}s(Bs,"access");async function Ir(t,e){switch(t=x(t),(await _i(t)).mode&61440){case 16384:if(e?.recursive)for(let n of await Rt(t))await Ir(B(t,n));await xr(t);return;case 32768:case 40960:await hn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(Ir,"rm");async function Ms(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await yn(r),i=="buffer"?Ht.Buffer.from(r):r}s(Ms,"mkdtemp");async function vr(t,e,i){if(t=x(t),e=x(e),i&&i&1&&await Ie(e))throw new f(17,"Destination file already exists.",e,"copyFile");await ki(e,await pn(t))}s(vr,"copyFile");async function Ws(t,e){return t=x(t),new ht(t)}s(Ws,"opendir");async function Pr(t,e,i){t=x(t),e=x(e);let n=await _r(t);if(i?.errorOnExist&&await Ie(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");await yn(e,{recursive:!0});for(let r of await Rt(t,{withFileTypes:!0}))i.filter&&!i.filter(B(t,r.name),B(e,r.name))||await Pr(B(t,r.name),B(e,r.name),i);break;case 32768:case 40960:await vr(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await Fr(e,n.atime,n.mtime)}s(Pr,"cp");async function Us(t,e){throw f.With("ENOSYS",t.toString(),"statfs")}s(Us,"statfs");function tu(t,e,i=S){vs(t,e).then(()=>i()).catch(i)}s(tu,"rename");function iu(t,e=S){Ie(t).then(e).catch(()=>e(!1))}s(iu,"exists");function nu(t,e,i=S){i=typeof e=="function"?e:i,_i(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(nu,"stat");function ru(t,e,i=S){i=typeof e=="function"?e:i,_r(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(ru,"lstat");function ou(t,e=0,i=S){i=typeof e=="function"?e:i,Ps(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(ou,"truncate");function su(t,e=S){hn(t).then(()=>e()).catch(e)}s(su,"unlink");function au(t,e,i,n=S){let r=me(i,420);n=typeof i=="function"?i:n,ue(t,e,r).then(o=>n(void 0,o.fd)).catch(n)}s(au,"open");function lu(t,e,i=S){i=typeof e=="function"?e:i,pn(t,typeof e=="function"?null:e).then(n=>i(void 0,n)).catch(i)}s(lu,"readFile");function cu(t,e,i,n=S){n=typeof i=="function"?i:n,ki(t,e,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(cu,"writeFile");function fu(t,e,i,n=S){n=typeof i=="function"?i:n,Ts(t,e,typeof i=="function"?null:i).then(()=>n()).catch(n)}s(fu,"appendFile");function uu(t,e,i=S){i=typeof e=="function"?e:i,M(t).stat().then(n=>i(void 0,typeof e=="object"&&e?.bigint?new ie(n):n)).catch(i)}s(uu,"fstat");function du(t,e=S){new te(t).close().then(()=>e()).catch(e)}s(du,"close");function hu(t,e,i=S){let n=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let r=M(t);if(n<0)throw new f(22);r.truncate(n).then(()=>i()).catch(i)}s(hu,"ftruncate");function pu(t,e=S){M(t).sync().then(()=>e()).catch(e)}s(pu,"fsync");function yu(t,e=S){M(t).datasync().then(()=>e()).catch(e)}s(yu,"fdatasync");function mu(t,e,i,n,r,o=S){let a,l,c,u,h,d=new te(t);if(typeof e=="string"){switch(h="utf8",typeof i){case"function":o=i;break;case"number":u=i,h=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new f(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,c=a.length;let b=o;d.write(a,l,c,u).then(({bytesWritten:m})=>b(void 0,m,a.toString(h))).catch(b)}else{a=Buffer.from(e.buffer),l=i,c=n,u=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;d.write(a,l,c,u).then(({bytesWritten:m})=>b(void 0,m,a)).catch(b)}}s(mu,"write");function bu(t,e,i,n,r,o=S){new te(t).read(e,i,n,r).then(({bytesRead:a,buffer:l})=>o(void 0,a,l)).catch(o)}s(bu,"read");function gu(t,e,i,n=S){new te(t).chown(e,i).then(()=>n()).catch(n)}s(gu,"fchown");function wu(t,e,i){new te(t).chmod(e).then(()=>i()).catch(i)}s(wu,"fchmod");function Su(t,e,i,n=S){new te(t).utimes(e,i).then(()=>n()).catch(n)}s(Su,"futimes");function Eu(t,e=S){xr(t).then(()=>e()).catch(e)}s(Eu,"rmdir");function _u(t,e,i=S){yn(t,e).then(()=>i()).catch(i)}s(_u,"mkdir");function xu(t,e,i=S){i=typeof e=="function"?e:i,Rt(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(xu,"readdir");function ku(t,e,i=S){As(t,e).then(()=>i()).catch(i)}s(ku,"link");function Fu(t,e,i,n=S){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,Os(t,e,r).then(()=>n()).catch(n)}s(Fu,"symlink");function Iu(t,e,i=S){i=typeof e=="function"?e:i,kr(t).then(n=>i(void 0,n)).catch(i)}s(Iu,"readlink");function vu(t,e,i,n=S){Cs(t,e,i).then(()=>n()).catch(n)}s(vu,"chown");function Pu(t,e,i,n=S){Rs(t,e,i).then(()=>n()).catch(n)}s(Pu,"lchown");function Tu(t,e,i=S){Ls(t,e).then(()=>i()).catch(i)}s(Tu,"chmod");function Au(t,e,i=S){Ns(t,e).then(()=>i()).catch(i)}s(Au,"lchmod");function Ou(t,e,i,n=S){Fr(t,e,i).then(()=>n()).catch(n)}s(Ou,"utimes");function Cu(t,e,i,n=S){Ds(t,e,i).then(()=>n()).catch(n)}s(Cu,"lutimes");function Ru(t,e,i=S){i=typeof e=="function"?e:i,Fe(t,typeof e=="function"?null:e).then(n=>i(void 0,n)).catch(i)}s(Ru,"realpath");function Lu(t,e,i=S){let n=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Bs(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(Lu,"access");function Nu(t,e,i=S){throw f.With("ENOSYS",t.toString(),"watchFile")}s(Nu,"watchFile");function Du(t,e=S){throw f.With("ENOSYS",t.toString(),"unwatchFile")}s(Du,"unwatchFile");function Bu(t,e,i=S){throw f.With("ENOSYS",t.toString(),"watch")}s(Bu,"watch");function Mu(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new gt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{n||=await ue(t,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},"read"),destroy:s(function(o,a){n?.close().then(()=>a(o)).catch(a)},"destroy")});return r.path=t.toString(),r}s(Mu,"createReadStream");function Wu(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new wt({highWaterMark:i?.highWaterMark,write:s(async function(o,a,l){try{n||=await ue(t,"w",i?.mode||438),await n.write(o,0,a),l(void 0)}catch(c){await n?.close(),l(c)}},"write"),destroy:s(function(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){n?.close().then(()=>o()).catch(o)},"final")});return r.path=t.toString(),r}s(Wu,"createWriteStream");function Uu(t,e,i=S){i=typeof e=="function"?e:i,Ir(t,typeof e=="function"?void 0:e).then(()=>i(void 0)).catch(i)}s(Uu,"rm");function qu(t,e,i=S){i=typeof e=="function"?e:i,Ms(t,typeof e!="function"?e:null).then(n=>i(void 0,n)).catch(i)}s(qu,"mkdtemp");function ju(t,e,i,n=S){n=typeof i=="function"?i:n,vr(t,e,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(ju,"copyFile");function $u(t,e,i,n=S){n=typeof i=="function"?i:n,new te(t).readv(e,typeof i=="function"?void 0:i).then(({buffers:r,bytesRead:o})=>n(void 0,o,r)).catch(n)}s($u,"readv");function Vu(t,e,i,n=S){n=typeof i=="function"?i:n,new te(t).writev(e,typeof i=="function"?void 0:i).then(({buffers:r,bytesWritten:o})=>n(void 0,o,r)).catch(n)}s(Vu,"writev");function zu(t,e,i=S){i=typeof e=="function"?e:i,Ws(t,typeof e=="function"?void 0:e).then(n=>i(void 0,n)).catch(i)}s(zu,"opendir");function Hu(t,e,i,n=S){n=typeof i=="function"?i:n,Pr(t,e,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Hu,"cp");function Yu(t,e,i=S){i=typeof e=="function"?e:i,Us(t,typeof e=="function"?void 0:e).then(n=>i(void 0,n)).catch(i)}s(Yu,"statfs");async function Gu(t,e){let i=await ue(t.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],e)}s(Gu,"openAsBlob");function qs(t){return Yr(t)||zi(t)||t instanceof se}s(qs,"isMountConfig");async function js(t,e=0){if(typeof t!="object"||t==null)throw new f(22,"Invalid options on mount configuration");if(!qs(t))throw new f(22,"Invalid mount configuration");if(t instanceof se)return t;zi(t)&&(t={backend:t});for(let[r,o]of Object.entries(t))if(r!="backend"&&qs(o)){if(e>10)throw new f(22,"Invalid configuration, too deep and possibly infinite");t[r]=await js(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new f(1,"Backend not available: "+i);Hr(i,t);let n=await i.create(t);return await n.ready(),n}s(js,"resolveMountConfig");async function Hg(t){let e="uid"in t&&t.uid||0,i="gid"in t&&t.gid||0;qs(t)&&(t={mounts:{"/":t}});for(let[n,r]of Object.entries(t.mounts)){if(!n.startsWith("/"))throw new f(22,"Mount points must have absolute paths");t.mounts[n]=await js(r)}Ki(t.mounts),_a({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i})}s(Hg,"configure");var Yg=bn;return td(Gg);})();
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
ieee754/index.js:
|