@elizaos/plugin-openai 1.5.16 → 1.5.18
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/browser/index.browser.js +3 -3
- package/dist/browser/index.browser.js.map +17 -4
- package/dist/cjs/index.node.cjs +563 -489
- package/dist/cjs/index.node.js.map +17 -4
- package/dist/index.d.ts +2 -18
- package/dist/init.d.ts +5 -0
- package/dist/models/audio.d.ts +10 -0
- package/dist/models/embedding.d.ts +5 -0
- package/dist/models/image.d.ts +14 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/object.d.ts +10 -0
- package/dist/models/text.d.ts +9 -0
- package/dist/models/tokenizer.d.ts +9 -0
- package/dist/node/index.node.js +564 -494
- package/dist/node/index.node.js.map +17 -4
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/openai.d.ts +8 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/utils/audio.d.ts +12 -0
- package/dist/utils/config.d.ts +70 -0
- package/dist/utils/events.d.ts +10 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/json.d.ts +7 -0
- package/dist/utils/tokenization.d.ts +17 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var H6=Object.create;var{getPrototypeOf:$6,defineProperty:J2,getOwnPropertyNames:B1,getOwnPropertyDescriptor:G6}=Object,w1=Object.prototype.hasOwnProperty;var C6=(w,h,B)=>{B=w!=null?H6($6(w)):{};let U=h||!w||!w.__esModule?J2(B,"default",{value:w,enumerable:!0}):B;for(let I of B1(w))if(!w1.call(U,I))J2(U,I,{get:()=>w[I],enumerable:!0});return U},h1=new WeakMap,_0=(w)=>{var h=h1.get(w),B;if(h)return h;if(h=J2({},"__esModule",{value:!0}),w&&typeof w==="object"||typeof w==="function")B1(w).map((U)=>!w1.call(h,U)&&J2(h,U,{get:()=>w[U],enumerable:!(B=G6(w,U))||B.enumerable}));return h1.set(w,h),h},N6=(w,h)=>()=>(h||w((h={exports:{}}).exports,h),h.exports);var U1=(w,h)=>{for(var B in h)J2(w,B,{get:h[B],enumerable:!0,configurable:!0,set:(U)=>h[B]=()=>U})};var I1=(w,h)=>()=>(w&&(h=w(w=0)),h);var u0={};U1(u0,{transcode:()=>U8,resolveObjectURL:()=>h8,kStringMaxLength:()=>q1,kMaxLength:()=>F2,isUtf8:()=>B8,isAscii:()=>w8,default:()=>I8,constants:()=>D6,btoa:()=>M6,atob:()=>L6,INSPECT_MAX_BYTES:()=>Y1,File:()=>O6,Buffer:()=>_,Blob:()=>x6});function E6(w){var h=w.length;if(h%4>0)throw Error("Invalid string. Length must be a multiple of 4");var B=w.indexOf("=");if(B===-1)B=h;var U=B===h?0:4-B%4;return[B,U]}function W6(w,h){return(w+h)*3/4-h}function V6(w){var h,B=E6(w),U=B[0],I=B[1],X=new Uint8Array(W6(U,I)),Z=0,K=I>0?U-4:U,q;for(q=0;q<K;q+=4)h=R0[w.charCodeAt(q)]<<18|R0[w.charCodeAt(q+1)]<<12|R0[w.charCodeAt(q+2)]<<6|R0[w.charCodeAt(q+3)],X[Z++]=h>>16&255,X[Z++]=h>>8&255,X[Z++]=h&255;if(I===2)h=R0[w.charCodeAt(q)]<<2|R0[w.charCodeAt(q+1)]>>4,X[Z++]=h&255;if(I===1)h=R0[w.charCodeAt(q)]<<10|R0[w.charCodeAt(q+1)]<<4|R0[w.charCodeAt(q+2)]>>2,X[Z++]=h>>8&255,X[Z++]=h&255;return X}function j6(w){return S0[w>>18&63]+S0[w>>12&63]+S0[w>>6&63]+S0[w&63]}function A6(w,h,B){var U,I=[];for(var X=h;X<B;X+=3)U=(w[X]<<16&16711680)+(w[X+1]<<8&65280)+(w[X+2]&255),I.push(j6(U));return I.join("")}function Z1(w){var h,B=w.length,U=B%3,I=[],X=16383;for(var Z=0,K=B-U;Z<K;Z+=X)I.push(A6(w,Z,Z+X>K?K:Z+X));if(U===1)h=w[B-1],I.push(S0[h>>2]+S0[h<<4&63]+"==");else if(U===2)h=(w[B-2]<<8)+w[B-1],I.push(S0[h>>10]+S0[h>>4&63]+S0[h<<2&63]+"=");return I.join("")}function N2(w,h,B,U,I){var X,Z,K=I*8-U-1,q=(1<<K)-1,z=q>>1,G=-7,C=B?I-1:0,O=B?-1:1,x=w[h+C];C+=O,X=x&(1<<-G)-1,x>>=-G,G+=K;for(;G>0;X=X*256+w[h+C],C+=O,G-=8);Z=X&(1<<-G)-1,X>>=-G,G+=U;for(;G>0;Z=Z*256+w[h+C],C+=O,G-=8);if(X===0)X=1-z;else if(X===q)return Z?NaN:(x?-1:1)*(1/0);else Z=Z+Math.pow(2,U),X=X-z;return(x?-1:1)*Z*Math.pow(2,X-U)}function K1(w,h,B,U,I,X){var Z,K,q,z=X*8-I-1,G=(1<<z)-1,C=G>>1,O=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=U?0:X-1,l=U?1:-1,a=h<0||h===0&&1/h<0?1:0;if(h=Math.abs(h),isNaN(h)||h===1/0)K=isNaN(h)?1:0,Z=G;else{if(Z=Math.floor(Math.log(h)/Math.LN2),h*(q=Math.pow(2,-Z))<1)Z--,q*=2;if(Z+C>=1)h+=O/q;else h+=O*Math.pow(2,1-C);if(h*q>=2)Z++,q/=2;if(Z+C>=G)K=0,Z=G;else if(Z+C>=1)K=(h*q-1)*Math.pow(2,I),Z=Z+C;else K=h*Math.pow(2,C-1)*Math.pow(2,I),Z=0}for(;I>=8;w[B+x]=K&255,x+=l,K/=256,I-=8);Z=Z<<I|K,z+=I;for(;z>0;w[B+x]=Z&255,x+=l,Z/=256,z-=8);w[B+x-l]|=a*128}function c0(w){if(w>F2)throw RangeError('The value "'+w+'" is invalid for option "size"');let h=new Uint8Array(w);return Object.setPrototypeOf(h,_.prototype),h}function S2(w,h,B){return class extends B{constructor(){super();Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}function _(w,h,B){if(typeof w==="number"){if(typeof h==="string")throw TypeError('The "string" argument must be of type string. Received type number');return f2(w)}return H1(w,h,B)}function H1(w,h,B){if(typeof w==="string")return R6(w,h);if(ArrayBuffer.isView(w))return k6(w);if(w==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(f0(w,ArrayBuffer)||w&&f0(w.buffer,ArrayBuffer))return R2(w,h,B);if(typeof SharedArrayBuffer<"u"&&(f0(w,SharedArrayBuffer)||w&&f0(w.buffer,SharedArrayBuffer)))return R2(w,h,B);if(typeof w==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let U=w.valueOf&&w.valueOf();if(U!=null&&U!==w)return _.from(U,h,B);let I=S6(w);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]==="function")return _.from(w[Symbol.toPrimitive]("string"),h,B);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}function $1(w){if(typeof w!=="number")throw TypeError('"size" argument must be of type number');else if(w<0)throw RangeError('The value "'+w+'" is invalid for option "size"')}function _6(w,h,B){if($1(w),w<=0)return c0(w);if(h!==void 0)return typeof B==="string"?c0(w).fill(h,B):c0(w).fill(h);return c0(w)}function f2(w){return $1(w),c0(w<0?0:y2(w)|0)}function R6(w,h){if(typeof h!=="string"||h==="")h="utf8";if(!_.isEncoding(h))throw TypeError("Unknown encoding: "+h);let B=G1(w,h)|0,U=c0(B),I=U.write(w,h);if(I!==B)U=U.slice(0,I);return U}function _2(w){let h=w.length<0?0:y2(w.length)|0,B=c0(h);for(let U=0;U<h;U+=1)B[U]=w[U]&255;return B}function k6(w){if(f0(w,Uint8Array)){let h=new Uint8Array(w);return R2(h.buffer,h.byteOffset,h.byteLength)}return _2(w)}function R2(w,h,B){if(h<0||w.byteLength<h)throw RangeError('"offset" is outside of buffer bounds');if(w.byteLength<h+(B||0))throw RangeError('"length" is outside of buffer bounds');let U;if(h===void 0&&B===void 0)U=new Uint8Array(w);else if(B===void 0)U=new Uint8Array(w,h);else U=new Uint8Array(w,h,B);return Object.setPrototypeOf(U,_.prototype),U}function S6(w){if(_.isBuffer(w)){let h=y2(w.length)|0,B=c0(h);if(B.length===0)return B;return w.copy(B,0,0,h),B}if(w.length!==void 0){if(typeof w.length!=="number"||Number.isNaN(w.length))return c0(0);return _2(w)}if(w.type==="Buffer"&&Array.isArray(w.data))return _2(w.data)}function y2(w){if(w>=F2)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+F2.toString(16)+" bytes");return w|0}function G1(w,h){if(_.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||f0(w,ArrayBuffer))return w.byteLength;if(typeof w!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);let B=w.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&B===0)return 0;let I=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return B;case"utf8":case"utf-8":return k2(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B*2;case"hex":return B>>>1;case"base64":return L1(w).length;default:if(I)return U?-1:k2(w).length;h=(""+h).toLowerCase(),I=!0}}function f6(w,h,B){let U=!1;if(h===void 0||h<0)h=0;if(h>this.length)return"";if(B===void 0||B>this.length)B=this.length;if(B<=0)return"";if(B>>>=0,h>>>=0,B<=h)return"";if(!w)w="utf8";while(!0)switch(w){case"hex":return l6(this,h,B);case"utf8":case"utf-8":return N1(this,h,B);case"ascii":return p6(this,h,B);case"latin1":case"binary":return d6(this,h,B);case"base64":return b6(this,h,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m6(this,h,B);default:if(U)throw TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),U=!0}}function a0(w,h,B){let U=w[h];w[h]=w[B],w[B]=U}function C1(w,h,B,U,I){if(w.length===0)return-1;if(typeof B==="string")U=B,B=0;else if(B>2147483647)B=2147483647;else if(B<-2147483648)B=-2147483648;if(B=+B,Number.isNaN(B))B=I?0:w.length-1;if(B<0)B=w.length+B;if(B>=w.length)if(I)return-1;else B=w.length-1;else if(B<0)if(I)B=0;else return-1;if(typeof h==="string")h=_.from(h,U);if(_.isBuffer(h)){if(h.length===0)return-1;return J1(w,h,B,U,I)}else if(typeof h==="number"){if(h=h&255,typeof Uint8Array.prototype.indexOf==="function")if(I)return Uint8Array.prototype.indexOf.call(w,h,B);else return Uint8Array.prototype.lastIndexOf.call(w,h,B);return J1(w,[h],B,U,I)}throw TypeError("val must be string, number or Buffer")}function J1(w,h,B,U,I){let X=1,Z=w.length,K=h.length;if(U!==void 0){if(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le"){if(w.length<2||h.length<2)return-1;X=2,Z/=2,K/=2,B/=2}}function q(G,C){if(X===1)return G[C];else return G.readUInt16BE(C*X)}let z;if(I){let G=-1;for(z=B;z<Z;z++)if(q(w,z)===q(h,G===-1?0:z-G)){if(G===-1)G=z;if(z-G+1===K)return G*X}else{if(G!==-1)z-=z-G;G=-1}}else{if(B+K>Z)B=Z-K;for(z=B;z>=0;z--){let G=!0;for(let C=0;C<K;C++)if(q(w,z+C)!==q(h,C)){G=!1;break}if(G)return z}}return-1}function y6(w,h,B,U){B=Number(B)||0;let I=w.length-B;if(!U)U=I;else if(U=Number(U),U>I)U=I;let X=h.length;if(U>X/2)U=X/2;let Z;for(Z=0;Z<U;++Z){let K=parseInt(h.substr(Z*2,2),16);if(Number.isNaN(K))return Z;w[B+Z]=K}return Z}function c6(w,h,B,U){return E2(k2(h,w.length-B),w,B,U)}function u6(w,h,B,U){return E2(a6(h),w,B,U)}function v6(w,h,B,U){return E2(L1(h),w,B,U)}function g6(w,h,B,U){return E2(s6(h,w.length-B),w,B,U)}function b6(w,h,B){if(h===0&&B===w.length)return Z1(w);else return Z1(w.slice(h,B))}function N1(w,h,B){B=Math.min(w.length,B);let U=[],I=h;while(I<B){let X=w[I],Z=null,K=X>239?4:X>223?3:X>191?2:1;if(I+K<=B){let q,z,G,C;switch(K){case 1:if(X<128)Z=X;break;case 2:if(q=w[I+1],(q&192)===128){if(C=(X&31)<<6|q&63,C>127)Z=C}break;case 3:if(q=w[I+1],z=w[I+2],(q&192)===128&&(z&192)===128){if(C=(X&15)<<12|(q&63)<<6|z&63,C>2047&&(C<55296||C>57343))Z=C}break;case 4:if(q=w[I+1],z=w[I+2],G=w[I+3],(q&192)===128&&(z&192)===128&&(G&192)===128){if(C=(X&15)<<18|(q&63)<<12|(z&63)<<6|G&63,C>65535&&C<1114112)Z=C}}}if(Z===null)Z=65533,K=1;else if(Z>65535)Z-=65536,U.push(Z>>>10&1023|55296),Z=56320|Z&1023;U.push(Z),I+=K}return i6(U)}function i6(w){let h=w.length;if(h<=F1)return String.fromCharCode.apply(String,w);let B="",U=0;while(U<h)B+=String.fromCharCode.apply(String,w.slice(U,U+=F1));return B}function p6(w,h,B){let U="";B=Math.min(w.length,B);for(let I=h;I<B;++I)U+=String.fromCharCode(w[I]&127);return U}function d6(w,h,B){let U="";B=Math.min(w.length,B);for(let I=h;I<B;++I)U+=String.fromCharCode(w[I]);return U}function l6(w,h,B){let U=w.length;if(!h||h<0)h=0;if(!B||B<0||B>U)B=U;let I="";for(let X=h;X<B;++X)I+=t6[w[X]];return I}function m6(w,h,B){let U=w.slice(h,B),I="";for(let X=0;X<U.length-1;X+=2)I+=String.fromCharCode(U[X]+U[X+1]*256);return I}function j0(w,h,B){if(w%1!==0||w<0)throw RangeError("offset is not uint");if(w+h>B)throw RangeError("Trying to access beyond buffer length")}function x0(w,h,B,U,I,X){if(!_.isBuffer(w))throw TypeError('"buffer" argument must be a Buffer instance');if(h>I||h<X)throw RangeError('"value" argument is out of bounds');if(B+U>w.length)throw RangeError("Index out of range")}function E1(w,h,B,U,I){M1(h,U,I,w,B,7);let X=Number(h&BigInt(4294967295));w[B++]=X,X=X>>8,w[B++]=X,X=X>>8,w[B++]=X,X=X>>8,w[B++]=X;let Z=Number(h>>BigInt(32)&BigInt(4294967295));return w[B++]=Z,Z=Z>>8,w[B++]=Z,Z=Z>>8,w[B++]=Z,Z=Z>>8,w[B++]=Z,B}function W1(w,h,B,U,I){M1(h,U,I,w,B,7);let X=Number(h&BigInt(4294967295));w[B+7]=X,X=X>>8,w[B+6]=X,X=X>>8,w[B+5]=X,X=X>>8,w[B+4]=X;let Z=Number(h>>BigInt(32)&BigInt(4294967295));return w[B+3]=Z,Z=Z>>8,w[B+2]=Z,Z=Z>>8,w[B+1]=Z,Z=Z>>8,w[B]=Z,B+8}function V1(w,h,B,U,I,X){if(B+U>w.length)throw RangeError("Index out of range");if(B<0)throw RangeError("Index out of range")}function j1(w,h,B,U,I){if(h=+h,B=B>>>0,!I)V1(w,h,B,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return K1(w,h,B,U,23,4),B+4}function A1(w,h,B,U,I){if(h=+h,B=B>>>0,!I)V1(w,h,B,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return K1(w,h,B,U,52,8),B+8}function z1(w){let h="",B=w.length,U=w[0]==="-"?1:0;for(;B>=U+4;B-=3)h=`_${w.slice(B-3,B)}${h}`;return`${w.slice(0,B)}${h}`}function n6(w,h,B){if(w2(h,"offset"),w[h]===void 0||w[h+B]===void 0)z2(h,w.length-(B+1))}function M1(w,h,B,U,I,X){if(w>B||w<h){let Z=typeof h==="bigint"?"n":"",K;if(X>3)if(h===0||h===BigInt(0))K=`>= 0${Z} and < 2${Z} ** ${(X+1)*8}${Z}`;else K=`>= -(2${Z} ** ${(X+1)*8-1}${Z}) and < 2 ** ${(X+1)*8-1}${Z}`;else K=`>= ${h}${Z} and <= ${B}${Z}`;throw new P2("value",K,w)}n6(U,I,X)}function w2(w,h){if(typeof w!=="number")throw new P6(h,"number",w)}function z2(w,h,B){if(Math.floor(w)!==w)throw w2(w,B),new P2(B||"offset","an integer",w);if(h<0)throw new T6;throw new P2(B||"offset",`>= ${B?1:0} and <= ${h}`,w)}function r6(w){if(w=w.split("=")[0],w=w.trim().replace(o6,""),w.length<2)return"";while(w.length%4!==0)w=w+"=";return w}function k2(w,h){h=h||1/0;let B,U=w.length,I=null,X=[];for(let Z=0;Z<U;++Z){if(B=w.charCodeAt(Z),B>55295&&B<57344){if(!I){if(B>56319){if((h-=3)>-1)X.push(239,191,189);continue}else if(Z+1===U){if((h-=3)>-1)X.push(239,191,189);continue}I=B;continue}if(B<56320){if((h-=3)>-1)X.push(239,191,189);I=B;continue}B=(I-55296<<10|B-56320)+65536}else if(I){if((h-=3)>-1)X.push(239,191,189)}if(I=null,B<128){if((h-=1)<0)break;X.push(B)}else if(B<2048){if((h-=2)<0)break;X.push(B>>6|192,B&63|128)}else if(B<65536){if((h-=3)<0)break;X.push(B>>12|224,B>>6&63|128,B&63|128)}else if(B<1114112){if((h-=4)<0)break;X.push(B>>18|240,B>>12&63|128,B>>6&63|128,B&63|128)}else throw Error("Invalid code point")}return X}function a6(w){let h=[];for(let B=0;B<w.length;++B)h.push(w.charCodeAt(B)&255);return h}function s6(w,h){let B,U,I,X=[];for(let Z=0;Z<w.length;++Z){if((h-=2)<0)break;B=w.charCodeAt(Z),U=B>>8,I=B%256,X.push(I),X.push(U)}return X}function L1(w){return V6(r6(w))}function E2(w,h,B,U){let I;for(I=0;I<U;++I){if(I+B>=h.length||I>=w.length)break;h[I+B]=w[I]}return I}function f0(w,h){return w instanceof h||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===h.name}function i0(w){return typeof BigInt>"u"?e6:w}function e6(){throw Error("BigInt not supported")}function c2(w){return()=>{throw Error(w+" is not implemented for node:buffer browser polyfill")}}var S0,R0,T2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r0,X1,Q1,Y1=50,F2=2147483647,q1=536870888,M6,L6,O6,x6,D6,T6,P6,P2,F1=4096,o6,t6,h8,B8,w8=(w)=>{for(let h of w)if(h.charCodeAt(0)>127)return!1;return!0},U8,I8;var v0=I1(()=>{S0=[],R0=[];for(r0=0,X1=T2.length;r0<X1;++r0)S0[r0]=T2[r0],R0[T2.charCodeAt(r0)]=r0;R0[45]=62;R0[95]=63;Q1=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,M6=globalThis.btoa,L6=globalThis.atob,O6=globalThis.File,x6=globalThis.Blob,D6={MAX_LENGTH:F2,MAX_STRING_LENGTH:q1};T6=S2("ERR_BUFFER_OUT_OF_BOUNDS",function(w){if(w)return`${w} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),P6=S2("ERR_INVALID_ARG_TYPE",function(w,h){return`The "${w}" argument must be of type number. Received type ${typeof h}`},TypeError),P2=S2("ERR_OUT_OF_RANGE",function(w,h,B){let U=`The value of "${w}" is out of range.`,I=B;if(Number.isInteger(B)&&Math.abs(B)>4294967296)I=z1(String(B));else if(typeof B==="bigint"){if(I=String(B),B>BigInt(2)**BigInt(32)||B<-(BigInt(2)**BigInt(32)))I=z1(I);I+="n"}return U+=` It must be ${h}. Received ${I}`,U},RangeError);Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(!_.isBuffer(this))return;return this.buffer}});Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(!_.isBuffer(this))return;return this.byteOffset}});_.poolSize=8192;_.from=function(w,h,B){return H1(w,h,B)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);_.alloc=function(w,h,B){return _6(w,h,B)};_.allocUnsafe=function(w){return f2(w)};_.allocUnsafeSlow=function(w){return f2(w)};_.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==_.prototype};_.compare=function(h,B){if(f0(h,Uint8Array))h=_.from(h,h.offset,h.byteLength);if(f0(B,Uint8Array))B=_.from(B,B.offset,B.byteLength);if(!_.isBuffer(h)||!_.isBuffer(B))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===B)return 0;let U=h.length,I=B.length;for(let X=0,Z=Math.min(U,I);X<Z;++X)if(h[X]!==B[X]){U=h[X],I=B[X];break}if(U<I)return-1;if(I<U)return 1;return 0};_.isEncoding=function(h){switch(String(h).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}};_.concat=function(h,B){if(!Array.isArray(h))throw TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return _.alloc(0);let U;if(B===void 0){B=0;for(U=0;U<h.length;++U)B+=h[U].length}let I=_.allocUnsafe(B),X=0;for(U=0;U<h.length;++U){let Z=h[U];if(f0(Z,Uint8Array))if(X+Z.length>I.length){if(!_.isBuffer(Z))Z=_.from(Z);Z.copy(I,X)}else Uint8Array.prototype.set.call(I,Z,X);else if(!_.isBuffer(Z))throw TypeError('"list" argument must be an Array of Buffers');else Z.copy(I,X);X+=Z.length}return I};_.byteLength=G1;_.prototype._isBuffer=!0;_.prototype.swap16=function(){let h=this.length;if(h%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let B=0;B<h;B+=2)a0(this,B,B+1);return this};_.prototype.swap32=function(){let h=this.length;if(h%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let B=0;B<h;B+=4)a0(this,B,B+3),a0(this,B+1,B+2);return this};_.prototype.swap64=function(){let h=this.length;if(h%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let B=0;B<h;B+=8)a0(this,B,B+7),a0(this,B+1,B+6),a0(this,B+2,B+5),a0(this,B+3,B+4);return this};_.prototype.toString=function(){let h=this.length;if(h===0)return"";if(arguments.length===0)return N1(this,0,h);return f6.apply(this,arguments)};_.prototype.toLocaleString=_.prototype.toString;_.prototype.equals=function(h){if(!_.isBuffer(h))throw TypeError("Argument must be a Buffer");if(this===h)return!0;return _.compare(this,h)===0};_.prototype.inspect=function(){let h="",B=Y1;if(h=this.toString("hex",0,B).replace(/(.{2})/g,"$1 ").trim(),this.length>B)h+=" ... ";return"<Buffer "+h+">"};if(Q1)_.prototype[Q1]=_.prototype.inspect;_.prototype.compare=function(h,B,U,I,X){if(f0(h,Uint8Array))h=_.from(h,h.offset,h.byteLength);if(!_.isBuffer(h))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(B===void 0)B=0;if(U===void 0)U=h?h.length:0;if(I===void 0)I=0;if(X===void 0)X=this.length;if(B<0||U>h.length||I<0||X>this.length)throw RangeError("out of range index");if(I>=X&&B>=U)return 0;if(I>=X)return-1;if(B>=U)return 1;if(B>>>=0,U>>>=0,I>>>=0,X>>>=0,this===h)return 0;let Z=X-I,K=U-B,q=Math.min(Z,K),z=this.slice(I,X),G=h.slice(B,U);for(let C=0;C<q;++C)if(z[C]!==G[C]){Z=z[C],K=G[C];break}if(Z<K)return-1;if(K<Z)return 1;return 0};_.prototype.includes=function(h,B,U){return this.indexOf(h,B,U)!==-1};_.prototype.indexOf=function(h,B,U){return C1(this,h,B,U,!0)};_.prototype.lastIndexOf=function(h,B,U){return C1(this,h,B,U,!1)};_.prototype.write=function(h,B,U,I){if(B===void 0)I="utf8",U=this.length,B=0;else if(U===void 0&&typeof B==="string")I=B,U=this.length,B=0;else if(isFinite(B))if(B=B>>>0,isFinite(U)){if(U=U>>>0,I===void 0)I="utf8"}else I=U,U=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let X=this.length-B;if(U===void 0||U>X)U=X;if(h.length>0&&(U<0||B<0)||B>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!I)I="utf8";let Z=!1;for(;;)switch(I){case"hex":return y6(this,h,B,U);case"utf8":case"utf-8":return c6(this,h,B,U);case"ascii":case"latin1":case"binary":return u6(this,h,B,U);case"base64":return v6(this,h,B,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g6(this,h,B,U);default:if(Z)throw TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),Z=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};_.prototype.slice=function(h,B){let U=this.length;if(h=~~h,B=B===void 0?U:~~B,h<0){if(h+=U,h<0)h=0}else if(h>U)h=U;if(B<0){if(B+=U,B<0)B=0}else if(B>U)B=U;if(B<h)B=h;let I=this.subarray(h,B);return Object.setPrototypeOf(I,_.prototype),I};_.prototype.readUintLE=_.prototype.readUIntLE=function(h,B,U){if(h=h>>>0,B=B>>>0,!U)j0(h,B,this.length);let I=this[h],X=1,Z=0;while(++Z<B&&(X*=256))I+=this[h+Z]*X;return I};_.prototype.readUintBE=_.prototype.readUIntBE=function(h,B,U){if(h=h>>>0,B=B>>>0,!U)j0(h,B,this.length);let I=this[h+--B],X=1;while(B>0&&(X*=256))I+=this[h+--B]*X;return I};_.prototype.readUint8=_.prototype.readUInt8=function(h,B){if(h=h>>>0,!B)j0(h,1,this.length);return this[h]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(h,B){if(h=h>>>0,!B)j0(h,2,this.length);return this[h]|this[h+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(h,B){if(h=h>>>0,!B)j0(h,2,this.length);return this[h]<<8|this[h+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(h,B){if(h=h>>>0,!B)j0(h,4,this.length);return(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216};_.prototype.readUint32BE=_.prototype.readUInt32BE=function(h,B){if(h=h>>>0,!B)j0(h,4,this.length);return this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])};_.prototype.readBigUInt64LE=i0(function(h){h=h>>>0,w2(h,"offset");let B=this[h],U=this[h+7];if(B===void 0||U===void 0)z2(h,this.length-8);let I=B+this[++h]*256+this[++h]*65536+this[++h]*16777216,X=this[++h]+this[++h]*256+this[++h]*65536+U*16777216;return BigInt(I)+(BigInt(X)<<BigInt(32))});_.prototype.readBigUInt64BE=i0(function(h){h=h>>>0,w2(h,"offset");let B=this[h],U=this[h+7];if(B===void 0||U===void 0)z2(h,this.length-8);let I=B*16777216+this[++h]*65536+this[++h]*256+this[++h],X=this[++h]*16777216+this[++h]*65536+this[++h]*256+U;return(BigInt(I)<<BigInt(32))+BigInt(X)});_.prototype.readIntLE=function(h,B,U){if(h=h>>>0,B=B>>>0,!U)j0(h,B,this.length);let I=this[h],X=1,Z=0;while(++Z<B&&(X*=256))I+=this[h+Z]*X;if(X*=128,I>=X)I-=Math.pow(2,8*B);return I};_.prototype.readIntBE=function(h,B,U){if(h=h>>>0,B=B>>>0,!U)j0(h,B,this.length);let I=B,X=1,Z=this[h+--I];while(I>0&&(X*=256))Z+=this[h+--I]*X;if(X*=128,Z>=X)Z-=Math.pow(2,8*B);return Z};_.prototype.readInt8=function(h,B){if(h=h>>>0,!B)j0(h,1,this.length);if(!(this[h]&128))return this[h];return(255-this[h]+1)*-1};_.prototype.readInt16LE=function(h,B){if(h=h>>>0,!B)j0(h,2,this.length);let U=this[h]|this[h+1]<<8;return U&32768?U|4294901760:U};_.prototype.readInt16BE=function(h,B){if(h=h>>>0,!B)j0(h,2,this.length);let U=this[h+1]|this[h]<<8;return U&32768?U|4294901760:U};_.prototype.readInt32LE=function(h,B){if(h=h>>>0,!B)j0(h,4,this.length);return this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24};_.prototype.readInt32BE=function(h,B){if(h=h>>>0,!B)j0(h,4,this.length);return this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]};_.prototype.readBigInt64LE=i0(function(h){h=h>>>0,w2(h,"offset");let B=this[h],U=this[h+7];if(B===void 0||U===void 0)z2(h,this.length-8);let I=this[h+4]+this[h+5]*256+this[h+6]*65536+(U<<24);return(BigInt(I)<<BigInt(32))+BigInt(B+this[++h]*256+this[++h]*65536+this[++h]*16777216)});_.prototype.readBigInt64BE=i0(function(h){h=h>>>0,w2(h,"offset");let B=this[h],U=this[h+7];if(B===void 0||U===void 0)z2(h,this.length-8);let I=(B<<24)+this[++h]*65536+this[++h]*256+this[++h];return(BigInt(I)<<BigInt(32))+BigInt(this[++h]*16777216+this[++h]*65536+this[++h]*256+U)});_.prototype.readFloatLE=function(h,B){if(h=h>>>0,!B)j0(h,4,this.length);return N2(this,h,!0,23,4)};_.prototype.readFloatBE=function(h,B){if(h=h>>>0,!B)j0(h,4,this.length);return N2(this,h,!1,23,4)};_.prototype.readDoubleLE=function(h,B){if(h=h>>>0,!B)j0(h,8,this.length);return N2(this,h,!0,52,8)};_.prototype.readDoubleBE=function(h,B){if(h=h>>>0,!B)j0(h,8,this.length);return N2(this,h,!1,52,8)};_.prototype.writeUintLE=_.prototype.writeUIntLE=function(h,B,U,I){if(h=+h,B=B>>>0,U=U>>>0,!I){let K=Math.pow(2,8*U)-1;x0(this,h,B,U,K,0)}let X=1,Z=0;this[B]=h&255;while(++Z<U&&(X*=256))this[B+Z]=h/X&255;return B+U};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(h,B,U,I){if(h=+h,B=B>>>0,U=U>>>0,!I){let K=Math.pow(2,8*U)-1;x0(this,h,B,U,K,0)}let X=U-1,Z=1;this[B+X]=h&255;while(--X>=0&&(Z*=256))this[B+X]=h/Z&255;return B+U};_.prototype.writeUint8=_.prototype.writeUInt8=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,1,255,0);return this[B]=h&255,B+1};_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,2,65535,0);return this[B]=h&255,this[B+1]=h>>>8,B+2};_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,2,65535,0);return this[B]=h>>>8,this[B+1]=h&255,B+2};_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,4,4294967295,0);return this[B+3]=h>>>24,this[B+2]=h>>>16,this[B+1]=h>>>8,this[B]=h&255,B+4};_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,4,4294967295,0);return this[B]=h>>>24,this[B+1]=h>>>16,this[B+2]=h>>>8,this[B+3]=h&255,B+4};_.prototype.writeBigUInt64LE=i0(function(h,B=0){return E1(this,h,B,BigInt(0),BigInt("0xffffffffffffffff"))});_.prototype.writeBigUInt64BE=i0(function(h,B=0){return W1(this,h,B,BigInt(0),BigInt("0xffffffffffffffff"))});_.prototype.writeIntLE=function(h,B,U,I){if(h=+h,B=B>>>0,!I){let q=Math.pow(2,8*U-1);x0(this,h,B,U,q-1,-q)}let X=0,Z=1,K=0;this[B]=h&255;while(++X<U&&(Z*=256)){if(h<0&&K===0&&this[B+X-1]!==0)K=1;this[B+X]=(h/Z>>0)-K&255}return B+U};_.prototype.writeIntBE=function(h,B,U,I){if(h=+h,B=B>>>0,!I){let q=Math.pow(2,8*U-1);x0(this,h,B,U,q-1,-q)}let X=U-1,Z=1,K=0;this[B+X]=h&255;while(--X>=0&&(Z*=256)){if(h<0&&K===0&&this[B+X+1]!==0)K=1;this[B+X]=(h/Z>>0)-K&255}return B+U};_.prototype.writeInt8=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,1,127,-128);if(h<0)h=255+h+1;return this[B]=h&255,B+1};_.prototype.writeInt16LE=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,2,32767,-32768);return this[B]=h&255,this[B+1]=h>>>8,B+2};_.prototype.writeInt16BE=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,2,32767,-32768);return this[B]=h>>>8,this[B+1]=h&255,B+2};_.prototype.writeInt32LE=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,4,2147483647,-2147483648);return this[B]=h&255,this[B+1]=h>>>8,this[B+2]=h>>>16,this[B+3]=h>>>24,B+4};_.prototype.writeInt32BE=function(h,B,U){if(h=+h,B=B>>>0,!U)x0(this,h,B,4,2147483647,-2147483648);if(h<0)h=4294967295+h+1;return this[B]=h>>>24,this[B+1]=h>>>16,this[B+2]=h>>>8,this[B+3]=h&255,B+4};_.prototype.writeBigInt64LE=i0(function(h,B=0){return E1(this,h,B,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});_.prototype.writeBigInt64BE=i0(function(h,B=0){return W1(this,h,B,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});_.prototype.writeFloatLE=function(h,B,U){return j1(this,h,B,!0,U)};_.prototype.writeFloatBE=function(h,B,U){return j1(this,h,B,!1,U)};_.prototype.writeDoubleLE=function(h,B,U){return A1(this,h,B,!0,U)};_.prototype.writeDoubleBE=function(h,B,U){return A1(this,h,B,!1,U)};_.prototype.copy=function(h,B,U,I){if(!_.isBuffer(h))throw TypeError("argument should be a Buffer");if(!U)U=0;if(!I&&I!==0)I=this.length;if(B>=h.length)B=h.length;if(!B)B=0;if(I>0&&I<U)I=U;if(I===U)return 0;if(h.length===0||this.length===0)return 0;if(B<0)throw RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw RangeError("Index out of range");if(I<0)throw RangeError("sourceEnd out of bounds");if(I>this.length)I=this.length;if(h.length-B<I-U)I=h.length-B+U;let X=I-U;if(this===h&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(B,U,I);else Uint8Array.prototype.set.call(h,this.subarray(U,I),B);return X};_.prototype.fill=function(h,B,U,I){if(typeof h==="string"){if(typeof B==="string")I=B,B=0,U=this.length;else if(typeof U==="string")I=U,U=this.length;if(I!==void 0&&typeof I!=="string")throw TypeError("encoding must be a string");if(typeof I==="string"&&!_.isEncoding(I))throw TypeError("Unknown encoding: "+I);if(h.length===1){let Z=h.charCodeAt(0);if(I==="utf8"&&Z<128||I==="latin1")h=Z}}else if(typeof h==="number")h=h&255;else if(typeof h==="boolean")h=Number(h);if(B<0||this.length<B||this.length<U)throw RangeError("Out of range index");if(U<=B)return this;if(B=B>>>0,U=U===void 0?this.length:U>>>0,!h)h=0;let X;if(typeof h==="number")for(X=B;X<U;++X)this[X]=h;else{let Z=_.isBuffer(h)?h:_.from(h,I),K=Z.length;if(K===0)throw TypeError('The value "'+h+'" is invalid for argument "value"');for(X=0;X<U-B;++X)this[X+B]=Z[X%K]}return this};o6=/[^+/0-9A-Za-z-_]/g;t6=function(){let w=Array(256);for(let h=0;h<16;++h){let B=h*16;for(let U=0;U<16;++U)w[B+U]="0123456789abcdef"[h]+"0123456789abcdef"[U]}return w}();h8=c2("resolveObjectURL"),B8=c2("isUtf8"),U8=c2("transcode"),I8=_});var Y2={};U1(Y2,{setMaxListeners:()=>y1,once:()=>S1,listenerCount:()=>c1,init:()=>p0,getMaxListeners:()=>v1,getEventListeners:()=>f1,default:()=>q8,captureRejectionSymbol:()=>P1,addAbortListener:()=>g1,EventEmitter:()=>p0});function _1(w,h){var{_events:B}=w;if(h[0]??=Error("Unhandled error."),!B)throw h[0];var U=B[T1];if(U)for(var I of x1.call(U))I.apply(w,h);var X=B.error;if(!X)throw h[0];for(var I of x1.call(X))I.apply(w,h);return!0}function Q8(w,h,B,U){h.then(void 0,function(I){queueMicrotask(()=>J8(w,I,B,U))})}function J8(w,h,B,U){if(typeof w[O1]==="function")w[O1](h,B,...U);else try{w[s0]=!1,w.emit("error",h)}finally{w[s0]=!0}}function R1(w,h,B){B.warned=!0;let U=Error(`Possible EventEmitter memory leak detected. ${B.length} ${String(h)} listeners added to [${w.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);U.name="MaxListenersExceededWarning",U.emitter=w,U.type=h,U.count=B.length,console.warn(U)}function k1(w,h,...B){this.removeListener(w,h),h.apply(this,B)}function S1(w,h,B){var U=B?.signal;if(u1(U,"options.signal"),U?.aborted)throw new u2(void 0,{cause:U?.reason});let{resolve:I,reject:X,promise:Z}=$newPromiseCapability(Promise),K=(G)=>{if(w.removeListener(h,q),U!=null)W2(U,"abort",z);X(G)},q=(...G)=>{if(typeof w.removeListener==="function")w.removeListener("error",K);if(U!=null)W2(U,"abort",z);I(G)};if(D1(w,h,q,{once:!0}),h!=="error"&&typeof w.once==="function")w.once("error",K);function z(){W2(w,h,q),W2(w,"error",K),X(new u2(void 0,{cause:U?.reason}))}if(U!=null)D1(U,"abort",z,{once:!0});return Z}function f1(w,h){return w.listeners(h)}function y1(w,...h){g2(w,"setMaxListeners",0);var B;if(h&&(B=h.length))for(let U=0;U<B;U++)h[U].setMaxListeners(w);else t0=w}function c1(w,h){return w.listenerCount(h)}function W2(w,h,B,U){if(typeof w.removeListener==="function")w.removeListener(h,B);else w.removeEventListener(h,B,U)}function D1(w,h,B,U){if(typeof w.on==="function")if(U.once)w.once(h,B);else w.on(h,B);else w.addEventListener(h,B,U)}function U2(w,h,B){let U=TypeError(`The "${w}" argument must be of type ${h}. Received ${B}`);return U.code="ERR_INVALID_ARG_TYPE",U}function K8(w,h,B){let U=RangeError(`The "${w}" argument is out of range. It must be ${h}. Received ${B}`);return U.code="ERR_OUT_OF_RANGE",U}function u1(w,h){if(w!==void 0&&(w===null||typeof w!=="object"||!("aborted"in w)))throw U2(h,"AbortSignal",w)}function g2(w,h,B,U){if(typeof w!=="number")throw U2(h,"number",w);if(B!=null&&w<B||U!=null&&w>U||(B!=null||U!=null)&&Number.isNaN(w))throw K8(h,`${B!=null?`>= ${B}`:""}${B!=null&&U!=null?" && ":""}${U!=null?`<= ${U}`:""}`,w)}function K2(w){if(typeof w!=="function")throw TypeError("The listener must be a function")}function Y8(w,h){if(typeof w!=="boolean")throw U2(h,"boolean",w)}function v1(w){return w?._maxListeners??t0}function g1(w,h){if(w===void 0)throw U2("signal","AbortSignal",w);if(u1(w,"signal"),typeof h!=="function")throw U2("listener","function",h);let B;if(w.aborted)queueMicrotask(()=>h());else w.addEventListener("abort",h,{__proto__:null,once:!0}),B=()=>{w.removeEventListener("abort",h)};return{__proto__:null,[Symbol.dispose](){B?.()}}}var v2,s0,T1,X8,Z8,O1,P1,x1,t0=10,p0=function(h){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[s0]=h?.captureRejections?Boolean(h?.captureRejections):C0[s0])this.emit=z8},C0,F8=function(h,...B){if(h==="error")return _1(this,B);var{_events:U}=this;if(U===void 0)return!1;var I=U[h];if(I===void 0)return!1;let X=I.length>1?I.slice():I;for(let Z=0,{length:K}=X;Z<K;Z++){let q=X[Z];switch(B.length){case 0:q.call(this);break;case 1:q.call(this,B[0]);break;case 2:q.call(this,B[0],B[1]);break;case 3:q.call(this,B[0],B[1],B[2]);break;default:q.apply(this,B);break}}return!0},z8=function(h,...B){if(h==="error")return _1(this,B);var{_events:U}=this;if(U===void 0)return!1;var I=U[h];if(I===void 0)return!1;let X=I.length>1?I.slice():I;for(let Z=0,{length:K}=X;Z<K;Z++){let q=X[Z],z;switch(B.length){case 0:z=q.call(this);break;case 1:z=q.call(this,B[0]);break;case 2:z=q.call(this,B[0],B[1]);break;case 3:z=q.call(this,B[0],B[1],B[2]);break;default:z=q.apply(this,B);break}if(z!==void 0&&typeof z?.then==="function"&&z.then===Promise.prototype.then)Q8(this,z,h,B)}return!0},u2,q8;var q2=I1(()=>{v2=Symbol.for,s0=Symbol("kCapture"),T1=v2("events.errorMonitor"),X8=Symbol("events.maxEventTargetListeners"),Z8=Symbol("events.maxEventTargetListenersWarned"),O1=v2("nodejs.rejection"),P1=v2("nodejs.rejection"),x1=Array.prototype.slice,C0=p0.prototype={};C0._events=void 0;C0._eventsCount=0;C0._maxListeners=void 0;C0.setMaxListeners=function(h){return g2(h,"setMaxListeners",0),this._maxListeners=h,this};C0.constructor=p0;C0.getMaxListeners=function(){return this?._maxListeners??t0};C0.emit=F8;C0.addListener=function(h,B){K2(B);var U=this._events;if(!U)U=this._events={__proto__:null},this._eventsCount=0;else if(U.newListener)this.emit("newListener",h,B.listener??B);var I=U[h];if(!I)U[h]=[B],this._eventsCount++;else{I.push(B);var X=this._maxListeners??t0;if(X>0&&I.length>X&&!I.warned)R1(this,h,I)}return this};C0.on=C0.addListener;C0.prependListener=function(h,B){K2(B);var U=this._events;if(!U)U=this._events={__proto__:null},this._eventsCount=0;else if(U.newListener)this.emit("newListener",h,B.listener??B);var I=U[h];if(!I)U[h]=[B],this._eventsCount++;else{I.unshift(B);var X=this._maxListeners??t0;if(X>0&&I.length>X&&!I.warned)R1(this,h,I)}return this};C0.once=function(h,B){K2(B);let U=k1.bind(this,h,B);return U.listener=B,this.addListener(h,U),this};C0.prependOnceListener=function(h,B){K2(B);let U=k1.bind(this,h,B);return U.listener=B,this.prependListener(h,U),this};C0.removeListener=function(h,B){K2(B);var{_events:U}=this;if(!U)return this;var I=U[h];if(!I)return this;var X=I.length;let Z=-1;for(let K=X-1;K>=0;K--)if(I[K]===B||I[K].listener===B){Z=K;break}if(Z<0)return this;if(Z===0)I.shift();else I.splice(Z,1);if(I.length===0)delete U[h],this._eventsCount--;return this};C0.off=C0.removeListener;C0.removeAllListeners=function(h){var{_events:B}=this;if(h&&B){if(B[h])delete B[h],this._eventsCount--}else this._events={__proto__:null};return this};C0.listeners=function(h){var{_events:B}=this;if(!B)return[];var U=B[h];if(!U)return[];return U.map((I)=>I.listener??I)};C0.rawListeners=function(h){var{_events:B}=this;if(!B)return[];var U=B[h];if(!U)return[];return U.slice()};C0.listenerCount=function(h){var{_events:B}=this;if(!B)return 0;return B[h]?.length??0};C0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};C0[s0]=!1;u2=class u2 extends Error{constructor(w="The operation was aborted",h=void 0){if(h!==void 0&&typeof h!=="object")throw U2("options","Object",h);super(w,h);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(p0,{captureRejections:{get(){return C0[s0]},set(w){Y8(w,"EventEmitter.captureRejections"),C0[s0]=w},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return t0},set:(w)=>{g2(w,"defaultMaxListeners",0),t0=w}},kMaxEventTargetListeners:{value:X8,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:Z8,enumerable:!1,configurable:!1,writable:!1}});Object.assign(p0,{once:S1,getEventListeners:f1,getMaxListeners:v1,setMaxListeners:y1,EventEmitter:p0,usingDomains:!1,captureRejectionSymbol:P1,errorMonitor:T1,addAbortListener:g1,init:p0,listenerCount:c1});q8=p0});var d2=N6((S8,o1)=>{var G0=(w,h)=>()=>(h||w((h={exports:{}}).exports,h),h.exports),N0=G0((w,h)=>{class B extends Error{constructor(U){if(!Array.isArray(U))throw TypeError(`Expected input to be an Array, got ${typeof U}`);let I="";for(let X=0;X<U.length;X++)I+=` ${U[X].stack}
|
|
2
|
-
`;super(I);this.name="AggregateError",this.errors=U}}h.exports={AggregateError:B,ArrayIsArray(U){return Array.isArray(U)},ArrayPrototypeIncludes(U,I){return U.includes(I)},ArrayPrototypeIndexOf(U,I){return U.indexOf(I)},ArrayPrototypeJoin(U,I){return U.join(I)},ArrayPrototypeMap(U,I){return U.map(I)},ArrayPrototypePop(U,I){return U.pop(I)},ArrayPrototypePush(U,I){return U.push(I)},ArrayPrototypeSlice(U,I,X){return U.slice(I,X)},Error,FunctionPrototypeCall(U,I,...X){return U.call(I,...X)},FunctionPrototypeSymbolHasInstance(U,I){return Function.prototype[Symbol.hasInstance].call(U,I)},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(U,I){return Object.defineProperties(U,I)},ObjectDefineProperty(U,I,X){return Object.defineProperty(U,I,X)},ObjectGetOwnPropertyDescriptor(U,I){return Object.getOwnPropertyDescriptor(U,I)},ObjectKeys(U){return Object.keys(U)},ObjectSetPrototypeOf(U,I){return Object.setPrototypeOf(U,I)},Promise,PromisePrototypeCatch(U,I){return U.catch(I)},PromisePrototypeThen(U,I,X){return U.then(I,X)},PromiseReject(U){return Promise.reject(U)},PromiseResolve(U){return Promise.resolve(U)},ReflectApply:Reflect.apply,RegExpPrototypeTest(U,I){return U.test(I)},SafeSet:Set,String,StringPrototypeSlice(U,I,X){return U.slice(I,X)},StringPrototypeToLowerCase(U){return U.toLowerCase()},StringPrototypeToUpperCase(U){return U.toUpperCase()},StringPrototypeTrim(U){return U.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(U,I,X){return U.set(I,X)},Boolean,Uint8Array}}),b1=G0((w,h)=>{h.exports={format(B,...U){return B.replace(/%([sdifj])/g,function(...[I,X]){let Z=U.shift();if(X==="f")return Z.toFixed(6);else if(X==="j")return JSON.stringify(Z);else if(X==="s"&&typeof Z==="object")return`${Z.constructor!==Object?Z.constructor.name:""} {}`.trim();else return Z.toString()})},inspect(B){switch(typeof B){case"string":if(B.includes("'")){if(!B.includes('"'))return`"${B}"`;else if(!B.includes("`")&&!B.includes("${"))return`\`${B}\``}return`'${B}'`;case"number":if(isNaN(B))return"NaN";else if(Object.is(B,-0))return String(B);return B;case"bigint":return`${String(B)}n`;case"boolean":case"undefined":return String(B);case"object":return"{}"}}}}),L0=G0((w,h)=>{var{format:B,inspect:U}=b1(),{AggregateError:I}=N0(),X=globalThis.AggregateError||I,Z=Symbol("kIsNodeError"),K=["string","function","number","object","Function","Object","boolean","bigint","symbol"],q=/^([A-Z][a-z0-9]*)+$/,z={};function G(j,F){if(!j)throw new z.ERR_INTERNAL_ASSERTION(F)}function C(j){let F="",N=j.length,A=j[0]==="-"?1:0;for(;N>=A+4;N-=3)F=`_${j.slice(N-3,N)}${F}`;return`${j.slice(0,N)}${F}`}function O(j,F,N){if(typeof F==="function")return G(F.length<=N.length,`Code: ${j}; The provided arguments length (${N.length}) does not match the required ones (${F.length}).`),F(...N);let A=(F.match(/%[dfijoOs]/g)||[]).length;if(G(A===N.length,`Code: ${j}; The provided arguments length (${N.length}) does not match the required ones (${A}).`),N.length===0)return F;return B(F,...N)}function x(j,F,N){if(!N)N=Error;class A extends N{constructor(...P){super(O(j,F,P))}toString(){return`${this.name} [${j}]: ${this.message}`}}Object.defineProperties(A.prototype,{name:{value:N.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${j}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),A.prototype.code=j,A.prototype[Z]=!0,z[j]=A}function l(j){let F="__node_internal_"+j.name;return Object.defineProperty(j,"name",{value:F}),j}function a(j,F){if(j&&F&&j!==F){if(Array.isArray(F.errors))return F.errors.push(j),F;let N=new X([F,j],F.message);return N.code=F.code,N}return j||F}class u extends Error{constructor(j="The operation was aborted",F=void 0){if(F!==void 0&&typeof F!=="object")throw new z.ERR_INVALID_ARG_TYPE("options","Object",F);super(j,F);this.code="ABORT_ERR",this.name="AbortError"}}x("ERR_ASSERTION","%s",Error),x("ERR_INVALID_ARG_TYPE",(j,F,N)=>{if(G(typeof j==="string","'name' must be a string"),!Array.isArray(F))F=[F];let A="The ";if(j.endsWith(" argument"))A+=`${j} `;else A+=`"${j}" ${j.includes(".")?"property":"argument"} `;A+="must be ";let P=[],s=[],B0=[];for(let t of F)if(G(typeof t==="string","All expected entries have to be of type string"),K.includes(t))P.push(t.toLowerCase());else if(q.test(t))s.push(t);else G(t!=="object",'The value "object" should be written as "Object"'),B0.push(t);if(s.length>0){let t=P.indexOf("object");if(t!==-1)P.splice(P,t,1),s.push("Object")}if(P.length>0){switch(P.length){case 1:A+=`of type ${P[0]}`;break;case 2:A+=`one of type ${P[0]} or ${P[1]}`;break;default:{let t=P.pop();A+=`one of type ${P.join(", ")}, or ${t}`}}if(s.length>0||B0.length>0)A+=" or "}if(s.length>0){switch(s.length){case 1:A+=`an instance of ${s[0]}`;break;case 2:A+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let t=s.pop();A+=`an instance of ${s.join(", ")}, or ${t}`}}if(B0.length>0)A+=" or "}switch(B0.length){case 0:break;case 1:if(B0[0].toLowerCase()!==B0[0])A+="an ";A+=`${B0[0]}`;break;case 2:A+=`one of ${B0[0]} or ${B0[1]}`;break;default:{let t=B0.pop();A+=`one of ${B0.join(", ")}, or ${t}`}}if(N==null)A+=`. Received ${N}`;else if(typeof N==="function"&&N.name)A+=`. Received function ${N.name}`;else if(typeof N==="object"){var H0;if((H0=N.constructor)!==null&&H0!==void 0&&H0.name)A+=`. Received an instance of ${N.constructor.name}`;else{let t=U(N,{depth:-1});A+=`. Received ${t}`}}else{let t=U(N,{colors:!1});if(t.length>25)t=`${t.slice(0,25)}...`;A+=`. Received type ${typeof N} (${t})`}return A},TypeError),x("ERR_INVALID_ARG_VALUE",(j,F,N="is invalid")=>{let A=U(F);if(A.length>128)A=A.slice(0,128)+"...";return`The ${j.includes(".")?"property":"argument"} '${j}' ${N}. Received ${A}`},TypeError),x("ERR_INVALID_RETURN_VALUE",(j,F,N)=>{var A;let P=N!==null&&N!==void 0&&(A=N.constructor)!==null&&A!==void 0&&A.name?`instance of ${N.constructor.name}`:`type ${typeof N}`;return`Expected ${j} to be returned from the "${F}" function but got ${P}.`},TypeError),x("ERR_MISSING_ARGS",(...j)=>{G(j.length>0,"At least one arg needs to be specified");let F,N=j.length;switch(j=(Array.isArray(j)?j:[j]).map((A)=>`"${A}"`).join(" or "),N){case 1:F+=`The ${j[0]} argument`;break;case 2:F+=`The ${j[0]} and ${j[1]} arguments`;break;default:{let A=j.pop();F+=`The ${j.join(", ")}, and ${A} arguments`}break}return`${F} must be specified`},TypeError),x("ERR_OUT_OF_RANGE",(j,F,N)=>{G(F,'Missing "range" argument');let A;if(Number.isInteger(N)&&Math.abs(N)>4294967296)A=C(String(N));else if(typeof N==="bigint"){A=String(N);let P=BigInt(2)**BigInt(32);if(N>P||N<-P)A=C(A);A+="n"}else A=U(N);return`The value of "${j}" is out of range. It must be ${F}. Received ${A}`},RangeError),x("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),x("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),x("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),x("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),x("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),x("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),x("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),x("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),x("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),x("ERR_STREAM_WRITE_AFTER_END","write after end",Error),x("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),h.exports={AbortError:u,aggregateTwoErrors:l(a),hideStackFrames:l,codes:z}}),H8=G0((w,h)=>{Object.defineProperty(w,"__esModule",{value:!0});var B=new WeakMap,U=new WeakMap;function I(D){let v=B.get(D);return console.assert(v!=null,"'this' is expected an Event object, but got",D),v}function X(D){if(D.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",D.passiveListener);return}if(!D.event.cancelable)return;if(D.canceled=!0,typeof D.event.preventDefault==="function")D.event.preventDefault()}function Z(D,v){B.set(this,{eventTarget:D,event:v,eventPhase:2,currentTarget:D,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:v.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let M=Object.keys(v);for(let V=0;V<M.length;++V){let L=M[V];if(!(L in this))Object.defineProperty(this,L,K(L))}}if(Z.prototype={get type(){return I(this).event.type},get target(){return I(this).eventTarget},get currentTarget(){return I(this).currentTarget},composedPath(){let D=I(this).currentTarget;if(D==null)return[];return[D]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return I(this).eventPhase},stopPropagation(){let D=I(this);if(D.stopped=!0,typeof D.event.stopPropagation==="function")D.event.stopPropagation()},stopImmediatePropagation(){let D=I(this);if(D.stopped=!0,D.immediateStopped=!0,typeof D.event.stopImmediatePropagation==="function")D.event.stopImmediatePropagation()},get bubbles(){return Boolean(I(this).event.bubbles)},get cancelable(){return Boolean(I(this).event.cancelable)},preventDefault(){X(I(this))},get defaultPrevented(){return I(this).canceled},get composed(){return Boolean(I(this).event.composed)},get timeStamp(){return I(this).timeStamp},get srcElement(){return I(this).eventTarget},get cancelBubble(){return I(this).stopped},set cancelBubble(D){if(!D)return;let v=I(this);if(v.stopped=!0,typeof v.event.cancelBubble==="boolean")v.event.cancelBubble=!0},get returnValue(){return!I(this).canceled},set returnValue(D){if(!D)X(I(this))},initEvent(){}},Object.defineProperty(Z.prototype,"constructor",{value:Z,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(Z.prototype,window.Event.prototype),U.set(window.Event.prototype,Z);function K(D){return{get(){return I(this).event[D]},set(v){I(this).event[D]=v},configurable:!0,enumerable:!0}}function q(D){return{value(){let v=I(this).event;return v[D].apply(v,arguments)},configurable:!0,enumerable:!0}}function z(D,v){let M=Object.keys(v);if(M.length===0)return D;function V(L,W){D.call(this,L,W)}V.prototype=Object.create(D.prototype,{constructor:{value:V,configurable:!0,writable:!0}});for(let L=0;L<M.length;++L){let W=M[L];if(!(W in D.prototype)){let b=typeof Object.getOwnPropertyDescriptor(v,W).value==="function";Object.defineProperty(V.prototype,W,b?q(W):K(W))}}return V}function G(D){if(D==null||D===Object.prototype)return Z;let v=U.get(D);if(v==null)v=z(G(Object.getPrototypeOf(D)),D),U.set(D,v);return v}function C(D,v){return new(G(Object.getPrototypeOf(v)))(D,v)}function O(D){return I(D).immediateStopped}function x(D,v){I(D).eventPhase=v}function l(D,v){I(D).currentTarget=v}function a(D,v){I(D).passiveListener=v}var u=new WeakMap,j=1,F=2,N=3;function A(D){return D!==null&&typeof D==="object"}function P(D){let v=u.get(D);if(v==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return v}function s(D){return{get(){let v=P(this).get(D);while(v!=null){if(v.listenerType===N)return v.listener;v=v.next}return null},set(v){if(typeof v!=="function"&&!A(v))v=null;let M=P(this),V=null,L=M.get(D);while(L!=null){if(L.listenerType===N)if(V!==null)V.next=L.next;else if(L.next!==null)M.set(D,L.next);else M.delete(D);else V=L;L=L.next}if(v!==null){let W={listener:v,listenerType:N,passive:!1,once:!1,next:null};if(V===null)M.set(D,W);else V.next=W}},configurable:!0,enumerable:!0}}function B0(D,v){Object.defineProperty(D,`on${v}`,s(v))}function H0(D){function v(){t.call(this)}v.prototype=Object.create(t.prototype,{constructor:{value:v,configurable:!0,writable:!0}});for(let M=0;M<D.length;++M)B0(v.prototype,D[M]);return v}function t(){if(this instanceof t){u.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return H0(arguments[0]);if(arguments.length>0){let D=Array(arguments.length);for(let v=0;v<arguments.length;++v)D[v]=arguments[v];return H0(D)}throw TypeError("Cannot call a class as a function")}if(t.prototype={addEventListener(D,v,M){if(v==null)return;if(typeof v!=="function"&&!A(v))throw TypeError("'listener' should be a function or an object.");let V=P(this),L=A(M),W=(L?Boolean(M.capture):Boolean(M))?j:F,b={listener:v,listenerType:W,passive:L&&Boolean(M.passive),once:L&&Boolean(M.once),next:null},e=V.get(D);if(e===void 0){V.set(D,b);return}let X0=null;while(e!=null){if(e.listener===v&&e.listenerType===W)return;X0=e,e=e.next}X0.next=b},removeEventListener(D,v,M){if(v==null)return;let V=P(this),L=(A(M)?Boolean(M.capture):Boolean(M))?j:F,W=null,b=V.get(D);while(b!=null){if(b.listener===v&&b.listenerType===L){if(W!==null)W.next=b.next;else if(b.next!==null)V.set(D,b.next);else V.delete(D);return}W=b,b=b.next}},dispatchEvent(D){if(D==null||typeof D.type!=="string")throw TypeError('"event.type" should be a string.');let v=P(this),M=D.type,V=v.get(M);if(V==null)return!0;let L=C(this,D),W=null;while(V!=null){if(V.once)if(W!==null)W.next=V.next;else if(V.next!==null)v.set(M,V.next);else v.delete(M);else W=V;if(a(L,V.passive?V.listener:null),typeof V.listener==="function")try{V.listener.call(this,L)}catch(b){if(typeof console<"u"&&typeof console.error==="function")console.error(b)}else if(V.listenerType!==N&&typeof V.listener.handleEvent==="function")V.listener.handleEvent(L);if(O(L))break;V=V.next}return a(L,null),x(L,0),l(L,null),!L.defaultPrevented}},Object.defineProperty(t.prototype,"constructor",{value:t,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(t.prototype,window.EventTarget.prototype);w.defineEventAttribute=B0,w.EventTarget=t,w.default=t,h.exports=t,h.exports.EventTarget=h.exports.default=t,h.exports.defineEventAttribute=B0}),H2=G0((w,h)=>{Object.defineProperty(w,"__esModule",{value:!0});var B=H8();class U extends B.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let G=Z.get(this);if(typeof G!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return G}}B.defineEventAttribute(U.prototype,"abort");function I(){let G=Object.create(U.prototype);return B.EventTarget.call(G),Z.set(G,!1),G}function X(G){if(Z.get(G)!==!1)return;Z.set(G,!0),G.dispatchEvent({type:"abort"})}var Z=new WeakMap;if(Object.defineProperties(U.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(U.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class K{constructor(){q.set(this,I())}get signal(){return z(this)}abort(){X(z(this))}}var q=new WeakMap;function z(G){let C=q.get(G);if(C==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${G===null?"null":typeof G}`);return C}if(Object.defineProperties(K.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(K.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});w.AbortController=K,w.AbortSignal=U,w.default=K,h.exports=K,h.exports.AbortController=h.exports.default=K,h.exports.AbortSignal=U}),D0=G0((w,h)=>{var B=(v0(),_0(u0)),{format:U,inspect:I}=b1(),{codes:{ERR_INVALID_ARG_TYPE:X}}=L0(),{kResistStopPropagation:Z,AggregateError:K,SymbolDispose:q}=N0(),z=globalThis.AbortSignal||H2().AbortSignal,G=globalThis.AbortController||H2().AbortController,C=Object.getPrototypeOf(async function(){}).constructor,O=globalThis.Blob||B.Blob,x=typeof O<"u"?function(j){return j instanceof O}:function(j){return!1},l=(u,j)=>{if(u!==void 0&&(u===null||typeof u!=="object"||!("aborted"in u)))throw new X(j,"AbortSignal",u)},a=(u,j)=>{if(typeof u!=="function")throw new X(j,"Function",u)};h.exports={AggregateError:K,kEmptyObject:Object.freeze({}),once(u){let j=!1;return function(...F){if(j)return;j=!0,u.apply(this,F)}},createDeferredPromise:function(){let u,j;return{promise:new Promise((F,N)=>{u=F,j=N}),resolve:u,reject:j}},promisify(u){return new Promise((j,F)=>{u((N,...A)=>{if(N)return F(N);return j(...A)})})},debuglog(){return function(){}},format:U,inspect:I,types:{isAsyncFunction(u){return u instanceof C},isArrayBufferView(u){return ArrayBuffer.isView(u)}},isBlob:x,deprecate(u,j){return u},addAbortListener:(q2(),_0(Y2)).addAbortListener||function(j,F){if(j===void 0)throw new X("signal","AbortSignal",j);l(j,"signal"),a(F,"listener");let N;if(j.aborted)queueMicrotask(()=>F());else j.addEventListener("abort",F,{__proto__:null,once:!0,[Z]:!0}),N=()=>{j.removeEventListener("abort",F)};return{__proto__:null,[q](){var A;(A=N)===null||A===void 0||A()}}},AbortSignalAny:z.any||function(j){if(j.length===1)return j[0];let F=new G,N=()=>F.abort();return j.forEach((A)=>{l(A,"signals"),A.addEventListener("abort",N,{once:!0})}),F.signal.addEventListener("abort",()=>{j.forEach((A)=>A.removeEventListener("abort",N))},{once:!0}),F.signal}},h.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),$2=G0((w,h)=>{var{ArrayIsArray:B,ArrayPrototypeIncludes:U,ArrayPrototypeJoin:I,ArrayPrototypeMap:X,NumberIsInteger:Z,NumberIsNaN:K,NumberMAX_SAFE_INTEGER:q,NumberMIN_SAFE_INTEGER:z,NumberParseInt:G,ObjectPrototypeHasOwnProperty:C,RegExpPrototypeExec:O,String:x,StringPrototypeToUpperCase:l,StringPrototypeTrim:a}=N0(),{hideStackFrames:u,codes:{ERR_SOCKET_BAD_PORT:j,ERR_INVALID_ARG_TYPE:F,ERR_INVALID_ARG_VALUE:N,ERR_OUT_OF_RANGE:A,ERR_UNKNOWN_SIGNAL:P}}=L0(),{normalizeEncoding:s}=D0(),{isAsyncFunction:B0,isArrayBufferView:H0}=D0().types,t={};function D($){return $===($|0)}function v($){return $===$>>>0}var M=/^[0-7]+$/,V="must be a 32-bit unsigned integer or an octal string";function L($,y,r){if(typeof $>"u")$=r;if(typeof $==="string"){if(O(M,$)===null)throw new N(y,$,V);$=G($,8)}return e($,y),$}var W=u(($,y,r=z,g=q)=>{if(typeof $!=="number")throw new F(y,"number",$);if(!Z($))throw new A(y,"an integer",$);if($<r||$>g)throw new A(y,`>= ${r} && <= ${g}`,$)}),b=u(($,y,r=-2147483648,g=2147483647)=>{if(typeof $!=="number")throw new F(y,"number",$);if(!Z($))throw new A(y,"an integer",$);if($<r||$>g)throw new A(y,`>= ${r} && <= ${g}`,$)}),e=u(($,y,r=!1)=>{if(typeof $!=="number")throw new F(y,"number",$);if(!Z($))throw new A(y,"an integer",$);let g=r?1:0,Q0=4294967295;if($<g||$>Q0)throw new A(y,`>= ${g} && <= ${Q0}`,$)});function X0($,y){if(typeof $!=="string")throw new F(y,"string",$)}function Y0($,y,r=void 0,g){if(typeof $!=="number")throw new F(y,"number",$);if(r!=null&&$<r||g!=null&&$>g||(r!=null||g!=null)&&K($))throw new A(y,`${r!=null?`>= ${r}`:""}${r!=null&&g!=null?" && ":""}${g!=null?`<= ${g}`:""}`,$)}var S=u(($,y,r)=>{if(!U(r,$)){let g="must be one of: "+I(X(r,(Q0)=>typeof Q0==="string"?`'${Q0}'`:x(Q0)),", ");throw new N(y,$,g)}});function Z0($,y){if(typeof $!=="boolean")throw new F(y,"boolean",$)}function Y($,y,r){return $==null||!C($,y)?r:$[y]}var c=u(($,y,r=null)=>{let g=Y(r,"allowArray",!1),Q0=Y(r,"allowFunction",!1);if(!Y(r,"nullable",!1)&&$===null||!g&&B($)||typeof $!=="object"&&(!Q0||typeof $!=="function"))throw new F(y,"Object",$)}),h0=u(($,y)=>{if($!=null&&typeof $!=="object"&&typeof $!=="function")throw new F(y,"a dictionary",$)}),R=u(($,y,r=0)=>{if(!B($))throw new F(y,"Array",$);if($.length<r){let g=`must be longer than ${r}`;throw new N(y,$,g)}});function I0($,y){R($,y);for(let r=0;r<$.length;r++)X0($[r],`${y}[${r}]`)}function J0($,y){R($,y);for(let r=0;r<$.length;r++)Z0($[r],`${y}[${r}]`)}function q0($,y){R($,y);for(let r=0;r<$.length;r++){let g=$[r],Q0=`${y}[${r}]`;if(g==null)throw new F(Q0,"AbortSignal",g);z0(g,Q0)}}function K0($,y="signal"){if(X0($,y),t[$]===void 0){if(t[l($)]!==void 0)throw new P($+" (signals must use all capital letters)");throw new P($)}}var k=u(($,y="buffer")=>{if(!H0($))throw new F(y,["Buffer","TypedArray","DataView"],$)});function f($,y){let r=s(y),g=$.length;if(r==="hex"&&g%2!==0)throw new N("encoding",y,`is invalid for data of length ${g}`)}function o($,y="Port",r=!0){if(typeof $!=="number"&&typeof $!=="string"||typeof $==="string"&&a($).length===0||+$!==+$>>>0||$>65535||$===0&&!r)throw new j(y,$,r);return $|0}var z0=u(($,y)=>{if($!==void 0&&($===null||typeof $!=="object"||!("aborted"in $)))throw new F(y,"AbortSignal",$)}),F0=u(($,y)=>{if(typeof $!=="function")throw new F(y,"Function",$)}),H=u(($,y)=>{if(typeof $!=="function"||B0($))throw new F(y,"Function",$)}),E=u(($,y)=>{if($!==void 0)throw new F(y,"undefined",$)});function T($,y,r){if(!U(r,$))throw new F(y,`('${I(r,"|")}')`,$)}var p=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function m($,y){if(typeof $>"u"||!O(p,$))throw new N(y,$,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function i($){if(typeof $==="string")return m($,"hints"),$;else if(B($)){let y=$.length,r="";if(y===0)return r;for(let g=0;g<y;g++){let Q0=$[g];if(m(Q0,"hints"),r+=Q0,g!==y-1)r+=", "}return r}throw new N("hints",$,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}h.exports={isInt32:D,isUint32:v,parseFileMode:L,validateArray:R,validateStringArray:I0,validateBooleanArray:J0,validateAbortSignalArray:q0,validateBoolean:Z0,validateBuffer:k,validateDictionary:h0,validateEncoding:f,validateFunction:F0,validateInt32:b,validateInteger:W,validateNumber:Y0,validateObject:c,validateOneOf:S,validatePlainFunction:H,validatePort:o,validateSignalName:K0,validateString:X0,validateUint32:e,validateUndefined:E,validateUnion:T,validateAbortSignal:z0,validateLinkHeaderValue:i}}),e0=G0((w,h)=>{h.exports=globalThis.process}),b0=G0((w,h)=>{var{SymbolAsyncIterator:B,SymbolIterator:U,SymbolFor:I}=N0(),X=I("nodejs.stream.destroyed"),Z=I("nodejs.stream.errored"),K=I("nodejs.stream.readable"),q=I("nodejs.stream.writable"),z=I("nodejs.stream.disturbed"),G=I("nodejs.webstream.isClosedPromise"),C=I("nodejs.webstream.controllerErrorFunction");function O(Y,c=!1){var h0;return!!(Y&&typeof Y.pipe==="function"&&typeof Y.on==="function"&&(!c||typeof Y.pause==="function"&&typeof Y.resume==="function")&&(!Y._writableState||((h0=Y._readableState)===null||h0===void 0?void 0:h0.readable)!==!1)&&(!Y._writableState||Y._readableState))}function x(Y){var c;return!!(Y&&typeof Y.write==="function"&&typeof Y.on==="function"&&(!Y._readableState||((c=Y._writableState)===null||c===void 0?void 0:c.writable)!==!1))}function l(Y){return!!(Y&&typeof Y.pipe==="function"&&Y._readableState&&typeof Y.on==="function"&&typeof Y.write==="function")}function a(Y){return Y&&(Y._readableState||Y._writableState||typeof Y.write==="function"&&typeof Y.on==="function"||typeof Y.pipe==="function"&&typeof Y.on==="function")}function u(Y){return!!(Y&&!a(Y)&&typeof Y.pipeThrough==="function"&&typeof Y.getReader==="function"&&typeof Y.cancel==="function")}function j(Y){return!!(Y&&!a(Y)&&typeof Y.getWriter==="function"&&typeof Y.abort==="function")}function F(Y){return!!(Y&&!a(Y)&&typeof Y.readable==="object"&&typeof Y.writable==="object")}function N(Y){return u(Y)||j(Y)||F(Y)}function A(Y,c){if(Y==null)return!1;if(c===!0)return typeof Y[B]==="function";if(c===!1)return typeof Y[U]==="function";return typeof Y[B]==="function"||typeof Y[U]==="function"}function P(Y){if(!a(Y))return null;let{_writableState:c,_readableState:h0}=Y,R=c||h0;return!!(Y.destroyed||Y[X]||R!==null&&R!==void 0&&R.destroyed)}function s(Y){if(!x(Y))return null;if(Y.writableEnded===!0)return!0;let c=Y._writableState;if(c!==null&&c!==void 0&&c.errored)return!1;if(typeof(c===null||c===void 0?void 0:c.ended)!=="boolean")return null;return c.ended}function B0(Y,c){if(!x(Y))return null;if(Y.writableFinished===!0)return!0;let h0=Y._writableState;if(h0!==null&&h0!==void 0&&h0.errored)return!1;if(typeof(h0===null||h0===void 0?void 0:h0.finished)!=="boolean")return null;return!!(h0.finished||c===!1&&h0.ended===!0&&h0.length===0)}function H0(Y){if(!O(Y))return null;if(Y.readableEnded===!0)return!0;let c=Y._readableState;if(!c||c.errored)return!1;if(typeof(c===null||c===void 0?void 0:c.ended)!=="boolean")return null;return c.ended}function t(Y,c){if(!O(Y))return null;let h0=Y._readableState;if(h0!==null&&h0!==void 0&&h0.errored)return!1;if(typeof(h0===null||h0===void 0?void 0:h0.endEmitted)!=="boolean")return null;return!!(h0.endEmitted||c===!1&&h0.ended===!0&&h0.length===0)}function D(Y){if(Y&&Y[K]!=null)return Y[K];if(typeof(Y===null||Y===void 0?void 0:Y.readable)!=="boolean")return null;if(P(Y))return!1;return O(Y)&&Y.readable&&!t(Y)}function v(Y){if(Y&&Y[q]!=null)return Y[q];if(typeof(Y===null||Y===void 0?void 0:Y.writable)!=="boolean")return null;if(P(Y))return!1;return x(Y)&&Y.writable&&!s(Y)}function M(Y,c){if(!a(Y))return null;if(P(Y))return!0;if((c===null||c===void 0?void 0:c.readable)!==!1&&D(Y))return!1;if((c===null||c===void 0?void 0:c.writable)!==!1&&v(Y))return!1;return!0}function V(Y){var c,h0;if(!a(Y))return null;if(Y.writableErrored)return Y.writableErrored;return(c=(h0=Y._writableState)===null||h0===void 0?void 0:h0.errored)!==null&&c!==void 0?c:null}function L(Y){var c,h0;if(!a(Y))return null;if(Y.readableErrored)return Y.readableErrored;return(c=(h0=Y._readableState)===null||h0===void 0?void 0:h0.errored)!==null&&c!==void 0?c:null}function W(Y){if(!a(Y))return null;if(typeof Y.closed==="boolean")return Y.closed;let{_writableState:c,_readableState:h0}=Y;if(typeof(c===null||c===void 0?void 0:c.closed)==="boolean"||typeof(h0===null||h0===void 0?void 0:h0.closed)==="boolean")return(c===null||c===void 0?void 0:c.closed)||(h0===null||h0===void 0?void 0:h0.closed);if(typeof Y._closed==="boolean"&&b(Y))return Y._closed;return null}function b(Y){return typeof Y._closed==="boolean"&&typeof Y._defaultKeepAlive==="boolean"&&typeof Y._removedConnection==="boolean"&&typeof Y._removedContLen==="boolean"}function e(Y){return typeof Y._sent100==="boolean"&&b(Y)}function X0(Y){var c;return typeof Y._consuming==="boolean"&&typeof Y._dumped==="boolean"&&((c=Y.req)===null||c===void 0?void 0:c.upgradeOrConnect)===void 0}function Y0(Y){if(!a(Y))return null;let{_writableState:c,_readableState:h0}=Y,R=c||h0;return!R&&e(Y)||!!(R&&R.autoDestroy&&R.emitClose&&R.closed===!1)}function S(Y){var c;return!!(Y&&((c=Y[z])!==null&&c!==void 0?c:Y.readableDidRead||Y.readableAborted))}function Z0(Y){var c,h0,R,I0,J0,q0,K0,k,f,o;return!!(Y&&((c=(h0=(R=(I0=(J0=(q0=Y[Z])!==null&&q0!==void 0?q0:Y.readableErrored)!==null&&J0!==void 0?J0:Y.writableErrored)!==null&&I0!==void 0?I0:(K0=Y._readableState)===null||K0===void 0?void 0:K0.errorEmitted)!==null&&R!==void 0?R:(k=Y._writableState)===null||k===void 0?void 0:k.errorEmitted)!==null&&h0!==void 0?h0:(f=Y._readableState)===null||f===void 0?void 0:f.errored)!==null&&c!==void 0?c:(o=Y._writableState)===null||o===void 0?void 0:o.errored))}h.exports={isDestroyed:P,kIsDestroyed:X,isDisturbed:S,kIsDisturbed:z,isErrored:Z0,kIsErrored:Z,isReadable:D,kIsReadable:K,kIsClosedPromise:G,kControllerErrorFunction:C,kIsWritable:q,isClosed:W,isDuplexNodeStream:l,isFinished:M,isIterable:A,isReadableNodeStream:O,isReadableStream:u,isReadableEnded:H0,isReadableFinished:t,isReadableErrored:L,isNodeStream:a,isWebStream:N,isWritable:v,isWritableNodeStream:x,isWritableStream:j,isWritableEnded:s,isWritableFinished:B0,isWritableErrored:V,isServerRequest:X0,isServerResponse:e,willEmitClose:Y0,isTransformStream:F}}),d0=G0((w,h)=>{var B=e0(),{AbortError:U,codes:I}=L0(),{ERR_INVALID_ARG_TYPE:X,ERR_STREAM_PREMATURE_CLOSE:Z}=I,{kEmptyObject:K,once:q}=D0(),{validateAbortSignal:z,validateFunction:G,validateObject:C,validateBoolean:O}=$2(),{Promise:x,PromisePrototypeThen:l,SymbolDispose:a}=N0(),{isClosed:u,isReadable:j,isReadableNodeStream:F,isReadableStream:N,isReadableFinished:A,isReadableErrored:P,isWritable:s,isWritableNodeStream:B0,isWritableStream:H0,isWritableFinished:t,isWritableErrored:D,isNodeStream:v,willEmitClose:M,kIsClosedPromise:V}=b0(),L;function W(S){return S.setHeader&&typeof S.abort==="function"}var b=()=>{};function e(S,Z0,Y){var c,h0;if(arguments.length===2)Y=Z0,Z0=K;else if(Z0==null)Z0=K;else C(Z0,"options");if(G(Y,"callback"),z(Z0.signal,"options.signal"),Y=q(Y),N(S)||H0(S))return X0(S,Z0,Y);if(!v(S))throw new X("stream",["ReadableStream","WritableStream","Stream"],S);let R=(c=Z0.readable)!==null&&c!==void 0?c:F(S),I0=(h0=Z0.writable)!==null&&h0!==void 0?h0:B0(S),J0=S._writableState,q0=S._readableState,K0=()=>{if(!S.writable)o()},k=M(S)&&F(S)===R&&B0(S)===I0,f=t(S,!1),o=()=>{if(f=!0,S.destroyed)k=!1;if(k&&(!S.readable||R))return;if(!R||z0)Y.call(S)},z0=A(S,!1),F0=()=>{if(z0=!0,S.destroyed)k=!1;if(k&&(!S.writable||I0))return;if(!I0||f)Y.call(S)},H=($)=>{Y.call(S,$)},E=u(S),T=()=>{E=!0;let $=D(S)||P(S);if($&&typeof $!=="boolean")return Y.call(S,$);if(R&&!z0&&F(S,!0)){if(!A(S,!1))return Y.call(S,new Z)}if(I0&&!f){if(!t(S,!1))return Y.call(S,new Z)}Y.call(S)},p=()=>{E=!0;let $=D(S)||P(S);if($&&typeof $!=="boolean")return Y.call(S,$);Y.call(S)},m=()=>{S.req.on("finish",o)};if(W(S)){if(S.on("complete",o),!k)S.on("abort",T);if(S.req)m();else S.on("request",m)}else if(I0&&!J0)S.on("end",K0),S.on("close",K0);if(!k&&typeof S.aborted==="boolean")S.on("aborted",T);if(S.on("end",F0),S.on("finish",o),Z0.error!==!1)S.on("error",H);if(S.on("close",T),E)B.nextTick(T);else if(J0!==null&&J0!==void 0&&J0.errorEmitted||q0!==null&&q0!==void 0&&q0.errorEmitted){if(!k)B.nextTick(p)}else if(!R&&(!k||j(S))&&(f||s(S)===!1))B.nextTick(p);else if(!I0&&(!k||s(S))&&(z0||j(S)===!1))B.nextTick(p);else if(q0&&S.req&&S.aborted)B.nextTick(p);let i=()=>{if(Y=b,S.removeListener("aborted",T),S.removeListener("complete",o),S.removeListener("abort",T),S.removeListener("request",m),S.req)S.req.removeListener("finish",o);S.removeListener("end",K0),S.removeListener("close",K0),S.removeListener("finish",o),S.removeListener("end",F0),S.removeListener("error",H),S.removeListener("close",T)};if(Z0.signal&&!E){let $=()=>{let y=Y;i(),y.call(S,new U(void 0,{cause:Z0.signal.reason}))};if(Z0.signal.aborted)B.nextTick($);else{L=L||D0().addAbortListener;let y=L(Z0.signal,$),r=Y;Y=q((...g)=>{y[a](),r.apply(S,g)})}}return i}function X0(S,Z0,Y){let c=!1,h0=b;if(Z0.signal)if(h0=()=>{c=!0,Y.call(S,new U(void 0,{cause:Z0.signal.reason}))},Z0.signal.aborted)B.nextTick(h0);else{L=L||D0().addAbortListener;let I0=L(Z0.signal,h0),J0=Y;Y=q((...q0)=>{I0[a](),J0.apply(S,q0)})}let R=(...I0)=>{if(!c)B.nextTick(()=>Y.apply(S,I0))};return l(S[V].promise,R,R),b}function Y0(S,Z0){var Y;let c=!1;if(Z0===null)Z0=K;if((Y=Z0)!==null&&Y!==void 0&&Y.cleanup)O(Z0.cleanup,"cleanup"),c=Z0.cleanup;return new x((h0,R)=>{let I0=e(S,Z0,(J0)=>{if(c)I0();if(J0)R(J0);else h0()})})}h.exports=e,h.exports.finished=Y0}),I2=G0((w,h)=>{var B=e0(),{aggregateTwoErrors:U,codes:{ERR_MULTIPLE_CALLBACK:I},AbortError:X}=L0(),{Symbol:Z}=N0(),{kIsDestroyed:K,isDestroyed:q,isFinished:z,isServerRequest:G}=b0(),C=Z("kDestroy"),O=Z("kConstruct");function x(M,V,L){if(M){if(M.stack,V&&!V.errored)V.errored=M;if(L&&!L.errored)L.errored=M}}function l(M,V){let L=this._readableState,W=this._writableState,b=W||L;if(W!==null&&W!==void 0&&W.destroyed||L!==null&&L!==void 0&&L.destroyed){if(typeof V==="function")V();return this}if(x(M,W,L),W)W.destroyed=!0;if(L)L.destroyed=!0;if(!b.constructed)this.once(C,function(e){a(this,U(e,M),V)});else a(this,M,V);return this}function a(M,V,L){let W=!1;function b(e){if(W)return;W=!0;let{_readableState:X0,_writableState:Y0}=M;if(x(e,Y0,X0),Y0)Y0.closed=!0;if(X0)X0.closed=!0;if(typeof L==="function")L(e);if(e)B.nextTick(u,M,e);else B.nextTick(j,M)}try{M._destroy(V||null,b)}catch(e){b(e)}}function u(M,V){F(M,V),j(M)}function j(M){let{_readableState:V,_writableState:L}=M;if(L)L.closeEmitted=!0;if(V)V.closeEmitted=!0;if(L!==null&&L!==void 0&&L.emitClose||V!==null&&V!==void 0&&V.emitClose)M.emit("close")}function F(M,V){let{_readableState:L,_writableState:W}=M;if(W!==null&&W!==void 0&&W.errorEmitted||L!==null&&L!==void 0&&L.errorEmitted)return;if(W)W.errorEmitted=!0;if(L)L.errorEmitted=!0;M.emit("error",V)}function N(){let M=this._readableState,V=this._writableState;if(M)M.constructed=!0,M.closed=!1,M.closeEmitted=!1,M.destroyed=!1,M.errored=null,M.errorEmitted=!1,M.reading=!1,M.ended=M.readable===!1,M.endEmitted=M.readable===!1;if(V)V.constructed=!0,V.destroyed=!1,V.closed=!1,V.closeEmitted=!1,V.errored=null,V.errorEmitted=!1,V.finalCalled=!1,V.prefinished=!1,V.ended=V.writable===!1,V.ending=V.writable===!1,V.finished=V.writable===!1}function A(M,V,L){let{_readableState:W,_writableState:b}=M;if(b!==null&&b!==void 0&&b.destroyed||W!==null&&W!==void 0&&W.destroyed)return this;if(W!==null&&W!==void 0&&W.autoDestroy||b!==null&&b!==void 0&&b.autoDestroy)M.destroy(V);else if(V){if(V.stack,b&&!b.errored)b.errored=V;if(W&&!W.errored)W.errored=V;if(L)B.nextTick(F,M,V);else F(M,V)}}function P(M,V){if(typeof M._construct!=="function")return;let{_readableState:L,_writableState:W}=M;if(L)L.constructed=!1;if(W)W.constructed=!1;if(M.once(O,V),M.listenerCount(O)>1)return;B.nextTick(s,M)}function s(M){let V=!1;function L(W){if(V){A(M,W!==null&&W!==void 0?W:new I);return}V=!0;let{_readableState:b,_writableState:e}=M,X0=e||b;if(b)b.constructed=!0;if(e)e.constructed=!0;if(X0.destroyed)M.emit(C,W);else if(W)A(M,W,!0);else B.nextTick(B0,M)}try{M._construct((W)=>{B.nextTick(L,W)})}catch(W){B.nextTick(L,W)}}function B0(M){M.emit(O)}function H0(M){return(M===null||M===void 0?void 0:M.setHeader)&&typeof M.abort==="function"}function t(M){M.emit("close")}function D(M,V){M.emit("error",V),B.nextTick(t,M)}function v(M,V){if(!M||q(M))return;if(!V&&!z(M))V=new X;if(G(M))M.socket=null,M.destroy(V);else if(H0(M))M.abort();else if(H0(M.req))M.req.abort();else if(typeof M.destroy==="function")M.destroy(V);else if(typeof M.close==="function")M.close();else if(V)B.nextTick(D,M,V);else B.nextTick(t,M);if(!M.destroyed)M[K]=!0}h.exports={construct:P,destroyer:v,destroy:l,undestroy:N,errorOrDestroy:A}}),b2=G0((w,h)=>{var{ArrayIsArray:B,ObjectSetPrototypeOf:U}=N0(),{EventEmitter:I}=(q2(),_0(Y2));function X(K){I.call(this,K)}U(X.prototype,I.prototype),U(X,I),X.prototype.pipe=function(K,q){let z=this;function G(j){if(K.writable&&K.write(j)===!1&&z.pause)z.pause()}z.on("data",G);function C(){if(z.readable&&z.resume)z.resume()}if(K.on("drain",C),!K._isStdio&&(!q||q.end!==!1))z.on("end",x),z.on("close",l);let O=!1;function x(){if(O)return;O=!0,K.end()}function l(){if(O)return;if(O=!0,typeof K.destroy==="function")K.destroy()}function a(j){if(u(),I.listenerCount(this,"error")===0)this.emit("error",j)}Z(z,"error",a),Z(K,"error",a);function u(){z.removeListener("data",G),K.removeListener("drain",C),z.removeListener("end",x),z.removeListener("close",l),z.removeListener("error",a),K.removeListener("error",a),z.removeListener("end",u),z.removeListener("close",u),K.removeListener("close",u)}return z.on("end",u),z.on("close",u),K.on("close",u),K.emit("pipe",z),K};function Z(K,q,z){if(typeof K.prependListener==="function")return K.prependListener(q,z);if(!K._events||!K._events[q])K.on(q,z);else if(B(K._events[q]))K._events[q].unshift(z);else K._events[q]=[z,K._events[q]]}h.exports={Stream:X,prependListener:Z}}),V2=G0((w,h)=>{var{SymbolDispose:B}=N0(),{AbortError:U,codes:I}=L0(),{isNodeStream:X,isWebStream:Z,kControllerErrorFunction:K}=b0(),q=d0(),{ERR_INVALID_ARG_TYPE:z}=I,G,C=(O,x)=>{if(typeof O!=="object"||!("aborted"in O))throw new z(x,"AbortSignal",O)};h.exports.addAbortSignal=function(x,l){if(C(x,"signal"),!X(l)&&!Z(l))throw new z("stream",["ReadableStream","WritableStream","Stream"],l);return h.exports.addAbortSignalNoValidate(x,l)},h.exports.addAbortSignalNoValidate=function(O,x){if(typeof O!=="object"||!("aborted"in O))return x;let l=X(x)?()=>{x.destroy(new U(void 0,{cause:O.reason}))}:()=>{x[K](new U(void 0,{cause:O.reason}))};if(O.aborted)l();else{G=G||D0().addAbortListener;let a=G(O,l);q(x,a[B])}return x}}),$8=G0((w,h)=>{var{StringPrototypeSlice:B,SymbolIterator:U,TypedArrayPrototypeSet:I,Uint8Array:X}=N0(),{Buffer:Z}=(v0(),_0(u0)),{inspect:K}=D0();h.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(z){let G={data:z,next:null};if(this.length>0)this.tail.next=G;else this.head=G;this.tail=G,++this.length}unshift(z){let G={data:z,next:this.head};if(this.length===0)this.tail=G;this.head=G,++this.length}shift(){if(this.length===0)return;let z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z}clear(){this.head=this.tail=null,this.length=0}join(z){if(this.length===0)return"";let G=this.head,C=""+G.data;while((G=G.next)!==null)C+=z+G.data;return C}concat(z){if(this.length===0)return Z.alloc(0);let G=Z.allocUnsafe(z>>>0),C=this.head,O=0;while(C)I(G,C.data,O),O+=C.data.length,C=C.next;return G}consume(z,G){let C=this.head.data;if(z<C.length){let O=C.slice(0,z);return this.head.data=C.slice(z),O}if(z===C.length)return this.shift();return G?this._getString(z):this._getBuffer(z)}first(){return this.head.data}*[U](){for(let z=this.head;z;z=z.next)yield z.data}_getString(z){let G="",C=this.head,O=0;do{let x=C.data;if(z>x.length)G+=x,z-=x.length;else{if(z===x.length)if(G+=x,++O,C.next)this.head=C.next;else this.head=this.tail=null;else G+=B(x,0,z),this.head=C,C.data=B(x,z);break}++O}while((C=C.next)!==null);return this.length-=O,G}_getBuffer(z){let G=Z.allocUnsafe(z),C=z,O=this.head,x=0;do{let l=O.data;if(z>l.length)I(G,l,C-z),z-=l.length;else{if(z===l.length)if(I(G,l,C-z),++x,O.next)this.head=O.next;else this.head=this.tail=null;else I(G,new X(l.buffer,l.byteOffset,z),C-z),this.head=O,O.data=l.slice(z);break}++x}while((O=O.next)!==null);return this.length-=x,G}[Symbol.for("nodejs.util.inspect.custom")](z,G){return K(this,{...G,depth:0,customInspect:!1})}}}),j2=G0((w,h)=>{var{MathFloor:B,NumberIsInteger:U}=N0(),{validateInteger:I}=$2(),{ERR_INVALID_ARG_VALUE:X}=L0().codes,Z=16384,K=16;function q(O,x,l){return O.highWaterMark!=null?O.highWaterMark:x?O[l]:null}function z(O){return O?K:Z}function G(O,x){if(I(x,"value",0),O)K=x;else Z=x}function C(O,x,l,a){let u=q(x,a,l);if(u!=null){if(!U(u)||u<0){let j=a?`options.${l}`:"options.highWaterMark";throw new X(j,u)}return B(u)}return z(O.objectMode)}h.exports={getHighWaterMark:C,getDefaultHighWaterMark:z,setDefaultHighWaterMark:G}}),G8=G0((w,h)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var B=(v0(),_0(u0)),U=B.Buffer;function I(Z,K){for(var q in Z)K[q]=Z[q]}if(U.from&&U.alloc&&U.allocUnsafe&&U.allocUnsafeSlow)h.exports=B;else I(B,w),w.Buffer=X;function X(Z,K,q){return U(Z,K,q)}X.prototype=Object.create(U.prototype),I(U,X),X.from=function(Z,K,q){if(typeof Z==="number")throw TypeError("Argument must not be a number");return U(Z,K,q)},X.alloc=function(Z,K,q){if(typeof Z!=="number")throw TypeError("Argument must be a number");var z=U(Z);if(K!==void 0)if(typeof q==="string")z.fill(K,q);else z.fill(K);else z.fill(0);return z},X.allocUnsafe=function(Z){if(typeof Z!=="number")throw TypeError("Argument must be a number");return U(Z)},X.allocUnsafeSlow=function(Z){if(typeof Z!=="number")throw TypeError("Argument must be a number");return B.SlowBuffer(Z)}}),C8=G0((w)=>{var h=G8().Buffer,B=h.isEncoding||function(F){switch(F=""+F,F&&F.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 U(F){if(!F)return"utf8";var N;while(!0)switch(F){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 F;default:if(N)return;F=(""+F).toLowerCase(),N=!0}}function I(F){var N=U(F);if(typeof N!=="string"&&(h.isEncoding===B||!B(F)))throw Error("Unknown encoding: "+F);return N||F}w.StringDecoder=X;function X(F){this.encoding=I(F);var N;switch(this.encoding){case"utf16le":this.text=O,this.end=x,N=4;break;case"utf8":this.fillLast=z,N=4;break;case"base64":this.text=l,this.end=a,N=3;break;default:this.write=u,this.end=j;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=h.allocUnsafe(N)}X.prototype.write=function(F){if(F.length===0)return"";var N,A;if(this.lastNeed){if(N=this.fillLast(F),N===void 0)return"";A=this.lastNeed,this.lastNeed=0}else A=0;if(A<F.length)return N?N+this.text(F,A):this.text(F,A);return N||""},X.prototype.end=C,X.prototype.text=G,X.prototype.fillLast=function(F){if(this.lastNeed<=F.length)return F.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);F.copy(this.lastChar,this.lastTotal-this.lastNeed,0,F.length),this.lastNeed-=F.length};function Z(F){if(F<=127)return 0;else if(F>>5===6)return 2;else if(F>>4===14)return 3;else if(F>>3===30)return 4;return F>>6===2?-1:-2}function K(F,N,A){var P=N.length-1;if(P<A)return 0;var s=Z(N[P]);if(s>=0){if(s>0)F.lastNeed=s-1;return s}if(--P<A||s===-2)return 0;if(s=Z(N[P]),s>=0){if(s>0)F.lastNeed=s-2;return s}if(--P<A||s===-2)return 0;if(s=Z(N[P]),s>=0){if(s>0)if(s===2)s=0;else F.lastNeed=s-3;return s}return 0}function q(F,N,A){if((N[0]&192)!==128)return F.lastNeed=0,"�";if(F.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return F.lastNeed=1,"�";if(F.lastNeed>2&&N.length>2){if((N[2]&192)!==128)return F.lastNeed=2,"�"}}}function z(F){var N=this.lastTotal-this.lastNeed,A=q(this,F,N);if(A!==void 0)return A;if(this.lastNeed<=F.length)return F.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);F.copy(this.lastChar,N,0,F.length),this.lastNeed-=F.length}function G(F,N){var A=K(this,F,N);if(!this.lastNeed)return F.toString("utf8",N);this.lastTotal=A;var P=F.length-(A-this.lastNeed);return F.copy(this.lastChar,0,P),F.toString("utf8",N,P)}function C(F){var N=F&&F.length?this.write(F):"";if(this.lastNeed)return N+"�";return N}function O(F,N){if((F.length-N)%2===0){var A=F.toString("utf16le",N);if(A){var P=A.charCodeAt(A.length-1);if(P>=55296&&P<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=F[F.length-2],this.lastChar[1]=F[F.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=F[F.length-1],F.toString("utf16le",N,F.length-1)}function x(F){var N=F&&F.length?this.write(F):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,A)}return N}function l(F,N){var A=(F.length-N)%3;if(A===0)return F.toString("base64",N);if(this.lastNeed=3-A,this.lastTotal=3,A===1)this.lastChar[0]=F[F.length-1];else this.lastChar[0]=F[F.length-2],this.lastChar[1]=F[F.length-1];return F.toString("base64",N,F.length-A)}function a(F){var N=F&&F.length?this.write(F):"";if(this.lastNeed)return N+this.lastChar.toString("base64",0,3-this.lastNeed);return N}function u(F){return F.toString(this.encoding)}function j(F){return F&&F.length?this.write(F):""}}),i1=G0((w,h)=>{var B=e0(),{PromisePrototypeThen:U,SymbolAsyncIterator:I,SymbolIterator:X}=N0(),{Buffer:Z}=(v0(),_0(u0)),{ERR_INVALID_ARG_TYPE:K,ERR_STREAM_NULL_VALUES:q}=L0().codes;function z(G,C,O){let x;if(typeof C==="string"||C instanceof Z)return new G({objectMode:!0,...O,read(){this.push(C),this.push(null)}});let l;if(C&&C[I])l=!0,x=C[I]();else if(C&&C[X])l=!1,x=C[X]();else throw new K("iterable",["Iterable"],C);let a=new G({objectMode:!0,highWaterMark:1,...O}),u=!1;a._read=function(){if(!u)u=!0,F()},a._destroy=function(N,A){U(j(N),()=>B.nextTick(A,N),(P)=>B.nextTick(A,P||N))};async function j(N){let A=N!==void 0&&N!==null,P=typeof x.throw==="function";if(A&&P){let{value:s,done:B0}=await x.throw(N);if(await s,B0)return}if(typeof x.return==="function"){let{value:s}=await x.return();await s}}async function F(){for(;;){try{let{value:N,done:A}=l?await x.next():x.next();if(A)a.push(null);else{let P=N&&typeof N.then==="function"?await N:N;if(P===null)throw u=!1,new q;else if(a.push(P))continue;else u=!1}}catch(N){a.destroy(N)}break}}return a}h.exports=z}),A2=G0((w,h)=>{var B=e0(),{ArrayPrototypeIndexOf:U,NumberIsInteger:I,NumberIsNaN:X,NumberParseInt:Z,ObjectDefineProperties:K,ObjectKeys:q,ObjectSetPrototypeOf:z,Promise:G,SafeSet:C,SymbolAsyncDispose:O,SymbolAsyncIterator:x,Symbol:l}=N0();h.exports=g,g.ReadableState=r;var{EventEmitter:a}=(q2(),_0(Y2)),{Stream:u,prependListener:j}=b2(),{Buffer:F}=(v0(),_0(u0)),{addAbortSignal:N}=V2(),A=d0(),P=D0().debuglog("stream",(Q)=>{P=Q}),s=$8(),B0=I2(),{getHighWaterMark:H0,getDefaultHighWaterMark:t}=j2(),{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_OUT_OF_RANGE:V,ERR_STREAM_PUSH_AFTER_EOF:L,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:W},AbortError:b}=L0(),{validateObject:e}=$2(),X0=l("kPaused"),{StringDecoder:Y0}=C8(),S=i1();z(g.prototype,u.prototype),z(g,u);var Z0=()=>{},{errorOrDestroy:Y}=B0,c=1,h0=2,R=4,I0=8,J0=16,q0=32,K0=64,k=128,f=256,o=512,z0=1024,F0=2048,H=4096,E=8192,T=16384,p=32768,m=65536,i=131072,$=262144;function y(Q){return{enumerable:!1,get(){return(this.state&Q)!==0},set(J){if(J)this.state|=Q;else this.state&=~Q}}}K(r.prototype,{objectMode:y(c),ended:y(h0),endEmitted:y(R),reading:y(I0),constructed:y(J0),sync:y(q0),needReadable:y(K0),emittedReadable:y(k),readableListening:y(f),resumeScheduled:y(o),errorEmitted:y(z0),emitClose:y(F0),autoDestroy:y(H),destroyed:y(E),closed:y(T),closeEmitted:y(p),multiAwaitDrain:y(m),readingMore:y(i),dataEmitted:y($)});function r(Q,J,d){if(typeof d!=="boolean")d=J instanceof g0();if(this.state=F0|H|J0|q0,Q&&Q.objectMode)this.state|=c;if(d&&Q&&Q.readableObjectMode)this.state|=c;if(this.highWaterMark=Q?H0(this,Q,"readableHighWaterMark",d):t(!1),this.buffer=new s,this.length=0,this.pipes=[],this.flowing=null,this[X0]=null,Q&&Q.emitClose===!1)this.state&=~F0;if(Q&&Q.autoDestroy===!1)this.state&=~H;if(this.errored=null,this.defaultEncoding=Q&&Q.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,Q&&Q.encoding)this.decoder=new Y0(Q.encoding),this.encoding=Q.encoding}function g(Q){if(!(this instanceof g))return new g(Q);let J=this instanceof g0();if(this._readableState=new r(Q,this,J),Q){if(typeof Q.read==="function")this._read=Q.read;if(typeof Q.destroy==="function")this._destroy=Q.destroy;if(typeof Q.construct==="function")this._construct=Q.construct;if(Q.signal&&!J)N(Q.signal,this)}u.call(this,Q),B0.construct(this,()=>{if(this._readableState.needReadable)B2(this,this._readableState)})}g.prototype.destroy=B0.destroy,g.prototype._undestroy=B0.undestroy,g.prototype._destroy=function(Q,J){J(Q)},g.prototype[a.captureRejectionSymbol]=function(Q){this.destroy(Q)},g.prototype[O]=function(){let Q;if(!this.destroyed)Q=this.readableEnded?null:new b,this.destroy(Q);return new G((J,d)=>A(this,(n)=>n&&n!==Q?d(n):J(null)))},g.prototype.push=function(Q,J){return Q0(this,Q,J,!1)},g.prototype.unshift=function(Q,J){return Q0(this,Q,J,!0)};function Q0(Q,J,d,n){P("readableAddChunk",J);let U0=Q._readableState,M0;if((U0.state&c)===0){if(typeof J==="string"){if(d=d||U0.defaultEncoding,U0.encoding!==d)if(n&&U0.encoding)J=F.from(J,d).toString(U0.encoding);else J=F.from(J,d),d=""}else if(J instanceof F)d="";else if(u._isUint8Array(J))J=u._uint8ArrayToBuffer(J),d="";else if(J!=null)M0=new v("chunk",["string","Buffer","Uint8Array"],J)}if(M0)Y(Q,M0);else if(J===null)U0.state&=~I0,A0(Q,U0);else if((U0.state&c)!==0||J&&J.length>0)if(n)if((U0.state&R)!==0)Y(Q,new W);else if(U0.destroyed||U0.errored)return!1;else T0(Q,U0,J,!0);else if(U0.ended)Y(Q,new L);else if(U0.destroyed||U0.errored)return!1;else if(U0.state&=~I0,U0.decoder&&!d)if(J=U0.decoder.write(J),U0.objectMode||J.length!==0)T0(Q,U0,J,!1);else B2(Q,U0);else T0(Q,U0,J,!1);else if(!n)U0.state&=~I0,B2(Q,U0);return!U0.ended&&(U0.length<U0.highWaterMark||U0.length===0)}function T0(Q,J,d,n){if(J.flowing&&J.length===0&&!J.sync&&Q.listenerCount("data")>0){if((J.state&m)!==0)J.awaitDrainWriters.clear();else J.awaitDrainWriters=null;J.dataEmitted=!0,Q.emit("data",d)}else{if(J.length+=J.objectMode?1:d.length,n)J.buffer.unshift(d);else J.buffer.push(d);if((J.state&K0)!==0)O0(Q)}B2(Q,J)}g.prototype.isPaused=function(){let Q=this._readableState;return Q[X0]===!0||Q.flowing===!1},g.prototype.setEncoding=function(Q){let J=new Y0(Q);this._readableState.decoder=J,this._readableState.encoding=this._readableState.decoder.encoding;let d=this._readableState.buffer,n="";for(let U0 of d)n+=J.write(U0);if(d.clear(),n!=="")d.push(n);return this._readableState.length=n.length,this};var E0=1073741824;function V0(Q){if(Q>E0)throw new V("size","<= 1GiB",Q);else Q--,Q|=Q>>>1,Q|=Q>>>2,Q|=Q>>>4,Q|=Q>>>8,Q|=Q>>>16,Q++;return Q}function m0(Q,J){if(Q<=0||J.length===0&&J.ended)return 0;if((J.state&c)!==0)return 1;if(X(Q)){if(J.flowing&&J.length)return J.buffer.first().length;return J.length}if(Q<=J.length)return Q;return J.ended?J.length:0}g.prototype.read=function(Q){if(P("read",Q),Q===void 0)Q=NaN;else if(!I(Q))Q=Z(Q,10);let J=this._readableState,d=Q;if(Q>J.highWaterMark)J.highWaterMark=V0(Q);if(Q!==0)J.state&=~k;if(Q===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended)){if(P("read: emitReadable",J.length,J.ended),J.length===0&&J.ended)M2(this);else O0(this);return null}if(Q=m0(Q,J),Q===0&&J.ended){if(J.length===0)M2(this);return null}let n=(J.state&K0)!==0;if(P("need readable",n),J.length===0||J.length-Q<J.highWaterMark)n=!0,P("length less than watermark",n);if(J.ended||J.reading||J.destroyed||J.errored||!J.constructed)n=!1,P("reading, ended or constructing",n);else if(n){if(P("do read"),J.state|=I0|q0,J.length===0)J.state|=K0;try{this._read(J.highWaterMark)}catch(M0){Y(this,M0)}if(J.state&=~q0,!J.reading)Q=m0(d,J)}let U0;if(Q>0)U0=r2(Q,J);else U0=null;if(U0===null)J.needReadable=J.length<=J.highWaterMark,Q=0;else if(J.length-=Q,J.multiAwaitDrain)J.awaitDrainWriters.clear();else J.awaitDrainWriters=null;if(J.length===0){if(!J.ended)J.needReadable=!0;if(d!==Q&&J.ended)M2(this)}if(U0!==null&&!J.errorEmitted&&!J.closeEmitted)J.dataEmitted=!0,this.emit("data",U0);return U0};function A0(Q,J){if(P("onEofChunk"),J.ended)return;if(J.decoder){let d=J.decoder.end();if(d&&d.length)J.buffer.push(d),J.length+=J.objectMode?1:d.length}if(J.ended=!0,J.sync)O0(Q);else J.needReadable=!1,J.emittedReadable=!0,h2(Q)}function O0(Q){let J=Q._readableState;if(P("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,!J.emittedReadable)P("emitReadable",J.flowing),J.emittedReadable=!0,B.nextTick(h2,Q)}function h2(Q){let J=Q._readableState;if(P("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&!J.errored&&(J.length||J.ended))Q.emit("readable"),J.emittedReadable=!1;J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,n2(Q)}function B2(Q,J){if(!J.readingMore&&J.constructed)J.readingMore=!0,B.nextTick(k0,Q,J)}function k0(Q,J){while(!J.reading&&!J.ended&&(J.length<J.highWaterMark||J.flowing&&J.length===0)){let d=J.length;if(P("maybeReadMore read 0"),Q.read(0),d===J.length)break}J.readingMore=!1}g.prototype._read=function(Q){throw new M("_read()")},g.prototype.pipe=function(Q,J){let d=this,n=this._readableState;if(n.pipes.length===1){if(!n.multiAwaitDrain)n.multiAwaitDrain=!0,n.awaitDrainWriters=new C(n.awaitDrainWriters?[n.awaitDrainWriters]:[])}n.pipes.push(Q),P("pipe count=%d opts=%j",n.pipes.length,J);let U0=(!J||J.end!==!1)&&Q!==B.stdout&&Q!==B.stderr?P0:Q2;if(n.endEmitted)B.nextTick(U0);else d.once("end",U0);Q.on("unpipe",M0);function M0(o0,y0){if(P("onunpipe"),o0===d){if(y0&&y0.hasUnpiped===!1)y0.hasUnpiped=!0,q6()}}function P0(){P("onend"),Q.end()}let n0,s2=!1;function q6(){if(P("cleanup"),Q.removeListener("close",x2),Q.removeListener("finish",D2),n0)Q.removeListener("drain",n0);if(Q.removeListener("error",O2),Q.removeListener("unpipe",M0),d.removeListener("end",P0),d.removeListener("end",Q2),d.removeListener("data",e2),s2=!0,n0&&n.awaitDrainWriters&&(!Q._writableState||Q._writableState.needDrain))n0()}function t2(){if(!s2){if(n.pipes.length===1&&n.pipes[0]===Q)P("false write response, pause",0),n.awaitDrainWriters=Q,n.multiAwaitDrain=!1;else if(n.pipes.length>1&&n.pipes.includes(Q))P("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(Q);d.pause()}if(!n0)n0=Z6(d,Q),Q.on("drain",n0)}d.on("data",e2);function e2(o0){P("ondata");let y0=Q.write(o0);if(P("dest.write",y0),y0===!1)t2()}function O2(o0){if(P("onerror",o0),Q2(),Q.removeListener("error",O2),Q.listenerCount("error")===0){let y0=Q._writableState||Q._readableState;if(y0&&!y0.errorEmitted)Y(Q,o0);else Q.emit("error",o0)}}j(Q,"error",O2);function x2(){Q.removeListener("finish",D2),Q2()}Q.once("close",x2);function D2(){P("onfinish"),Q.removeListener("close",x2),Q2()}Q.once("finish",D2);function Q2(){P("unpipe"),d.unpipe(Q)}if(Q.emit("pipe",d),Q.writableNeedDrain===!0)t2();else if(!n.flowing)P("pipe resume"),d.resume();return Q};function Z6(Q,J){return function(){let n=Q._readableState;if(n.awaitDrainWriters===J)P("pipeOnDrain",1),n.awaitDrainWriters=null;else if(n.multiAwaitDrain)P("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(J);if((!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&Q.listenerCount("data"))Q.resume()}}g.prototype.unpipe=function(Q){let J=this._readableState,d={hasUnpiped:!1};if(J.pipes.length===0)return this;if(!Q){let U0=J.pipes;J.pipes=[],this.pause();for(let M0=0;M0<U0.length;M0++)U0[M0].emit("unpipe",this,{hasUnpiped:!1});return this}let n=U(J.pipes,Q);if(n===-1)return this;if(J.pipes.splice(n,1),J.pipes.length===0)this.pause();return Q.emit("unpipe",this,d),this},g.prototype.on=function(Q,J){let d=u.prototype.on.call(this,Q,J),n=this._readableState;if(Q==="data"){if(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1)this.resume()}else if(Q==="readable"){if(!n.endEmitted&&!n.readableListening){if(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,P("on readable",n.length,n.reading),n.length)O0(this);else if(!n.reading)B.nextTick(Q6,this)}}return d},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(Q,J){let d=u.prototype.removeListener.call(this,Q,J);if(Q==="readable")B.nextTick(m2,this);return d},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(Q){let J=u.prototype.removeAllListeners.apply(this,arguments);if(Q==="readable"||Q===void 0)B.nextTick(m2,this);return J};function m2(Q){let J=Q._readableState;if(J.readableListening=Q.listenerCount("readable")>0,J.resumeScheduled&&J[X0]===!1)J.flowing=!0;else if(Q.listenerCount("data")>0)Q.resume();else if(!J.readableListening)J.flowing=null}function Q6(Q){P("readable nexttick read 0"),Q.read(0)}g.prototype.resume=function(){let Q=this._readableState;if(!Q.flowing)P("resume"),Q.flowing=!Q.readableListening,J6(this,Q);return Q[X0]=!1,this};function J6(Q,J){if(!J.resumeScheduled)J.resumeScheduled=!0,B.nextTick(F6,Q,J)}function F6(Q,J){if(P("resume",J.reading),!J.reading)Q.read(0);if(J.resumeScheduled=!1,Q.emit("resume"),n2(Q),J.flowing&&!J.reading)Q.read(0)}g.prototype.pause=function(){if(P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)P("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[X0]=!0,this};function n2(Q){let J=Q._readableState;P("flow",J.flowing);while(J.flowing&&Q.read()!==null);}g.prototype.wrap=function(Q){let J=!1;Q.on("data",(n)=>{if(!this.push(n)&&Q.pause)J=!0,Q.pause()}),Q.on("end",()=>{this.push(null)}),Q.on("error",(n)=>{Y(this,n)}),Q.on("close",()=>{this.destroy()}),Q.on("destroy",()=>{this.destroy()}),this._read=()=>{if(J&&Q.resume)J=!1,Q.resume()};let d=q(Q);for(let n=1;n<d.length;n++){let U0=d[n];if(this[U0]===void 0&&typeof Q[U0]==="function")this[U0]=Q[U0].bind(Q)}return this},g.prototype[x]=function(){return o2(this)},g.prototype.iterator=function(Q){if(Q!==void 0)e(Q,"options");return o2(this,Q)};function o2(Q,J){if(typeof Q.read!=="function")Q=g.wrap(Q,{objectMode:!0});let d=z6(Q,J);return d.stream=Q,d}async function*z6(Q,J){let d=Z0;function n(P0){if(this===Q)d(),d=Z0;else d=P0}Q.on("readable",n);let U0,M0=A(Q,{writable:!1},(P0)=>{U0=P0?D(U0,P0):null,d(),d=Z0});try{while(!0){let P0=Q.destroyed?null:Q.read();if(P0!==null)yield P0;else if(U0)throw U0;else if(U0===null)return;else await new G(n)}}catch(P0){throw U0=D(U0,P0),U0}finally{if((U0||(J===null||J===void 0?void 0:J.destroyOnReturn)!==!1)&&(U0===void 0||Q._readableState.autoDestroy))B0.destroyer(Q,null);else Q.off("readable",n),M0()}}K(g.prototype,{readable:{__proto__:null,get(){let Q=this._readableState;return!!Q&&Q.readable!==!1&&!Q.destroyed&&!Q.errorEmitted&&!Q.endEmitted},set(Q){if(this._readableState)this._readableState.readable=!!Q}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Q){if(this._readableState)this._readableState.flowing=Q}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Q){if(!this._readableState)return;this._readableState.destroyed=Q}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),K(r.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[X0]!==!1},set(Q){this[X0]=!!Q}}}),g._fromList=r2;function r2(Q,J){if(J.length===0)return null;let d;if(J.objectMode)d=J.buffer.shift();else if(!Q||Q>=J.length){if(J.decoder)d=J.buffer.join("");else if(J.buffer.length===1)d=J.buffer.first();else d=J.buffer.concat(J.length);J.buffer.clear()}else d=J.buffer.consume(Q,J.decoder);return d}function M2(Q){let J=Q._readableState;if(P("endReadable",J.endEmitted),!J.endEmitted)J.ended=!0,B.nextTick(K6,J,Q)}function K6(Q,J){if(P("endReadableNT",Q.endEmitted,Q.length),!Q.errored&&!Q.closeEmitted&&!Q.endEmitted&&Q.length===0){if(Q.endEmitted=!0,J.emit("end"),J.writable&&J.allowHalfOpen===!1)B.nextTick(Y6,J);else if(Q.autoDestroy){let d=J._writableState;if(!d||d.autoDestroy&&(d.finished||d.writable===!1))J.destroy()}}}function Y6(Q){if(Q.writable&&!Q.writableEnded&&!Q.destroyed)Q.end()}g.from=function(Q,J){return S(g,Q,J)};var L2;function a2(){if(L2===void 0)L2={};return L2}g.fromWeb=function(Q,J){return a2().newStreamReadableFromReadableStream(Q,J)},g.toWeb=function(Q,J){return a2().newReadableStreamFromStreamReadable(Q,J)},g.wrap=function(Q,J){var d,n;return new g({objectMode:(d=(n=Q.readableObjectMode)!==null&&n!==void 0?n:Q.objectMode)!==null&&d!==void 0?d:!0,...J,destroy(U0,M0){B0.destroyer(Q,U0),M0(U0)}}).wrap(Q)}}),i2=G0((w,h)=>{var B=e0(),{ArrayPrototypeSlice:U,Error:I,FunctionPrototypeSymbolHasInstance:X,ObjectDefineProperty:Z,ObjectDefineProperties:K,ObjectSetPrototypeOf:q,StringPrototypeToLowerCase:z,Symbol:G,SymbolHasInstance:C}=N0();h.exports=e,e.WritableState=W;var{EventEmitter:O}=(q2(),_0(Y2)),x=b2().Stream,{Buffer:l}=(v0(),_0(u0)),a=I2(),{addAbortSignal:u}=V2(),{getHighWaterMark:j,getDefaultHighWaterMark:F}=j2(),{ERR_INVALID_ARG_TYPE:N,ERR_METHOD_NOT_IMPLEMENTED:A,ERR_MULTIPLE_CALLBACK:P,ERR_STREAM_CANNOT_PIPE:s,ERR_STREAM_DESTROYED:B0,ERR_STREAM_ALREADY_FINISHED:H0,ERR_STREAM_NULL_VALUES:t,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:v}=L0().codes,{errorOrDestroy:M}=a;q(e.prototype,x.prototype),q(e,x);function V(){}var L=G("kOnFinished");function W(H,E,T){if(typeof T!=="boolean")T=E instanceof g0();if(this.objectMode=!!(H&&H.objectMode),T)this.objectMode=this.objectMode||!!(H&&H.writableObjectMode);this.highWaterMark=H?j(this,H,"writableHighWaterMark",T):F(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let p=!!(H&&H.decodeStrings===!1);this.decodeStrings=!p,this.defaultEncoding=H&&H.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Y.bind(void 0,E),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,b(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!H||H.emitClose!==!1,this.autoDestroy=!H||H.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[L]=[]}function b(H){H.buffered=[],H.bufferedIndex=0,H.allBuffers=!0,H.allNoop=!0}W.prototype.getBuffer=function(){return U(this.buffered,this.bufferedIndex)},Z(W.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function e(H){let E=this instanceof g0();if(!E&&!X(e,this))return new e(H);if(this._writableState=new W(H,this,E),H){if(typeof H.write==="function")this._write=H.write;if(typeof H.writev==="function")this._writev=H.writev;if(typeof H.destroy==="function")this._destroy=H.destroy;if(typeof H.final==="function")this._final=H.final;if(typeof H.construct==="function")this._construct=H.construct;if(H.signal)u(H.signal,this)}x.call(this,H),a.construct(this,()=>{let T=this._writableState;if(!T.writing)I0(this,T);k(this,T)})}Z(e,C,{__proto__:null,value:function(H){if(X(this,H))return!0;if(this!==e)return!1;return H&&H._writableState instanceof W}}),e.prototype.pipe=function(){M(this,new s)};function X0(H,E,T,p){let m=H._writableState;if(typeof T==="function")p=T,T=m.defaultEncoding;else{if(!T)T=m.defaultEncoding;else if(T!=="buffer"&&!l.isEncoding(T))throw new v(T);if(typeof p!=="function")p=V}if(E===null)throw new t;else if(!m.objectMode)if(typeof E==="string"){if(m.decodeStrings!==!1)E=l.from(E,T),T="buffer"}else if(E instanceof l)T="buffer";else if(x._isUint8Array(E))E=x._uint8ArrayToBuffer(E),T="buffer";else throw new N("chunk",["string","Buffer","Uint8Array"],E);let i;if(m.ending)i=new D;else if(m.destroyed)i=new B0("write");if(i)return B.nextTick(p,i),M(H,i,!0),i;return m.pendingcb++,Y0(H,m,E,T,p)}e.prototype.write=function(H,E,T){return X0(this,H,E,T)===!0},e.prototype.cork=function(){this._writableState.corked++},e.prototype.uncork=function(){let H=this._writableState;if(H.corked){if(H.corked--,!H.writing)I0(this,H)}},e.prototype.setDefaultEncoding=function(E){if(typeof E==="string")E=z(E);if(!l.isEncoding(E))throw new v(E);return this._writableState.defaultEncoding=E,this};function Y0(H,E,T,p,m){let i=E.objectMode?1:T.length;E.length+=i;let $=E.length<E.highWaterMark;if(!$)E.needDrain=!0;if(E.writing||E.corked||E.errored||!E.constructed){if(E.buffered.push({chunk:T,encoding:p,callback:m}),E.allBuffers&&p!=="buffer")E.allBuffers=!1;if(E.allNoop&&m!==V)E.allNoop=!1}else E.writelen=i,E.writecb=m,E.writing=!0,E.sync=!0,H._write(T,p,E.onwrite),E.sync=!1;return $&&!E.errored&&!E.destroyed}function S(H,E,T,p,m,i,$){if(E.writelen=p,E.writecb=$,E.writing=!0,E.sync=!0,E.destroyed)E.onwrite(new B0("write"));else if(T)H._writev(m,E.onwrite);else H._write(m,i,E.onwrite);E.sync=!1}function Z0(H,E,T,p){--E.pendingcb,p(T),R(E),M(H,T)}function Y(H,E){let T=H._writableState,p=T.sync,m=T.writecb;if(typeof m!=="function"){M(H,new P);return}if(T.writing=!1,T.writecb=null,T.length-=T.writelen,T.writelen=0,E){if(E.stack,!T.errored)T.errored=E;if(H._readableState&&!H._readableState.errored)H._readableState.errored=E;if(p)B.nextTick(Z0,H,T,E,m);else Z0(H,T,E,m)}else{if(T.buffered.length>T.bufferedIndex)I0(H,T);if(p)if(T.afterWriteTickInfo!==null&&T.afterWriteTickInfo.cb===m)T.afterWriteTickInfo.count++;else T.afterWriteTickInfo={count:1,cb:m,stream:H,state:T},B.nextTick(c,T.afterWriteTickInfo);else h0(H,T,1,m)}}function c({stream:H,state:E,count:T,cb:p}){return E.afterWriteTickInfo=null,h0(H,E,T,p)}function h0(H,E,T,p){if(!E.ending&&!H.destroyed&&E.length===0&&E.needDrain)E.needDrain=!1,H.emit("drain");while(T-- >0)E.pendingcb--,p();if(E.destroyed)R(E);k(H,E)}function R(H){if(H.writing)return;for(let m=H.bufferedIndex;m<H.buffered.length;++m){var E;let{chunk:i,callback:$}=H.buffered[m],y=H.objectMode?1:i.length;H.length-=y,$((E=H.errored)!==null&&E!==void 0?E:new B0("write"))}let T=H[L].splice(0);for(let m=0;m<T.length;m++){var p;T[m]((p=H.errored)!==null&&p!==void 0?p:new B0("end"))}b(H)}function I0(H,E){if(E.corked||E.bufferProcessing||E.destroyed||!E.constructed)return;let{buffered:T,bufferedIndex:p,objectMode:m}=E,i=T.length-p;if(!i)return;let $=p;if(E.bufferProcessing=!0,i>1&&H._writev){E.pendingcb-=i-1;let y=E.allNoop?V:(g)=>{for(let Q0=$;Q0<T.length;++Q0)T[Q0].callback(g)},r=E.allNoop&&$===0?T:U(T,$);r.allBuffers=E.allBuffers,S(H,E,!0,E.length,r,"",y),b(E)}else{do{let{chunk:y,encoding:r,callback:g}=T[$];T[$++]=null;let Q0=m?1:y.length;S(H,E,!1,Q0,y,r,g)}while($<T.length&&!E.writing);if($===T.length)b(E);else if($>256)T.splice(0,$),E.bufferedIndex=0;else E.bufferedIndex=$}E.bufferProcessing=!1}e.prototype._write=function(H,E,T){if(this._writev)this._writev([{chunk:H,encoding:E}],T);else throw new A("_write()")},e.prototype._writev=null,e.prototype.end=function(H,E,T){let p=this._writableState;if(typeof H==="function")T=H,H=null,E=null;else if(typeof E==="function")T=E,E=null;let m;if(H!==null&&H!==void 0){let i=X0(this,H,E);if(i instanceof I)m=i}if(p.corked)p.corked=1,this.uncork();if(m);else if(!p.errored&&!p.ending)p.ending=!0,k(this,p,!0),p.ended=!0;else if(p.finished)m=new H0("end");else if(p.destroyed)m=new B0("end");if(typeof T==="function")if(m||p.finished)B.nextTick(T,m);else p[L].push(T);return this};function J0(H){return H.ending&&!H.destroyed&&H.constructed&&H.length===0&&!H.errored&&H.buffered.length===0&&!H.finished&&!H.writing&&!H.errorEmitted&&!H.closeEmitted}function q0(H,E){let T=!1;function p(m){if(T){M(H,m!==null&&m!==void 0?m:P());return}if(T=!0,E.pendingcb--,m){let i=E[L].splice(0);for(let $=0;$<i.length;$++)i[$](m);M(H,m,E.sync)}else if(J0(E))E.prefinished=!0,H.emit("prefinish"),E.pendingcb++,B.nextTick(f,H,E)}E.sync=!0,E.pendingcb++;try{H._final(p)}catch(m){p(m)}E.sync=!1}function K0(H,E){if(!E.prefinished&&!E.finalCalled)if(typeof H._final==="function"&&!E.destroyed)E.finalCalled=!0,q0(H,E);else E.prefinished=!0,H.emit("prefinish")}function k(H,E,T){if(J0(E)){if(K0(H,E),E.pendingcb===0){if(T)E.pendingcb++,B.nextTick((p,m)=>{if(J0(m))f(p,m);else m.pendingcb--},H,E);else if(J0(E))E.pendingcb++,f(H,E)}}}function f(H,E){E.pendingcb--,E.finished=!0;let T=E[L].splice(0);for(let p=0;p<T.length;p++)T[p]();if(H.emit("finish"),E.autoDestroy){let p=H._readableState;if(!p||p.autoDestroy&&(p.endEmitted||p.readable===!1))H.destroy()}}K(e.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(H){if(this._writableState)this._writableState.destroyed=H}},writable:{__proto__:null,get(){let H=this._writableState;return!!H&&H.writable!==!1&&!H.destroyed&&!H.errored&&!H.ending&&!H.ended},set(H){if(this._writableState)this._writableState.writable=!!H}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let H=this._writableState;if(!H)return!1;return!H.destroyed&&!H.ending&&H.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var o=a.destroy;e.prototype.destroy=function(H,E){let T=this._writableState;if(!T.destroyed&&(T.bufferedIndex<T.buffered.length||T[L].length))B.nextTick(R,T);return o.call(this,H,E),this},e.prototype._undestroy=a.undestroy,e.prototype._destroy=function(H,E){E(H)},e.prototype[O.captureRejectionSymbol]=function(H){this.destroy(H)};var z0;function F0(){if(z0===void 0)z0={};return z0}e.fromWeb=function(H,E){return F0().newStreamWritableFromWritableStream(H,E)},e.toWeb=function(H){return F0().newWritableStreamFromStreamWritable(H)}}),N8=G0((w,h)=>{var B=e0(),U=(v0(),_0(u0)),{isReadable:I,isWritable:X,isIterable:Z,isNodeStream:K,isReadableNodeStream:q,isWritableNodeStream:z,isDuplexNodeStream:G,isReadableStream:C,isWritableStream:O}=b0(),x=d0(),{AbortError:l,codes:{ERR_INVALID_ARG_TYPE:a,ERR_INVALID_RETURN_VALUE:u}}=L0(),{destroyer:j}=I2(),F=g0(),N=A2(),A=i2(),{createDeferredPromise:P}=D0(),s=i1(),B0=globalThis.Blob||U.Blob,H0=typeof B0<"u"?function(W){return W instanceof B0}:function(W){return!1},t=globalThis.AbortController||H2().AbortController,{FunctionPrototypeCall:D}=N0();class v extends F{constructor(L){super(L);if((L===null||L===void 0?void 0:L.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((L===null||L===void 0?void 0:L.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}h.exports=function L(W,b){if(G(W))return W;if(q(W))return V({readable:W});if(z(W))return V({writable:W});if(K(W))return V({writable:!1,readable:!1});if(C(W))return V({readable:N.fromWeb(W)});if(O(W))return V({writable:A.fromWeb(W)});if(typeof W==="function"){let{value:X0,write:Y0,final:S,destroy:Z0}=M(W);if(Z(X0))return s(v,X0,{objectMode:!0,write:Y0,final:S,destroy:Z0});let Y=X0===null||X0===void 0?void 0:X0.then;if(typeof Y==="function"){let c,h0=D(Y,X0,(R)=>{if(R!=null)throw new u("nully","body",R)},(R)=>{j(c,R)});return c=new v({objectMode:!0,readable:!1,write:Y0,final(R){S(async()=>{try{await h0,B.nextTick(R,null)}catch(I0){B.nextTick(R,I0)}})},destroy:Z0})}throw new u("Iterable, AsyncIterable or AsyncFunction",b,X0)}if(H0(W))return L(W.arrayBuffer());if(Z(W))return s(v,W,{objectMode:!0,writable:!1});if(C(W===null||W===void 0?void 0:W.readable)&&O(W===null||W===void 0?void 0:W.writable))return v.fromWeb(W);if(typeof(W===null||W===void 0?void 0:W.writable)==="object"||typeof(W===null||W===void 0?void 0:W.readable)==="object"){let X0=W!==null&&W!==void 0&&W.readable?q(W===null||W===void 0?void 0:W.readable)?W===null||W===void 0?void 0:W.readable:L(W.readable):void 0,Y0=W!==null&&W!==void 0&&W.writable?z(W===null||W===void 0?void 0:W.writable)?W===null||W===void 0?void 0:W.writable:L(W.writable):void 0;return V({readable:X0,writable:Y0})}let e=W===null||W===void 0?void 0:W.then;if(typeof e==="function"){let X0;return D(e,W,(Y0)=>{if(Y0!=null)X0.push(Y0);X0.push(null)},(Y0)=>{j(X0,Y0)}),X0=new v({objectMode:!0,writable:!1,read(){}})}throw new a(b,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],W)};function M(L){let{promise:W,resolve:b}=P(),e=new t,X0=e.signal;return{value:L(async function*(){while(!0){let Y0=W;W=null;let{chunk:S,done:Z0,cb:Y}=await Y0;if(B.nextTick(Y),Z0)return;if(X0.aborted)throw new l(void 0,{cause:X0.reason});({promise:W,resolve:b}=P()),yield S}}(),{signal:X0}),write(Y0,S,Z0){let Y=b;b=null,Y({chunk:Y0,done:!1,cb:Z0})},final(Y0){let S=b;b=null,S({done:!0,cb:Y0})},destroy(Y0,S){e.abort(),S(Y0)}}}function V(L){let W=L.readable&&typeof L.readable.read!=="function"?N.wrap(L.readable):L.readable,b=L.writable,e=!!I(W),X0=!!X(b),Y0,S,Z0,Y,c;function h0(R){let I0=Y;if(Y=null,I0)I0(R);else if(R)c.destroy(R)}if(c=new v({readableObjectMode:!!(W!==null&&W!==void 0&&W.readableObjectMode),writableObjectMode:!!(b!==null&&b!==void 0&&b.writableObjectMode),readable:e,writable:X0}),X0)x(b,(R)=>{if(X0=!1,R)j(W,R);h0(R)}),c._write=function(R,I0,J0){if(b.write(R,I0))J0();else Y0=J0},c._final=function(R){b.end(),S=R},b.on("drain",function(){if(Y0){let R=Y0;Y0=null,R()}}),b.on("finish",function(){if(S){let R=S;S=null,R()}});if(e)x(W,(R)=>{if(e=!1,R)j(W,R);h0(R)}),W.on("readable",function(){if(Z0){let R=Z0;Z0=null,R()}}),W.on("end",function(){c.push(null)}),c._read=function(){while(!0){let R=W.read();if(R===null){Z0=c._read;return}if(!c.push(R))return}};return c._destroy=function(R,I0){if(!R&&Y!==null)R=new l;if(Z0=null,Y0=null,S=null,Y===null)I0(R);else Y=I0,j(b,R),j(W,R)},c}}),g0=G0((w,h)=>{var{ObjectDefineProperties:B,ObjectGetOwnPropertyDescriptor:U,ObjectKeys:I,ObjectSetPrototypeOf:X}=N0();h.exports=q;var Z=A2(),K=i2();X(q.prototype,Z.prototype),X(q,Z);{let O=I(K.prototype);for(let x=0;x<O.length;x++){let l=O[x];if(!q.prototype[l])q.prototype[l]=K.prototype[l]}}function q(O){if(!(this instanceof q))return new q(O);if(Z.call(this,O),K.call(this,O),O){if(this.allowHalfOpen=O.allowHalfOpen!==!1,O.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(O.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}B(q.prototype,{writable:{__proto__:null,...U(K.prototype,"writable")},writableHighWaterMark:{__proto__:null,...U(K.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...U(K.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...U(K.prototype,"writableBuffer")},writableLength:{__proto__:null,...U(K.prototype,"writableLength")},writableFinished:{__proto__:null,...U(K.prototype,"writableFinished")},writableCorked:{__proto__:null,...U(K.prototype,"writableCorked")},writableEnded:{__proto__:null,...U(K.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...U(K.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(O){if(this._readableState&&this._writableState)this._readableState.destroyed=O,this._writableState.destroyed=O}}});var z;function G(){if(z===void 0)z={};return z}q.fromWeb=function(O,x){return G().newStreamDuplexFromReadableWritablePair(O,x)},q.toWeb=function(O){return G().newReadableWritablePairFromDuplex(O)};var C;q.from=function(O){if(!C)C=N8();return C(O,"body")}}),p1=G0((w,h)=>{var{ObjectSetPrototypeOf:B,Symbol:U}=N0();h.exports=q;var{ERR_METHOD_NOT_IMPLEMENTED:I}=L0().codes,X=g0(),{getHighWaterMark:Z}=j2();B(q.prototype,X.prototype),B(q,X);var K=U("kCallback");function q(C){if(!(this instanceof q))return new q(C);let O=C?Z(this,C,"readableHighWaterMark",!0):null;if(O===0)C={...C,highWaterMark:null,readableHighWaterMark:O,writableHighWaterMark:C.writableHighWaterMark||0};if(X.call(this,C),this._readableState.sync=!1,this[K]=null,C){if(typeof C.transform==="function")this._transform=C.transform;if(typeof C.flush==="function")this._flush=C.flush}this.on("prefinish",G)}function z(C){if(typeof this._flush==="function"&&!this.destroyed)this._flush((O,x)=>{if(O){if(C)C(O);else this.destroy(O);return}if(x!=null)this.push(x);if(this.push(null),C)C()});else if(this.push(null),C)C()}function G(){if(this._final!==z)z.call(this)}q.prototype._final=z,q.prototype._transform=function(C,O,x){throw new I("_transform()")},q.prototype._write=function(C,O,x){let l=this._readableState,a=this._writableState,u=l.length;this._transform(C,O,(j,F)=>{if(j){x(j);return}if(F!=null)this.push(F);if(a.ended||u===l.length||l.length<l.highWaterMark)x();else this[K]=x})},q.prototype._read=function(){if(this[K]){let C=this[K];this[K]=null,C()}}}),d1=G0((w,h)=>{var{ObjectSetPrototypeOf:B}=N0();h.exports=I;var U=p1();B(I.prototype,U.prototype),B(I,U);function I(X){if(!(this instanceof I))return new I(X);U.call(this,X)}I.prototype._transform=function(X,Z,K){K(null,X)}}),p2=G0((w,h)=>{var B=e0(),{ArrayIsArray:U,Promise:I,SymbolAsyncIterator:X,SymbolDispose:Z}=N0(),K=d0(),{once:q}=D0(),z=I2(),G=g0(),{aggregateTwoErrors:C,codes:{ERR_INVALID_ARG_TYPE:O,ERR_INVALID_RETURN_VALUE:x,ERR_MISSING_ARGS:l,ERR_STREAM_DESTROYED:a,ERR_STREAM_PREMATURE_CLOSE:u},AbortError:j}=L0(),{validateFunction:F,validateAbortSignal:N}=$2(),{isIterable:A,isReadable:P,isReadableNodeStream:s,isNodeStream:B0,isTransformStream:H0,isWebStream:t,isReadableStream:D,isReadableFinished:v}=b0(),M=globalThis.AbortController||H2().AbortController,V,L,W;function b(R,I0,J0){let q0=!1;R.on("close",()=>{q0=!0});let K0=K(R,{readable:I0,writable:J0},(k)=>{q0=!k});return{destroy:(k)=>{if(q0)return;q0=!0,z.destroyer(R,k||new a("pipe"))},cleanup:K0}}function e(R){return F(R[R.length-1],"streams[stream.length - 1]"),R.pop()}function X0(R){if(A(R))return R;else if(s(R))return Y0(R);throw new O("val",["Readable","Iterable","AsyncIterable"],R)}async function*Y0(R){if(!L)L=A2();yield*L.prototype[X].call(R)}async function S(R,I0,J0,{end:q0}){let K0,k=null,f=(F0)=>{if(F0)K0=F0;if(k){let H=k;k=null,H()}},o=()=>new I((F0,H)=>{if(K0)H(K0);else k=()=>{if(K0)H(K0);else F0()}});I0.on("drain",f);let z0=K(I0,{readable:!1},f);try{if(I0.writableNeedDrain)await o();for await(let F0 of R)if(!I0.write(F0))await o();if(q0)I0.end(),await o();J0()}catch(F0){J0(K0!==F0?C(K0,F0):F0)}finally{z0(),I0.off("drain",f)}}async function Z0(R,I0,J0,{end:q0}){if(H0(I0))I0=I0.writable;let K0=I0.getWriter();try{for await(let k of R)await K0.ready,K0.write(k).catch(()=>{});if(await K0.ready,q0)await K0.close();J0()}catch(k){try{await K0.abort(k),J0(k)}catch(f){J0(f)}}}function Y(...R){return c(R,q(e(R)))}function c(R,I0,J0){if(R.length===1&&U(R[0]))R=R[0];if(R.length<2)throw new l("streams");let q0=new M,K0=q0.signal,k=J0===null||J0===void 0?void 0:J0.signal,f=[];N(k,"options.signal");function o(){m(new j)}W=W||D0().addAbortListener;let z0;if(k)z0=W(k,o);let F0,H,E=[],T=0;function p(g){m(g,--T===0)}function m(g,Q0){var T0;if(g&&(!F0||F0.code==="ERR_STREAM_PREMATURE_CLOSE"))F0=g;if(!F0&&!Q0)return;while(E.length)E.shift()(F0);if((T0=z0)===null||T0===void 0||T0[Z](),q0.abort(),Q0){if(!F0)f.forEach((E0)=>E0());B.nextTick(I0,F0,H)}}let i;for(let g=0;g<R.length;g++){let Q0=R[g],T0=g<R.length-1,E0=g>0,V0=T0||(J0===null||J0===void 0?void 0:J0.end)!==!1,m0=g===R.length-1;if(B0(Q0)){let A0=function(O0){if(O0&&O0.name!=="AbortError"&&O0.code!=="ERR_STREAM_PREMATURE_CLOSE")p(O0)};var $=A0;if(V0){let{destroy:O0,cleanup:h2}=b(Q0,T0,E0);if(E.push(O0),P(Q0)&&m0)f.push(h2)}if(Q0.on("error",A0),P(Q0)&&m0)f.push(()=>{Q0.removeListener("error",A0)})}if(g===0)if(typeof Q0==="function"){if(i=Q0({signal:K0}),!A(i))throw new x("Iterable, AsyncIterable or Stream","source",i)}else if(A(Q0)||s(Q0)||H0(Q0))i=Q0;else i=G.from(Q0);else if(typeof Q0==="function"){if(H0(i)){var y;i=X0((y=i)===null||y===void 0?void 0:y.readable)}else i=X0(i);if(i=Q0(i,{signal:K0}),T0){if(!A(i,!0))throw new x("AsyncIterable",`transform[${g-1}]`,i)}else{var r;if(!V)V=d1();let A0=new V({objectMode:!0}),O0=(r=i)===null||r===void 0?void 0:r.then;if(typeof O0==="function")T++,O0.call(i,(k0)=>{if(H=k0,k0!=null)A0.write(k0);if(V0)A0.end();B.nextTick(p)},(k0)=>{A0.destroy(k0),B.nextTick(p,k0)});else if(A(i,!0))T++,S(i,A0,p,{end:V0});else if(D(i)||H0(i)){let k0=i.readable||i;T++,S(k0,A0,p,{end:V0})}else throw new x("AsyncIterable or Promise","destination",i);i=A0;let{destroy:h2,cleanup:B2}=b(i,!1,!0);if(E.push(h2),m0)f.push(B2)}}else if(B0(Q0)){if(s(i)){T+=2;let A0=h0(i,Q0,p,{end:V0});if(P(Q0)&&m0)f.push(A0)}else if(H0(i)||D(i)){let A0=i.readable||i;T++,S(A0,Q0,p,{end:V0})}else if(A(i))T++,S(i,Q0,p,{end:V0});else throw new O("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],i);i=Q0}else if(t(Q0)){if(s(i))T++,Z0(X0(i),Q0,p,{end:V0});else if(D(i)||A(i))T++,Z0(i,Q0,p,{end:V0});else if(H0(i))T++,Z0(i.readable,Q0,p,{end:V0});else throw new O("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],i);i=Q0}else i=G.from(Q0)}if(K0!==null&&K0!==void 0&&K0.aborted||k!==null&&k!==void 0&&k.aborted)B.nextTick(o);return i}function h0(R,I0,J0,{end:q0}){let K0=!1;if(I0.on("close",()=>{if(!K0)J0(new u)}),R.pipe(I0,{end:!1}),q0){let f=function(){K0=!0,I0.end()};var k=f;if(v(R))B.nextTick(f);else R.once("end",f)}else J0();return K(R,{readable:!0,writable:!1},(f)=>{let o=R._readableState;if(f&&f.code==="ERR_STREAM_PREMATURE_CLOSE"&&o&&o.ended&&!o.errored&&!o.errorEmitted)R.once("end",J0).once("error",J0);else J0(f)}),K(I0,{readable:!1,writable:!0},J0)}h.exports={pipelineImpl:c,pipeline:Y}}),l1=G0((w,h)=>{var{pipeline:B}=p2(),U=g0(),{destroyer:I}=I2(),{isNodeStream:X,isReadable:Z,isWritable:K,isWebStream:q,isTransformStream:z,isWritableStream:G,isReadableStream:C}=b0(),{AbortError:O,codes:{ERR_INVALID_ARG_VALUE:x,ERR_MISSING_ARGS:l}}=L0(),a=d0();h.exports=function(...j){if(j.length===0)throw new l("streams");if(j.length===1)return U.from(j[0]);let F=[...j];if(typeof j[0]==="function")j[0]=U.from(j[0]);if(typeof j[j.length-1]==="function"){let V=j.length-1;j[V]=U.from(j[V])}for(let V=0;V<j.length;++V){if(!X(j[V])&&!q(j[V]))continue;if(V<j.length-1&&!(Z(j[V])||C(j[V])||z(j[V])))throw new x(`streams[${V}]`,F[V],"must be readable");if(V>0&&!(K(j[V])||G(j[V])||z(j[V])))throw new x(`streams[${V}]`,F[V],"must be writable")}let N,A,P,s,B0;function H0(V){let L=s;if(s=null,L)L(V);else if(V)B0.destroy(V);else if(!M&&!v)B0.destroy()}let t=j[0],D=B(j,H0),v=!!(K(t)||G(t)||z(t)),M=!!(Z(D)||C(D)||z(D));if(B0=new U({writableObjectMode:!!(t!==null&&t!==void 0&&t.writableObjectMode),readableObjectMode:!!(D!==null&&D!==void 0&&D.readableObjectMode),writable:v,readable:M}),v){if(X(t))B0._write=function(L,W,b){if(t.write(L,W))b();else N=b},B0._final=function(L){t.end(),A=L},t.on("drain",function(){if(N){let L=N;N=null,L()}});else if(q(t)){let L=(z(t)?t.writable:t).getWriter();B0._write=async function(W,b,e){try{await L.ready,L.write(W).catch(()=>{}),e()}catch(X0){e(X0)}},B0._final=async function(W){try{await L.ready,L.close().catch(()=>{}),A=W}catch(b){W(b)}}}let V=z(D)?D.readable:D;a(V,()=>{if(A){let L=A;A=null,L()}})}if(M){if(X(D))D.on("readable",function(){if(P){let V=P;P=null,V()}}),D.on("end",function(){B0.push(null)}),B0._read=function(){while(!0){let V=D.read();if(V===null){P=B0._read;return}if(!B0.push(V))return}};else if(q(D)){let V=(z(D)?D.readable:D).getReader();B0._read=async function(){while(!0)try{let{value:L,done:W}=await V.read();if(!B0.push(L))return;if(W){B0.push(null);return}}catch{return}}}}return B0._destroy=function(V,L){if(!V&&s!==null)V=new O;if(P=null,N=null,A=null,s===null)L(V);else if(s=L,X(D))I(D,V)},B0}}),E8=G0((w,h)=>{var B=globalThis.AbortController||H2().AbortController,{codes:{ERR_INVALID_ARG_VALUE:U,ERR_INVALID_ARG_TYPE:I,ERR_MISSING_ARGS:X,ERR_OUT_OF_RANGE:Z},AbortError:K}=L0(),{validateAbortSignal:q,validateInteger:z,validateObject:G}=$2(),C=N0().Symbol("kWeak"),O=N0().Symbol("kResistStopPropagation"),{finished:x}=d0(),l=l1(),{addAbortSignalNoValidate:a}=V2(),{isWritable:u,isNodeStream:j}=b0(),{deprecate:F}=D0(),{ArrayPrototypePush:N,Boolean:A,MathFloor:P,Number:s,NumberIsNaN:B0,Promise:H0,PromiseReject:t,PromiseResolve:D,PromisePrototypeThen:v,Symbol:M}=N0(),V=M("kEmpty"),L=M("kEof");function W(k,f){if(f!=null)G(f,"options");if((f===null||f===void 0?void 0:f.signal)!=null)q(f.signal,"options.signal");if(j(k)&&!u(k))throw new U("stream",k,"must be writable");let o=l(this,k);if(f!==null&&f!==void 0&&f.signal)a(f.signal,o);return o}function b(k,f){if(typeof k!=="function")throw new I("fn",["Function","AsyncFunction"],k);if(f!=null)G(f,"options");if((f===null||f===void 0?void 0:f.signal)!=null)q(f.signal,"options.signal");let o=1;if((f===null||f===void 0?void 0:f.concurrency)!=null)o=P(f.concurrency);let z0=o-1;if((f===null||f===void 0?void 0:f.highWaterMark)!=null)z0=P(f.highWaterMark);return z(o,"options.concurrency",1),z(z0,"options.highWaterMark",0),z0+=o,async function*(){let H=D0().AbortSignalAny([f===null||f===void 0?void 0:f.signal].filter(A)),E=this,T=[],p={signal:H},m,i,$=!1,y=0;function r(){$=!0,g()}function g(){y-=1,Q0()}function Q0(){if(i&&!$&&y<o&&T.length<z0)i(),i=null}async function T0(){try{for await(let E0 of E){if($)return;if(H.aborted)throw new K;try{if(E0=k(E0,p),E0===V)continue;E0=D(E0)}catch(V0){E0=t(V0)}if(y+=1,v(E0,g,r),T.push(E0),m)m(),m=null;if(!$&&(T.length>=z0||y>=o))await new H0((V0)=>{i=V0})}T.push(L)}catch(E0){let V0=t(E0);v(V0,g,r),T.push(V0)}finally{if($=!0,m)m(),m=null}}T0();try{while(!0){while(T.length>0){let E0=await T[0];if(E0===L)return;if(H.aborted)throw new K;if(E0!==V)yield E0;T.shift(),Q0()}await new H0((E0)=>{m=E0})}}finally{if($=!0,i)i(),i=null}}.call(this)}function e(k=void 0){if(k!=null)G(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)q(k.signal,"options.signal");return async function*(){let o=0;for await(let F0 of this){var z0;if(k!==null&&k!==void 0&&(z0=k.signal)!==null&&z0!==void 0&&z0.aborted)throw new K({cause:k.signal.reason});yield[o++,F0]}}.call(this)}async function X0(k,f=void 0){for await(let o of Y.call(this,k,f))return!0;return!1}async function Y0(k,f=void 0){if(typeof k!=="function")throw new I("fn",["Function","AsyncFunction"],k);return!await X0.call(this,async(...o)=>{return!await k(...o)},f)}async function S(k,f){for await(let o of Y.call(this,k,f))return o;return}async function Z0(k,f){if(typeof k!=="function")throw new I("fn",["Function","AsyncFunction"],k);async function o(z0,F0){return await k(z0,F0),V}for await(let z0 of b.call(this,o,f));}function Y(k,f){if(typeof k!=="function")throw new I("fn",["Function","AsyncFunction"],k);async function o(z0,F0){if(await k(z0,F0))return z0;return V}return b.call(this,o,f)}class c extends X{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function h0(k,f,o){var z0;if(typeof k!=="function")throw new I("reducer",["Function","AsyncFunction"],k);if(o!=null)G(o,"options");if((o===null||o===void 0?void 0:o.signal)!=null)q(o.signal,"options.signal");let F0=arguments.length>1;if(o!==null&&o!==void 0&&(z0=o.signal)!==null&&z0!==void 0&&z0.aborted){let m=new K(void 0,{cause:o.signal.reason});throw this.once("error",()=>{}),await x(this.destroy(m)),m}let H=new B,E=H.signal;if(o!==null&&o!==void 0&&o.signal){let m={once:!0,[C]:this,[O]:!0};o.signal.addEventListener("abort",()=>H.abort(),m)}let T=!1;try{for await(let m of this){var p;if(T=!0,o!==null&&o!==void 0&&(p=o.signal)!==null&&p!==void 0&&p.aborted)throw new K;if(!F0)f=m,F0=!0;else f=await k(f,m,{signal:E})}if(!T&&!F0)throw new c}finally{H.abort()}return f}async function R(k){if(k!=null)G(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)q(k.signal,"options.signal");let f=[];for await(let z0 of this){var o;if(k!==null&&k!==void 0&&(o=k.signal)!==null&&o!==void 0&&o.aborted)throw new K(void 0,{cause:k.signal.reason});N(f,z0)}return f}function I0(k,f){let o=b.call(this,k,f);return async function*(){for await(let F0 of o)yield*F0}.call(this)}function J0(k){if(k=s(k),B0(k))return 0;if(k<0)throw new Z("number",">= 0",k);return k}function q0(k,f=void 0){if(f!=null)G(f,"options");if((f===null||f===void 0?void 0:f.signal)!=null)q(f.signal,"options.signal");return k=J0(k),async function*(){var z0;if(f!==null&&f!==void 0&&(z0=f.signal)!==null&&z0!==void 0&&z0.aborted)throw new K;for await(let H of this){var F0;if(f!==null&&f!==void 0&&(F0=f.signal)!==null&&F0!==void 0&&F0.aborted)throw new K;if(k--<=0)yield H}}.call(this)}function K0(k,f=void 0){if(f!=null)G(f,"options");if((f===null||f===void 0?void 0:f.signal)!=null)q(f.signal,"options.signal");return k=J0(k),async function*(){var z0;if(f!==null&&f!==void 0&&(z0=f.signal)!==null&&z0!==void 0&&z0.aborted)throw new K;for await(let H of this){var F0;if(f!==null&&f!==void 0&&(F0=f.signal)!==null&&F0!==void 0&&F0.aborted)throw new K;if(k-- >0)yield H;if(k<=0)return}}.call(this)}h.exports.streamReturningOperators={asIndexedPairs:F(e,"readable.asIndexedPairs will be removed in a future version."),drop:q0,filter:Y,flatMap:I0,map:b,take:K0,compose:W},h.exports.promiseReturningOperators={every:Y0,forEach:Z0,reduce:h0,toArray:R,some:X0,find:S}}),m1=G0((w,h)=>{var{ArrayPrototypePop:B,Promise:U}=N0(),{isIterable:I,isNodeStream:X,isWebStream:Z}=b0(),{pipelineImpl:K}=p2(),{finished:q}=d0();n1();function z(...G){return new U((C,O)=>{let x,l,a=G[G.length-1];if(a&&typeof a==="object"&&!X(a)&&!I(a)&&!Z(a)){let u=B(G);x=u.signal,l=u.end}K(G,(u,j)=>{if(u)O(u);else C(j)},{signal:x,end:l})})}h.exports={finished:q,pipeline:z}}),n1=G0((w,h)=>{var{Buffer:B}=(v0(),_0(u0)),{ObjectDefineProperty:U,ObjectKeys:I,ReflectApply:X}=N0(),{promisify:{custom:Z}}=D0(),{streamReturningOperators:K,promiseReturningOperators:q}=E8(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:z}}=L0(),G=l1(),{setDefaultHighWaterMark:C,getDefaultHighWaterMark:O}=j2(),{pipeline:x}=p2(),{destroyer:l}=I2(),a=d0(),u=m1(),j=b0(),F=h.exports=b2().Stream;F.isDestroyed=j.isDestroyed,F.isDisturbed=j.isDisturbed,F.isErrored=j.isErrored,F.isReadable=j.isReadable,F.isWritable=j.isWritable,F.Readable=A2();for(let A of I(K)){let P=function(...B0){if(new.target)throw z();return F.Readable.from(X(s,this,B0))},s=K[A];U(P,"name",{__proto__:null,value:s.name}),U(P,"length",{__proto__:null,value:s.length}),U(F.Readable.prototype,A,{__proto__:null,value:P,enumerable:!1,configurable:!0,writable:!0})}for(let A of I(q)){let P=function(...B0){if(new.target)throw z();return X(s,this,B0)},s=q[A];U(P,"name",{__proto__:null,value:s.name}),U(P,"length",{__proto__:null,value:s.length}),U(F.Readable.prototype,A,{__proto__:null,value:P,enumerable:!1,configurable:!0,writable:!0})}F.Writable=i2(),F.Duplex=g0(),F.Transform=p1(),F.PassThrough=d1(),F.pipeline=x;var{addAbortSignal:N}=V2();F.addAbortSignal=N,F.finished=a,F.destroy=l,F.compose=G,F.setDefaultHighWaterMark=C,F.getDefaultHighWaterMark=O,U(F,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return u}}),U(x,Z,{__proto__:null,enumerable:!0,get(){return u.pipeline}}),U(a,Z,{__proto__:null,enumerable:!0,get(){return u.finished}}),F.Stream=F,F._isUint8Array=function(P){return P instanceof Uint8Array},F._uint8ArrayToBuffer=function(P){return B.from(P.buffer,P.byteOffset,P.byteLength)}}),W8=G0((w,h)=>{var B=d2();{let U=n1(),I=m1(),X=U.Readable.destroy;h.exports=U.Readable,h.exports._uint8ArrayToBuffer=U._uint8ArrayToBuffer,h.exports._isUint8Array=U._isUint8Array,h.exports.isDisturbed=U.isDisturbed,h.exports.isErrored=U.isErrored,h.exports.isReadable=U.isReadable,h.exports.Readable=U.Readable,h.exports.Writable=U.Writable,h.exports.Duplex=U.Duplex,h.exports.Transform=U.Transform,h.exports.PassThrough=U.PassThrough,h.exports.addAbortSignal=U.addAbortSignal,h.exports.finished=U.finished,h.exports.destroy=U.destroy,h.exports.destroy=X,h.exports.pipeline=U.pipeline,h.exports.compose=U.compose,Object.defineProperty(U,"promises",{configurable:!0,enumerable:!0,get(){return I}}),h.exports.Stream=U.Stream}h.exports.default=h.exports});o1.exports=W8()});import{createOpenAI as V8}from"@ai-sdk/openai";import{EventType as j8,logger as w0,ModelType as $0,VECTOR_DIMS as r1}from"@elizaos/core";import{generateObject as A8,generateText as a1,JSONParseError as I6}from"ai";import{encodingForModel as X6}from"js-tiktoken";function W0(w,h,B){return w.getSetting(h)??process.env[h]??B}function Z2(){return typeof globalThis<"u"&&typeof globalThis.document<"u"}function M8(w){return Z2()&&!!W0(w,"OPENAI_BROWSER_BASE_URL")}function X2(w,h=!1){if(Z2())return{};let B=h?O8(w):C2(w);return B?{Authorization:`Bearer ${B}`}:{}}function l0(w){let h=W0(w,"OPENAI_BROWSER_BASE_URL"),B=Z2()&&h?h:W0(w,"OPENAI_BASE_URL","https://api.openai.com/v1");return w0.debug(`[OpenAI] Default base URL: ${B}`),B}function L8(w){let h=Z2()?W0(w,"OPENAI_BROWSER_EMBEDDING_URL")||W0(w,"OPENAI_BROWSER_BASE_URL"):W0(w,"OPENAI_EMBEDDING_URL");if(h)return w0.debug(`[OpenAI] Using specific embedding base URL: ${h}`),h;return w0.debug("[OpenAI] Falling back to general base URL for embeddings."),l0(w)}function C2(w){return W0(w,"OPENAI_API_KEY")}function O8(w){let h=W0(w,"OPENAI_EMBEDDING_API_KEY");if(h)return w0.debug("[OpenAI] Using specific embedding API key (present)"),h;return w0.debug("[OpenAI] Falling back to general API key for embeddings."),C2(w)}function s1(w){return W0(w,"OPENAI_SMALL_MODEL")??W0(w,"SMALL_MODEL","gpt-5-nano")}function t1(w){return W0(w,"OPENAI_LARGE_MODEL")??W0(w,"LARGE_MODEL","gpt-5-mini")}function x8(w){return W0(w,"OPENAI_IMAGE_DESCRIPTION_MODEL","gpt-5-nano")??"gpt-5-nano"}function e1(w){let h=W0(w,"OPENAI_EXPERIMENTAL_TELEMETRY","false"),B=String(h).toLowerCase(),U=B==="true";return w0.debug(`[OpenAI] Experimental telemetry in function: "${h}" (type: ${typeof h}, normalized: "${B}", result: ${U})`),U}function l2(w){let h=l0(w),B=C2(w)??(M8(w)?"sk-proxy":void 0);return V8({apiKey:B??"",baseURL:h})}async function D8(w,h){let B=w===$0.TEXT_SMALL?process.env.OPENAI_SMALL_MODEL??process.env.SMALL_MODEL??"gpt-5-nano":process.env.LARGE_MODEL??"gpt-5-mini";return X6(B).encode(h)}async function T8(w,h){let B=w===$0.TEXT_SMALL?process.env.OPENAI_SMALL_MODEL??process.env.SMALL_MODEL??"gpt-5-nano":process.env.OPENAI_LARGE_MODEL??process.env.LARGE_MODEL??"gpt-5-mini";return X6(B).decode(h)}async function h6(w,h,B,U){let I=l2(w),X=U(w);w0.log(`[OpenAI] Using ${B} model: ${X}`);let Z=h.temperature??0;if(!!h.schema)w0.info(`Using ${B} without schema validation (schema provided but output=no-schema)`);try{let{object:q,usage:z}=await A8({model:I.languageModel(X),output:"no-schema",prompt:h.prompt,temperature:Z,experimental_repairText:B6()});if(z)G2(w,B,h.prompt,z);return q}catch(q){if(q instanceof I6){w0.error(`[generateObject] Failed to parse JSON: ${q.message}`);let G=await B6()({text:q.text,error:q});if(G)try{let C=JSON.parse(G);return w0.info("[generateObject] Successfully repaired JSON."),C}catch(C){let O=C instanceof Error?C.message:String(C);throw w0.error(`[generateObject] Failed to parse repaired JSON: ${O}`),C}else throw w0.error("[generateObject] JSON repair failed."),q}else{let z=q instanceof Error?q.message:String(q);throw w0.error(`[generateObject] Unknown error: ${z}`),q}}}function B6(){return async({text:w,error:h})=>{try{if(h instanceof I6){let B=w.replace(/```json\n|\n```|```/g,"");return JSON.parse(B),B}return null}catch(B){let U=B instanceof Error?B.message:String(B);return w0.warn(`Failed to repair JSON text: ${U}`),null}}}function G2(w,h,B,U){w.emitEvent(j8.MODEL_USED,{provider:"openai",type:h,prompt:B,tokens:{prompt:U.inputTokens,completion:U.outputTokens,total:U.totalTokens}})}function w6(w){if(w.length<12)return"application/octet-stream";if(w[0]===82&&w[1]===73&&w[2]===70&&w[3]===70&&w[8]===87&&w[9]===65&&w[10]===86&&w[11]===69)return"audio/wav";if(w[0]===73&&w[1]===68&&w[2]===51||w[0]===255&&(w[1]&224)===224)return"audio/mpeg";if(w[0]===79&&w[1]===103&&w[2]===103&&w[3]===83)return"audio/ogg";if(w[0]===102&&w[1]===76&&w[2]===97&&w[3]===67)return"audio/flac";if(w[4]===102&&w[5]===116&&w[6]===121&&w[7]===112)return"audio/mp4";if(w[0]===26&&w[1]===69&&w[2]===223&&w[3]===163)return"audio/webm";return w0.warn("Could not detect audio format from buffer, using generic binary type"),"application/octet-stream"}async function P8(w){try{let{Readable:h}=await Promise.resolve().then(() => C6(d2(),1)),B=w.getReader();return new h({async read(){try{let{done:U,value:I}=await B.read();if(U)this.push(null);else this.push(I)}catch(U){this.destroy(U)}},destroy(U,I){B.cancel().finally(()=>I(U))}})}catch(h){let B=h instanceof Error?h.message:String(h);throw w0.error(`Failed to load node:stream module: ${B}`),Error("Cannot convert stream: node:stream module unavailable. This feature requires a Node.js environment.")}}async function U6(w,h){let B=W0(w,"OPENAI_TTS_MODEL","gpt-4o-mini-tts"),U=W0(w,"OPENAI_TTS_VOICE","nova"),I=W0(w,"OPENAI_TTS_INSTRUCTIONS",""),X=l0(w),Z=h.model||B,K=h.voice||U,q=h.instructions??I,z=h.format||"mp3";try{let G=await fetch(`${X}/audio/speech`,{method:"POST",headers:{...X2(w),"Content-Type":"application/json",...z==="mp3"?{Accept:"audio/mpeg"}:{}},body:JSON.stringify({model:Z,voice:K,input:h.text,format:z,...q&&{instructions:q}})});if(!G.ok){let C=await G.text();throw Error(`OpenAI TTS error ${G.status}: ${C}`)}if(!G.body)throw Error("OpenAI TTS response body is null");if(!Z2())return await P8(G.body);return G.body}catch(G){let C=G instanceof Error?G.message:String(G);throw Error(`Failed to fetch speech from OpenAI TTS: ${C}`)}}var _8={name:"openai",description:"OpenAI plugin",config:{OPENAI_API_KEY:process.env.OPENAI_API_KEY,OPENAI_BASE_URL:process.env.OPENAI_BASE_URL,OPENAI_SMALL_MODEL:process.env.OPENAI_SMALL_MODEL,OPENAI_LARGE_MODEL:process.env.OPENAI_LARGE_MODEL,SMALL_MODEL:process.env.SMALL_MODEL,LARGE_MODEL:process.env.LARGE_MODEL,OPENAI_EMBEDDING_MODEL:process.env.OPENAI_EMBEDDING_MODEL,OPENAI_EMBEDDING_API_KEY:process.env.OPENAI_EMBEDDING_API_KEY,OPENAI_EMBEDDING_URL:process.env.OPENAI_EMBEDDING_URL,OPENAI_EMBEDDING_DIMENSIONS:process.env.OPENAI_EMBEDDING_DIMENSIONS,OPENAI_IMAGE_DESCRIPTION_MODEL:process.env.OPENAI_IMAGE_DESCRIPTION_MODEL,OPENAI_IMAGE_DESCRIPTION_MAX_TOKENS:process.env.OPENAI_IMAGE_DESCRIPTION_MAX_TOKENS,OPENAI_EXPERIMENTAL_TELEMETRY:process.env.OPENAI_EXPERIMENTAL_TELEMETRY},async init(w,h){new Promise(async(B)=>{B();try{if(!C2(h)&&!Z2()){w0.warn("OPENAI_API_KEY is not set in environment - OpenAI functionality will be limited");return}try{let U=l0(h),I=await fetch(`${U}/models`,{headers:{...X2(h)}});if(!I.ok)w0.warn(`OpenAI API key validation failed: ${I.statusText}`),w0.warn("OpenAI functionality will be limited until a valid API key is provided");else w0.log("OpenAI API key validated successfully")}catch(U){let I=U instanceof Error?U.message:String(U);w0.warn(`Error validating OpenAI API key: ${I}`),w0.warn("OpenAI functionality will be limited until a valid API key is provided")}}catch(U){let I=U?.errors?.map((X)=>X.message).join(", ")||(U instanceof Error?U.message:String(U));w0.warn(`OpenAI plugin configuration issue: ${I} - You need to configure the OPENAI_API_KEY in your environment variables`)}})},models:{[$0.TEXT_EMBEDDING]:async(w,h)=>{let B=W0(w,"OPENAI_EMBEDDING_MODEL","text-embedding-3-small"),U=Number.parseInt(W0(w,"OPENAI_EMBEDDING_DIMENSIONS","1536")||"1536",10);if(!Object.values(r1).includes(U)){let Z=`Invalid embedding dimension: ${U}. Must be one of: ${Object.values(r1).join(", ")}`;throw w0.error(Z),Error(Z)}if(h===null){w0.debug("Creating test embedding for initialization");let Z=Array(U).fill(0);return Z[0]=0.1,Z}let I;if(typeof h==="string")I=h;else if(typeof h==="object"&&h.text)I=h.text;else{w0.warn("Invalid input format for embedding");let Z=Array(U).fill(0);return Z[0]=0.2,Z}if(!I.trim()){w0.warn("Empty text for embedding");let Z=Array(U).fill(0);return Z[0]=0.3,Z}let X=L8(w);try{let Z=await fetch(`${X}/embeddings`,{method:"POST",headers:{...X2(w,!0),"Content-Type":"application/json"},body:JSON.stringify({model:B,input:I})});if(!Z.ok){w0.error(`OpenAI API error: ${Z.status} - ${Z.statusText}`);let z=Array(U).fill(0);return z[0]=0.4,z}let K=await Z.json();if(!K?.data?.[0]?.embedding){w0.error("API returned invalid structure");let z=Array(U).fill(0);return z[0]=0.5,z}let q=K.data[0].embedding;if(K.usage){let z={inputTokens:K.usage.prompt_tokens,outputTokens:0,totalTokens:K.usage.total_tokens};G2(w,$0.TEXT_EMBEDDING,I,z)}return w0.log(`Got valid embedding with length ${q.length}`),q}catch(Z){let K=Z instanceof Error?Z.message:String(Z);w0.error(`Error generating embedding: ${K}`);let q=Array(U).fill(0);return q[0]=0.6,q}},[$0.TEXT_TOKENIZER_ENCODE]:async(w,{prompt:h,modelType:B=$0.TEXT_LARGE})=>{return await D8(B??$0.TEXT_LARGE,h)},[$0.TEXT_TOKENIZER_DECODE]:async(w,{tokens:h,modelType:B=$0.TEXT_LARGE})=>{return await T8(B??$0.TEXT_LARGE,h)},[$0.TEXT_SMALL]:async(w,{prompt:h,stopSequences:B=[],maxTokens:U=8192,temperature:I=0.7,frequencyPenalty:X=0.7,presencePenalty:Z=0.7})=>{let K=l2(w),q=s1(w),z=e1(w);w0.log(`[OpenAI] Using TEXT_SMALL model: ${q}`),w0.log(h);let{text:G,usage:C}=await a1({model:K.languageModel(q),prompt:h,system:w.character.system??void 0,temperature:I,maxOutputTokens:U,frequencyPenalty:X,presencePenalty:Z,stopSequences:B,experimental_telemetry:{isEnabled:z}});if(C)G2(w,$0.TEXT_SMALL,h,C);return G},[$0.TEXT_LARGE]:async(w,{prompt:h,stopSequences:B=[],maxTokens:U=8192,temperature:I=0.7,frequencyPenalty:X=0.7,presencePenalty:Z=0.7})=>{let K=l2(w),q=t1(w),z=e1(w);w0.log(`[OpenAI] Using TEXT_LARGE model: ${q}`),w0.log(h);let{text:G,usage:C}=await a1({model:K.languageModel(q),prompt:h,system:w.character.system??void 0,temperature:I,maxOutputTokens:U,frequencyPenalty:X,presencePenalty:Z,stopSequences:B,experimental_telemetry:{isEnabled:z}});if(C)G2(w,$0.TEXT_LARGE,h,C);return G},[$0.IMAGE]:async(w,h)=>{let B=h.n||1,U=h.size||"1024x1024",I=h.prompt,X="gpt-image-1";w0.log("[OpenAI] Using IMAGE model: gpt-image-1");let Z=l0(w);try{let K=await fetch(`${Z}/images/generations`,{method:"POST",headers:{...X2(w),"Content-Type":"application/json"},body:JSON.stringify({model:"gpt-image-1",prompt:I,n:B,size:U})});if(!K.ok)throw Error(`Failed to generate image: ${K.statusText}`);return(await K.json()).data}catch(K){let q=K instanceof Error?K.message:String(K);throw K}},[$0.IMAGE_DESCRIPTION]:async(w,h)=>{let B,U,I=x8(w);w0.log(`[OpenAI] Using IMAGE_DESCRIPTION model: ${I}`);let X=Number.parseInt(W0(w,"OPENAI_IMAGE_DESCRIPTION_MAX_TOKENS","8192")||"8192",10);if(typeof h==="string")B=h,U="Please analyze this image and provide a title and detailed description.";else B=h.imageUrl,U=h.prompt||"Please analyze this image and provide a title and detailed description.";let Z=[{role:"user",content:[{type:"text",text:U},{type:"image_url",image_url:{url:B}}]}],K=l0(w);try{let q={model:I,messages:Z,max_tokens:X},z=await fetch(`${K}/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",...X2(w)},body:JSON.stringify(q)});if(!z.ok)throw Error(`OpenAI API error: ${z.status}`);let C=await z.json(),O=C.choices?.[0]?.message?.content;if(C.usage)G2(w,$0.IMAGE_DESCRIPTION,typeof h==="string"?h:h.prompt||"",{inputTokens:C.usage.prompt_tokens,outputTokens:C.usage.completion_tokens,totalTokens:C.usage.total_tokens});if(!O)return{title:"Failed to analyze image",description:"No response from API"};if(typeof h==="object"&&h.prompt&&h.prompt!=="Please analyze this image and provide a title and detailed description.")return O;let a=O.match(/title[:\s]+(.+?)(?:\n|$)/i)?.[1]?.trim()||"Image Analysis",u=O.replace(/title[:\s]+(.+?)(?:\n|$)/i,"").trim();return{title:a,description:u}}catch(q){let z=q instanceof Error?q.message:String(q);return w0.error(`Error analyzing image: ${z}`),{title:"Failed to analyze image",description:`Error: ${z}`}}},[$0.TRANSCRIPTION]:async(w,h)=>{let B=W0(w,"OPENAI_TRANSCRIPTION_MODEL","gpt-4o-mini-transcribe");w0.log(`[OpenAI] Using TRANSCRIPTION model: ${B}`);let U=l0(w),I,X=null;if(h instanceof Blob||h instanceof File)I=h;else if(Buffer.isBuffer(h)){let z=w6(h);w0.debug(`Auto-detected audio MIME type: ${z}`),I=new Blob([h],{type:z})}else if(typeof h==="object"&&h!==null&&h.audio!=null){let z=h;if(!(z.audio instanceof Blob)&&!(z.audio instanceof File)&&!Buffer.isBuffer(z.audio))throw Error("TRANSCRIPTION param 'audio' must be a Blob/File/Buffer.");if(Buffer.isBuffer(z.audio)){let G=z.mimeType;if(!G)G=w6(z.audio),w0.debug(`Auto-detected audio MIME type: ${G}`);else w0.debug(`Using provided MIME type: ${G}`);I=new Blob([z.audio],{type:G})}else I=z.audio;if(X=z,typeof z.model==="string"&&z.model)B=z.model}else throw Error("TRANSCRIPTION expects a Blob/File/Buffer or an object { audio: Blob/File/Buffer, mimeType?, language?, response_format?, timestampGranularities?, prompt?, temperature?, model? }");let Z=I.type||"audio/webm",K=I.name||(Z.includes("mp3")||Z.includes("mpeg")?"recording.mp3":Z.includes("ogg")?"recording.ogg":Z.includes("wav")?"recording.wav":Z.includes("webm")?"recording.webm":"recording.bin"),q=new FormData;if(q.append("file",I,K),q.append("model",String(B)),X){if(typeof X.language==="string")q.append("language",String(X.language));if(typeof X.response_format==="string")q.append("response_format",String(X.response_format));if(typeof X.prompt==="string")q.append("prompt",String(X.prompt));if(typeof X.temperature==="number")q.append("temperature",String(X.temperature));if(Array.isArray(X.timestampGranularities))for(let z of X.timestampGranularities)q.append("timestamp_granularities[]",String(z))}try{let z=await fetch(`${U}/audio/transcriptions`,{method:"POST",headers:{...X2(w)},body:q});if(!z.ok)throw Error(`Failed to transcribe audio: ${z.status} ${z.statusText}`);return(await z.json()).text||""}catch(z){let G=z instanceof Error?z.message:String(z);throw w0.error(`TRANSCRIPTION error: ${G}`),z}},[$0.TEXT_TO_SPEECH]:async(w,h)=>{let B=typeof h==="string"?{text:h}:h,U=B.model||W0(w,"OPENAI_TTS_MODEL","gpt-4o-mini-tts");w0.log(`[OpenAI] Using TEXT_TO_SPEECH model: ${U}`);try{return await U6(w,B)}catch(I){let X=I instanceof Error?I.message:String(I);throw w0.error(`Error in TEXT_TO_SPEECH: ${X}`),I}},[$0.OBJECT_SMALL]:async(w,h)=>{return h6(w,h,$0.OBJECT_SMALL,s1)},[$0.OBJECT_LARGE]:async(w,h)=>{return h6(w,h,$0.OBJECT_LARGE,t1)}},tests:[{name:"openai_plugin_tests",tests:[{name:"openai_test_url_and_api_key_validation",fn:async(w)=>{let h=l0(w),B=await fetch(`${h}/models`,{headers:{Authorization:`Bearer ${C2(w)}`}}),U=await B.json();if(w0.log({data:U?.data?.length??"N/A"},"Models Available"),!B.ok)throw Error(`Failed to validate OpenAI API key: ${B.statusText}`)}},{name:"openai_test_text_embedding",fn:async(w)=>{try{let h=await w.useModel($0.TEXT_EMBEDDING,{text:"Hello, world!"});w0.log({embedding:h},"embedding")}catch(h){let B=h instanceof Error?h.message:String(h);throw w0.error(`Error in test_text_embedding: ${B}`),h}}},{name:"openai_test_text_large",fn:async(w)=>{try{let h=await w.useModel($0.TEXT_LARGE,{prompt:"What is the nature of reality in 10 words?"});if(h.length===0)throw Error("Failed to generate text");w0.log({text:h},"generated with test_text_large")}catch(h){let B=h instanceof Error?h.message:String(h);throw w0.error(`Error in test_text_large: ${B}`),h}}},{name:"openai_test_text_small",fn:async(w)=>{try{let h=await w.useModel($0.TEXT_SMALL,{prompt:"What is the nature of reality in 10 words?"});if(h.length===0)throw Error("Failed to generate text");w0.log({text:h},"generated with test_text_small")}catch(h){let B=h instanceof Error?h.message:String(h);throw w0.error(`Error in test_text_small: ${B}`),h}}},{name:"openai_test_image_generation",fn:async(w)=>{w0.log("openai_test_image_generation");try{let h=await w.useModel($0.IMAGE,{prompt:"A beautiful sunset over a calm ocean",n:1,size:"1024x1024"});w0.log({image:h},"generated with test_image_generation")}catch(h){let B=h instanceof Error?h.message:String(h);throw w0.error(`Error in test_image_generation: ${B}`),h}}},{name:"image-description",fn:async(w)=>{try{w0.log("openai_test_image_description");try{let h=await w.useModel($0.IMAGE_DESCRIPTION,"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg/537px-Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg");if(h&&typeof h==="object"&&"title"in h&&"description"in h)w0.log({result:h},"Image description");else w0.error("Invalid image description result format:",h)}catch(h){let B=h instanceof Error?h.message:String(h);w0.error(`Error in image description test: ${B}`)}}catch(h){let B=h instanceof Error?h.message:String(h);w0.error(`Error in openai_test_image_description: ${B}`)}}},{name:"openai_test_transcription",fn:async(w)=>{w0.log("openai_test_transcription");try{let B=await(await fetch("https://upload.wikimedia.org/wikipedia/en/4/40/Chris_Benoit_Voice_Message.ogg")).arrayBuffer(),U=await w.useModel($0.TRANSCRIPTION,Buffer.from(new Uint8Array(B)));w0.log({transcription:U},"generated with test_transcription")}catch(h){let B=h instanceof Error?h.message:String(h);throw w0.error(`Error in test_transcription: ${B}`),h}}},{name:"openai_test_text_tokenizer_encode",fn:async(w)=>{let B=await w.useModel($0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer encode!"});if(!Array.isArray(B)||B.length===0)throw Error("Failed to tokenize text: expected non-empty array of tokens");w0.log({tokens:B},"Tokenized output")}},{name:"openai_test_text_tokenizer_decode",fn:async(w)=>{let B=await w.useModel($0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer decode!"}),U=await w.useModel($0.TEXT_TOKENIZER_DECODE,{tokens:B});if(U!=="Hello tokenizer decode!")throw Error(`Decoded text does not match original. Expected "Hello tokenizer decode!", got "${U}"`);w0.log({decodedText:U},"Decoded text")}},{name:"openai_test_text_to_speech",fn:async(w)=>{try{if(!await U6(w,{text:"Hello, this is a test for text-to-speech."}))throw Error("Failed to generate speech");w0.log("Generated speech successfully")}catch(h){let B=h instanceof Error?h.message:String(h);throw w0.error(`Error in openai_test_text_to_speech: ${B}`),h}}}]}]},R8=_8;export{_8 as openaiPlugin,R8 as default};
|
|
1
|
+
var i6=Object.create;var{getPrototypeOf:l6,defineProperty:C2,getOwnPropertyNames:L1,getOwnPropertyDescriptor:m6}=Object,A1=Object.prototype.hasOwnProperty;var n6=(w,B,h)=>{h=w!=null?i6(l6(w)):{};let U=B||!w||!w.__esModule?C2(h,"default",{value:w,enumerable:!0}):h;for(let I of L1(w))if(!A1.call(U,I))C2(U,I,{get:()=>w[I],enumerable:!0});return U},E1=new WeakMap,_0=(w)=>{var B=E1.get(w),h;if(B)return B;if(B=C2({},"__esModule",{value:!0}),w&&typeof w==="object"||typeof w==="function")L1(w).map((U)=>!A1.call(B,U)&&C2(B,U,{get:()=>w[U],enumerable:!(h=m6(w,U))||h.enumerable}));return E1.set(w,B),B},r6=(w,B)=>()=>(B||w((B={exports:{}}).exports,B),B.exports);var O1=(w,B)=>{for(var h in B)C2(w,h,{get:B[h],enumerable:!0,configurable:!0,set:(U)=>B[h]=()=>U})};var M1=(w,B)=>()=>(w&&(B=w(w=0)),B);var b0={};O1(b0,{transcode:()=>u8,resolveObjectURL:()=>y8,kStringMaxLength:()=>i1,kMaxLength:()=>N2,isUtf8:()=>c8,isAscii:()=>v8,default:()=>g8,constants:()=>q8,btoa:()=>Q8,atob:()=>Z8,INSPECT_MAX_BYTES:()=>d1,File:()=>J8,Buffer:()=>R,Blob:()=>F8});function h8(w){var B=w.length;if(B%4>0)throw Error("Invalid string. Length must be a multiple of 4");var h=w.indexOf("=");if(h===-1)h=B;var U=h===B?0:4-h%4;return[h,U]}function w8(w,B){return(w+B)*3/4-B}function U8(w){var B,h=h8(w),U=h[0],I=h[1],X=new Uint8Array(w8(U,I)),Q=0,q=I>0?U-4:U,Y;for(Y=0;Y<q;Y+=4)B=S0[w.charCodeAt(Y)]<<18|S0[w.charCodeAt(Y+1)]<<12|S0[w.charCodeAt(Y+2)]<<6|S0[w.charCodeAt(Y+3)],X[Q++]=B>>16&255,X[Q++]=B>>8&255,X[Q++]=B&255;if(I===2)B=S0[w.charCodeAt(Y)]<<2|S0[w.charCodeAt(Y+1)]>>4,X[Q++]=B&255;if(I===1)B=S0[w.charCodeAt(Y)]<<10|S0[w.charCodeAt(Y+1)]<<4|S0[w.charCodeAt(Y+2)]>>2,X[Q++]=B>>8&255,X[Q++]=B&255;return X}function I8(w){return y0[w>>18&63]+y0[w>>12&63]+y0[w>>6&63]+y0[w&63]}function X8(w,B,h){var U,I=[];for(var X=B;X<h;X+=3)U=(w[X]<<16&16711680)+(w[X+1]<<8&65280)+(w[X+2]&255),I.push(I8(U));return I.join("")}function c1(w){var B,h=w.length,U=h%3,I=[],X=16383;for(var Q=0,q=h-U;Q<q;Q+=X)I.push(X8(w,Q,Q+X>q?q:Q+X));if(U===1)B=w[h-1],I.push(y0[B>>2]+y0[B<<4&63]+"==");else if(U===2)B=(w[h-2]<<8)+w[h-1],I.push(y0[B>>10]+y0[B>>4&63]+y0[B<<2&63]+"=");return I.join("")}function D2(w,B,h,U,I){var X,Q,q=I*8-U-1,Y=(1<<q)-1,K=Y>>1,$=-7,j=h?I-1:0,x=h?-1:1,M=w[B+j];j+=x,X=M&(1<<-$)-1,M>>=-$,$+=q;for(;$>0;X=X*256+w[B+j],j+=x,$-=8);Q=X&(1<<-$)-1,X>>=-$,$+=U;for(;$>0;Q=Q*256+w[B+j],j+=x,$-=8);if(X===0)X=1-K;else if(X===Y)return Q?NaN:(M?-1:1)*(1/0);else Q=Q+Math.pow(2,U),X=X-K;return(M?-1:1)*Q*Math.pow(2,X-U)}function p1(w,B,h,U,I,X){var Q,q,Y,K=X*8-I-1,$=(1<<K)-1,j=$>>1,x=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=U?0:X-1,d=U?1:-1,s=B<0||B===0&&1/B<0?1:0;if(B=Math.abs(B),isNaN(B)||B===1/0)q=isNaN(B)?1:0,Q=$;else{if(Q=Math.floor(Math.log(B)/Math.LN2),B*(Y=Math.pow(2,-Q))<1)Q--,Y*=2;if(Q+j>=1)B+=x/Y;else B+=x*Math.pow(2,1-j);if(B*Y>=2)Q++,Y/=2;if(Q+j>=$)q=0,Q=$;else if(Q+j>=1)q=(B*Y-1)*Math.pow(2,I),Q=Q+j;else q=B*Math.pow(2,j-1)*Math.pow(2,I),Q=0}for(;I>=8;w[h+M]=q&255,M+=d,q/=256,I-=8);Q=Q<<I|q,K+=I;for(;K>0;w[h+M]=Q&255,M+=d,Q/=256,K-=8);w[h+M-d]|=s*128}function g0(w){if(w>N2)throw RangeError('The value "'+w+'" is invalid for option "size"');let B=new Uint8Array(w);return Object.setPrototypeOf(B,R.prototype),B}function o2(w,B,h){return class extends h{constructor(){super();Object.defineProperty(this,"message",{value:B.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}function R(w,B,h){if(typeof w==="number"){if(typeof B==="string")throw TypeError('The "string" argument must be of type string. Received type number');return a2(w)}return l1(w,B,h)}function l1(w,B,h){if(typeof w==="string")return $8(w,B);if(ArrayBuffer.isView(w))return z8(w);if(w==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(c0(w,ArrayBuffer)||w&&c0(w.buffer,ArrayBuffer))return n2(w,B,h);if(typeof SharedArrayBuffer<"u"&&(c0(w,SharedArrayBuffer)||w&&c0(w.buffer,SharedArrayBuffer)))return n2(w,B,h);if(typeof w==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let U=w.valueOf&&w.valueOf();if(U!=null&&U!==w)return R.from(U,B,h);let I=G8(w);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]==="function")return R.from(w[Symbol.toPrimitive]("string"),B,h);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}function m1(w){if(typeof w!=="number")throw TypeError('"size" argument must be of type number');else if(w<0)throw RangeError('The value "'+w+'" is invalid for option "size"')}function Y8(w,B,h){if(m1(w),w<=0)return g0(w);if(B!==void 0)return typeof h==="string"?g0(w).fill(B,h):g0(w).fill(B);return g0(w)}function a2(w){return m1(w),g0(w<0?0:s2(w)|0)}function $8(w,B){if(typeof B!=="string"||B==="")B="utf8";if(!R.isEncoding(B))throw TypeError("Unknown encoding: "+B);let h=n1(w,B)|0,U=g0(h),I=U.write(w,B);if(I!==h)U=U.slice(0,I);return U}function m2(w){let B=w.length<0?0:s2(w.length)|0,h=g0(B);for(let U=0;U<B;U+=1)h[U]=w[U]&255;return h}function z8(w){if(c0(w,Uint8Array)){let B=new Uint8Array(w);return n2(B.buffer,B.byteOffset,B.byteLength)}return m2(w)}function n2(w,B,h){if(B<0||w.byteLength<B)throw RangeError('"offset" is outside of buffer bounds');if(w.byteLength<B+(h||0))throw RangeError('"length" is outside of buffer bounds');let U;if(B===void 0&&h===void 0)U=new Uint8Array(w);else if(h===void 0)U=new Uint8Array(w,B);else U=new Uint8Array(w,B,h);return Object.setPrototypeOf(U,R.prototype),U}function G8(w){if(R.isBuffer(w)){let B=s2(w.length)|0,h=g0(B);if(h.length===0)return h;return w.copy(h,0,0,B),h}if(w.length!==void 0){if(typeof w.length!=="number"||Number.isNaN(w.length))return g0(0);return m2(w)}if(w.type==="Buffer"&&Array.isArray(w.data))return m2(w.data)}function s2(w){if(w>=N2)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+N2.toString(16)+" bytes");return w|0}function n1(w,B){if(R.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||c0(w,ArrayBuffer))return w.byteLength;if(typeof w!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);let h=w.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&h===0)return 0;let I=!1;for(;;)switch(B){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return r2(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return w6(w).length;default:if(I)return U?-1:r2(w).length;B=(""+B).toLowerCase(),I=!0}}function W8(w,B,h){let U=!1;if(B===void 0||B<0)B=0;if(B>this.length)return"";if(h===void 0||h>this.length)h=this.length;if(h<=0)return"";if(h>>>=0,B>>>=0,h<=B)return"";if(!w)w="utf8";while(!0)switch(w){case"hex":return x8(this,B,h);case"utf8":case"utf-8":return o1(this,B,h);case"ascii":return O8(this,B,h);case"latin1":case"binary":return M8(this,B,h);case"base64":return L8(this,B,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D8(this,B,h);default:if(U)throw TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),U=!0}}function U2(w,B,h){let U=w[B];w[B]=w[h],w[h]=U}function r1(w,B,h,U,I){if(w.length===0)return-1;if(typeof h==="string")U=h,h=0;else if(h>2147483647)h=2147483647;else if(h<-2147483648)h=-2147483648;if(h=+h,Number.isNaN(h))h=I?0:w.length-1;if(h<0)h=w.length+h;if(h>=w.length)if(I)return-1;else h=w.length-1;else if(h<0)if(I)h=0;else return-1;if(typeof B==="string")B=R.from(B,U);if(R.isBuffer(B)){if(B.length===0)return-1;return u1(w,B,h,U,I)}else if(typeof B==="number"){if(B=B&255,typeof Uint8Array.prototype.indexOf==="function")if(I)return Uint8Array.prototype.indexOf.call(w,B,h);else return Uint8Array.prototype.lastIndexOf.call(w,B,h);return u1(w,[B],h,U,I)}throw TypeError("val must be string, number or Buffer")}function u1(w,B,h,U,I){let X=1,Q=w.length,q=B.length;if(U!==void 0){if(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le"){if(w.length<2||B.length<2)return-1;X=2,Q/=2,q/=2,h/=2}}function Y($,j){if(X===1)return $[j];else return $.readUInt16BE(j*X)}let K;if(I){let $=-1;for(K=h;K<Q;K++)if(Y(w,K)===Y(B,$===-1?0:K-$)){if($===-1)$=K;if(K-$+1===q)return $*X}else{if($!==-1)K-=K-$;$=-1}}else{if(h+q>Q)h=Q-q;for(K=h;K>=0;K--){let $=!0;for(let j=0;j<q;j++)if(Y(w,K+j)!==Y(B,j)){$=!1;break}if($)return K}}return-1}function C8(w,B,h,U){h=Number(h)||0;let I=w.length-h;if(!U)U=I;else if(U=Number(U),U>I)U=I;let X=B.length;if(U>X/2)U=X/2;let Q;for(Q=0;Q<U;++Q){let q=parseInt(B.substr(Q*2,2),16);if(Number.isNaN(q))return Q;w[h+Q]=q}return Q}function N8(w,B,h,U){return P2(r2(B,w.length-h),w,h,U)}function V8(w,B,h,U){return P2(_8(B),w,h,U)}function j8(w,B,h,U){return P2(w6(B),w,h,U)}function E8(w,B,h,U){return P2(f8(B,w.length-h),w,h,U)}function L8(w,B,h){if(B===0&&h===w.length)return c1(w);else return c1(w.slice(B,h))}function o1(w,B,h){h=Math.min(w.length,h);let U=[],I=B;while(I<h){let X=w[I],Q=null,q=X>239?4:X>223?3:X>191?2:1;if(I+q<=h){let Y,K,$,j;switch(q){case 1:if(X<128)Q=X;break;case 2:if(Y=w[I+1],(Y&192)===128){if(j=(X&31)<<6|Y&63,j>127)Q=j}break;case 3:if(Y=w[I+1],K=w[I+2],(Y&192)===128&&(K&192)===128){if(j=(X&15)<<12|(Y&63)<<6|K&63,j>2047&&(j<55296||j>57343))Q=j}break;case 4:if(Y=w[I+1],K=w[I+2],$=w[I+3],(Y&192)===128&&(K&192)===128&&($&192)===128){if(j=(X&15)<<18|(Y&63)<<12|(K&63)<<6|$&63,j>65535&&j<1114112)Q=j}}}if(Q===null)Q=65533,q=1;else if(Q>65535)Q-=65536,U.push(Q>>>10&1023|55296),Q=56320|Q&1023;U.push(Q),I+=q}return A8(U)}function A8(w){let B=w.length;if(B<=g1)return String.fromCharCode.apply(String,w);let h="",U=0;while(U<B)h+=String.fromCharCode.apply(String,w.slice(U,U+=g1));return h}function O8(w,B,h){let U="";h=Math.min(w.length,h);for(let I=B;I<h;++I)U+=String.fromCharCode(w[I]&127);return U}function M8(w,B,h){let U="";h=Math.min(w.length,h);for(let I=B;I<h;++I)U+=String.fromCharCode(w[I]);return U}function x8(w,B,h){let U=w.length;if(!B||B<0)B=0;if(!h||h<0||h>U)h=U;let I="";for(let X=B;X<h;++X)I+=S8[w[X]];return I}function D8(w,B,h){let U=w.slice(B,h),I="";for(let X=0;X<U.length-1;X+=2)I+=String.fromCharCode(U[X]+U[X+1]*256);return I}function E0(w,B,h){if(w%1!==0||w<0)throw RangeError("offset is not uint");if(w+B>h)throw RangeError("Trying to access beyond buffer length")}function x0(w,B,h,U,I,X){if(!R.isBuffer(w))throw TypeError('"buffer" argument must be a Buffer instance');if(B>I||B<X)throw RangeError('"value" argument is out of bounds');if(h+U>w.length)throw RangeError("Index out of range")}function a1(w,B,h,U,I){h6(B,U,I,w,h,7);let X=Number(B&BigInt(4294967295));w[h++]=X,X=X>>8,w[h++]=X,X=X>>8,w[h++]=X,X=X>>8,w[h++]=X;let Q=Number(B>>BigInt(32)&BigInt(4294967295));return w[h++]=Q,Q=Q>>8,w[h++]=Q,Q=Q>>8,w[h++]=Q,Q=Q>>8,w[h++]=Q,h}function s1(w,B,h,U,I){h6(B,U,I,w,h,7);let X=Number(B&BigInt(4294967295));w[h+7]=X,X=X>>8,w[h+6]=X,X=X>>8,w[h+5]=X,X=X>>8,w[h+4]=X;let Q=Number(B>>BigInt(32)&BigInt(4294967295));return w[h+3]=Q,Q=Q>>8,w[h+2]=Q,Q=Q>>8,w[h+1]=Q,Q=Q>>8,w[h]=Q,h+8}function t1(w,B,h,U,I,X){if(h+U>w.length)throw RangeError("Index out of range");if(h<0)throw RangeError("Index out of range")}function e1(w,B,h,U,I){if(B=+B,h=h>>>0,!I)t1(w,B,h,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return p1(w,B,h,U,23,4),h+4}function B6(w,B,h,U,I){if(B=+B,h=h>>>0,!I)t1(w,B,h,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return p1(w,B,h,U,52,8),h+8}function b1(w){let B="",h=w.length,U=w[0]==="-"?1:0;for(;h>=U+4;h-=3)B=`_${w.slice(h-3,h)}${B}`;return`${w.slice(0,h)}${B}`}function P8(w,B,h){if($2(B,"offset"),w[B]===void 0||w[B+h]===void 0)V2(B,w.length-(h+1))}function h6(w,B,h,U,I,X){if(w>h||w<B){let Q=typeof B==="bigint"?"n":"",q;if(X>3)if(B===0||B===BigInt(0))q=`>= 0${Q} and < 2${Q} ** ${(X+1)*8}${Q}`;else q=`>= -(2${Q} ** ${(X+1)*8-1}${Q}) and < 2 ** ${(X+1)*8-1}${Q}`;else q=`>= ${B}${Q} and <= ${h}${Q}`;throw new l2("value",q,w)}P8(U,I,X)}function $2(w,B){if(typeof w!=="number")throw new H8(B,"number",w)}function V2(w,B,h){if(Math.floor(w)!==w)throw $2(w,h),new l2(h||"offset","an integer",w);if(B<0)throw new K8;throw new l2(h||"offset",`>= ${h?1:0} and <= ${B}`,w)}function R8(w){if(w=w.split("=")[0],w=w.trim().replace(T8,""),w.length<2)return"";while(w.length%4!==0)w=w+"=";return w}function r2(w,B){B=B||1/0;let h,U=w.length,I=null,X=[];for(let Q=0;Q<U;++Q){if(h=w.charCodeAt(Q),h>55295&&h<57344){if(!I){if(h>56319){if((B-=3)>-1)X.push(239,191,189);continue}else if(Q+1===U){if((B-=3)>-1)X.push(239,191,189);continue}I=h;continue}if(h<56320){if((B-=3)>-1)X.push(239,191,189);I=h;continue}h=(I-55296<<10|h-56320)+65536}else if(I){if((B-=3)>-1)X.push(239,191,189)}if(I=null,h<128){if((B-=1)<0)break;X.push(h)}else if(h<2048){if((B-=2)<0)break;X.push(h>>6|192,h&63|128)}else if(h<65536){if((B-=3)<0)break;X.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((B-=4)<0)break;X.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw Error("Invalid code point")}return X}function _8(w){let B=[];for(let h=0;h<w.length;++h)B.push(w.charCodeAt(h)&255);return B}function f8(w,B){let h,U,I,X=[];for(let Q=0;Q<w.length;++Q){if((B-=2)<0)break;h=w.charCodeAt(Q),U=h>>8,I=h%256,X.push(I),X.push(U)}return X}function w6(w){return U8(R8(w))}function P2(w,B,h,U){let I;for(I=0;I<U;++I){if(I+h>=B.length||I>=w.length)break;B[I+h]=w[I]}return I}function c0(w,B){return w instanceof B||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===B.name}function n0(w){return typeof BigInt>"u"?k8:w}function k8(){throw Error("BigInt not supported")}function t2(w){return()=>{throw Error(w+" is not implemented for node:buffer browser polyfill")}}var y0,S0,i2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w2,y1,v1,d1=50,N2=2147483647,i1=536870888,Q8,Z8,J8,F8,q8,K8,H8,l2,g1=4096,T8,S8,y8,c8,v8=(w)=>{for(let B of w)if(B.charCodeAt(0)>127)return!1;return!0},u8,g8;var p0=M1(()=>{y0=[],S0=[];for(w2=0,y1=i2.length;w2<y1;++w2)y0[w2]=i2[w2],S0[i2.charCodeAt(w2)]=w2;S0[45]=62;S0[95]=63;v1=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,Q8=globalThis.btoa,Z8=globalThis.atob,J8=globalThis.File,F8=globalThis.Blob,q8={MAX_LENGTH:N2,MAX_STRING_LENGTH:i1};K8=o2("ERR_BUFFER_OUT_OF_BOUNDS",function(w){if(w)return`${w} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),H8=o2("ERR_INVALID_ARG_TYPE",function(w,B){return`The "${w}" argument must be of type number. Received type ${typeof B}`},TypeError),l2=o2("ERR_OUT_OF_RANGE",function(w,B,h){let U=`The value of "${w}" is out of range.`,I=h;if(Number.isInteger(h)&&Math.abs(h)>4294967296)I=b1(String(h));else if(typeof h==="bigint"){if(I=String(h),h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))I=b1(I);I+="n"}return U+=` It must be ${B}. Received ${I}`,U},RangeError);Object.defineProperty(R.prototype,"parent",{enumerable:!0,get:function(){if(!R.isBuffer(this))return;return this.buffer}});Object.defineProperty(R.prototype,"offset",{enumerable:!0,get:function(){if(!R.isBuffer(this))return;return this.byteOffset}});R.poolSize=8192;R.from=function(w,B,h){return l1(w,B,h)};Object.setPrototypeOf(R.prototype,Uint8Array.prototype);Object.setPrototypeOf(R,Uint8Array);R.alloc=function(w,B,h){return Y8(w,B,h)};R.allocUnsafe=function(w){return a2(w)};R.allocUnsafeSlow=function(w){return a2(w)};R.isBuffer=function(B){return B!=null&&B._isBuffer===!0&&B!==R.prototype};R.compare=function(B,h){if(c0(B,Uint8Array))B=R.from(B,B.offset,B.byteLength);if(c0(h,Uint8Array))h=R.from(h,h.offset,h.byteLength);if(!R.isBuffer(B)||!R.isBuffer(h))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(B===h)return 0;let U=B.length,I=h.length;for(let X=0,Q=Math.min(U,I);X<Q;++X)if(B[X]!==h[X]){U=B[X],I=h[X];break}if(U<I)return-1;if(I<U)return 1;return 0};R.isEncoding=function(B){switch(String(B).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}};R.concat=function(B,h){if(!Array.isArray(B))throw TypeError('"list" argument must be an Array of Buffers');if(B.length===0)return R.alloc(0);let U;if(h===void 0){h=0;for(U=0;U<B.length;++U)h+=B[U].length}let I=R.allocUnsafe(h),X=0;for(U=0;U<B.length;++U){let Q=B[U];if(c0(Q,Uint8Array))if(X+Q.length>I.length){if(!R.isBuffer(Q))Q=R.from(Q);Q.copy(I,X)}else Uint8Array.prototype.set.call(I,Q,X);else if(!R.isBuffer(Q))throw TypeError('"list" argument must be an Array of Buffers');else Q.copy(I,X);X+=Q.length}return I};R.byteLength=n1;R.prototype._isBuffer=!0;R.prototype.swap16=function(){let B=this.length;if(B%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<B;h+=2)U2(this,h,h+1);return this};R.prototype.swap32=function(){let B=this.length;if(B%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<B;h+=4)U2(this,h,h+3),U2(this,h+1,h+2);return this};R.prototype.swap64=function(){let B=this.length;if(B%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<B;h+=8)U2(this,h,h+7),U2(this,h+1,h+6),U2(this,h+2,h+5),U2(this,h+3,h+4);return this};R.prototype.toString=function(){let B=this.length;if(B===0)return"";if(arguments.length===0)return o1(this,0,B);return W8.apply(this,arguments)};R.prototype.toLocaleString=R.prototype.toString;R.prototype.equals=function(B){if(!R.isBuffer(B))throw TypeError("Argument must be a Buffer");if(this===B)return!0;return R.compare(this,B)===0};R.prototype.inspect=function(){let B="",h=d1;if(B=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h)B+=" ... ";return"<Buffer "+B+">"};if(v1)R.prototype[v1]=R.prototype.inspect;R.prototype.compare=function(B,h,U,I,X){if(c0(B,Uint8Array))B=R.from(B,B.offset,B.byteLength);if(!R.isBuffer(B))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof B);if(h===void 0)h=0;if(U===void 0)U=B?B.length:0;if(I===void 0)I=0;if(X===void 0)X=this.length;if(h<0||U>B.length||I<0||X>this.length)throw RangeError("out of range index");if(I>=X&&h>=U)return 0;if(I>=X)return-1;if(h>=U)return 1;if(h>>>=0,U>>>=0,I>>>=0,X>>>=0,this===B)return 0;let Q=X-I,q=U-h,Y=Math.min(Q,q),K=this.slice(I,X),$=B.slice(h,U);for(let j=0;j<Y;++j)if(K[j]!==$[j]){Q=K[j],q=$[j];break}if(Q<q)return-1;if(q<Q)return 1;return 0};R.prototype.includes=function(B,h,U){return this.indexOf(B,h,U)!==-1};R.prototype.indexOf=function(B,h,U){return r1(this,B,h,U,!0)};R.prototype.lastIndexOf=function(B,h,U){return r1(this,B,h,U,!1)};R.prototype.write=function(B,h,U,I){if(h===void 0)I="utf8",U=this.length,h=0;else if(U===void 0&&typeof h==="string")I=h,U=this.length,h=0;else if(isFinite(h))if(h=h>>>0,isFinite(U)){if(U=U>>>0,I===void 0)I="utf8"}else I=U,U=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let X=this.length-h;if(U===void 0||U>X)U=X;if(B.length>0&&(U<0||h<0)||h>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!I)I="utf8";let Q=!1;for(;;)switch(I){case"hex":return C8(this,B,h,U);case"utf8":case"utf-8":return N8(this,B,h,U);case"ascii":case"latin1":case"binary":return V8(this,B,h,U);case"base64":return j8(this,B,h,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E8(this,B,h,U);default:if(Q)throw TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),Q=!0}};R.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};R.prototype.slice=function(B,h){let U=this.length;if(B=~~B,h=h===void 0?U:~~h,B<0){if(B+=U,B<0)B=0}else if(B>U)B=U;if(h<0){if(h+=U,h<0)h=0}else if(h>U)h=U;if(h<B)h=B;let I=this.subarray(B,h);return Object.setPrototypeOf(I,R.prototype),I};R.prototype.readUintLE=R.prototype.readUIntLE=function(B,h,U){if(B=B>>>0,h=h>>>0,!U)E0(B,h,this.length);let I=this[B],X=1,Q=0;while(++Q<h&&(X*=256))I+=this[B+Q]*X;return I};R.prototype.readUintBE=R.prototype.readUIntBE=function(B,h,U){if(B=B>>>0,h=h>>>0,!U)E0(B,h,this.length);let I=this[B+--h],X=1;while(h>0&&(X*=256))I+=this[B+--h]*X;return I};R.prototype.readUint8=R.prototype.readUInt8=function(B,h){if(B=B>>>0,!h)E0(B,1,this.length);return this[B]};R.prototype.readUint16LE=R.prototype.readUInt16LE=function(B,h){if(B=B>>>0,!h)E0(B,2,this.length);return this[B]|this[B+1]<<8};R.prototype.readUint16BE=R.prototype.readUInt16BE=function(B,h){if(B=B>>>0,!h)E0(B,2,this.length);return this[B]<<8|this[B+1]};R.prototype.readUint32LE=R.prototype.readUInt32LE=function(B,h){if(B=B>>>0,!h)E0(B,4,this.length);return(this[B]|this[B+1]<<8|this[B+2]<<16)+this[B+3]*16777216};R.prototype.readUint32BE=R.prototype.readUInt32BE=function(B,h){if(B=B>>>0,!h)E0(B,4,this.length);return this[B]*16777216+(this[B+1]<<16|this[B+2]<<8|this[B+3])};R.prototype.readBigUInt64LE=n0(function(B){B=B>>>0,$2(B,"offset");let h=this[B],U=this[B+7];if(h===void 0||U===void 0)V2(B,this.length-8);let I=h+this[++B]*256+this[++B]*65536+this[++B]*16777216,X=this[++B]+this[++B]*256+this[++B]*65536+U*16777216;return BigInt(I)+(BigInt(X)<<BigInt(32))});R.prototype.readBigUInt64BE=n0(function(B){B=B>>>0,$2(B,"offset");let h=this[B],U=this[B+7];if(h===void 0||U===void 0)V2(B,this.length-8);let I=h*16777216+this[++B]*65536+this[++B]*256+this[++B],X=this[++B]*16777216+this[++B]*65536+this[++B]*256+U;return(BigInt(I)<<BigInt(32))+BigInt(X)});R.prototype.readIntLE=function(B,h,U){if(B=B>>>0,h=h>>>0,!U)E0(B,h,this.length);let I=this[B],X=1,Q=0;while(++Q<h&&(X*=256))I+=this[B+Q]*X;if(X*=128,I>=X)I-=Math.pow(2,8*h);return I};R.prototype.readIntBE=function(B,h,U){if(B=B>>>0,h=h>>>0,!U)E0(B,h,this.length);let I=h,X=1,Q=this[B+--I];while(I>0&&(X*=256))Q+=this[B+--I]*X;if(X*=128,Q>=X)Q-=Math.pow(2,8*h);return Q};R.prototype.readInt8=function(B,h){if(B=B>>>0,!h)E0(B,1,this.length);if(!(this[B]&128))return this[B];return(255-this[B]+1)*-1};R.prototype.readInt16LE=function(B,h){if(B=B>>>0,!h)E0(B,2,this.length);let U=this[B]|this[B+1]<<8;return U&32768?U|4294901760:U};R.prototype.readInt16BE=function(B,h){if(B=B>>>0,!h)E0(B,2,this.length);let U=this[B+1]|this[B]<<8;return U&32768?U|4294901760:U};R.prototype.readInt32LE=function(B,h){if(B=B>>>0,!h)E0(B,4,this.length);return this[B]|this[B+1]<<8|this[B+2]<<16|this[B+3]<<24};R.prototype.readInt32BE=function(B,h){if(B=B>>>0,!h)E0(B,4,this.length);return this[B]<<24|this[B+1]<<16|this[B+2]<<8|this[B+3]};R.prototype.readBigInt64LE=n0(function(B){B=B>>>0,$2(B,"offset");let h=this[B],U=this[B+7];if(h===void 0||U===void 0)V2(B,this.length-8);let I=this[B+4]+this[B+5]*256+this[B+6]*65536+(U<<24);return(BigInt(I)<<BigInt(32))+BigInt(h+this[++B]*256+this[++B]*65536+this[++B]*16777216)});R.prototype.readBigInt64BE=n0(function(B){B=B>>>0,$2(B,"offset");let h=this[B],U=this[B+7];if(h===void 0||U===void 0)V2(B,this.length-8);let I=(h<<24)+this[++B]*65536+this[++B]*256+this[++B];return(BigInt(I)<<BigInt(32))+BigInt(this[++B]*16777216+this[++B]*65536+this[++B]*256+U)});R.prototype.readFloatLE=function(B,h){if(B=B>>>0,!h)E0(B,4,this.length);return D2(this,B,!0,23,4)};R.prototype.readFloatBE=function(B,h){if(B=B>>>0,!h)E0(B,4,this.length);return D2(this,B,!1,23,4)};R.prototype.readDoubleLE=function(B,h){if(B=B>>>0,!h)E0(B,8,this.length);return D2(this,B,!0,52,8)};R.prototype.readDoubleBE=function(B,h){if(B=B>>>0,!h)E0(B,8,this.length);return D2(this,B,!1,52,8)};R.prototype.writeUintLE=R.prototype.writeUIntLE=function(B,h,U,I){if(B=+B,h=h>>>0,U=U>>>0,!I){let q=Math.pow(2,8*U)-1;x0(this,B,h,U,q,0)}let X=1,Q=0;this[h]=B&255;while(++Q<U&&(X*=256))this[h+Q]=B/X&255;return h+U};R.prototype.writeUintBE=R.prototype.writeUIntBE=function(B,h,U,I){if(B=+B,h=h>>>0,U=U>>>0,!I){let q=Math.pow(2,8*U)-1;x0(this,B,h,U,q,0)}let X=U-1,Q=1;this[h+X]=B&255;while(--X>=0&&(Q*=256))this[h+X]=B/Q&255;return h+U};R.prototype.writeUint8=R.prototype.writeUInt8=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,1,255,0);return this[h]=B&255,h+1};R.prototype.writeUint16LE=R.prototype.writeUInt16LE=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,2,65535,0);return this[h]=B&255,this[h+1]=B>>>8,h+2};R.prototype.writeUint16BE=R.prototype.writeUInt16BE=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,2,65535,0);return this[h]=B>>>8,this[h+1]=B&255,h+2};R.prototype.writeUint32LE=R.prototype.writeUInt32LE=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,4,4294967295,0);return this[h+3]=B>>>24,this[h+2]=B>>>16,this[h+1]=B>>>8,this[h]=B&255,h+4};R.prototype.writeUint32BE=R.prototype.writeUInt32BE=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,4,4294967295,0);return this[h]=B>>>24,this[h+1]=B>>>16,this[h+2]=B>>>8,this[h+3]=B&255,h+4};R.prototype.writeBigUInt64LE=n0(function(B,h=0){return a1(this,B,h,BigInt(0),BigInt("0xffffffffffffffff"))});R.prototype.writeBigUInt64BE=n0(function(B,h=0){return s1(this,B,h,BigInt(0),BigInt("0xffffffffffffffff"))});R.prototype.writeIntLE=function(B,h,U,I){if(B=+B,h=h>>>0,!I){let Y=Math.pow(2,8*U-1);x0(this,B,h,U,Y-1,-Y)}let X=0,Q=1,q=0;this[h]=B&255;while(++X<U&&(Q*=256)){if(B<0&&q===0&&this[h+X-1]!==0)q=1;this[h+X]=(B/Q>>0)-q&255}return h+U};R.prototype.writeIntBE=function(B,h,U,I){if(B=+B,h=h>>>0,!I){let Y=Math.pow(2,8*U-1);x0(this,B,h,U,Y-1,-Y)}let X=U-1,Q=1,q=0;this[h+X]=B&255;while(--X>=0&&(Q*=256)){if(B<0&&q===0&&this[h+X+1]!==0)q=1;this[h+X]=(B/Q>>0)-q&255}return h+U};R.prototype.writeInt8=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,1,127,-128);if(B<0)B=255+B+1;return this[h]=B&255,h+1};R.prototype.writeInt16LE=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,2,32767,-32768);return this[h]=B&255,this[h+1]=B>>>8,h+2};R.prototype.writeInt16BE=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,2,32767,-32768);return this[h]=B>>>8,this[h+1]=B&255,h+2};R.prototype.writeInt32LE=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,4,2147483647,-2147483648);return this[h]=B&255,this[h+1]=B>>>8,this[h+2]=B>>>16,this[h+3]=B>>>24,h+4};R.prototype.writeInt32BE=function(B,h,U){if(B=+B,h=h>>>0,!U)x0(this,B,h,4,2147483647,-2147483648);if(B<0)B=4294967295+B+1;return this[h]=B>>>24,this[h+1]=B>>>16,this[h+2]=B>>>8,this[h+3]=B&255,h+4};R.prototype.writeBigInt64LE=n0(function(B,h=0){return a1(this,B,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});R.prototype.writeBigInt64BE=n0(function(B,h=0){return s1(this,B,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});R.prototype.writeFloatLE=function(B,h,U){return e1(this,B,h,!0,U)};R.prototype.writeFloatBE=function(B,h,U){return e1(this,B,h,!1,U)};R.prototype.writeDoubleLE=function(B,h,U){return B6(this,B,h,!0,U)};R.prototype.writeDoubleBE=function(B,h,U){return B6(this,B,h,!1,U)};R.prototype.copy=function(B,h,U,I){if(!R.isBuffer(B))throw TypeError("argument should be a Buffer");if(!U)U=0;if(!I&&I!==0)I=this.length;if(h>=B.length)h=B.length;if(!h)h=0;if(I>0&&I<U)I=U;if(I===U)return 0;if(B.length===0||this.length===0)return 0;if(h<0)throw RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw RangeError("Index out of range");if(I<0)throw RangeError("sourceEnd out of bounds");if(I>this.length)I=this.length;if(B.length-h<I-U)I=B.length-h+U;let X=I-U;if(this===B&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(h,U,I);else Uint8Array.prototype.set.call(B,this.subarray(U,I),h);return X};R.prototype.fill=function(B,h,U,I){if(typeof B==="string"){if(typeof h==="string")I=h,h=0,U=this.length;else if(typeof U==="string")I=U,U=this.length;if(I!==void 0&&typeof I!=="string")throw TypeError("encoding must be a string");if(typeof I==="string"&&!R.isEncoding(I))throw TypeError("Unknown encoding: "+I);if(B.length===1){let Q=B.charCodeAt(0);if(I==="utf8"&&Q<128||I==="latin1")B=Q}}else if(typeof B==="number")B=B&255;else if(typeof B==="boolean")B=Number(B);if(h<0||this.length<h||this.length<U)throw RangeError("Out of range index");if(U<=h)return this;if(h=h>>>0,U=U===void 0?this.length:U>>>0,!B)B=0;let X;if(typeof B==="number")for(X=h;X<U;++X)this[X]=B;else{let Q=R.isBuffer(B)?B:R.from(B,I),q=Q.length;if(q===0)throw TypeError('The value "'+B+'" is invalid for argument "value"');for(X=0;X<U-h;++X)this[X+h]=Q[X%q]}return this};T8=/[^+/0-9A-Za-z-_]/g;S8=function(){let w=Array(256);for(let B=0;B<16;++B){let h=B*16;for(let U=0;U<16;++U)w[h+U]="0123456789abcdef"[B]+"0123456789abcdef"[U]}return w}();y8=t2("resolveObjectURL"),c8=t2("isUtf8"),u8=t2("transcode"),g8=R});var E2={};O1(E2,{setMaxListeners:()=>Y6,once:()=>K6,listenerCount:()=>$6,init:()=>r0,getMaxListeners:()=>G6,getEventListeners:()=>H6,default:()=>o8,captureRejectionSymbol:()=>Z6,addAbortListener:()=>W6,EventEmitter:()=>r0});function J6(w,B){var{_events:h}=w;if(B[0]??=Error("Unhandled error."),!h)throw B[0];var U=h[Q6];if(U)for(var I of I6.call(U))I.apply(w,B);var X=h.error;if(!X)throw B[0];for(var I of I6.call(X))I.apply(w,B);return!0}function d8(w,B,h,U){B.then(void 0,function(I){queueMicrotask(()=>i8(w,I,h,U))})}function i8(w,B,h,U){if(typeof w[U6]==="function")w[U6](B,h,...U);else try{w[I2]=!1,w.emit("error",B)}finally{w[I2]=!0}}function F6(w,B,h){h.warned=!0;let U=Error(`Possible EventEmitter memory leak detected. ${h.length} ${String(B)} listeners added to [${w.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);U.name="MaxListenersExceededWarning",U.emitter=w,U.type=B,U.count=h.length,console.warn(U)}function q6(w,B,...h){this.removeListener(w,B),B.apply(this,h)}function K6(w,B,h){var U=h?.signal;if(z6(U,"options.signal"),U?.aborted)throw new e2(void 0,{cause:U?.reason});let{resolve:I,reject:X,promise:Q}=$newPromiseCapability(Promise),q=($)=>{if(w.removeListener(B,Y),U!=null)T2(U,"abort",K);X($)},Y=(...$)=>{if(typeof w.removeListener==="function")w.removeListener("error",q);if(U!=null)T2(U,"abort",K);I($)};if(X6(w,B,Y,{once:!0}),B!=="error"&&typeof w.once==="function")w.once("error",q);function K(){T2(w,B,Y),T2(w,"error",q),X(new e2(void 0,{cause:U?.reason}))}if(U!=null)X6(U,"abort",K,{once:!0});return Q}function H6(w,B){return w.listeners(B)}function Y6(w,...B){h1(w,"setMaxListeners",0);var h;if(B&&(h=B.length))for(let U=0;U<h;U++)B[U].setMaxListeners(w);else X2=w}function $6(w,B){return w.listenerCount(B)}function T2(w,B,h,U){if(typeof w.removeListener==="function")w.removeListener(B,h);else w.removeEventListener(B,h,U)}function X6(w,B,h,U){if(typeof w.on==="function")if(U.once)w.once(B,h);else w.on(B,h);else w.addEventListener(B,h,U)}function z2(w,B,h){let U=TypeError(`The "${w}" argument must be of type ${B}. Received ${h}`);return U.code="ERR_INVALID_ARG_TYPE",U}function n8(w,B,h){let U=RangeError(`The "${w}" argument is out of range. It must be ${B}. Received ${h}`);return U.code="ERR_OUT_OF_RANGE",U}function z6(w,B){if(w!==void 0&&(w===null||typeof w!=="object"||!("aborted"in w)))throw z2(B,"AbortSignal",w)}function h1(w,B,h,U){if(typeof w!=="number")throw z2(B,"number",w);if(h!=null&&w<h||U!=null&&w>U||(h!=null||U!=null)&&Number.isNaN(w))throw n8(B,`${h!=null?`>= ${h}`:""}${h!=null&&U!=null?" && ":""}${U!=null?`<= ${U}`:""}`,w)}function j2(w){if(typeof w!=="function")throw TypeError("The listener must be a function")}function r8(w,B){if(typeof w!=="boolean")throw z2(B,"boolean",w)}function G6(w){return w?._maxListeners??X2}function W6(w,B){if(w===void 0)throw z2("signal","AbortSignal",w);if(z6(w,"signal"),typeof B!=="function")throw z2("listener","function",B);let h;if(w.aborted)queueMicrotask(()=>B());else w.addEventListener("abort",B,{__proto__:null,once:!0}),h=()=>{w.removeEventListener("abort",B)};return{__proto__:null,[Symbol.dispose](){h?.()}}}var B1,I2,Q6,b8,p8,U6,Z6,I6,X2=10,r0=function(B){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[I2]=B?.captureRejections?Boolean(B?.captureRejections):G0[I2])this.emit=m8},G0,l8=function(B,...h){if(B==="error")return J6(this,h);var{_events:U}=this;if(U===void 0)return!1;var I=U[B];if(I===void 0)return!1;let X=I.length>1?I.slice():I;for(let Q=0,{length:q}=X;Q<q;Q++){let Y=X[Q];switch(h.length){case 0:Y.call(this);break;case 1:Y.call(this,h[0]);break;case 2:Y.call(this,h[0],h[1]);break;case 3:Y.call(this,h[0],h[1],h[2]);break;default:Y.apply(this,h);break}}return!0},m8=function(B,...h){if(B==="error")return J6(this,h);var{_events:U}=this;if(U===void 0)return!1;var I=U[B];if(I===void 0)return!1;let X=I.length>1?I.slice():I;for(let Q=0,{length:q}=X;Q<q;Q++){let Y=X[Q],K;switch(h.length){case 0:K=Y.call(this);break;case 1:K=Y.call(this,h[0]);break;case 2:K=Y.call(this,h[0],h[1]);break;case 3:K=Y.call(this,h[0],h[1],h[2]);break;default:K=Y.apply(this,h);break}if(K!==void 0&&typeof K?.then==="function"&&K.then===Promise.prototype.then)d8(this,K,B,h)}return!0},e2,o8;var L2=M1(()=>{B1=Symbol.for,I2=Symbol("kCapture"),Q6=B1("events.errorMonitor"),b8=Symbol("events.maxEventTargetListeners"),p8=Symbol("events.maxEventTargetListenersWarned"),U6=B1("nodejs.rejection"),Z6=B1("nodejs.rejection"),I6=Array.prototype.slice,G0=r0.prototype={};G0._events=void 0;G0._eventsCount=0;G0._maxListeners=void 0;G0.setMaxListeners=function(B){return h1(B,"setMaxListeners",0),this._maxListeners=B,this};G0.constructor=r0;G0.getMaxListeners=function(){return this?._maxListeners??X2};G0.emit=l8;G0.addListener=function(B,h){j2(h);var U=this._events;if(!U)U=this._events={__proto__:null},this._eventsCount=0;else if(U.newListener)this.emit("newListener",B,h.listener??h);var I=U[B];if(!I)U[B]=[h],this._eventsCount++;else{I.push(h);var X=this._maxListeners??X2;if(X>0&&I.length>X&&!I.warned)F6(this,B,I)}return this};G0.on=G0.addListener;G0.prependListener=function(B,h){j2(h);var U=this._events;if(!U)U=this._events={__proto__:null},this._eventsCount=0;else if(U.newListener)this.emit("newListener",B,h.listener??h);var I=U[B];if(!I)U[B]=[h],this._eventsCount++;else{I.unshift(h);var X=this._maxListeners??X2;if(X>0&&I.length>X&&!I.warned)F6(this,B,I)}return this};G0.once=function(B,h){j2(h);let U=q6.bind(this,B,h);return U.listener=h,this.addListener(B,U),this};G0.prependOnceListener=function(B,h){j2(h);let U=q6.bind(this,B,h);return U.listener=h,this.prependListener(B,U),this};G0.removeListener=function(B,h){j2(h);var{_events:U}=this;if(!U)return this;var I=U[B];if(!I)return this;var X=I.length;let Q=-1;for(let q=X-1;q>=0;q--)if(I[q]===h||I[q].listener===h){Q=q;break}if(Q<0)return this;if(Q===0)I.shift();else I.splice(Q,1);if(I.length===0)delete U[B],this._eventsCount--;return this};G0.off=G0.removeListener;G0.removeAllListeners=function(B){var{_events:h}=this;if(B&&h){if(h[B])delete h[B],this._eventsCount--}else this._events={__proto__:null};return this};G0.listeners=function(B){var{_events:h}=this;if(!h)return[];var U=h[B];if(!U)return[];return U.map((I)=>I.listener??I)};G0.rawListeners=function(B){var{_events:h}=this;if(!h)return[];var U=h[B];if(!U)return[];return U.slice()};G0.listenerCount=function(B){var{_events:h}=this;if(!h)return 0;return h[B]?.length??0};G0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};G0[I2]=!1;e2=class e2 extends Error{constructor(w="The operation was aborted",B=void 0){if(B!==void 0&&typeof B!=="object")throw z2("options","Object",B);super(w,B);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(r0,{captureRejections:{get(){return G0[I2]},set(w){r8(w,"EventEmitter.captureRejections"),G0[I2]=w},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return X2},set:(w)=>{h1(w,"defaultMaxListeners",0),X2=w}},kMaxEventTargetListeners:{value:b8,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:p8,enumerable:!1,configurable:!1,writable:!1}});Object.assign(r0,{once:K6,getEventListeners:H6,getMaxListeners:G6,setMaxListeners:Y6,EventEmitter:r0,usingDomains:!1,captureRejectionSymbol:Z6,errorMonitor:Q6,addAbortListener:W6,init:r0,listenerCount:$6});o8=r0});var X1=r6((y4,O6)=>{var $0=(w,B)=>()=>(B||w((B={exports:{}}).exports,B),B.exports),W0=$0((w,B)=>{class h extends Error{constructor(U){if(!Array.isArray(U))throw TypeError(`Expected input to be an Array, got ${typeof U}`);let I="";for(let X=0;X<U.length;X++)I+=` ${U[X].stack}
|
|
2
|
+
`;super(I);this.name="AggregateError",this.errors=U}}B.exports={AggregateError:h,ArrayIsArray(U){return Array.isArray(U)},ArrayPrototypeIncludes(U,I){return U.includes(I)},ArrayPrototypeIndexOf(U,I){return U.indexOf(I)},ArrayPrototypeJoin(U,I){return U.join(I)},ArrayPrototypeMap(U,I){return U.map(I)},ArrayPrototypePop(U,I){return U.pop(I)},ArrayPrototypePush(U,I){return U.push(I)},ArrayPrototypeSlice(U,I,X){return U.slice(I,X)},Error,FunctionPrototypeCall(U,I,...X){return U.call(I,...X)},FunctionPrototypeSymbolHasInstance(U,I){return Function.prototype[Symbol.hasInstance].call(U,I)},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(U,I){return Object.defineProperties(U,I)},ObjectDefineProperty(U,I,X){return Object.defineProperty(U,I,X)},ObjectGetOwnPropertyDescriptor(U,I){return Object.getOwnPropertyDescriptor(U,I)},ObjectKeys(U){return Object.keys(U)},ObjectSetPrototypeOf(U,I){return Object.setPrototypeOf(U,I)},Promise,PromisePrototypeCatch(U,I){return U.catch(I)},PromisePrototypeThen(U,I,X){return U.then(I,X)},PromiseReject(U){return Promise.reject(U)},PromiseResolve(U){return Promise.resolve(U)},ReflectApply:Reflect.apply,RegExpPrototypeTest(U,I){return U.test(I)},SafeSet:Set,String,StringPrototypeSlice(U,I,X){return U.slice(I,X)},StringPrototypeToLowerCase(U){return U.toLowerCase()},StringPrototypeToUpperCase(U){return U.toUpperCase()},StringPrototypeTrim(U){return U.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(U,I,X){return U.set(I,X)},Boolean,Uint8Array}}),C6=$0((w,B)=>{B.exports={format(h,...U){return h.replace(/%([sdifj])/g,function(...[I,X]){let Q=U.shift();if(X==="f")return Q.toFixed(6);else if(X==="j")return JSON.stringify(Q);else if(X==="s"&&typeof Q==="object")return`${Q.constructor!==Object?Q.constructor.name:""} {}`.trim();else return Q.toString()})},inspect(h){switch(typeof h){case"string":if(h.includes("'")){if(!h.includes('"'))return`"${h}"`;else if(!h.includes("`")&&!h.includes("${"))return`\`${h}\``}return`'${h}'`;case"number":if(isNaN(h))return"NaN";else if(Object.is(h,-0))return String(h);return h;case"bigint":return`${String(h)}n`;case"boolean":case"undefined":return String(h);case"object":return"{}"}}}}),O0=$0((w,B)=>{var{format:h,inspect:U}=C6(),{AggregateError:I}=W0(),X=globalThis.AggregateError||I,Q=Symbol("kIsNodeError"),q=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Y=/^([A-Z][a-z0-9]*)+$/,K={};function $(E,F){if(!E)throw new K.ERR_INTERNAL_ASSERTION(F)}function j(E){let F="",W=E.length,L=E[0]==="-"?1:0;for(;W>=L+4;W-=3)F=`_${E.slice(W-3,W)}${F}`;return`${E.slice(0,W)}${F}`}function x(E,F,W){if(typeof F==="function")return $(F.length<=W.length,`Code: ${E}; The provided arguments length (${W.length}) does not match the required ones (${F.length}).`),F(...W);let L=(F.match(/%[dfijoOs]/g)||[]).length;if($(L===W.length,`Code: ${E}; The provided arguments length (${W.length}) does not match the required ones (${L}).`),W.length===0)return F;return h(F,...W)}function M(E,F,W){if(!W)W=Error;class L extends W{constructor(...T){super(x(E,F,T))}toString(){return`${this.name} [${E}]: ${this.message}`}}Object.defineProperties(L.prototype,{name:{value:W.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${E}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),L.prototype.code=E,L.prototype[Q]=!0,K[E]=L}function d(E){let F="__node_internal_"+E.name;return Object.defineProperty(E,"name",{value:F}),E}function s(E,F){if(E&&F&&E!==F){if(Array.isArray(F.errors))return F.errors.push(E),F;let W=new X([F,E],F.message);return W.code=F.code,W}return E||F}class c extends Error{constructor(E="The operation was aborted",F=void 0){if(F!==void 0&&typeof F!=="object")throw new K.ERR_INVALID_ARG_TYPE("options","Object",F);super(E,F);this.code="ABORT_ERR",this.name="AbortError"}}M("ERR_ASSERTION","%s",Error),M("ERR_INVALID_ARG_TYPE",(E,F,W)=>{if($(typeof E==="string","'name' must be a string"),!Array.isArray(F))F=[F];let L="The ";if(E.endsWith(" argument"))L+=`${E} `;else L+=`"${E}" ${E.includes(".")?"property":"argument"} `;L+="must be ";let T=[],a=[],h0=[];for(let t of F)if($(typeof t==="string","All expected entries have to be of type string"),q.includes(t))T.push(t.toLowerCase());else if(Y.test(t))a.push(t);else $(t!=="object",'The value "object" should be written as "Object"'),h0.push(t);if(a.length>0){let t=T.indexOf("object");if(t!==-1)T.splice(T,t,1),a.push("Object")}if(T.length>0){switch(T.length){case 1:L+=`of type ${T[0]}`;break;case 2:L+=`one of type ${T[0]} or ${T[1]}`;break;default:{let t=T.pop();L+=`one of type ${T.join(", ")}, or ${t}`}}if(a.length>0||h0.length>0)L+=" or "}if(a.length>0){switch(a.length){case 1:L+=`an instance of ${a[0]}`;break;case 2:L+=`an instance of ${a[0]} or ${a[1]}`;break;default:{let t=a.pop();L+=`an instance of ${a.join(", ")}, or ${t}`}}if(h0.length>0)L+=" or "}switch(h0.length){case 0:break;case 1:if(h0[0].toLowerCase()!==h0[0])L+="an ";L+=`${h0[0]}`;break;case 2:L+=`one of ${h0[0]} or ${h0[1]}`;break;default:{let t=h0.pop();L+=`one of ${h0.join(", ")}, or ${t}`}}if(W==null)L+=`. Received ${W}`;else if(typeof W==="function"&&W.name)L+=`. Received function ${W.name}`;else if(typeof W==="object"){var Y0;if((Y0=W.constructor)!==null&&Y0!==void 0&&Y0.name)L+=`. Received an instance of ${W.constructor.name}`;else{let t=U(W,{depth:-1});L+=`. Received ${t}`}}else{let t=U(W,{colors:!1});if(t.length>25)t=`${t.slice(0,25)}...`;L+=`. Received type ${typeof W} (${t})`}return L},TypeError),M("ERR_INVALID_ARG_VALUE",(E,F,W="is invalid")=>{let L=U(F);if(L.length>128)L=L.slice(0,128)+"...";return`The ${E.includes(".")?"property":"argument"} '${E}' ${W}. Received ${L}`},TypeError),M("ERR_INVALID_RETURN_VALUE",(E,F,W)=>{var L;let T=W!==null&&W!==void 0&&(L=W.constructor)!==null&&L!==void 0&&L.name?`instance of ${W.constructor.name}`:`type ${typeof W}`;return`Expected ${E} to be returned from the "${F}" function but got ${T}.`},TypeError),M("ERR_MISSING_ARGS",(...E)=>{$(E.length>0,"At least one arg needs to be specified");let F,W=E.length;switch(E=(Array.isArray(E)?E:[E]).map((L)=>`"${L}"`).join(" or "),W){case 1:F+=`The ${E[0]} argument`;break;case 2:F+=`The ${E[0]} and ${E[1]} arguments`;break;default:{let L=E.pop();F+=`The ${E.join(", ")}, and ${L} arguments`}break}return`${F} must be specified`},TypeError),M("ERR_OUT_OF_RANGE",(E,F,W)=>{$(F,'Missing "range" argument');let L;if(Number.isInteger(W)&&Math.abs(W)>4294967296)L=j(String(W));else if(typeof W==="bigint"){L=String(W);let T=BigInt(2)**BigInt(32);if(W>T||W<-T)L=j(L);L+="n"}else L=U(W);return`The value of "${E}" is out of range. It must be ${F}. Received ${L}`},RangeError),M("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),M("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),M("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),M("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),M("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),M("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),M("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),M("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),M("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),M("ERR_STREAM_WRITE_AFTER_END","write after end",Error),M("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),B.exports={AbortError:c,aggregateTwoErrors:d(s),hideStackFrames:d,codes:K}}),a8=$0((w,B)=>{Object.defineProperty(w,"__esModule",{value:!0});var h=new WeakMap,U=new WeakMap;function I(D){let u=h.get(D);return console.assert(u!=null,"'this' is expected an Event object, but got",D),u}function X(D){if(D.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",D.passiveListener);return}if(!D.event.cancelable)return;if(D.canceled=!0,typeof D.event.preventDefault==="function")D.event.preventDefault()}function Q(D,u){h.set(this,{eventTarget:D,event:u,eventPhase:2,currentTarget:D,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:u.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let A=Object.keys(u);for(let V=0;V<A.length;++V){let O=A[V];if(!(O in this))Object.defineProperty(this,O,q(O))}}if(Q.prototype={get type(){return I(this).event.type},get target(){return I(this).eventTarget},get currentTarget(){return I(this).currentTarget},composedPath(){let D=I(this).currentTarget;if(D==null)return[];return[D]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return I(this).eventPhase},stopPropagation(){let D=I(this);if(D.stopped=!0,typeof D.event.stopPropagation==="function")D.event.stopPropagation()},stopImmediatePropagation(){let D=I(this);if(D.stopped=!0,D.immediateStopped=!0,typeof D.event.stopImmediatePropagation==="function")D.event.stopImmediatePropagation()},get bubbles(){return Boolean(I(this).event.bubbles)},get cancelable(){return Boolean(I(this).event.cancelable)},preventDefault(){X(I(this))},get defaultPrevented(){return I(this).canceled},get composed(){return Boolean(I(this).event.composed)},get timeStamp(){return I(this).timeStamp},get srcElement(){return I(this).eventTarget},get cancelBubble(){return I(this).stopped},set cancelBubble(D){if(!D)return;let u=I(this);if(u.stopped=!0,typeof u.event.cancelBubble==="boolean")u.event.cancelBubble=!0},get returnValue(){return!I(this).canceled},set returnValue(D){if(!D)X(I(this))},initEvent(){}},Object.defineProperty(Q.prototype,"constructor",{value:Q,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(Q.prototype,window.Event.prototype),U.set(window.Event.prototype,Q);function q(D){return{get(){return I(this).event[D]},set(u){I(this).event[D]=u},configurable:!0,enumerable:!0}}function Y(D){return{value(){let u=I(this).event;return u[D].apply(u,arguments)},configurable:!0,enumerable:!0}}function K(D,u){let A=Object.keys(u);if(A.length===0)return D;function V(O,N){D.call(this,O,N)}V.prototype=Object.create(D.prototype,{constructor:{value:V,configurable:!0,writable:!0}});for(let O=0;O<A.length;++O){let N=A[O];if(!(N in D.prototype)){let b=typeof Object.getOwnPropertyDescriptor(u,N).value==="function";Object.defineProperty(V.prototype,N,b?Y(N):q(N))}}return V}function $(D){if(D==null||D===Object.prototype)return Q;let u=U.get(D);if(u==null)u=K($(Object.getPrototypeOf(D)),D),U.set(D,u);return u}function j(D,u){return new($(Object.getPrototypeOf(u)))(D,u)}function x(D){return I(D).immediateStopped}function M(D,u){I(D).eventPhase=u}function d(D,u){I(D).currentTarget=u}function s(D,u){I(D).passiveListener=u}var c=new WeakMap,E=1,F=2,W=3;function L(D){return D!==null&&typeof D==="object"}function T(D){let u=c.get(D);if(u==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return u}function a(D){return{get(){let u=T(this).get(D);while(u!=null){if(u.listenerType===W)return u.listener;u=u.next}return null},set(u){if(typeof u!=="function"&&!L(u))u=null;let A=T(this),V=null,O=A.get(D);while(O!=null){if(O.listenerType===W)if(V!==null)V.next=O.next;else if(O.next!==null)A.set(D,O.next);else A.delete(D);else V=O;O=O.next}if(u!==null){let N={listener:u,listenerType:W,passive:!1,once:!1,next:null};if(V===null)A.set(D,N);else V.next=N}},configurable:!0,enumerable:!0}}function h0(D,u){Object.defineProperty(D,`on${u}`,a(u))}function Y0(D){function u(){t.call(this)}u.prototype=Object.create(t.prototype,{constructor:{value:u,configurable:!0,writable:!0}});for(let A=0;A<D.length;++A)h0(u.prototype,D[A]);return u}function t(){if(this instanceof t){c.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Y0(arguments[0]);if(arguments.length>0){let D=Array(arguments.length);for(let u=0;u<arguments.length;++u)D[u]=arguments[u];return Y0(D)}throw TypeError("Cannot call a class as a function")}if(t.prototype={addEventListener(D,u,A){if(u==null)return;if(typeof u!=="function"&&!L(u))throw TypeError("'listener' should be a function or an object.");let V=T(this),O=L(A),N=(O?Boolean(A.capture):Boolean(A))?E:F,b={listener:u,listenerType:N,passive:O&&Boolean(A.passive),once:O&&Boolean(A.once),next:null},e=V.get(D);if(e===void 0){V.set(D,b);return}let I0=null;while(e!=null){if(e.listener===u&&e.listenerType===N)return;I0=e,e=e.next}I0.next=b},removeEventListener(D,u,A){if(u==null)return;let V=T(this),O=(L(A)?Boolean(A.capture):Boolean(A))?E:F,N=null,b=V.get(D);while(b!=null){if(b.listener===u&&b.listenerType===O){if(N!==null)N.next=b.next;else if(b.next!==null)V.set(D,b.next);else V.delete(D);return}N=b,b=b.next}},dispatchEvent(D){if(D==null||typeof D.type!=="string")throw TypeError('"event.type" should be a string.');let u=T(this),A=D.type,V=u.get(A);if(V==null)return!0;let O=j(this,D),N=null;while(V!=null){if(V.once)if(N!==null)N.next=V.next;else if(V.next!==null)u.set(A,V.next);else u.delete(A);else N=V;if(s(O,V.passive?V.listener:null),typeof V.listener==="function")try{V.listener.call(this,O)}catch(b){if(typeof console<"u"&&typeof console.error==="function")console.error(b)}else if(V.listenerType!==W&&typeof V.listener.handleEvent==="function")V.listener.handleEvent(O);if(x(O))break;V=V.next}return s(O,null),M(O,0),d(O,null),!O.defaultPrevented}},Object.defineProperty(t.prototype,"constructor",{value:t,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(t.prototype,window.EventTarget.prototype);w.defineEventAttribute=h0,w.EventTarget=t,w.default=t,B.exports=t,B.exports.EventTarget=B.exports.default=t,B.exports.defineEventAttribute=h0}),A2=$0((w,B)=>{Object.defineProperty(w,"__esModule",{value:!0});var h=a8();class U extends h.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let $=Q.get(this);if(typeof $!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return $}}h.defineEventAttribute(U.prototype,"abort");function I(){let $=Object.create(U.prototype);return h.EventTarget.call($),Q.set($,!1),$}function X($){if(Q.get($)!==!1)return;Q.set($,!0),$.dispatchEvent({type:"abort"})}var Q=new WeakMap;if(Object.defineProperties(U.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(U.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class q{constructor(){Y.set(this,I())}get signal(){return K(this)}abort(){X(K(this))}}var Y=new WeakMap;function K($){let j=Y.get($);if(j==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${$===null?"null":typeof $}`);return j}if(Object.defineProperties(q.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(q.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});w.AbortController=q,w.AbortSignal=U,w.default=q,B.exports=q,B.exports.AbortController=B.exports.default=q,B.exports.AbortSignal=U}),D0=$0((w,B)=>{var h=(p0(),_0(b0)),{format:U,inspect:I}=C6(),{codes:{ERR_INVALID_ARG_TYPE:X}}=O0(),{kResistStopPropagation:Q,AggregateError:q,SymbolDispose:Y}=W0(),K=globalThis.AbortSignal||A2().AbortSignal,$=globalThis.AbortController||A2().AbortController,j=Object.getPrototypeOf(async function(){}).constructor,x=globalThis.Blob||h.Blob,M=typeof x<"u"?function(E){return E instanceof x}:function(E){return!1},d=(c,E)=>{if(c!==void 0&&(c===null||typeof c!=="object"||!("aborted"in c)))throw new X(E,"AbortSignal",c)},s=(c,E)=>{if(typeof c!=="function")throw new X(E,"Function",c)};B.exports={AggregateError:q,kEmptyObject:Object.freeze({}),once(c){let E=!1;return function(...F){if(E)return;E=!0,c.apply(this,F)}},createDeferredPromise:function(){let c,E;return{promise:new Promise((F,W)=>{c=F,E=W}),resolve:c,reject:E}},promisify(c){return new Promise((E,F)=>{c((W,...L)=>{if(W)return F(W);return E(...L)})})},debuglog(){return function(){}},format:U,inspect:I,types:{isAsyncFunction(c){return c instanceof j},isArrayBufferView(c){return ArrayBuffer.isView(c)}},isBlob:M,deprecate(c,E){return c},addAbortListener:(L2(),_0(E2)).addAbortListener||function(E,F){if(E===void 0)throw new X("signal","AbortSignal",E);d(E,"signal"),s(F,"listener");let W;if(E.aborted)queueMicrotask(()=>F());else E.addEventListener("abort",F,{__proto__:null,once:!0,[Q]:!0}),W=()=>{E.removeEventListener("abort",F)};return{__proto__:null,[Y](){var L;(L=W)===null||L===void 0||L()}}},AbortSignalAny:K.any||function(E){if(E.length===1)return E[0];let F=new $,W=()=>F.abort();return E.forEach((L)=>{d(L,"signals"),L.addEventListener("abort",W,{once:!0})}),F.signal.addEventListener("abort",()=>{E.forEach((L)=>L.removeEventListener("abort",W))},{once:!0}),F.signal}},B.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),O2=$0((w,B)=>{var{ArrayIsArray:h,ArrayPrototypeIncludes:U,ArrayPrototypeJoin:I,ArrayPrototypeMap:X,NumberIsInteger:Q,NumberIsNaN:q,NumberMAX_SAFE_INTEGER:Y,NumberMIN_SAFE_INTEGER:K,NumberParseInt:$,ObjectPrototypeHasOwnProperty:j,RegExpPrototypeExec:x,String:M,StringPrototypeToUpperCase:d,StringPrototypeTrim:s}=W0(),{hideStackFrames:c,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:F,ERR_INVALID_ARG_VALUE:W,ERR_OUT_OF_RANGE:L,ERR_UNKNOWN_SIGNAL:T}}=O0(),{normalizeEncoding:a}=D0(),{isAsyncFunction:h0,isArrayBufferView:Y0}=D0().types,t={};function D(G){return G===(G|0)}function u(G){return G===G>>>0}var A=/^[0-7]+$/,V="must be a 32-bit unsigned integer or an octal string";function O(G,y,o){if(typeof G>"u")G=o;if(typeof G==="string"){if(x(A,G)===null)throw new W(y,G,V);G=$(G,8)}return e(G,y),G}var N=c((G,y,o=K,g=Y)=>{if(typeof G!=="number")throw new F(y,"number",G);if(!Q(G))throw new L(y,"an integer",G);if(G<o||G>g)throw new L(y,`>= ${o} && <= ${g}`,G)}),b=c((G,y,o=-2147483648,g=2147483647)=>{if(typeof G!=="number")throw new F(y,"number",G);if(!Q(G))throw new L(y,"an integer",G);if(G<o||G>g)throw new L(y,`>= ${o} && <= ${g}`,G)}),e=c((G,y,o=!1)=>{if(typeof G!=="number")throw new F(y,"number",G);if(!Q(G))throw new L(y,"an integer",G);let g=o?1:0,Q0=4294967295;if(G<g||G>Q0)throw new L(y,`>= ${g} && <= ${Q0}`,G)});function I0(G,y){if(typeof G!=="string")throw new F(y,"string",G)}function K0(G,y,o=void 0,g){if(typeof G!=="number")throw new F(y,"number",G);if(o!=null&&G<o||g!=null&&G>g||(o!=null||g!=null)&&q(G))throw new L(y,`${o!=null?`>= ${o}`:""}${o!=null&&g!=null?" && ":""}${g!=null?`<= ${g}`:""}`,G)}var S=c((G,y,o)=>{if(!U(o,G)){let g="must be one of: "+I(X(o,(Q0)=>typeof Q0==="string"?`'${Q0}'`:M(Q0)),", ");throw new W(y,G,g)}});function X0(G,y){if(typeof G!=="boolean")throw new F(y,"boolean",G)}function H(G,y,o){return G==null||!j(G,y)?o:G[y]}var v=c((G,y,o=null)=>{let g=H(o,"allowArray",!1),Q0=H(o,"allowFunction",!1);if(!H(o,"nullable",!1)&&G===null||!g&&h(G)||typeof G!=="object"&&(!Q0||typeof G!=="function"))throw new F(y,"Object",G)}),B0=c((G,y)=>{if(G!=null&&typeof G!=="object"&&typeof G!=="function")throw new F(y,"a dictionary",G)}),_=c((G,y,o=0)=>{if(!h(G))throw new F(y,"Array",G);if(G.length<o){let g=`must be longer than ${o}`;throw new W(y,G,g)}});function U0(G,y){_(G,y);for(let o=0;o<G.length;o++)I0(G[o],`${y}[${o}]`)}function Z0(G,y){_(G,y);for(let o=0;o<G.length;o++)X0(G[o],`${y}[${o}]`)}function H0(G,y){_(G,y);for(let o=0;o<G.length;o++){let g=G[o],Q0=`${y}[${o}]`;if(g==null)throw new F(Q0,"AbortSignal",g);F0(g,Q0)}}function q0(G,y="signal"){if(I0(G,y),t[G]===void 0){if(t[d(G)]!==void 0)throw new T(G+" (signals must use all capital letters)");throw new T(G)}}var f=c((G,y="buffer")=>{if(!Y0(G))throw new F(y,["Buffer","TypedArray","DataView"],G)});function k(G,y){let o=a(y),g=G.length;if(o==="hex"&&g%2!==0)throw new W("encoding",y,`is invalid for data of length ${g}`)}function r(G,y="Port",o=!0){if(typeof G!=="number"&&typeof G!=="string"||typeof G==="string"&&s(G).length===0||+G!==+G>>>0||G>65535||G===0&&!o)throw new E(y,G,o);return G|0}var F0=c((G,y)=>{if(G!==void 0&&(G===null||typeof G!=="object"||!("aborted"in G)))throw new F(y,"AbortSignal",G)}),J0=c((G,y)=>{if(typeof G!=="function")throw new F(y,"Function",G)}),z=c((G,y)=>{if(typeof G!=="function"||h0(G))throw new F(y,"Function",G)}),C=c((G,y)=>{if(G!==void 0)throw new F(y,"undefined",G)});function P(G,y,o){if(!U(o,G))throw new F(y,`('${I(o,"|")}')`,G)}var i=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function m(G,y){if(typeof G>"u"||!x(i,G))throw new W(y,G,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function p(G){if(typeof G==="string")return m(G,"hints"),G;else if(h(G)){let y=G.length,o="";if(y===0)return o;for(let g=0;g<y;g++){let Q0=G[g];if(m(Q0,"hints"),o+=Q0,g!==y-1)o+=", "}return o}throw new W("hints",G,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}B.exports={isInt32:D,isUint32:u,parseFileMode:O,validateArray:_,validateStringArray:U0,validateBooleanArray:Z0,validateAbortSignalArray:H0,validateBoolean:X0,validateBuffer:f,validateDictionary:B0,validateEncoding:k,validateFunction:J0,validateInt32:b,validateInteger:N,validateNumber:K0,validateObject:v,validateOneOf:S,validatePlainFunction:z,validatePort:r,validateSignalName:q0,validateString:I0,validateUint32:e,validateUndefined:C,validateUnion:P,validateAbortSignal:F0,validateLinkHeaderValue:p}}),Q2=$0((w,B)=>{B.exports=globalThis.process}),i0=$0((w,B)=>{var{SymbolAsyncIterator:h,SymbolIterator:U,SymbolFor:I}=W0(),X=I("nodejs.stream.destroyed"),Q=I("nodejs.stream.errored"),q=I("nodejs.stream.readable"),Y=I("nodejs.stream.writable"),K=I("nodejs.stream.disturbed"),$=I("nodejs.webstream.isClosedPromise"),j=I("nodejs.webstream.controllerErrorFunction");function x(H,v=!1){var B0;return!!(H&&typeof H.pipe==="function"&&typeof H.on==="function"&&(!v||typeof H.pause==="function"&&typeof H.resume==="function")&&(!H._writableState||((B0=H._readableState)===null||B0===void 0?void 0:B0.readable)!==!1)&&(!H._writableState||H._readableState))}function M(H){var v;return!!(H&&typeof H.write==="function"&&typeof H.on==="function"&&(!H._readableState||((v=H._writableState)===null||v===void 0?void 0:v.writable)!==!1))}function d(H){return!!(H&&typeof H.pipe==="function"&&H._readableState&&typeof H.on==="function"&&typeof H.write==="function")}function s(H){return H&&(H._readableState||H._writableState||typeof H.write==="function"&&typeof H.on==="function"||typeof H.pipe==="function"&&typeof H.on==="function")}function c(H){return!!(H&&!s(H)&&typeof H.pipeThrough==="function"&&typeof H.getReader==="function"&&typeof H.cancel==="function")}function E(H){return!!(H&&!s(H)&&typeof H.getWriter==="function"&&typeof H.abort==="function")}function F(H){return!!(H&&!s(H)&&typeof H.readable==="object"&&typeof H.writable==="object")}function W(H){return c(H)||E(H)||F(H)}function L(H,v){if(H==null)return!1;if(v===!0)return typeof H[h]==="function";if(v===!1)return typeof H[U]==="function";return typeof H[h]==="function"||typeof H[U]==="function"}function T(H){if(!s(H))return null;let{_writableState:v,_readableState:B0}=H,_=v||B0;return!!(H.destroyed||H[X]||_!==null&&_!==void 0&&_.destroyed)}function a(H){if(!M(H))return null;if(H.writableEnded===!0)return!0;let v=H._writableState;if(v!==null&&v!==void 0&&v.errored)return!1;if(typeof(v===null||v===void 0?void 0:v.ended)!=="boolean")return null;return v.ended}function h0(H,v){if(!M(H))return null;if(H.writableFinished===!0)return!0;let B0=H._writableState;if(B0!==null&&B0!==void 0&&B0.errored)return!1;if(typeof(B0===null||B0===void 0?void 0:B0.finished)!=="boolean")return null;return!!(B0.finished||v===!1&&B0.ended===!0&&B0.length===0)}function Y0(H){if(!x(H))return null;if(H.readableEnded===!0)return!0;let v=H._readableState;if(!v||v.errored)return!1;if(typeof(v===null||v===void 0?void 0:v.ended)!=="boolean")return null;return v.ended}function t(H,v){if(!x(H))return null;let B0=H._readableState;if(B0!==null&&B0!==void 0&&B0.errored)return!1;if(typeof(B0===null||B0===void 0?void 0:B0.endEmitted)!=="boolean")return null;return!!(B0.endEmitted||v===!1&&B0.ended===!0&&B0.length===0)}function D(H){if(H&&H[q]!=null)return H[q];if(typeof(H===null||H===void 0?void 0:H.readable)!=="boolean")return null;if(T(H))return!1;return x(H)&&H.readable&&!t(H)}function u(H){if(H&&H[Y]!=null)return H[Y];if(typeof(H===null||H===void 0?void 0:H.writable)!=="boolean")return null;if(T(H))return!1;return M(H)&&H.writable&&!a(H)}function A(H,v){if(!s(H))return null;if(T(H))return!0;if((v===null||v===void 0?void 0:v.readable)!==!1&&D(H))return!1;if((v===null||v===void 0?void 0:v.writable)!==!1&&u(H))return!1;return!0}function V(H){var v,B0;if(!s(H))return null;if(H.writableErrored)return H.writableErrored;return(v=(B0=H._writableState)===null||B0===void 0?void 0:B0.errored)!==null&&v!==void 0?v:null}function O(H){var v,B0;if(!s(H))return null;if(H.readableErrored)return H.readableErrored;return(v=(B0=H._readableState)===null||B0===void 0?void 0:B0.errored)!==null&&v!==void 0?v:null}function N(H){if(!s(H))return null;if(typeof H.closed==="boolean")return H.closed;let{_writableState:v,_readableState:B0}=H;if(typeof(v===null||v===void 0?void 0:v.closed)==="boolean"||typeof(B0===null||B0===void 0?void 0:B0.closed)==="boolean")return(v===null||v===void 0?void 0:v.closed)||(B0===null||B0===void 0?void 0:B0.closed);if(typeof H._closed==="boolean"&&b(H))return H._closed;return null}function b(H){return typeof H._closed==="boolean"&&typeof H._defaultKeepAlive==="boolean"&&typeof H._removedConnection==="boolean"&&typeof H._removedContLen==="boolean"}function e(H){return typeof H._sent100==="boolean"&&b(H)}function I0(H){var v;return typeof H._consuming==="boolean"&&typeof H._dumped==="boolean"&&((v=H.req)===null||v===void 0?void 0:v.upgradeOrConnect)===void 0}function K0(H){if(!s(H))return null;let{_writableState:v,_readableState:B0}=H,_=v||B0;return!_&&e(H)||!!(_&&_.autoDestroy&&_.emitClose&&_.closed===!1)}function S(H){var v;return!!(H&&((v=H[K])!==null&&v!==void 0?v:H.readableDidRead||H.readableAborted))}function X0(H){var v,B0,_,U0,Z0,H0,q0,f,k,r;return!!(H&&((v=(B0=(_=(U0=(Z0=(H0=H[Q])!==null&&H0!==void 0?H0:H.readableErrored)!==null&&Z0!==void 0?Z0:H.writableErrored)!==null&&U0!==void 0?U0:(q0=H._readableState)===null||q0===void 0?void 0:q0.errorEmitted)!==null&&_!==void 0?_:(f=H._writableState)===null||f===void 0?void 0:f.errorEmitted)!==null&&B0!==void 0?B0:(k=H._readableState)===null||k===void 0?void 0:k.errored)!==null&&v!==void 0?v:(r=H._writableState)===null||r===void 0?void 0:r.errored))}B.exports={isDestroyed:T,kIsDestroyed:X,isDisturbed:S,kIsDisturbed:K,isErrored:X0,kIsErrored:Q,isReadable:D,kIsReadable:q,kIsClosedPromise:$,kControllerErrorFunction:j,kIsWritable:Y,isClosed:N,isDuplexNodeStream:d,isFinished:A,isIterable:L,isReadableNodeStream:x,isReadableStream:c,isReadableEnded:Y0,isReadableFinished:t,isReadableErrored:O,isNodeStream:s,isWebStream:W,isWritable:u,isWritableNodeStream:M,isWritableStream:E,isWritableEnded:a,isWritableFinished:h0,isWritableErrored:V,isServerRequest:I0,isServerResponse:e,willEmitClose:K0,isTransformStream:F}}),o0=$0((w,B)=>{var h=Q2(),{AbortError:U,codes:I}=O0(),{ERR_INVALID_ARG_TYPE:X,ERR_STREAM_PREMATURE_CLOSE:Q}=I,{kEmptyObject:q,once:Y}=D0(),{validateAbortSignal:K,validateFunction:$,validateObject:j,validateBoolean:x}=O2(),{Promise:M,PromisePrototypeThen:d,SymbolDispose:s}=W0(),{isClosed:c,isReadable:E,isReadableNodeStream:F,isReadableStream:W,isReadableFinished:L,isReadableErrored:T,isWritable:a,isWritableNodeStream:h0,isWritableStream:Y0,isWritableFinished:t,isWritableErrored:D,isNodeStream:u,willEmitClose:A,kIsClosedPromise:V}=i0(),O;function N(S){return S.setHeader&&typeof S.abort==="function"}var b=()=>{};function e(S,X0,H){var v,B0;if(arguments.length===2)H=X0,X0=q;else if(X0==null)X0=q;else j(X0,"options");if($(H,"callback"),K(X0.signal,"options.signal"),H=Y(H),W(S)||Y0(S))return I0(S,X0,H);if(!u(S))throw new X("stream",["ReadableStream","WritableStream","Stream"],S);let _=(v=X0.readable)!==null&&v!==void 0?v:F(S),U0=(B0=X0.writable)!==null&&B0!==void 0?B0:h0(S),Z0=S._writableState,H0=S._readableState,q0=()=>{if(!S.writable)r()},f=A(S)&&F(S)===_&&h0(S)===U0,k=t(S,!1),r=()=>{if(k=!0,S.destroyed)f=!1;if(f&&(!S.readable||_))return;if(!_||F0)H.call(S)},F0=L(S,!1),J0=()=>{if(F0=!0,S.destroyed)f=!1;if(f&&(!S.writable||U0))return;if(!U0||k)H.call(S)},z=(G)=>{H.call(S,G)},C=c(S),P=()=>{C=!0;let G=D(S)||T(S);if(G&&typeof G!=="boolean")return H.call(S,G);if(_&&!F0&&F(S,!0)){if(!L(S,!1))return H.call(S,new Q)}if(U0&&!k){if(!t(S,!1))return H.call(S,new Q)}H.call(S)},i=()=>{C=!0;let G=D(S)||T(S);if(G&&typeof G!=="boolean")return H.call(S,G);H.call(S)},m=()=>{S.req.on("finish",r)};if(N(S)){if(S.on("complete",r),!f)S.on("abort",P);if(S.req)m();else S.on("request",m)}else if(U0&&!Z0)S.on("end",q0),S.on("close",q0);if(!f&&typeof S.aborted==="boolean")S.on("aborted",P);if(S.on("end",J0),S.on("finish",r),X0.error!==!1)S.on("error",z);if(S.on("close",P),C)h.nextTick(P);else if(Z0!==null&&Z0!==void 0&&Z0.errorEmitted||H0!==null&&H0!==void 0&&H0.errorEmitted){if(!f)h.nextTick(i)}else if(!_&&(!f||E(S))&&(k||a(S)===!1))h.nextTick(i);else if(!U0&&(!f||a(S))&&(F0||E(S)===!1))h.nextTick(i);else if(H0&&S.req&&S.aborted)h.nextTick(i);let p=()=>{if(H=b,S.removeListener("aborted",P),S.removeListener("complete",r),S.removeListener("abort",P),S.removeListener("request",m),S.req)S.req.removeListener("finish",r);S.removeListener("end",q0),S.removeListener("close",q0),S.removeListener("finish",r),S.removeListener("end",J0),S.removeListener("error",z),S.removeListener("close",P)};if(X0.signal&&!C){let G=()=>{let y=H;p(),y.call(S,new U(void 0,{cause:X0.signal.reason}))};if(X0.signal.aborted)h.nextTick(G);else{O=O||D0().addAbortListener;let y=O(X0.signal,G),o=H;H=Y((...g)=>{y[s](),o.apply(S,g)})}}return p}function I0(S,X0,H){let v=!1,B0=b;if(X0.signal)if(B0=()=>{v=!0,H.call(S,new U(void 0,{cause:X0.signal.reason}))},X0.signal.aborted)h.nextTick(B0);else{O=O||D0().addAbortListener;let U0=O(X0.signal,B0),Z0=H;H=Y((...H0)=>{U0[s](),Z0.apply(S,H0)})}let _=(...U0)=>{if(!v)h.nextTick(()=>H.apply(S,U0))};return d(S[V].promise,_,_),b}function K0(S,X0){var H;let v=!1;if(X0===null)X0=q;if((H=X0)!==null&&H!==void 0&&H.cleanup)x(X0.cleanup,"cleanup"),v=X0.cleanup;return new M((B0,_)=>{let U0=e(S,X0,(Z0)=>{if(v)U0();if(Z0)_(Z0);else B0()})})}B.exports=e,B.exports.finished=K0}),G2=$0((w,B)=>{var h=Q2(),{aggregateTwoErrors:U,codes:{ERR_MULTIPLE_CALLBACK:I},AbortError:X}=O0(),{Symbol:Q}=W0(),{kIsDestroyed:q,isDestroyed:Y,isFinished:K,isServerRequest:$}=i0(),j=Q("kDestroy"),x=Q("kConstruct");function M(A,V,O){if(A){if(A.stack,V&&!V.errored)V.errored=A;if(O&&!O.errored)O.errored=A}}function d(A,V){let O=this._readableState,N=this._writableState,b=N||O;if(N!==null&&N!==void 0&&N.destroyed||O!==null&&O!==void 0&&O.destroyed){if(typeof V==="function")V();return this}if(M(A,N,O),N)N.destroyed=!0;if(O)O.destroyed=!0;if(!b.constructed)this.once(j,function(e){s(this,U(e,A),V)});else s(this,A,V);return this}function s(A,V,O){let N=!1;function b(e){if(N)return;N=!0;let{_readableState:I0,_writableState:K0}=A;if(M(e,K0,I0),K0)K0.closed=!0;if(I0)I0.closed=!0;if(typeof O==="function")O(e);if(e)h.nextTick(c,A,e);else h.nextTick(E,A)}try{A._destroy(V||null,b)}catch(e){b(e)}}function c(A,V){F(A,V),E(A)}function E(A){let{_readableState:V,_writableState:O}=A;if(O)O.closeEmitted=!0;if(V)V.closeEmitted=!0;if(O!==null&&O!==void 0&&O.emitClose||V!==null&&V!==void 0&&V.emitClose)A.emit("close")}function F(A,V){let{_readableState:O,_writableState:N}=A;if(N!==null&&N!==void 0&&N.errorEmitted||O!==null&&O!==void 0&&O.errorEmitted)return;if(N)N.errorEmitted=!0;if(O)O.errorEmitted=!0;A.emit("error",V)}function W(){let A=this._readableState,V=this._writableState;if(A)A.constructed=!0,A.closed=!1,A.closeEmitted=!1,A.destroyed=!1,A.errored=null,A.errorEmitted=!1,A.reading=!1,A.ended=A.readable===!1,A.endEmitted=A.readable===!1;if(V)V.constructed=!0,V.destroyed=!1,V.closed=!1,V.closeEmitted=!1,V.errored=null,V.errorEmitted=!1,V.finalCalled=!1,V.prefinished=!1,V.ended=V.writable===!1,V.ending=V.writable===!1,V.finished=V.writable===!1}function L(A,V,O){let{_readableState:N,_writableState:b}=A;if(b!==null&&b!==void 0&&b.destroyed||N!==null&&N!==void 0&&N.destroyed)return this;if(N!==null&&N!==void 0&&N.autoDestroy||b!==null&&b!==void 0&&b.autoDestroy)A.destroy(V);else if(V){if(V.stack,b&&!b.errored)b.errored=V;if(N&&!N.errored)N.errored=V;if(O)h.nextTick(F,A,V);else F(A,V)}}function T(A,V){if(typeof A._construct!=="function")return;let{_readableState:O,_writableState:N}=A;if(O)O.constructed=!1;if(N)N.constructed=!1;if(A.once(x,V),A.listenerCount(x)>1)return;h.nextTick(a,A)}function a(A){let V=!1;function O(N){if(V){L(A,N!==null&&N!==void 0?N:new I);return}V=!0;let{_readableState:b,_writableState:e}=A,I0=e||b;if(b)b.constructed=!0;if(e)e.constructed=!0;if(I0.destroyed)A.emit(j,N);else if(N)L(A,N,!0);else h.nextTick(h0,A)}try{A._construct((N)=>{h.nextTick(O,N)})}catch(N){h.nextTick(O,N)}}function h0(A){A.emit(x)}function Y0(A){return(A===null||A===void 0?void 0:A.setHeader)&&typeof A.abort==="function"}function t(A){A.emit("close")}function D(A,V){A.emit("error",V),h.nextTick(t,A)}function u(A,V){if(!A||Y(A))return;if(!V&&!K(A))V=new X;if($(A))A.socket=null,A.destroy(V);else if(Y0(A))A.abort();else if(Y0(A.req))A.req.abort();else if(typeof A.destroy==="function")A.destroy(V);else if(typeof A.close==="function")A.close();else if(V)h.nextTick(D,A,V);else h.nextTick(t,A);if(!A.destroyed)A[q]=!0}B.exports={construct:T,destroyer:u,destroy:d,undestroy:W,errorOrDestroy:L}}),w1=$0((w,B)=>{var{ArrayIsArray:h,ObjectSetPrototypeOf:U}=W0(),{EventEmitter:I}=(L2(),_0(E2));function X(q){I.call(this,q)}U(X.prototype,I.prototype),U(X,I),X.prototype.pipe=function(q,Y){let K=this;function $(E){if(q.writable&&q.write(E)===!1&&K.pause)K.pause()}K.on("data",$);function j(){if(K.readable&&K.resume)K.resume()}if(q.on("drain",j),!q._isStdio&&(!Y||Y.end!==!1))K.on("end",M),K.on("close",d);let x=!1;function M(){if(x)return;x=!0,q.end()}function d(){if(x)return;if(x=!0,typeof q.destroy==="function")q.destroy()}function s(E){if(c(),I.listenerCount(this,"error")===0)this.emit("error",E)}Q(K,"error",s),Q(q,"error",s);function c(){K.removeListener("data",$),q.removeListener("drain",j),K.removeListener("end",M),K.removeListener("close",d),K.removeListener("error",s),q.removeListener("error",s),K.removeListener("end",c),K.removeListener("close",c),q.removeListener("close",c)}return K.on("end",c),K.on("close",c),q.on("close",c),q.emit("pipe",K),q};function Q(q,Y,K){if(typeof q.prependListener==="function")return q.prependListener(Y,K);if(!q._events||!q._events[Y])q.on(Y,K);else if(h(q._events[Y]))q._events[Y].unshift(K);else q._events[Y]=[K,q._events[Y]]}B.exports={Stream:X,prependListener:Q}}),R2=$0((w,B)=>{var{SymbolDispose:h}=W0(),{AbortError:U,codes:I}=O0(),{isNodeStream:X,isWebStream:Q,kControllerErrorFunction:q}=i0(),Y=o0(),{ERR_INVALID_ARG_TYPE:K}=I,$,j=(x,M)=>{if(typeof x!=="object"||!("aborted"in x))throw new K(M,"AbortSignal",x)};B.exports.addAbortSignal=function(M,d){if(j(M,"signal"),!X(d)&&!Q(d))throw new K("stream",["ReadableStream","WritableStream","Stream"],d);return B.exports.addAbortSignalNoValidate(M,d)},B.exports.addAbortSignalNoValidate=function(x,M){if(typeof x!=="object"||!("aborted"in x))return M;let d=X(M)?()=>{M.destroy(new U(void 0,{cause:x.reason}))}:()=>{M[q](new U(void 0,{cause:x.reason}))};if(x.aborted)d();else{$=$||D0().addAbortListener;let s=$(x,d);Y(M,s[h])}return M}}),s8=$0((w,B)=>{var{StringPrototypeSlice:h,SymbolIterator:U,TypedArrayPrototypeSet:I,Uint8Array:X}=W0(),{Buffer:Q}=(p0(),_0(b0)),{inspect:q}=D0();B.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(K){let $={data:K,next:null};if(this.length>0)this.tail.next=$;else this.head=$;this.tail=$,++this.length}unshift(K){let $={data:K,next:this.head};if(this.length===0)this.tail=$;this.head=$,++this.length}shift(){if(this.length===0)return;let K=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,K}clear(){this.head=this.tail=null,this.length=0}join(K){if(this.length===0)return"";let $=this.head,j=""+$.data;while(($=$.next)!==null)j+=K+$.data;return j}concat(K){if(this.length===0)return Q.alloc(0);let $=Q.allocUnsafe(K>>>0),j=this.head,x=0;while(j)I($,j.data,x),x+=j.data.length,j=j.next;return $}consume(K,$){let j=this.head.data;if(K<j.length){let x=j.slice(0,K);return this.head.data=j.slice(K),x}if(K===j.length)return this.shift();return $?this._getString(K):this._getBuffer(K)}first(){return this.head.data}*[U](){for(let K=this.head;K;K=K.next)yield K.data}_getString(K){let $="",j=this.head,x=0;do{let M=j.data;if(K>M.length)$+=M,K-=M.length;else{if(K===M.length)if($+=M,++x,j.next)this.head=j.next;else this.head=this.tail=null;else $+=h(M,0,K),this.head=j,j.data=h(M,K);break}++x}while((j=j.next)!==null);return this.length-=x,$}_getBuffer(K){let $=Q.allocUnsafe(K),j=K,x=this.head,M=0;do{let d=x.data;if(K>d.length)I($,d,j-K),K-=d.length;else{if(K===d.length)if(I($,d,j-K),++M,x.next)this.head=x.next;else this.head=this.tail=null;else I($,new X(d.buffer,d.byteOffset,K),j-K),this.head=x,x.data=d.slice(K);break}++M}while((x=x.next)!==null);return this.length-=M,$}[Symbol.for("nodejs.util.inspect.custom")](K,$){return q(this,{...$,depth:0,customInspect:!1})}}}),_2=$0((w,B)=>{var{MathFloor:h,NumberIsInteger:U}=W0(),{validateInteger:I}=O2(),{ERR_INVALID_ARG_VALUE:X}=O0().codes,Q=16384,q=16;function Y(x,M,d){return x.highWaterMark!=null?x.highWaterMark:M?x[d]:null}function K(x){return x?q:Q}function $(x,M){if(I(M,"value",0),x)q=M;else Q=M}function j(x,M,d,s){let c=Y(M,s,d);if(c!=null){if(!U(c)||c<0){let E=s?`options.${d}`:"options.highWaterMark";throw new X(E,c)}return h(c)}return K(x.objectMode)}B.exports={getHighWaterMark:j,getDefaultHighWaterMark:K,setDefaultHighWaterMark:$}}),t8=$0((w,B)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var h=(p0(),_0(b0)),U=h.Buffer;function I(Q,q){for(var Y in Q)q[Y]=Q[Y]}if(U.from&&U.alloc&&U.allocUnsafe&&U.allocUnsafeSlow)B.exports=h;else I(h,w),w.Buffer=X;function X(Q,q,Y){return U(Q,q,Y)}X.prototype=Object.create(U.prototype),I(U,X),X.from=function(Q,q,Y){if(typeof Q==="number")throw TypeError("Argument must not be a number");return U(Q,q,Y)},X.alloc=function(Q,q,Y){if(typeof Q!=="number")throw TypeError("Argument must be a number");var K=U(Q);if(q!==void 0)if(typeof Y==="string")K.fill(q,Y);else K.fill(q);else K.fill(0);return K},X.allocUnsafe=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return U(Q)},X.allocUnsafeSlow=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return h.SlowBuffer(Q)}}),e8=$0((w)=>{var B=t8().Buffer,h=B.isEncoding||function(F){switch(F=""+F,F&&F.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 U(F){if(!F)return"utf8";var W;while(!0)switch(F){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 F;default:if(W)return;F=(""+F).toLowerCase(),W=!0}}function I(F){var W=U(F);if(typeof W!=="string"&&(B.isEncoding===h||!h(F)))throw Error("Unknown encoding: "+F);return W||F}w.StringDecoder=X;function X(F){this.encoding=I(F);var W;switch(this.encoding){case"utf16le":this.text=x,this.end=M,W=4;break;case"utf8":this.fillLast=K,W=4;break;case"base64":this.text=d,this.end=s,W=3;break;default:this.write=c,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=B.allocUnsafe(W)}X.prototype.write=function(F){if(F.length===0)return"";var W,L;if(this.lastNeed){if(W=this.fillLast(F),W===void 0)return"";L=this.lastNeed,this.lastNeed=0}else L=0;if(L<F.length)return W?W+this.text(F,L):this.text(F,L);return W||""},X.prototype.end=j,X.prototype.text=$,X.prototype.fillLast=function(F){if(this.lastNeed<=F.length)return F.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);F.copy(this.lastChar,this.lastTotal-this.lastNeed,0,F.length),this.lastNeed-=F.length};function Q(F){if(F<=127)return 0;else if(F>>5===6)return 2;else if(F>>4===14)return 3;else if(F>>3===30)return 4;return F>>6===2?-1:-2}function q(F,W,L){var T=W.length-1;if(T<L)return 0;var a=Q(W[T]);if(a>=0){if(a>0)F.lastNeed=a-1;return a}if(--T<L||a===-2)return 0;if(a=Q(W[T]),a>=0){if(a>0)F.lastNeed=a-2;return a}if(--T<L||a===-2)return 0;if(a=Q(W[T]),a>=0){if(a>0)if(a===2)a=0;else F.lastNeed=a-3;return a}return 0}function Y(F,W,L){if((W[0]&192)!==128)return F.lastNeed=0,"�";if(F.lastNeed>1&&W.length>1){if((W[1]&192)!==128)return F.lastNeed=1,"�";if(F.lastNeed>2&&W.length>2){if((W[2]&192)!==128)return F.lastNeed=2,"�"}}}function K(F){var W=this.lastTotal-this.lastNeed,L=Y(this,F,W);if(L!==void 0)return L;if(this.lastNeed<=F.length)return F.copy(this.lastChar,W,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);F.copy(this.lastChar,W,0,F.length),this.lastNeed-=F.length}function $(F,W){var L=q(this,F,W);if(!this.lastNeed)return F.toString("utf8",W);this.lastTotal=L;var T=F.length-(L-this.lastNeed);return F.copy(this.lastChar,0,T),F.toString("utf8",W,T)}function j(F){var W=F&&F.length?this.write(F):"";if(this.lastNeed)return W+"�";return W}function x(F,W){if((F.length-W)%2===0){var L=F.toString("utf16le",W);if(L){var T=L.charCodeAt(L.length-1);if(T>=55296&&T<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=F[F.length-2],this.lastChar[1]=F[F.length-1],L.slice(0,-1)}return L}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=F[F.length-1],F.toString("utf16le",W,F.length-1)}function M(F){var W=F&&F.length?this.write(F):"";if(this.lastNeed){var L=this.lastTotal-this.lastNeed;return W+this.lastChar.toString("utf16le",0,L)}return W}function d(F,W){var L=(F.length-W)%3;if(L===0)return F.toString("base64",W);if(this.lastNeed=3-L,this.lastTotal=3,L===1)this.lastChar[0]=F[F.length-1];else this.lastChar[0]=F[F.length-2],this.lastChar[1]=F[F.length-1];return F.toString("base64",W,F.length-L)}function s(F){var W=F&&F.length?this.write(F):"";if(this.lastNeed)return W+this.lastChar.toString("base64",0,3-this.lastNeed);return W}function c(F){return F.toString(this.encoding)}function E(F){return F&&F.length?this.write(F):""}}),N6=$0((w,B)=>{var h=Q2(),{PromisePrototypeThen:U,SymbolAsyncIterator:I,SymbolIterator:X}=W0(),{Buffer:Q}=(p0(),_0(b0)),{ERR_INVALID_ARG_TYPE:q,ERR_STREAM_NULL_VALUES:Y}=O0().codes;function K($,j,x){let M;if(typeof j==="string"||j instanceof Q)return new $({objectMode:!0,...x,read(){this.push(j),this.push(null)}});let d;if(j&&j[I])d=!0,M=j[I]();else if(j&&j[X])d=!1,M=j[X]();else throw new q("iterable",["Iterable"],j);let s=new $({objectMode:!0,highWaterMark:1,...x}),c=!1;s._read=function(){if(!c)c=!0,F()},s._destroy=function(W,L){U(E(W),()=>h.nextTick(L,W),(T)=>h.nextTick(L,T||W))};async function E(W){let L=W!==void 0&&W!==null,T=typeof M.throw==="function";if(L&&T){let{value:a,done:h0}=await M.throw(W);if(await a,h0)return}if(typeof M.return==="function"){let{value:a}=await M.return();await a}}async function F(){for(;;){try{let{value:W,done:L}=d?await M.next():M.next();if(L)s.push(null);else{let T=W&&typeof W.then==="function"?await W:W;if(T===null)throw c=!1,new Y;else if(s.push(T))continue;else c=!1}}catch(W){s.destroy(W)}break}}return s}B.exports=K}),f2=$0((w,B)=>{var h=Q2(),{ArrayPrototypeIndexOf:U,NumberIsInteger:I,NumberIsNaN:X,NumberParseInt:Q,ObjectDefineProperties:q,ObjectKeys:Y,ObjectSetPrototypeOf:K,Promise:$,SafeSet:j,SymbolAsyncDispose:x,SymbolAsyncIterator:M,Symbol:d}=W0();B.exports=g,g.ReadableState=o;var{EventEmitter:s}=(L2(),_0(E2)),{Stream:c,prependListener:E}=w1(),{Buffer:F}=(p0(),_0(b0)),{addAbortSignal:W}=R2(),L=o0(),T=D0().debuglog("stream",(Z)=>{T=Z}),a=s8(),h0=G2(),{getHighWaterMark:Y0,getDefaultHighWaterMark:t}=_2(),{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:u,ERR_METHOD_NOT_IMPLEMENTED:A,ERR_OUT_OF_RANGE:V,ERR_STREAM_PUSH_AFTER_EOF:O,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N},AbortError:b}=O0(),{validateObject:e}=O2(),I0=d("kPaused"),{StringDecoder:K0}=e8(),S=N6();K(g.prototype,c.prototype),K(g,c);var X0=()=>{},{errorOrDestroy:H}=h0,v=1,B0=2,_=4,U0=8,Z0=16,H0=32,q0=64,f=128,k=256,r=512,F0=1024,J0=2048,z=4096,C=8192,P=16384,i=32768,m=65536,p=131072,G=262144;function y(Z){return{enumerable:!1,get(){return(this.state&Z)!==0},set(J){if(J)this.state|=Z;else this.state&=~Z}}}q(o.prototype,{objectMode:y(v),ended:y(B0),endEmitted:y(_),reading:y(U0),constructed:y(Z0),sync:y(H0),needReadable:y(q0),emittedReadable:y(f),readableListening:y(k),resumeScheduled:y(r),errorEmitted:y(F0),emitClose:y(J0),autoDestroy:y(z),destroyed:y(C),closed:y(P),closeEmitted:y(i),multiAwaitDrain:y(m),readingMore:y(p),dataEmitted:y(G)});function o(Z,J,l){if(typeof l!=="boolean")l=J instanceof d0();if(this.state=J0|z|Z0|H0,Z&&Z.objectMode)this.state|=v;if(l&&Z&&Z.readableObjectMode)this.state|=v;if(this.highWaterMark=Z?Y0(this,Z,"readableHighWaterMark",l):t(!1),this.buffer=new a,this.length=0,this.pipes=[],this.flowing=null,this[I0]=null,Z&&Z.emitClose===!1)this.state&=~J0;if(Z&&Z.autoDestroy===!1)this.state&=~z;if(this.errored=null,this.defaultEncoding=Z&&Z.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,Z&&Z.encoding)this.decoder=new K0(Z.encoding),this.encoding=Z.encoding}function g(Z){if(!(this instanceof g))return new g(Z);let J=this instanceof d0();if(this._readableState=new o(Z,this,J),Z){if(typeof Z.read==="function")this._read=Z.read;if(typeof Z.destroy==="function")this._destroy=Z.destroy;if(typeof Z.construct==="function")this._construct=Z.construct;if(Z.signal&&!J)W(Z.signal,this)}c.call(this,Z),h0.construct(this,()=>{if(this._readableState.needReadable)K2(this,this._readableState)})}g.prototype.destroy=h0.destroy,g.prototype._undestroy=h0.undestroy,g.prototype._destroy=function(Z,J){J(Z)},g.prototype[s.captureRejectionSymbol]=function(Z){this.destroy(Z)},g.prototype[x]=function(){let Z;if(!this.destroyed)Z=this.readableEnded?null:new b,this.destroy(Z);return new $((J,l)=>L(this,(n)=>n&&n!==Z?l(n):J(null)))},g.prototype.push=function(Z,J){return Q0(this,Z,J,!1)},g.prototype.unshift=function(Z,J){return Q0(this,Z,J,!0)};function Q0(Z,J,l,n){T("readableAddChunk",J);let w0=Z._readableState,A0;if((w0.state&v)===0){if(typeof J==="string"){if(l=l||w0.defaultEncoding,w0.encoding!==l)if(n&&w0.encoding)J=F.from(J,l).toString(w0.encoding);else J=F.from(J,l),l=""}else if(J instanceof F)l="";else if(c._isUint8Array(J))J=c._uint8ArrayToBuffer(J),l="";else if(J!=null)A0=new u("chunk",["string","Buffer","Uint8Array"],J)}if(A0)H(Z,A0);else if(J===null)w0.state&=~U0,L0(Z,w0);else if((w0.state&v)!==0||J&&J.length>0)if(n)if((w0.state&_)!==0)H(Z,new N);else if(w0.destroyed||w0.errored)return!1;else P0(Z,w0,J,!0);else if(w0.ended)H(Z,new O);else if(w0.destroyed||w0.errored)return!1;else if(w0.state&=~U0,w0.decoder&&!l)if(J=w0.decoder.write(J),w0.objectMode||J.length!==0)P0(Z,w0,J,!1);else K2(Z,w0);else P0(Z,w0,J,!1);else if(!n)w0.state&=~U0,K2(Z,w0);return!w0.ended&&(w0.length<w0.highWaterMark||w0.length===0)}function P0(Z,J,l,n){if(J.flowing&&J.length===0&&!J.sync&&Z.listenerCount("data")>0){if((J.state&m)!==0)J.awaitDrainWriters.clear();else J.awaitDrainWriters=null;J.dataEmitted=!0,Z.emit("data",l)}else{if(J.length+=J.objectMode?1:l.length,n)J.buffer.unshift(l);else J.buffer.push(l);if((J.state&q0)!==0)M0(Z)}K2(Z,J)}g.prototype.isPaused=function(){let Z=this._readableState;return Z[I0]===!0||Z.flowing===!1},g.prototype.setEncoding=function(Z){let J=new K0(Z);this._readableState.decoder=J,this._readableState.encoding=this._readableState.decoder.encoding;let l=this._readableState.buffer,n="";for(let w0 of l)n+=J.write(w0);if(l.clear(),n!=="")l.push(n);return this._readableState.length=n.length,this};var C0=1073741824;function j0(Z){if(Z>C0)throw new V("size","<= 1GiB",Z);else Z--,Z|=Z>>>1,Z|=Z>>>2,Z|=Z>>>4,Z|=Z>>>8,Z|=Z>>>16,Z++;return Z}function a0(Z,J){if(Z<=0||J.length===0&&J.ended)return 0;if((J.state&v)!==0)return 1;if(X(Z)){if(J.flowing&&J.length)return J.buffer.first().length;return J.length}if(Z<=J.length)return Z;return J.ended?J.length:0}g.prototype.read=function(Z){if(T("read",Z),Z===void 0)Z=NaN;else if(!I(Z))Z=Q(Z,10);let J=this._readableState,l=Z;if(Z>J.highWaterMark)J.highWaterMark=j0(Z);if(Z!==0)J.state&=~f;if(Z===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended)){if(T("read: emitReadable",J.length,J.ended),J.length===0&&J.ended)S2(this);else M0(this);return null}if(Z=a0(Z,J),Z===0&&J.ended){if(J.length===0)S2(this);return null}let n=(J.state&q0)!==0;if(T("need readable",n),J.length===0||J.length-Z<J.highWaterMark)n=!0,T("length less than watermark",n);if(J.ended||J.reading||J.destroyed||J.errored||!J.constructed)n=!1,T("reading, ended or constructing",n);else if(n){if(T("do read"),J.state|=U0|H0,J.length===0)J.state|=q0;try{this._read(J.highWaterMark)}catch(A0){H(this,A0)}if(J.state&=~H0,!J.reading)Z=a0(l,J)}let w0;if(Z>0)w0=W1(Z,J);else w0=null;if(w0===null)J.needReadable=J.length<=J.highWaterMark,Z=0;else if(J.length-=Z,J.multiAwaitDrain)J.awaitDrainWriters.clear();else J.awaitDrainWriters=null;if(J.length===0){if(!J.ended)J.needReadable=!0;if(l!==Z&&J.ended)S2(this)}if(w0!==null&&!J.errorEmitted&&!J.closeEmitted)J.dataEmitted=!0,this.emit("data",w0);return w0};function L0(Z,J){if(T("onEofChunk"),J.ended)return;if(J.decoder){let l=J.decoder.end();if(l&&l.length)J.buffer.push(l),J.length+=J.objectMode?1:l.length}if(J.ended=!0,J.sync)M0(Z);else J.needReadable=!1,J.emittedReadable=!0,q2(Z)}function M0(Z){let J=Z._readableState;if(T("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,!J.emittedReadable)T("emitReadable",J.flowing),J.emittedReadable=!0,h.nextTick(q2,Z)}function q2(Z){let J=Z._readableState;if(T("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&!J.errored&&(J.length||J.ended))Z.emit("readable"),J.emittedReadable=!1;J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,z1(Z)}function K2(Z,J){if(!J.readingMore&&J.constructed)J.readingMore=!0,h.nextTick(k0,Z,J)}function k0(Z,J){while(!J.reading&&!J.ended&&(J.length<J.highWaterMark||J.flowing&&J.length===0)){let l=J.length;if(T("maybeReadMore read 0"),Z.read(0),l===J.length)break}J.readingMore=!1}g.prototype._read=function(Z){throw new A("_read()")},g.prototype.pipe=function(Z,J){let l=this,n=this._readableState;if(n.pipes.length===1){if(!n.multiAwaitDrain)n.multiAwaitDrain=!0,n.awaitDrainWriters=new j(n.awaitDrainWriters?[n.awaitDrainWriters]:[])}n.pipes.push(Z),T("pipe count=%d opts=%j",n.pipes.length,J);let w0=(!J||J.end!==!1)&&Z!==h.stdout&&Z!==h.stderr?R0:W2;if(n.endEmitted)h.nextTick(w0);else l.once("end",w0);Z.on("unpipe",A0);function A0(t0,v0){if(T("onunpipe"),t0===l){if(v0&&v0.hasUnpiped===!1)v0.hasUnpiped=!0,d6()}}function R0(){T("onend"),Z.end()}let s0,N1=!1;function d6(){if(T("cleanup"),Z.removeListener("close",c2),Z.removeListener("finish",v2),s0)Z.removeListener("drain",s0);if(Z.removeListener("error",y2),Z.removeListener("unpipe",A0),l.removeListener("end",R0),l.removeListener("end",W2),l.removeListener("data",j1),N1=!0,s0&&n.awaitDrainWriters&&(!Z._writableState||Z._writableState.needDrain))s0()}function V1(){if(!N1){if(n.pipes.length===1&&n.pipes[0]===Z)T("false write response, pause",0),n.awaitDrainWriters=Z,n.multiAwaitDrain=!1;else if(n.pipes.length>1&&n.pipes.includes(Z))T("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(Z);l.pause()}if(!s0)s0=y6(l,Z),Z.on("drain",s0)}l.on("data",j1);function j1(t0){T("ondata");let v0=Z.write(t0);if(T("dest.write",v0),v0===!1)V1()}function y2(t0){if(T("onerror",t0),W2(),Z.removeListener("error",y2),Z.listenerCount("error")===0){let v0=Z._writableState||Z._readableState;if(v0&&!v0.errorEmitted)H(Z,t0);else Z.emit("error",t0)}}E(Z,"error",y2);function c2(){Z.removeListener("finish",v2),W2()}Z.once("close",c2);function v2(){T("onfinish"),Z.removeListener("close",c2),W2()}Z.once("finish",v2);function W2(){T("unpipe"),l.unpipe(Z)}if(Z.emit("pipe",l),Z.writableNeedDrain===!0)V1();else if(!n.flowing)T("pipe resume"),l.resume();return Z};function y6(Z,J){return function(){let n=Z._readableState;if(n.awaitDrainWriters===J)T("pipeOnDrain",1),n.awaitDrainWriters=null;else if(n.multiAwaitDrain)T("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(J);if((!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&Z.listenerCount("data"))Z.resume()}}g.prototype.unpipe=function(Z){let J=this._readableState,l={hasUnpiped:!1};if(J.pipes.length===0)return this;if(!Z){let w0=J.pipes;J.pipes=[],this.pause();for(let A0=0;A0<w0.length;A0++)w0[A0].emit("unpipe",this,{hasUnpiped:!1});return this}let n=U(J.pipes,Z);if(n===-1)return this;if(J.pipes.splice(n,1),J.pipes.length===0)this.pause();return Z.emit("unpipe",this,l),this},g.prototype.on=function(Z,J){let l=c.prototype.on.call(this,Z,J),n=this._readableState;if(Z==="data"){if(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1)this.resume()}else if(Z==="readable"){if(!n.endEmitted&&!n.readableListening){if(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,T("on readable",n.length,n.reading),n.length)M0(this);else if(!n.reading)h.nextTick(c6,this)}}return l},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(Z,J){let l=c.prototype.removeListener.call(this,Z,J);if(Z==="readable")h.nextTick($1,this);return l},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(Z){let J=c.prototype.removeAllListeners.apply(this,arguments);if(Z==="readable"||Z===void 0)h.nextTick($1,this);return J};function $1(Z){let J=Z._readableState;if(J.readableListening=Z.listenerCount("readable")>0,J.resumeScheduled&&J[I0]===!1)J.flowing=!0;else if(Z.listenerCount("data")>0)Z.resume();else if(!J.readableListening)J.flowing=null}function c6(Z){T("readable nexttick read 0"),Z.read(0)}g.prototype.resume=function(){let Z=this._readableState;if(!Z.flowing)T("resume"),Z.flowing=!Z.readableListening,v6(this,Z);return Z[I0]=!1,this};function v6(Z,J){if(!J.resumeScheduled)J.resumeScheduled=!0,h.nextTick(u6,Z,J)}function u6(Z,J){if(T("resume",J.reading),!J.reading)Z.read(0);if(J.resumeScheduled=!1,Z.emit("resume"),z1(Z),J.flowing&&!J.reading)Z.read(0)}g.prototype.pause=function(){if(T("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)T("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[I0]=!0,this};function z1(Z){let J=Z._readableState;T("flow",J.flowing);while(J.flowing&&Z.read()!==null);}g.prototype.wrap=function(Z){let J=!1;Z.on("data",(n)=>{if(!this.push(n)&&Z.pause)J=!0,Z.pause()}),Z.on("end",()=>{this.push(null)}),Z.on("error",(n)=>{H(this,n)}),Z.on("close",()=>{this.destroy()}),Z.on("destroy",()=>{this.destroy()}),this._read=()=>{if(J&&Z.resume)J=!1,Z.resume()};let l=Y(Z);for(let n=1;n<l.length;n++){let w0=l[n];if(this[w0]===void 0&&typeof Z[w0]==="function")this[w0]=Z[w0].bind(Z)}return this},g.prototype[M]=function(){return G1(this)},g.prototype.iterator=function(Z){if(Z!==void 0)e(Z,"options");return G1(this,Z)};function G1(Z,J){if(typeof Z.read!=="function")Z=g.wrap(Z,{objectMode:!0});let l=g6(Z,J);return l.stream=Z,l}async function*g6(Z,J){let l=X0;function n(R0){if(this===Z)l(),l=X0;else l=R0}Z.on("readable",n);let w0,A0=L(Z,{writable:!1},(R0)=>{w0=R0?D(w0,R0):null,l(),l=X0});try{while(!0){let R0=Z.destroyed?null:Z.read();if(R0!==null)yield R0;else if(w0)throw w0;else if(w0===null)return;else await new $(n)}}catch(R0){throw w0=D(w0,R0),w0}finally{if((w0||(J===null||J===void 0?void 0:J.destroyOnReturn)!==!1)&&(w0===void 0||Z._readableState.autoDestroy))h0.destroyer(Z,null);else Z.off("readable",n),A0()}}q(g.prototype,{readable:{__proto__:null,get(){let Z=this._readableState;return!!Z&&Z.readable!==!1&&!Z.destroyed&&!Z.errorEmitted&&!Z.endEmitted},set(Z){if(this._readableState)this._readableState.readable=!!Z}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Z){if(this._readableState)this._readableState.flowing=Z}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Z){if(!this._readableState)return;this._readableState.destroyed=Z}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),q(o.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[I0]!==!1},set(Z){this[I0]=!!Z}}}),g._fromList=W1;function W1(Z,J){if(J.length===0)return null;let l;if(J.objectMode)l=J.buffer.shift();else if(!Z||Z>=J.length){if(J.decoder)l=J.buffer.join("");else if(J.buffer.length===1)l=J.buffer.first();else l=J.buffer.concat(J.length);J.buffer.clear()}else l=J.buffer.consume(Z,J.decoder);return l}function S2(Z){let J=Z._readableState;if(T("endReadable",J.endEmitted),!J.endEmitted)J.ended=!0,h.nextTick(b6,J,Z)}function b6(Z,J){if(T("endReadableNT",Z.endEmitted,Z.length),!Z.errored&&!Z.closeEmitted&&!Z.endEmitted&&Z.length===0){if(Z.endEmitted=!0,J.emit("end"),J.writable&&J.allowHalfOpen===!1)h.nextTick(p6,J);else if(Z.autoDestroy){let l=J._writableState;if(!l||l.autoDestroy&&(l.finished||l.writable===!1))J.destroy()}}}function p6(Z){if(Z.writable&&!Z.writableEnded&&!Z.destroyed)Z.end()}g.from=function(Z,J){return S(g,Z,J)};var k2;function C1(){if(k2===void 0)k2={};return k2}g.fromWeb=function(Z,J){return C1().newStreamReadableFromReadableStream(Z,J)},g.toWeb=function(Z,J){return C1().newReadableStreamFromStreamReadable(Z,J)},g.wrap=function(Z,J){var l,n;return new g({objectMode:(l=(n=Z.readableObjectMode)!==null&&n!==void 0?n:Z.objectMode)!==null&&l!==void 0?l:!0,...J,destroy(w0,A0){h0.destroyer(Z,w0),A0(w0)}}).wrap(Z)}}),U1=$0((w,B)=>{var h=Q2(),{ArrayPrototypeSlice:U,Error:I,FunctionPrototypeSymbolHasInstance:X,ObjectDefineProperty:Q,ObjectDefineProperties:q,ObjectSetPrototypeOf:Y,StringPrototypeToLowerCase:K,Symbol:$,SymbolHasInstance:j}=W0();B.exports=e,e.WritableState=N;var{EventEmitter:x}=(L2(),_0(E2)),M=w1().Stream,{Buffer:d}=(p0(),_0(b0)),s=G2(),{addAbortSignal:c}=R2(),{getHighWaterMark:E,getDefaultHighWaterMark:F}=_2(),{ERR_INVALID_ARG_TYPE:W,ERR_METHOD_NOT_IMPLEMENTED:L,ERR_MULTIPLE_CALLBACK:T,ERR_STREAM_CANNOT_PIPE:a,ERR_STREAM_DESTROYED:h0,ERR_STREAM_ALREADY_FINISHED:Y0,ERR_STREAM_NULL_VALUES:t,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:u}=O0().codes,{errorOrDestroy:A}=s;Y(e.prototype,M.prototype),Y(e,M);function V(){}var O=$("kOnFinished");function N(z,C,P){if(typeof P!=="boolean")P=C instanceof d0();if(this.objectMode=!!(z&&z.objectMode),P)this.objectMode=this.objectMode||!!(z&&z.writableObjectMode);this.highWaterMark=z?E(this,z,"writableHighWaterMark",P):F(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(z&&z.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=z&&z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=H.bind(void 0,C),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,b(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!z||z.emitClose!==!1,this.autoDestroy=!z||z.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[O]=[]}function b(z){z.buffered=[],z.bufferedIndex=0,z.allBuffers=!0,z.allNoop=!0}N.prototype.getBuffer=function(){return U(this.buffered,this.bufferedIndex)},Q(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function e(z){let C=this instanceof d0();if(!C&&!X(e,this))return new e(z);if(this._writableState=new N(z,this,C),z){if(typeof z.write==="function")this._write=z.write;if(typeof z.writev==="function")this._writev=z.writev;if(typeof z.destroy==="function")this._destroy=z.destroy;if(typeof z.final==="function")this._final=z.final;if(typeof z.construct==="function")this._construct=z.construct;if(z.signal)c(z.signal,this)}M.call(this,z),s.construct(this,()=>{let P=this._writableState;if(!P.writing)U0(this,P);f(this,P)})}Q(e,j,{__proto__:null,value:function(z){if(X(this,z))return!0;if(this!==e)return!1;return z&&z._writableState instanceof N}}),e.prototype.pipe=function(){A(this,new a)};function I0(z,C,P,i){let m=z._writableState;if(typeof P==="function")i=P,P=m.defaultEncoding;else{if(!P)P=m.defaultEncoding;else if(P!=="buffer"&&!d.isEncoding(P))throw new u(P);if(typeof i!=="function")i=V}if(C===null)throw new t;else if(!m.objectMode)if(typeof C==="string"){if(m.decodeStrings!==!1)C=d.from(C,P),P="buffer"}else if(C instanceof d)P="buffer";else if(M._isUint8Array(C))C=M._uint8ArrayToBuffer(C),P="buffer";else throw new W("chunk",["string","Buffer","Uint8Array"],C);let p;if(m.ending)p=new D;else if(m.destroyed)p=new h0("write");if(p)return h.nextTick(i,p),A(z,p,!0),p;return m.pendingcb++,K0(z,m,C,P,i)}e.prototype.write=function(z,C,P){return I0(this,z,C,P)===!0},e.prototype.cork=function(){this._writableState.corked++},e.prototype.uncork=function(){let z=this._writableState;if(z.corked){if(z.corked--,!z.writing)U0(this,z)}},e.prototype.setDefaultEncoding=function(C){if(typeof C==="string")C=K(C);if(!d.isEncoding(C))throw new u(C);return this._writableState.defaultEncoding=C,this};function K0(z,C,P,i,m){let p=C.objectMode?1:P.length;C.length+=p;let G=C.length<C.highWaterMark;if(!G)C.needDrain=!0;if(C.writing||C.corked||C.errored||!C.constructed){if(C.buffered.push({chunk:P,encoding:i,callback:m}),C.allBuffers&&i!=="buffer")C.allBuffers=!1;if(C.allNoop&&m!==V)C.allNoop=!1}else C.writelen=p,C.writecb=m,C.writing=!0,C.sync=!0,z._write(P,i,C.onwrite),C.sync=!1;return G&&!C.errored&&!C.destroyed}function S(z,C,P,i,m,p,G){if(C.writelen=i,C.writecb=G,C.writing=!0,C.sync=!0,C.destroyed)C.onwrite(new h0("write"));else if(P)z._writev(m,C.onwrite);else z._write(m,p,C.onwrite);C.sync=!1}function X0(z,C,P,i){--C.pendingcb,i(P),_(C),A(z,P)}function H(z,C){let P=z._writableState,i=P.sync,m=P.writecb;if(typeof m!=="function"){A(z,new T);return}if(P.writing=!1,P.writecb=null,P.length-=P.writelen,P.writelen=0,C){if(C.stack,!P.errored)P.errored=C;if(z._readableState&&!z._readableState.errored)z._readableState.errored=C;if(i)h.nextTick(X0,z,P,C,m);else X0(z,P,C,m)}else{if(P.buffered.length>P.bufferedIndex)U0(z,P);if(i)if(P.afterWriteTickInfo!==null&&P.afterWriteTickInfo.cb===m)P.afterWriteTickInfo.count++;else P.afterWriteTickInfo={count:1,cb:m,stream:z,state:P},h.nextTick(v,P.afterWriteTickInfo);else B0(z,P,1,m)}}function v({stream:z,state:C,count:P,cb:i}){return C.afterWriteTickInfo=null,B0(z,C,P,i)}function B0(z,C,P,i){if(!C.ending&&!z.destroyed&&C.length===0&&C.needDrain)C.needDrain=!1,z.emit("drain");while(P-- >0)C.pendingcb--,i();if(C.destroyed)_(C);f(z,C)}function _(z){if(z.writing)return;for(let m=z.bufferedIndex;m<z.buffered.length;++m){var C;let{chunk:p,callback:G}=z.buffered[m],y=z.objectMode?1:p.length;z.length-=y,G((C=z.errored)!==null&&C!==void 0?C:new h0("write"))}let P=z[O].splice(0);for(let m=0;m<P.length;m++){var i;P[m]((i=z.errored)!==null&&i!==void 0?i:new h0("end"))}b(z)}function U0(z,C){if(C.corked||C.bufferProcessing||C.destroyed||!C.constructed)return;let{buffered:P,bufferedIndex:i,objectMode:m}=C,p=P.length-i;if(!p)return;let G=i;if(C.bufferProcessing=!0,p>1&&z._writev){C.pendingcb-=p-1;let y=C.allNoop?V:(g)=>{for(let Q0=G;Q0<P.length;++Q0)P[Q0].callback(g)},o=C.allNoop&&G===0?P:U(P,G);o.allBuffers=C.allBuffers,S(z,C,!0,C.length,o,"",y),b(C)}else{do{let{chunk:y,encoding:o,callback:g}=P[G];P[G++]=null;let Q0=m?1:y.length;S(z,C,!1,Q0,y,o,g)}while(G<P.length&&!C.writing);if(G===P.length)b(C);else if(G>256)P.splice(0,G),C.bufferedIndex=0;else C.bufferedIndex=G}C.bufferProcessing=!1}e.prototype._write=function(z,C,P){if(this._writev)this._writev([{chunk:z,encoding:C}],P);else throw new L("_write()")},e.prototype._writev=null,e.prototype.end=function(z,C,P){let i=this._writableState;if(typeof z==="function")P=z,z=null,C=null;else if(typeof C==="function")P=C,C=null;let m;if(z!==null&&z!==void 0){let p=I0(this,z,C);if(p instanceof I)m=p}if(i.corked)i.corked=1,this.uncork();if(m);else if(!i.errored&&!i.ending)i.ending=!0,f(this,i,!0),i.ended=!0;else if(i.finished)m=new Y0("end");else if(i.destroyed)m=new h0("end");if(typeof P==="function")if(m||i.finished)h.nextTick(P,m);else i[O].push(P);return this};function Z0(z){return z.ending&&!z.destroyed&&z.constructed&&z.length===0&&!z.errored&&z.buffered.length===0&&!z.finished&&!z.writing&&!z.errorEmitted&&!z.closeEmitted}function H0(z,C){let P=!1;function i(m){if(P){A(z,m!==null&&m!==void 0?m:T());return}if(P=!0,C.pendingcb--,m){let p=C[O].splice(0);for(let G=0;G<p.length;G++)p[G](m);A(z,m,C.sync)}else if(Z0(C))C.prefinished=!0,z.emit("prefinish"),C.pendingcb++,h.nextTick(k,z,C)}C.sync=!0,C.pendingcb++;try{z._final(i)}catch(m){i(m)}C.sync=!1}function q0(z,C){if(!C.prefinished&&!C.finalCalled)if(typeof z._final==="function"&&!C.destroyed)C.finalCalled=!0,H0(z,C);else C.prefinished=!0,z.emit("prefinish")}function f(z,C,P){if(Z0(C)){if(q0(z,C),C.pendingcb===0){if(P)C.pendingcb++,h.nextTick((i,m)=>{if(Z0(m))k(i,m);else m.pendingcb--},z,C);else if(Z0(C))C.pendingcb++,k(z,C)}}}function k(z,C){C.pendingcb--,C.finished=!0;let P=C[O].splice(0);for(let i=0;i<P.length;i++)P[i]();if(z.emit("finish"),C.autoDestroy){let i=z._readableState;if(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))z.destroy()}}q(e.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(z){if(this._writableState)this._writableState.destroyed=z}},writable:{__proto__:null,get(){let z=this._writableState;return!!z&&z.writable!==!1&&!z.destroyed&&!z.errored&&!z.ending&&!z.ended},set(z){if(this._writableState)this._writableState.writable=!!z}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let z=this._writableState;if(!z)return!1;return!z.destroyed&&!z.ending&&z.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var r=s.destroy;e.prototype.destroy=function(z,C){let P=this._writableState;if(!P.destroyed&&(P.bufferedIndex<P.buffered.length||P[O].length))h.nextTick(_,P);return r.call(this,z,C),this},e.prototype._undestroy=s.undestroy,e.prototype._destroy=function(z,C){C(z)},e.prototype[x.captureRejectionSymbol]=function(z){this.destroy(z)};var F0;function J0(){if(F0===void 0)F0={};return F0}e.fromWeb=function(z,C){return J0().newStreamWritableFromWritableStream(z,C)},e.toWeb=function(z){return J0().newWritableStreamFromStreamWritable(z)}}),B4=$0((w,B)=>{var h=Q2(),U=(p0(),_0(b0)),{isReadable:I,isWritable:X,isIterable:Q,isNodeStream:q,isReadableNodeStream:Y,isWritableNodeStream:K,isDuplexNodeStream:$,isReadableStream:j,isWritableStream:x}=i0(),M=o0(),{AbortError:d,codes:{ERR_INVALID_ARG_TYPE:s,ERR_INVALID_RETURN_VALUE:c}}=O0(),{destroyer:E}=G2(),F=d0(),W=f2(),L=U1(),{createDeferredPromise:T}=D0(),a=N6(),h0=globalThis.Blob||U.Blob,Y0=typeof h0<"u"?function(N){return N instanceof h0}:function(N){return!1},t=globalThis.AbortController||A2().AbortController,{FunctionPrototypeCall:D}=W0();class u extends F{constructor(O){super(O);if((O===null||O===void 0?void 0:O.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((O===null||O===void 0?void 0:O.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}B.exports=function O(N,b){if($(N))return N;if(Y(N))return V({readable:N});if(K(N))return V({writable:N});if(q(N))return V({writable:!1,readable:!1});if(j(N))return V({readable:W.fromWeb(N)});if(x(N))return V({writable:L.fromWeb(N)});if(typeof N==="function"){let{value:I0,write:K0,final:S,destroy:X0}=A(N);if(Q(I0))return a(u,I0,{objectMode:!0,write:K0,final:S,destroy:X0});let H=I0===null||I0===void 0?void 0:I0.then;if(typeof H==="function"){let v,B0=D(H,I0,(_)=>{if(_!=null)throw new c("nully","body",_)},(_)=>{E(v,_)});return v=new u({objectMode:!0,readable:!1,write:K0,final(_){S(async()=>{try{await B0,h.nextTick(_,null)}catch(U0){h.nextTick(_,U0)}})},destroy:X0})}throw new c("Iterable, AsyncIterable or AsyncFunction",b,I0)}if(Y0(N))return O(N.arrayBuffer());if(Q(N))return a(u,N,{objectMode:!0,writable:!1});if(j(N===null||N===void 0?void 0:N.readable)&&x(N===null||N===void 0?void 0:N.writable))return u.fromWeb(N);if(typeof(N===null||N===void 0?void 0:N.writable)==="object"||typeof(N===null||N===void 0?void 0:N.readable)==="object"){let I0=N!==null&&N!==void 0&&N.readable?Y(N===null||N===void 0?void 0:N.readable)?N===null||N===void 0?void 0:N.readable:O(N.readable):void 0,K0=N!==null&&N!==void 0&&N.writable?K(N===null||N===void 0?void 0:N.writable)?N===null||N===void 0?void 0:N.writable:O(N.writable):void 0;return V({readable:I0,writable:K0})}let e=N===null||N===void 0?void 0:N.then;if(typeof e==="function"){let I0;return D(e,N,(K0)=>{if(K0!=null)I0.push(K0);I0.push(null)},(K0)=>{E(I0,K0)}),I0=new u({objectMode:!0,writable:!1,read(){}})}throw new s(b,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],N)};function A(O){let{promise:N,resolve:b}=T(),e=new t,I0=e.signal;return{value:O(async function*(){while(!0){let K0=N;N=null;let{chunk:S,done:X0,cb:H}=await K0;if(h.nextTick(H),X0)return;if(I0.aborted)throw new d(void 0,{cause:I0.reason});({promise:N,resolve:b}=T()),yield S}}(),{signal:I0}),write(K0,S,X0){let H=b;b=null,H({chunk:K0,done:!1,cb:X0})},final(K0){let S=b;b=null,S({done:!0,cb:K0})},destroy(K0,S){e.abort(),S(K0)}}}function V(O){let N=O.readable&&typeof O.readable.read!=="function"?W.wrap(O.readable):O.readable,b=O.writable,e=!!I(N),I0=!!X(b),K0,S,X0,H,v;function B0(_){let U0=H;if(H=null,U0)U0(_);else if(_)v.destroy(_)}if(v=new u({readableObjectMode:!!(N!==null&&N!==void 0&&N.readableObjectMode),writableObjectMode:!!(b!==null&&b!==void 0&&b.writableObjectMode),readable:e,writable:I0}),I0)M(b,(_)=>{if(I0=!1,_)E(N,_);B0(_)}),v._write=function(_,U0,Z0){if(b.write(_,U0))Z0();else K0=Z0},v._final=function(_){b.end(),S=_},b.on("drain",function(){if(K0){let _=K0;K0=null,_()}}),b.on("finish",function(){if(S){let _=S;S=null,_()}});if(e)M(N,(_)=>{if(e=!1,_)E(N,_);B0(_)}),N.on("readable",function(){if(X0){let _=X0;X0=null,_()}}),N.on("end",function(){v.push(null)}),v._read=function(){while(!0){let _=N.read();if(_===null){X0=v._read;return}if(!v.push(_))return}};return v._destroy=function(_,U0){if(!_&&H!==null)_=new d;if(X0=null,K0=null,S=null,H===null)U0(_);else H=U0,E(b,_),E(N,_)},v}}),d0=$0((w,B)=>{var{ObjectDefineProperties:h,ObjectGetOwnPropertyDescriptor:U,ObjectKeys:I,ObjectSetPrototypeOf:X}=W0();B.exports=Y;var Q=f2(),q=U1();X(Y.prototype,Q.prototype),X(Y,Q);{let x=I(q.prototype);for(let M=0;M<x.length;M++){let d=x[M];if(!Y.prototype[d])Y.prototype[d]=q.prototype[d]}}function Y(x){if(!(this instanceof Y))return new Y(x);if(Q.call(this,x),q.call(this,x),x){if(this.allowHalfOpen=x.allowHalfOpen!==!1,x.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(x.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}h(Y.prototype,{writable:{__proto__:null,...U(q.prototype,"writable")},writableHighWaterMark:{__proto__:null,...U(q.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...U(q.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...U(q.prototype,"writableBuffer")},writableLength:{__proto__:null,...U(q.prototype,"writableLength")},writableFinished:{__proto__:null,...U(q.prototype,"writableFinished")},writableCorked:{__proto__:null,...U(q.prototype,"writableCorked")},writableEnded:{__proto__:null,...U(q.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...U(q.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(x){if(this._readableState&&this._writableState)this._readableState.destroyed=x,this._writableState.destroyed=x}}});var K;function $(){if(K===void 0)K={};return K}Y.fromWeb=function(x,M){return $().newStreamDuplexFromReadableWritablePair(x,M)},Y.toWeb=function(x){return $().newReadableWritablePairFromDuplex(x)};var j;Y.from=function(x){if(!j)j=B4();return j(x,"body")}}),V6=$0((w,B)=>{var{ObjectSetPrototypeOf:h,Symbol:U}=W0();B.exports=Y;var{ERR_METHOD_NOT_IMPLEMENTED:I}=O0().codes,X=d0(),{getHighWaterMark:Q}=_2();h(Y.prototype,X.prototype),h(Y,X);var q=U("kCallback");function Y(j){if(!(this instanceof Y))return new Y(j);let x=j?Q(this,j,"readableHighWaterMark",!0):null;if(x===0)j={...j,highWaterMark:null,readableHighWaterMark:x,writableHighWaterMark:j.writableHighWaterMark||0};if(X.call(this,j),this._readableState.sync=!1,this[q]=null,j){if(typeof j.transform==="function")this._transform=j.transform;if(typeof j.flush==="function")this._flush=j.flush}this.on("prefinish",$)}function K(j){if(typeof this._flush==="function"&&!this.destroyed)this._flush((x,M)=>{if(x){if(j)j(x);else this.destroy(x);return}if(M!=null)this.push(M);if(this.push(null),j)j()});else if(this.push(null),j)j()}function $(){if(this._final!==K)K.call(this)}Y.prototype._final=K,Y.prototype._transform=function(j,x,M){throw new I("_transform()")},Y.prototype._write=function(j,x,M){let d=this._readableState,s=this._writableState,c=d.length;this._transform(j,x,(E,F)=>{if(E){M(E);return}if(F!=null)this.push(F);if(s.ended||c===d.length||d.length<d.highWaterMark)M();else this[q]=M})},Y.prototype._read=function(){if(this[q]){let j=this[q];this[q]=null,j()}}}),j6=$0((w,B)=>{var{ObjectSetPrototypeOf:h}=W0();B.exports=I;var U=V6();h(I.prototype,U.prototype),h(I,U);function I(X){if(!(this instanceof I))return new I(X);U.call(this,X)}I.prototype._transform=function(X,Q,q){q(null,X)}}),I1=$0((w,B)=>{var h=Q2(),{ArrayIsArray:U,Promise:I,SymbolAsyncIterator:X,SymbolDispose:Q}=W0(),q=o0(),{once:Y}=D0(),K=G2(),$=d0(),{aggregateTwoErrors:j,codes:{ERR_INVALID_ARG_TYPE:x,ERR_INVALID_RETURN_VALUE:M,ERR_MISSING_ARGS:d,ERR_STREAM_DESTROYED:s,ERR_STREAM_PREMATURE_CLOSE:c},AbortError:E}=O0(),{validateFunction:F,validateAbortSignal:W}=O2(),{isIterable:L,isReadable:T,isReadableNodeStream:a,isNodeStream:h0,isTransformStream:Y0,isWebStream:t,isReadableStream:D,isReadableFinished:u}=i0(),A=globalThis.AbortController||A2().AbortController,V,O,N;function b(_,U0,Z0){let H0=!1;_.on("close",()=>{H0=!0});let q0=q(_,{readable:U0,writable:Z0},(f)=>{H0=!f});return{destroy:(f)=>{if(H0)return;H0=!0,K.destroyer(_,f||new s("pipe"))},cleanup:q0}}function e(_){return F(_[_.length-1],"streams[stream.length - 1]"),_.pop()}function I0(_){if(L(_))return _;else if(a(_))return K0(_);throw new x("val",["Readable","Iterable","AsyncIterable"],_)}async function*K0(_){if(!O)O=f2();yield*O.prototype[X].call(_)}async function S(_,U0,Z0,{end:H0}){let q0,f=null,k=(J0)=>{if(J0)q0=J0;if(f){let z=f;f=null,z()}},r=()=>new I((J0,z)=>{if(q0)z(q0);else f=()=>{if(q0)z(q0);else J0()}});U0.on("drain",k);let F0=q(U0,{readable:!1},k);try{if(U0.writableNeedDrain)await r();for await(let J0 of _)if(!U0.write(J0))await r();if(H0)U0.end(),await r();Z0()}catch(J0){Z0(q0!==J0?j(q0,J0):J0)}finally{F0(),U0.off("drain",k)}}async function X0(_,U0,Z0,{end:H0}){if(Y0(U0))U0=U0.writable;let q0=U0.getWriter();try{for await(let f of _)await q0.ready,q0.write(f).catch(()=>{});if(await q0.ready,H0)await q0.close();Z0()}catch(f){try{await q0.abort(f),Z0(f)}catch(k){Z0(k)}}}function H(..._){return v(_,Y(e(_)))}function v(_,U0,Z0){if(_.length===1&&U(_[0]))_=_[0];if(_.length<2)throw new d("streams");let H0=new A,q0=H0.signal,f=Z0===null||Z0===void 0?void 0:Z0.signal,k=[];W(f,"options.signal");function r(){m(new E)}N=N||D0().addAbortListener;let F0;if(f)F0=N(f,r);let J0,z,C=[],P=0;function i(g){m(g,--P===0)}function m(g,Q0){var P0;if(g&&(!J0||J0.code==="ERR_STREAM_PREMATURE_CLOSE"))J0=g;if(!J0&&!Q0)return;while(C.length)C.shift()(J0);if((P0=F0)===null||P0===void 0||P0[Q](),H0.abort(),Q0){if(!J0)k.forEach((C0)=>C0());h.nextTick(U0,J0,z)}}let p;for(let g=0;g<_.length;g++){let Q0=_[g],P0=g<_.length-1,C0=g>0,j0=P0||(Z0===null||Z0===void 0?void 0:Z0.end)!==!1,a0=g===_.length-1;if(h0(Q0)){let L0=function(M0){if(M0&&M0.name!=="AbortError"&&M0.code!=="ERR_STREAM_PREMATURE_CLOSE")i(M0)};var G=L0;if(j0){let{destroy:M0,cleanup:q2}=b(Q0,P0,C0);if(C.push(M0),T(Q0)&&a0)k.push(q2)}if(Q0.on("error",L0),T(Q0)&&a0)k.push(()=>{Q0.removeListener("error",L0)})}if(g===0)if(typeof Q0==="function"){if(p=Q0({signal:q0}),!L(p))throw new M("Iterable, AsyncIterable or Stream","source",p)}else if(L(Q0)||a(Q0)||Y0(Q0))p=Q0;else p=$.from(Q0);else if(typeof Q0==="function"){if(Y0(p)){var y;p=I0((y=p)===null||y===void 0?void 0:y.readable)}else p=I0(p);if(p=Q0(p,{signal:q0}),P0){if(!L(p,!0))throw new M("AsyncIterable",`transform[${g-1}]`,p)}else{var o;if(!V)V=j6();let L0=new V({objectMode:!0}),M0=(o=p)===null||o===void 0?void 0:o.then;if(typeof M0==="function")P++,M0.call(p,(k0)=>{if(z=k0,k0!=null)L0.write(k0);if(j0)L0.end();h.nextTick(i)},(k0)=>{L0.destroy(k0),h.nextTick(i,k0)});else if(L(p,!0))P++,S(p,L0,i,{end:j0});else if(D(p)||Y0(p)){let k0=p.readable||p;P++,S(k0,L0,i,{end:j0})}else throw new M("AsyncIterable or Promise","destination",p);p=L0;let{destroy:q2,cleanup:K2}=b(p,!1,!0);if(C.push(q2),a0)k.push(K2)}}else if(h0(Q0)){if(a(p)){P+=2;let L0=B0(p,Q0,i,{end:j0});if(T(Q0)&&a0)k.push(L0)}else if(Y0(p)||D(p)){let L0=p.readable||p;P++,S(L0,Q0,i,{end:j0})}else if(L(p))P++,S(p,Q0,i,{end:j0});else throw new x("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=Q0}else if(t(Q0)){if(a(p))P++,X0(I0(p),Q0,i,{end:j0});else if(D(p)||L(p))P++,X0(p,Q0,i,{end:j0});else if(Y0(p))P++,X0(p.readable,Q0,i,{end:j0});else throw new x("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=Q0}else p=$.from(Q0)}if(q0!==null&&q0!==void 0&&q0.aborted||f!==null&&f!==void 0&&f.aborted)h.nextTick(r);return p}function B0(_,U0,Z0,{end:H0}){let q0=!1;if(U0.on("close",()=>{if(!q0)Z0(new c)}),_.pipe(U0,{end:!1}),H0){let k=function(){q0=!0,U0.end()};var f=k;if(u(_))h.nextTick(k);else _.once("end",k)}else Z0();return q(_,{readable:!0,writable:!1},(k)=>{let r=_._readableState;if(k&&k.code==="ERR_STREAM_PREMATURE_CLOSE"&&r&&r.ended&&!r.errored&&!r.errorEmitted)_.once("end",Z0).once("error",Z0);else Z0(k)}),q(U0,{readable:!1,writable:!0},Z0)}B.exports={pipelineImpl:v,pipeline:H}}),E6=$0((w,B)=>{var{pipeline:h}=I1(),U=d0(),{destroyer:I}=G2(),{isNodeStream:X,isReadable:Q,isWritable:q,isWebStream:Y,isTransformStream:K,isWritableStream:$,isReadableStream:j}=i0(),{AbortError:x,codes:{ERR_INVALID_ARG_VALUE:M,ERR_MISSING_ARGS:d}}=O0(),s=o0();B.exports=function(...E){if(E.length===0)throw new d("streams");if(E.length===1)return U.from(E[0]);let F=[...E];if(typeof E[0]==="function")E[0]=U.from(E[0]);if(typeof E[E.length-1]==="function"){let V=E.length-1;E[V]=U.from(E[V])}for(let V=0;V<E.length;++V){if(!X(E[V])&&!Y(E[V]))continue;if(V<E.length-1&&!(Q(E[V])||j(E[V])||K(E[V])))throw new M(`streams[${V}]`,F[V],"must be readable");if(V>0&&!(q(E[V])||$(E[V])||K(E[V])))throw new M(`streams[${V}]`,F[V],"must be writable")}let W,L,T,a,h0;function Y0(V){let O=a;if(a=null,O)O(V);else if(V)h0.destroy(V);else if(!A&&!u)h0.destroy()}let t=E[0],D=h(E,Y0),u=!!(q(t)||$(t)||K(t)),A=!!(Q(D)||j(D)||K(D));if(h0=new U({writableObjectMode:!!(t!==null&&t!==void 0&&t.writableObjectMode),readableObjectMode:!!(D!==null&&D!==void 0&&D.readableObjectMode),writable:u,readable:A}),u){if(X(t))h0._write=function(O,N,b){if(t.write(O,N))b();else W=b},h0._final=function(O){t.end(),L=O},t.on("drain",function(){if(W){let O=W;W=null,O()}});else if(Y(t)){let O=(K(t)?t.writable:t).getWriter();h0._write=async function(N,b,e){try{await O.ready,O.write(N).catch(()=>{}),e()}catch(I0){e(I0)}},h0._final=async function(N){try{await O.ready,O.close().catch(()=>{}),L=N}catch(b){N(b)}}}let V=K(D)?D.readable:D;s(V,()=>{if(L){let O=L;L=null,O()}})}if(A){if(X(D))D.on("readable",function(){if(T){let V=T;T=null,V()}}),D.on("end",function(){h0.push(null)}),h0._read=function(){while(!0){let V=D.read();if(V===null){T=h0._read;return}if(!h0.push(V))return}};else if(Y(D)){let V=(K(D)?D.readable:D).getReader();h0._read=async function(){while(!0)try{let{value:O,done:N}=await V.read();if(!h0.push(O))return;if(N){h0.push(null);return}}catch{return}}}}return h0._destroy=function(V,O){if(!V&&a!==null)V=new x;if(T=null,W=null,L=null,a===null)O(V);else if(a=O,X(D))I(D,V)},h0}}),h4=$0((w,B)=>{var h=globalThis.AbortController||A2().AbortController,{codes:{ERR_INVALID_ARG_VALUE:U,ERR_INVALID_ARG_TYPE:I,ERR_MISSING_ARGS:X,ERR_OUT_OF_RANGE:Q},AbortError:q}=O0(),{validateAbortSignal:Y,validateInteger:K,validateObject:$}=O2(),j=W0().Symbol("kWeak"),x=W0().Symbol("kResistStopPropagation"),{finished:M}=o0(),d=E6(),{addAbortSignalNoValidate:s}=R2(),{isWritable:c,isNodeStream:E}=i0(),{deprecate:F}=D0(),{ArrayPrototypePush:W,Boolean:L,MathFloor:T,Number:a,NumberIsNaN:h0,Promise:Y0,PromiseReject:t,PromiseResolve:D,PromisePrototypeThen:u,Symbol:A}=W0(),V=A("kEmpty"),O=A("kEof");function N(f,k){if(k!=null)$(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)Y(k.signal,"options.signal");if(E(f)&&!c(f))throw new U("stream",f,"must be writable");let r=d(this,f);if(k!==null&&k!==void 0&&k.signal)s(k.signal,r);return r}function b(f,k){if(typeof f!=="function")throw new I("fn",["Function","AsyncFunction"],f);if(k!=null)$(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)Y(k.signal,"options.signal");let r=1;if((k===null||k===void 0?void 0:k.concurrency)!=null)r=T(k.concurrency);let F0=r-1;if((k===null||k===void 0?void 0:k.highWaterMark)!=null)F0=T(k.highWaterMark);return K(r,"options.concurrency",1),K(F0,"options.highWaterMark",0),F0+=r,async function*(){let z=D0().AbortSignalAny([k===null||k===void 0?void 0:k.signal].filter(L)),C=this,P=[],i={signal:z},m,p,G=!1,y=0;function o(){G=!0,g()}function g(){y-=1,Q0()}function Q0(){if(p&&!G&&y<r&&P.length<F0)p(),p=null}async function P0(){try{for await(let C0 of C){if(G)return;if(z.aborted)throw new q;try{if(C0=f(C0,i),C0===V)continue;C0=D(C0)}catch(j0){C0=t(j0)}if(y+=1,u(C0,g,o),P.push(C0),m)m(),m=null;if(!G&&(P.length>=F0||y>=r))await new Y0((j0)=>{p=j0})}P.push(O)}catch(C0){let j0=t(C0);u(j0,g,o),P.push(j0)}finally{if(G=!0,m)m(),m=null}}P0();try{while(!0){while(P.length>0){let C0=await P[0];if(C0===O)return;if(z.aborted)throw new q;if(C0!==V)yield C0;P.shift(),Q0()}await new Y0((C0)=>{m=C0})}}finally{if(G=!0,p)p(),p=null}}.call(this)}function e(f=void 0){if(f!=null)$(f,"options");if((f===null||f===void 0?void 0:f.signal)!=null)Y(f.signal,"options.signal");return async function*(){let r=0;for await(let J0 of this){var F0;if(f!==null&&f!==void 0&&(F0=f.signal)!==null&&F0!==void 0&&F0.aborted)throw new q({cause:f.signal.reason});yield[r++,J0]}}.call(this)}async function I0(f,k=void 0){for await(let r of H.call(this,f,k))return!0;return!1}async function K0(f,k=void 0){if(typeof f!=="function")throw new I("fn",["Function","AsyncFunction"],f);return!await I0.call(this,async(...r)=>{return!await f(...r)},k)}async function S(f,k){for await(let r of H.call(this,f,k))return r;return}async function X0(f,k){if(typeof f!=="function")throw new I("fn",["Function","AsyncFunction"],f);async function r(F0,J0){return await f(F0,J0),V}for await(let F0 of b.call(this,r,k));}function H(f,k){if(typeof f!=="function")throw new I("fn",["Function","AsyncFunction"],f);async function r(F0,J0){if(await f(F0,J0))return F0;return V}return b.call(this,r,k)}class v extends X{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function B0(f,k,r){var F0;if(typeof f!=="function")throw new I("reducer",["Function","AsyncFunction"],f);if(r!=null)$(r,"options");if((r===null||r===void 0?void 0:r.signal)!=null)Y(r.signal,"options.signal");let J0=arguments.length>1;if(r!==null&&r!==void 0&&(F0=r.signal)!==null&&F0!==void 0&&F0.aborted){let m=new q(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await M(this.destroy(m)),m}let z=new h,C=z.signal;if(r!==null&&r!==void 0&&r.signal){let m={once:!0,[j]:this,[x]:!0};r.signal.addEventListener("abort",()=>z.abort(),m)}let P=!1;try{for await(let m of this){var i;if(P=!0,r!==null&&r!==void 0&&(i=r.signal)!==null&&i!==void 0&&i.aborted)throw new q;if(!J0)k=m,J0=!0;else k=await f(k,m,{signal:C})}if(!P&&!J0)throw new v}finally{z.abort()}return k}async function _(f){if(f!=null)$(f,"options");if((f===null||f===void 0?void 0:f.signal)!=null)Y(f.signal,"options.signal");let k=[];for await(let F0 of this){var r;if(f!==null&&f!==void 0&&(r=f.signal)!==null&&r!==void 0&&r.aborted)throw new q(void 0,{cause:f.signal.reason});W(k,F0)}return k}function U0(f,k){let r=b.call(this,f,k);return async function*(){for await(let J0 of r)yield*J0}.call(this)}function Z0(f){if(f=a(f),h0(f))return 0;if(f<0)throw new Q("number",">= 0",f);return f}function H0(f,k=void 0){if(k!=null)$(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)Y(k.signal,"options.signal");return f=Z0(f),async function*(){var F0;if(k!==null&&k!==void 0&&(F0=k.signal)!==null&&F0!==void 0&&F0.aborted)throw new q;for await(let z of this){var J0;if(k!==null&&k!==void 0&&(J0=k.signal)!==null&&J0!==void 0&&J0.aborted)throw new q;if(f--<=0)yield z}}.call(this)}function q0(f,k=void 0){if(k!=null)$(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)Y(k.signal,"options.signal");return f=Z0(f),async function*(){var F0;if(k!==null&&k!==void 0&&(F0=k.signal)!==null&&F0!==void 0&&F0.aborted)throw new q;for await(let z of this){var J0;if(k!==null&&k!==void 0&&(J0=k.signal)!==null&&J0!==void 0&&J0.aborted)throw new q;if(f-- >0)yield z;if(f<=0)return}}.call(this)}B.exports.streamReturningOperators={asIndexedPairs:F(e,"readable.asIndexedPairs will be removed in a future version."),drop:H0,filter:H,flatMap:U0,map:b,take:q0,compose:N},B.exports.promiseReturningOperators={every:K0,forEach:X0,reduce:B0,toArray:_,some:I0,find:S}}),L6=$0((w,B)=>{var{ArrayPrototypePop:h,Promise:U}=W0(),{isIterable:I,isNodeStream:X,isWebStream:Q}=i0(),{pipelineImpl:q}=I1(),{finished:Y}=o0();A6();function K(...$){return new U((j,x)=>{let M,d,s=$[$.length-1];if(s&&typeof s==="object"&&!X(s)&&!I(s)&&!Q(s)){let c=h($);M=c.signal,d=c.end}q($,(c,E)=>{if(c)x(c);else j(E)},{signal:M,end:d})})}B.exports={finished:Y,pipeline:K}}),A6=$0((w,B)=>{var{Buffer:h}=(p0(),_0(b0)),{ObjectDefineProperty:U,ObjectKeys:I,ReflectApply:X}=W0(),{promisify:{custom:Q}}=D0(),{streamReturningOperators:q,promiseReturningOperators:Y}=h4(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:K}}=O0(),$=E6(),{setDefaultHighWaterMark:j,getDefaultHighWaterMark:x}=_2(),{pipeline:M}=I1(),{destroyer:d}=G2(),s=o0(),c=L6(),E=i0(),F=B.exports=w1().Stream;F.isDestroyed=E.isDestroyed,F.isDisturbed=E.isDisturbed,F.isErrored=E.isErrored,F.isReadable=E.isReadable,F.isWritable=E.isWritable,F.Readable=f2();for(let L of I(q)){let T=function(...h0){if(new.target)throw K();return F.Readable.from(X(a,this,h0))},a=q[L];U(T,"name",{__proto__:null,value:a.name}),U(T,"length",{__proto__:null,value:a.length}),U(F.Readable.prototype,L,{__proto__:null,value:T,enumerable:!1,configurable:!0,writable:!0})}for(let L of I(Y)){let T=function(...h0){if(new.target)throw K();return X(a,this,h0)},a=Y[L];U(T,"name",{__proto__:null,value:a.name}),U(T,"length",{__proto__:null,value:a.length}),U(F.Readable.prototype,L,{__proto__:null,value:T,enumerable:!1,configurable:!0,writable:!0})}F.Writable=U1(),F.Duplex=d0(),F.Transform=V6(),F.PassThrough=j6(),F.pipeline=M;var{addAbortSignal:W}=R2();F.addAbortSignal=W,F.finished=s,F.destroy=d,F.compose=$,F.setDefaultHighWaterMark=j,F.getDefaultHighWaterMark=x,U(F,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return c}}),U(M,Q,{__proto__:null,enumerable:!0,get(){return c.pipeline}}),U(s,Q,{__proto__:null,enumerable:!0,get(){return c.finished}}),F.Stream=F,F._isUint8Array=function(T){return T instanceof Uint8Array},F._uint8ArrayToBuffer=function(T){return h.from(T.buffer,T.byteOffset,T.byteLength)}}),w4=$0((w,B)=>{var h=X1();{let U=A6(),I=L6(),X=U.Readable.destroy;B.exports=U.Readable,B.exports._uint8ArrayToBuffer=U._uint8ArrayToBuffer,B.exports._isUint8Array=U._isUint8Array,B.exports.isDisturbed=U.isDisturbed,B.exports.isErrored=U.isErrored,B.exports.isReadable=U.isReadable,B.exports.Readable=U.Readable,B.exports.Writable=U.Writable,B.exports.Duplex=U.Duplex,B.exports.Transform=U.Transform,B.exports.PassThrough=U.PassThrough,B.exports.addAbortSignal=U.addAbortSignal,B.exports.finished=U.finished,B.exports.destroy=U.destroy,B.exports.destroy=X,B.exports.pipeline=U.pipeline,B.exports.compose=U.compose,Object.defineProperty(U,"promises",{configurable:!0,enumerable:!0,get(){return I}}),B.exports.Stream=U.Stream}B.exports.default=B.exports});O6.exports=w4()});import{logger as N0,ModelType as V0}from"@elizaos/core";import{logger as h2}from"@elizaos/core";import{logger as H2}from"@elizaos/core";function z0(w,B,h){return w.getSetting(B)??process.env[B]??h}function l0(){return typeof globalThis<"u"&&"document"in globalThis&&typeof globalThis.document<"u"}function x1(w){return l0()&&!!z0(w,"OPENAI_BROWSER_BASE_URL")}function f0(w,B=!1){if(l0())return{};let h=B?o6(w):Y2(w);return h?{Authorization:`Bearer ${h}`}:{}}function T0(w){let B=z0(w,"OPENAI_BROWSER_BASE_URL"),h=l0()&&B?B:z0(w,"OPENAI_BASE_URL","https://api.openai.com/v1");return H2.debug(`[OpenAI] Default base URL: ${h}`),h}function D1(w){let B=l0()?z0(w,"OPENAI_BROWSER_EMBEDDING_URL")||z0(w,"OPENAI_BROWSER_BASE_URL"):z0(w,"OPENAI_EMBEDDING_URL");if(B)return H2.debug(`[OpenAI] Using specific embedding base URL: ${B}`),B;return H2.debug("[OpenAI] Falling back to general base URL for embeddings."),T0(w)}function Y2(w){return z0(w,"OPENAI_API_KEY")}function o6(w){let B=z0(w,"OPENAI_EMBEDDING_API_KEY");if(B)return H2.debug("[OpenAI] Using specific embedding API key (present)"),B;return H2.debug("[OpenAI] Falling back to general API key for embeddings."),Y2(w)}function e0(w){return z0(w,"OPENAI_SMALL_MODEL")??z0(w,"SMALL_MODEL","gpt-4o-mini")}function B2(w){return z0(w,"OPENAI_LARGE_MODEL")??z0(w,"LARGE_MODEL","gpt-4o")}function P1(w){return z0(w,"OPENAI_IMAGE_DESCRIPTION_MODEL","gpt-5-nano")}function T1(w){let B=z0(w,"OPENAI_EXPERIMENTAL_TELEMETRY","false"),h=String(B).toLowerCase(),U=h==="true";return H2.debug(`[OpenAI] Experimental telemetry in function: "${B}" (type: ${typeof B}, normalized: "${h}", result: ${U})`),U}function R1(w,B){(async()=>{try{if(!Y2(B)&&!l0()){h2.warn("OPENAI_API_KEY is not set in environment - OpenAI functionality will be limited");return}try{let h=T0(B),U=await fetch(`${h}/models`,{headers:f0(B)});if(!U.ok)h2.warn(`OpenAI API key validation failed: ${U.statusText}`),h2.warn("OpenAI functionality will be limited until a valid API key is provided");else h2.log("OpenAI API key validated successfully")}catch(h){let U=h instanceof Error?h.message:String(h);h2.warn(`Error validating OpenAI API key: ${U}`),h2.warn("OpenAI functionality will be limited until a valid API key is provided")}}catch(h){let U=h?.errors?.map((I)=>I.message).join(", ")||(h instanceof Error?h.message:String(h));h2.warn(`OpenAI plugin configuration issue: ${U} - You need to configure the OPENAI_API_KEY in your environment variables`)}})()}import{logger as _1,ModelType as f1}from"@elizaos/core";import{generateText as t6}from"ai";import{createOpenAI as a6}from"@ai-sdk/openai";function M2(w){let B=T0(w),h=Y2(w)??(x1(w)?"sk-proxy":void 0);return a6({apiKey:h??"",baseURL:B})}import{EventType as s6}from"@elizaos/core";function m0(w,B,h,U){let I=("promptTokens"in U?U.promptTokens:void 0)??("inputTokens"in U?U.inputTokens:void 0)??0,X=("completionTokens"in U?U.completionTokens:void 0)??("outputTokens"in U?U.outputTokens:void 0)??0,Q=("totalTokens"in U?U.totalTokens:void 0)??I+X;w.emitEvent(s6.MODEL_USED,{provider:"openai",type:B,prompt:h,tokens:{prompt:I,completion:X,total:Q}})}async function S1(w,B,h,U){let I=M2(w),X=U(w),Q=T1(w);_1.log(`[OpenAI] Using ${h} model: ${X}`),_1.log(B.prompt);let{prompt:q,stopSequences:Y=[],maxTokens:K=8192,temperature:$=0.7,frequencyPenalty:j=0.7,presencePenalty:x=0.7}=B,{text:M,usage:d}=await t6({model:I.languageModel(X),prompt:q,system:w.character.system??void 0,temperature:$,maxOutputTokens:K,frequencyPenalty:j,presencePenalty:x,stopSequences:Y,experimental_telemetry:{isEnabled:Q}});if(d)m0(w,h,q,d);return M}async function u2(w,B){return S1(w,B,f1.TEXT_SMALL,e0)}async function g2(w,B){return S1(w,B,f1.TEXT_LARGE,B2)}import{logger as u0,ModelType as e6,VECTOR_DIMS as k1}from"@elizaos/core";async function b2(w,B){let h=z0(w,"OPENAI_EMBEDDING_MODEL","text-embedding-3-small"),U=Number.parseInt(z0(w,"OPENAI_EMBEDDING_DIMENSIONS","1536")||"1536",10);if(!Object.values(k1).includes(U)){let Q=`Invalid embedding dimension: ${U}. Must be one of: ${Object.values(k1).join(", ")}`;throw u0.error(Q),Error(Q)}if(B===null){u0.debug("Creating test embedding for initialization");let Q=Array(U).fill(0);return Q[0]=0.1,Q}let I;if(typeof B==="string")I=B;else if(typeof B==="object"&&B.text)I=B.text;else{u0.warn("Invalid input format for embedding");let q=Array(U).fill(0);return q[0]=0.2,q}if(!I.trim()){u0.warn("Empty text for embedding");let q=Array(U).fill(0);return q[0]=0.3,q}let X=D1(w);try{let Q=await fetch(`${X}/embeddings`,{method:"POST",headers:{...f0(w,!0),"Content-Type":"application/json"},body:JSON.stringify({model:h,input:I})});if(!Q.ok)throw u0.error(`OpenAI API error: ${Q.status} - ${Q.statusText}`),Error(`OpenAI API error: ${Q.status} - ${Q.statusText}`);let q=await Q.json();if(!q?.data?.[0]?.embedding)throw u0.error("API returned invalid structure"),Error("API returned invalid structure");let Y=q.data[0].embedding;if(!Array.isArray(Y)||Y.length!==U){let K=`Embedding length ${Y?.length??0} does not match configured dimension ${U}`;u0.error(K);let $=Array(U).fill(0);return $[0]=0.4,$}if(q.usage){let K={inputTokens:q.usage.prompt_tokens,outputTokens:0,totalTokens:q.usage.total_tokens};m0(w,e6.TEXT_EMBEDDING,I,K)}return u0.log(`Got valid embedding with length ${Y.length}`),Y}catch(Q){let q=Q instanceof Error?Q.message:String(Q);throw u0.error(`Error generating embedding: ${q}`),Q instanceof Error?Q:Error(q)}}import{logger as x2,ModelType as B8}from"@elizaos/core";async function p2(w,B){let h=B.n||1,U=B.size||"1024x1024",I=B.prompt,X=z0(w,"OPENAI_IMAGE_MODEL","gpt-image-1");x2.log(`[OpenAI] Using IMAGE model: ${X}`);let Q=T0(w);try{let q=await fetch(`${Q}/images/generations`,{method:"POST",headers:{...f0(w),"Content-Type":"application/json"},body:JSON.stringify({model:X,prompt:I,n:h,size:U})});if(!q.ok)throw Error(`Failed to generate image: ${q.statusText}`);return await q.json()}catch(q){let Y=q instanceof Error?q.message:String(q);throw q}}async function d2(w,B){let h,U,I=P1(w);x2.log(`[OpenAI] Using IMAGE_DESCRIPTION model: ${I}`);let X=Number.parseInt(z0(w,"OPENAI_IMAGE_DESCRIPTION_MAX_TOKENS","8192")||"8192",10),Q="Please analyze this image and provide a title and detailed description.";if(typeof B==="string")h=B,U=Q;else h=B.imageUrl,U=B.prompt||Q;let q=[{role:"user",content:[{type:"text",text:U},{type:"image_url",image_url:{url:h}}]}],Y=T0(w);try{let K={model:I,messages:q,max_tokens:X},$=await fetch(`${Y}/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",...f0(w)},body:JSON.stringify(K)});if(!$.ok)throw Error(`OpenAI API error: ${$.status}`);let x=await $.json(),M=x.choices?.[0]?.message?.content;if(x.usage)m0(w,B8.IMAGE_DESCRIPTION,typeof B==="string"?B:B.prompt||"",{inputTokens:x.usage.prompt_tokens,outputTokens:x.usage.completion_tokens,totalTokens:x.usage.total_tokens});if(!M)return{title:"Failed to analyze image",description:"No response from API"};if(typeof B==="object"&&Boolean(B.prompt)&&B.prompt!==Q)return M;let c=M.match(/title[:\s]+(.+?)(?:\n|$)/i)?.[1]?.trim();if(!c)x2.warn("Could not extract title from image description response");let E=c||"Image Analysis",F=M.replace(/title[:\s]+(.+?)(?:\n|$)/i,"").trim();return{title:E,description:F}}catch(K){let $=K instanceof Error?K.message:String(K);return x2.error(`Error analyzing image: ${$}`),{title:"Failed to analyze image",description:`Error: ${$}`}}}import{logger as F2}from"@elizaos/core";import{logger as M6}from"@elizaos/core";var Z2={WAV:{HEADER:[82,73,70,70],IDENTIFIER:[87,65,86,69]},MP3_ID3:[73,68,51],OGG:[79,103,103,83],FLAC:[102,76,97,67],FTYP:[102,116,121,112],WEBM_EBML:[26,69,223,163]};function J2(w,B,h){for(let U=0;U<h.length;U++)if(w[B+U]!==h[U])return!1;return!0}function Q1(w){if(w.length<12)return"application/octet-stream";if(J2(w,0,Z2.WAV.HEADER)&&J2(w,8,Z2.WAV.IDENTIFIER))return"audio/wav";if(J2(w,0,Z2.MP3_ID3)||w[0]===255&&(w[1]&224)===224)return"audio/mpeg";if(J2(w,0,Z2.OGG))return"audio/ogg";if(J2(w,0,Z2.FLAC))return"audio/flac";if(J2(w,4,Z2.FTYP))return"audio/mp4";if(J2(w,0,Z2.WEBM_EBML))return"audio/webm";return M6.warn("Could not detect audio format from buffer, using generic binary type"),"application/octet-stream"}async function x6(w){try{let{Readable:B}=await Promise.resolve().then(() => n6(X1(),1)),h=w.getReader();return new B({async read(){try{let{done:U,value:I}=await h.read();if(U)this.push(null);else this.push(I)}catch(U){this.destroy(U)}},destroy(U,I){h.cancel().finally(()=>I(U))}})}catch(B){let h=B instanceof Error?B.message:String(B);throw M6.error(`Failed to load node:stream module: ${h}`),Error("Cannot convert stream: node:stream module unavailable. This feature requires a Node.js environment.")}}async function U4(w,B){let h=z0(w,"OPENAI_TTS_MODEL","gpt-4o-mini-tts"),U=z0(w,"OPENAI_TTS_VOICE","nova"),I=z0(w,"OPENAI_TTS_INSTRUCTIONS",""),X=T0(w),Q=B.model||h,q=B.voice||U,Y=B.instructions??I,K=B.format||"mp3";try{let $=await fetch(`${X}/audio/speech`,{method:"POST",headers:{...f0(w),"Content-Type":"application/json",...K==="mp3"?{Accept:"audio/mpeg"}:{}},body:JSON.stringify({model:Q,voice:q,input:B.text,format:K,...Y&&{instructions:Y}})});if(!$.ok){let j=await $.text();throw Error(`OpenAI TTS error ${$.status}: ${j}`)}if(!$.body)throw Error("OpenAI TTS response body is null");if(!l0())return await x6($.body);return $.body}catch($){let j=$ instanceof Error?$.message:String($);throw Error(`Failed to fetch speech from OpenAI TTS: ${j}`)}}async function Z1(w,B){let h=z0(w,"OPENAI_TRANSCRIPTION_MODEL","gpt-4o-mini-transcribe");F2.log(`[OpenAI] Using TRANSCRIPTION model: ${h}`);let U=T0(w),I,X=null;if(B instanceof Blob||B instanceof File)I=B;else if(Buffer.isBuffer(B)){let K=Q1(B);F2.debug(`Auto-detected audio MIME type: ${K}`);let $=new Uint8Array(B);I=new Blob([$],{type:K})}else if(typeof B==="object"&&B!==null&&B.audio!=null){let K=B;if(!(K.audio instanceof Blob)&&!(K.audio instanceof File)&&!Buffer.isBuffer(K.audio))throw Error("TRANSCRIPTION param 'audio' must be a Blob/File/Buffer.");if(Buffer.isBuffer(K.audio)){let $=K.mimeType;if(!$)$=Q1(K.audio),F2.debug(`Auto-detected audio MIME type: ${$}`);else F2.debug(`Using provided MIME type: ${$}`);let j=new Uint8Array(K.audio);I=new Blob([j],{type:$})}else I=K.audio;if(X=K,typeof K.model==="string"&&K.model)h=K.model}else throw Error("TRANSCRIPTION expects a Blob/File/Buffer or an object { audio: Blob/File/Buffer, mimeType?, language?, response_format?, timestampGranularities?, prompt?, temperature?, model? }");let Q=I.type||"audio/webm",q=I.name||(Q.includes("mp3")||Q.includes("mpeg")?"recording.mp3":Q.includes("ogg")?"recording.ogg":Q.includes("wav")?"recording.wav":Q.includes("webm")?"recording.webm":"recording.bin"),Y=new FormData;if(Y.append("file",I,q),Y.append("model",String(h)),X){if(typeof X.language==="string")Y.append("language",String(X.language));if(typeof X.response_format==="string")Y.append("response_format",String(X.response_format));if(typeof X.prompt==="string")Y.append("prompt",String(X.prompt));if(typeof X.temperature==="number")Y.append("temperature",String(X.temperature));if(Array.isArray(X.timestampGranularities))for(let K of X.timestampGranularities)Y.append("timestamp_granularities[]",String(K))}try{let K=await fetch(`${U}/audio/transcriptions`,{method:"POST",headers:{...f0(w)},body:Y});if(!K.ok)throw Error(`Failed to transcribe audio: ${K.status} ${K.statusText}`);return(await K.json()).text||""}catch(K){let $=K instanceof Error?K.message:String(K);throw F2.error(`TRANSCRIPTION error: ${$}`),K}}async function J1(w,B){let h=typeof B==="string"?{text:B}:B,U=h.model||z0(w,"OPENAI_TTS_MODEL","gpt-4o-mini-tts");F2.log(`[OpenAI] Using TEXT_TO_SPEECH model: ${U}`);try{return await U4(w,h)}catch(I){let X=I instanceof Error?I.message:String(I);throw F2.error(`Error in TEXT_TO_SPEECH: ${X}`),I}}import{logger as F1,ModelType as P6}from"@elizaos/core";import{generateObject as Q4}from"ai";import{logger as I4}from"@elizaos/core";import{JSONParseError as X4}from"ai";function D6(){return async({text:w,error:B})=>{try{if(B instanceof X4){let h=w.replace(/```json\n|\n```|```/g,"");return JSON.parse(h),h}return null}catch(h){let U=h instanceof Error?h.message:String(h);return I4.warn(`Failed to repair JSON text: ${U}`),null}}}async function T6(w,B,h,U){let I=M2(w),X=U(w);F1.log(`[OpenAI] Using ${h} model: ${X}`);let Q=B.temperature??0;if(!!B.schema)F1.warn("Schema provided but ignored: OpenAI object generation currently uses output=no-schema. The schema parameter has no effect.");try{let{object:Y,usage:K}=await Q4({model:I.languageModel(X),output:"no-schema",prompt:B.prompt,temperature:Q,experimental_repairText:D6()});if(K)m0(w,h,B.prompt,K);return Y}catch(Y){let K=Y instanceof Error?Y.message:String(Y);throw F1.error(`[generateObject] Error: ${K}`),Y}}async function q1(w,B){return T6(w,B,P6.OBJECT_SMALL,e0)}async function K1(w,B){return T6(w,B,P6.OBJECT_LARGE,B2)}import{ModelType as k6}from"@elizaos/core";import{ModelType as R6}from"@elizaos/core";import{encodingForModel as Z4,getEncoding as J4}from"js-tiktoken";function _6(w){let h=w.toLowerCase().includes("4o")?"o200k_base":"cl100k_base";try{return Z4(w)}catch(U){return J4(h)}}async function f6(w,B,h){let U=B===R6.TEXT_SMALL?e0(w):B2(w);return _6(U).encode(h)}async function S6(w,B,h){let U=B===R6.TEXT_SMALL?e0(w):B2(w);return _6(U).decode(h)}async function H1(w,{prompt:B,modelType:h=k6.TEXT_LARGE}){return await f6(w,h,B)}async function Y1(w,{tokens:B,modelType:h=k6.TEXT_LARGE}){return await S6(w,h,B)}var F4={name:"openai",description:"OpenAI plugin",config:{OPENAI_API_KEY:process.env.OPENAI_API_KEY,OPENAI_BASE_URL:process.env.OPENAI_BASE_URL,OPENAI_SMALL_MODEL:process.env.OPENAI_SMALL_MODEL,OPENAI_LARGE_MODEL:process.env.OPENAI_LARGE_MODEL,SMALL_MODEL:process.env.SMALL_MODEL,LARGE_MODEL:process.env.LARGE_MODEL,OPENAI_EMBEDDING_MODEL:process.env.OPENAI_EMBEDDING_MODEL,OPENAI_EMBEDDING_API_KEY:process.env.OPENAI_EMBEDDING_API_KEY,OPENAI_EMBEDDING_URL:process.env.OPENAI_EMBEDDING_URL,OPENAI_EMBEDDING_DIMENSIONS:process.env.OPENAI_EMBEDDING_DIMENSIONS,OPENAI_IMAGE_DESCRIPTION_MODEL:process.env.OPENAI_IMAGE_DESCRIPTION_MODEL,OPENAI_IMAGE_DESCRIPTION_MAX_TOKENS:process.env.OPENAI_IMAGE_DESCRIPTION_MAX_TOKENS,OPENAI_EXPERIMENTAL_TELEMETRY:process.env.OPENAI_EXPERIMENTAL_TELEMETRY},async init(w,B){R1(w,B)},models:{[V0.TEXT_EMBEDDING]:async(w,B)=>{return b2(w,B)},[V0.TEXT_TOKENIZER_ENCODE]:async(w,B)=>{return H1(w,B)},[V0.TEXT_TOKENIZER_DECODE]:async(w,B)=>{return Y1(w,B)},[V0.TEXT_SMALL]:async(w,B)=>{return u2(w,B)},[V0.TEXT_LARGE]:async(w,B)=>{return g2(w,B)},[V0.IMAGE]:async(w,B)=>{return p2(w,B)},[V0.IMAGE_DESCRIPTION]:async(w,B)=>{return d2(w,B)},[V0.TRANSCRIPTION]:async(w,B)=>{return Z1(w,B)},[V0.TEXT_TO_SPEECH]:async(w,B)=>{return J1(w,B)},[V0.OBJECT_SMALL]:async(w,B)=>{return q1(w,B)},[V0.OBJECT_LARGE]:async(w,B)=>{return K1(w,B)}},tests:[{name:"openai_plugin_tests",tests:[{name:"openai_test_url_and_api_key_validation",fn:async(w)=>{let B=T0(w),h=await fetch(`${B}/models`,{headers:f0(w)}),U=await h.json();if(N0.log({data:U?.data?.length??"N/A"},"Models Available"),!h.ok)throw Error(`Failed to validate OpenAI API key: ${h.statusText}`)}},{name:"openai_test_text_embedding",fn:async(w)=>{try{let B=await w.useModel(V0.TEXT_EMBEDDING,{text:"Hello, world!"});N0.log({embedding:B},"embedding")}catch(B){let h=B instanceof Error?B.message:String(B);throw N0.error(`Error in test_text_embedding: ${h}`),B}}},{name:"openai_test_text_large",fn:async(w)=>{try{let B=await w.useModel(V0.TEXT_LARGE,{prompt:"What is the nature of reality in 10 words?"});if(B.length===0)throw Error("Failed to generate text");N0.log({text:B},"generated with test_text_large")}catch(B){let h=B instanceof Error?B.message:String(B);throw N0.error(`Error in test_text_large: ${h}`),B}}},{name:"openai_test_text_small",fn:async(w)=>{try{let B=await w.useModel(V0.TEXT_SMALL,{prompt:"What is the nature of reality in 10 words?"});if(B.length===0)throw Error("Failed to generate text");N0.log({text:B},"generated with test_text_small")}catch(B){let h=B instanceof Error?B.message:String(B);throw N0.error(`Error in test_text_small: ${h}`),B}}},{name:"openai_test_image_generation",fn:async(w)=>{N0.log("openai_test_image_generation");try{let B=await w.useModel(V0.IMAGE,{prompt:"A beautiful sunset over a calm ocean",n:1,size:"1024x1024"});N0.log({image:B},"generated with test_image_generation")}catch(B){let h=B instanceof Error?B.message:String(B);throw N0.error(`Error in test_image_generation: ${h}`),B}}},{name:"image-description",fn:async(w)=>{try{N0.log("openai_test_image_description");try{let B=await w.useModel(V0.IMAGE_DESCRIPTION,"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg/537px-Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg");if(B&&typeof B==="object"&&"title"in B&&"description"in B)N0.log({result:B},"Image description");else N0.error("Invalid image description result format:",B)}catch(B){let h=B instanceof Error?B.message:String(B);N0.error(`Error in image description test: ${h}`)}}catch(B){let h=B instanceof Error?B.message:String(B);N0.error(`Error in openai_test_image_description: ${h}`)}}},{name:"openai_test_transcription",fn:async(w)=>{N0.log("openai_test_transcription");try{let h=await(await fetch("https://upload.wikimedia.org/wikipedia/en/4/40/Chris_Benoit_Voice_Message.ogg")).arrayBuffer(),U=await w.useModel(V0.TRANSCRIPTION,Buffer.from(new Uint8Array(h)));N0.log({transcription:U},"generated with test_transcription")}catch(B){let h=B instanceof Error?B.message:String(B);throw N0.error(`Error in test_transcription: ${h}`),B}}},{name:"openai_test_text_tokenizer_encode",fn:async(w)=>{let h=await w.useModel(V0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer encode!"});if(!Array.isArray(h)||h.length===0)throw Error("Failed to tokenize text: expected non-empty array of tokens");N0.log({tokens:h},"Tokenized output")}},{name:"openai_test_text_tokenizer_decode",fn:async(w)=>{let h=await w.useModel(V0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer decode!"}),U=await w.useModel(V0.TEXT_TOKENIZER_DECODE,{tokens:h});if(U!=="Hello tokenizer decode!")throw Error(`Decoded text does not match original. Expected "Hello tokenizer decode!", got "${U}"`);N0.log({decodedText:U},"Decoded text")}},{name:"openai_test_text_to_speech",fn:async(w)=>{try{if(!await w.useModel(V0.TEXT_TO_SPEECH,{text:"Hello, this is a test for text-to-speech."}))throw Error("Failed to generate speech");N0.log("Generated speech successfully")}catch(B){let h=B instanceof Error?B.message:String(B);throw N0.error(`Error in openai_test_text_to_speech: ${h}`),B}}}]}]},q4=F4;export{F4 as openaiPlugin,q4 as default};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=4B7FB4379F5FC70C64756E2164756E21
|