@libp2p/http-utils 0.0.0
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/README.md +56 -0
- package/dist/index.min.js +50 -0
- package/dist/index.min.js.map +7 -0
- package/dist/src/constants.d.ts +9 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +78 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/index.d.ts +102 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +411 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/request.d.ts +16 -0
- package/dist/src/request.d.ts.map +1 -0
- package/dist/src/request.js +41 -0
- package/dist/src/request.js.map +1 -0
- package/dist/src/response.d.ts +14 -0
- package/dist/src/response.d.ts.map +1 -0
- package/dist/src/response.js +37 -0
- package/dist/src/response.js.map +1 -0
- package/dist/src/stream-to-socket.d.ts +4 -0
- package/dist/src/stream-to-socket.d.ts.map +1 -0
- package/dist/src/stream-to-socket.js +155 -0
- package/dist/src/stream-to-socket.js.map +1 -0
- package/dist/typedoc-urls.json +57 -0
- package/package.json +163 -0
- package/src/constants.ts +77 -0
- package/src/index.ts +561 -0
- package/src/request.ts +44 -0
- package/src/response.ts +40 -0
- package/src/stream-to-socket.ts +200 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PHttpUtils = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
+
"use strict";var Libp2PHttpUtils=(()=>{var o0=Object.create;var Zn=Object.defineProperty;var s0=Object.getOwnPropertyDescriptor;var a0=Object.getOwnPropertyNames;var u0=Object.getPrototypeOf,c0=Object.prototype.hasOwnProperty;var V=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ke=(t,e)=>{for(var r in e)Zn(t,r,{get:e[r],enumerable:!0})},Wu=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of a0(e))!c0.call(t,i)&&i!==r&&Zn(t,i,{get:()=>e[i],enumerable:!(n=s0(e,i))||n.enumerable});return t};var l0=(t,e,r)=>(r=t!=null?o0(u0(t)):{},Wu(e||!t||!t.__esModule?Zn(r,"default",{value:t,enumerable:!0}):r,t)),f0=t=>Wu(Zn({},"__esModule",{value:!0}),t);var gf=V(ki=>{"use strict";ki.byteLength=_b;ki.toByteArray=Ib;ki.fromByteArray=Tb;var ot=[],We=[],Sb=typeof Uint8Array<"u"?Uint8Array:Array,ba="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ur=0,bf=ba.length;ur<bf;++ur)ot[ur]=ba[ur],We[ba.charCodeAt(ur)]=ur;var ur,bf;We[45]=62;We[95]=63;function mf(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function _b(t){var e=mf(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Ab(t,e,r){return(e+r)*3/4-r}function Ib(t){var e,r=mf(t),n=r[0],i=r[1],o=new Sb(Ab(t,n,i)),s=0,a=i>0?n-4:n,u;for(u=0;u<a;u+=4)e=We[t.charCodeAt(u)]<<18|We[t.charCodeAt(u+1)]<<12|We[t.charCodeAt(u+2)]<<6|We[t.charCodeAt(u+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=We[t.charCodeAt(u)]<<2|We[t.charCodeAt(u+1)]>>4,o[s++]=e&255),i===1&&(e=We[t.charCodeAt(u)]<<10|We[t.charCodeAt(u+1)]<<4|We[t.charCodeAt(u+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function vb(t){return ot[t>>18&63]+ot[t>>12&63]+ot[t>>6&63]+ot[t&63]}function Rb(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(vb(n));return i.join("")}function Tb(t){for(var e,r=t.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(Rb(t,s,s+o>a?a:s+o));return n===1?(e=t[r-1],i.push(ot[e>>2]+ot[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ot[e>>10]+ot[e>>4&63]+ot[e<<2&63]+"=")),i.join("")}});var xf=V(ma=>{ma.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,y=r?-1:1,p=t[e+f];for(f+=y,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=o*256+t[e+f],f+=y,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=s*256+t[e+f],f+=y,l-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(p?-1:1)*s*Math.pow(2,o-n)};ma.write=function(t,e,r,n,i,o){var s,a,u,c=o*8-i-1,l=(1<<c)-1,f=l>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,h=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+f>=1?e+=y/u:e+=y*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=a&255,p+=g,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+p]=s&255,p+=g,s/=256,c-=8);t[r+p-g]|=h*128}});var Rt=V(Kr=>{"use strict";var ga=gf(),Hr=xf(),Ef=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Kr.Buffer=w;Kr.SlowBuffer=Ub;Kr.INSPECT_MAX_BYTES=50;var Mi=2147483647;Kr.kMaxLength=Mi;w.TYPED_ARRAY_SUPPORT=Bb();!w.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Bb(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(w.prototype,"parent",{enumerable:!0,get:function(){if(w.isBuffer(this))return this.buffer}});Object.defineProperty(w.prototype,"offset",{enumerable:!0,get:function(){if(w.isBuffer(this))return this.byteOffset}});function vt(t){if(t>Mi)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,w.prototype),e}function w(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _a(t)}return If(t,e,r)}w.poolSize=8192;function If(t,e,r){if(typeof t=="string")return Cb(t,e);if(ArrayBuffer.isView(t))return Nb(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(st(t,ArrayBuffer)||t&&st(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(st(t,SharedArrayBuffer)||t&&st(t.buffer,SharedArrayBuffer)))return Ea(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return w.from(n,e,r);let i=Pb(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return w.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}w.from=function(t,e,r){return If(t,e,r)};Object.setPrototypeOf(w.prototype,Uint8Array.prototype);Object.setPrototypeOf(w,Uint8Array);function vf(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Lb(t,e,r){return vf(t),t<=0?vt(t):e!==void 0?typeof r=="string"?vt(t).fill(e,r):vt(t).fill(e):vt(t)}w.alloc=function(t,e,r){return Lb(t,e,r)};function _a(t){return vf(t),vt(t<0?0:Aa(t)|0)}w.allocUnsafe=function(t){return _a(t)};w.allocUnsafeSlow=function(t){return _a(t)};function Cb(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!w.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Rf(t,e)|0,n=vt(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function xa(t){let e=t.length<0?0:Aa(t.length)|0,r=vt(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Nb(t){if(st(t,Uint8Array)){let e=new Uint8Array(t);return Ea(e.buffer,e.byteOffset,e.byteLength)}return xa(t)}function Ea(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,w.prototype),n}function Pb(t){if(w.isBuffer(t)){let e=Aa(t.length)|0,r=vt(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||va(t.length)?vt(0):xa(t);if(t.type==="Buffer"&&Array.isArray(t.data))return xa(t.data)}function Aa(t){if(t>=Mi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Mi.toString(16)+" bytes");return t|0}function Ub(t){return+t!=t&&(t=0),w.alloc(+t)}w.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==w.prototype};w.compare=function(e,r){if(st(e,Uint8Array)&&(e=w.from(e,e.offset,e.byteLength)),st(r,Uint8Array)&&(r=w.from(r,r.offset,r.byteLength)),!w.isBuffer(e)||!w.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};w.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};w.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return w.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=w.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let s=e[n];if(st(s,Uint8Array))o+s.length>i.length?(w.isBuffer(s)||(s=w.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(w.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function Rf(t,e){if(w.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||st(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Sa(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Of(t).length;default:if(i)return n?-1:Sa(t).length;e=(""+e).toLowerCase(),i=!0}}w.byteLength=Rf;function Db(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return jb(this,e,r);case"utf8":case"utf-8":return Bf(this,e,r);case"ascii":return Kb(this,e,r);case"latin1":case"binary":return Wb(this,e,r);case"base64":return Hb(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vb(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}w.prototype._isBuffer=!0;function cr(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}w.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)cr(this,r,r+1);return this};w.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)cr(this,r,r+3),cr(this,r+1,r+2);return this};w.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)cr(this,r,r+7),cr(this,r+1,r+6),cr(this,r+2,r+5),cr(this,r+3,r+4);return this};w.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Bf(this,0,e):Db.apply(this,arguments)};w.prototype.toLocaleString=w.prototype.toString;w.prototype.equals=function(e){if(!w.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:w.compare(this,e)===0};w.prototype.inspect=function(){let e="",r=Kr.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Ef&&(w.prototype[Ef]=w.prototype.inspect);w.prototype.compare=function(e,r,n,i,o){if(st(e,Uint8Array)&&(e=w.from(e,e.offset,e.byteLength)),!w.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let s=o-i,a=n-r,u=Math.min(s,a),c=this.slice(i,o),l=e.slice(r,n);for(let f=0;f<u;++f)if(c[f]!==l[f]){s=c[f],a=l[f];break}return s<a?-1:a<s?1:0};function Tf(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,va(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=w.from(e,n)),w.isBuffer(e))return e.length===0?-1:Sf(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Sf(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Sf(t,e,r,n,i){let o=1,s=t.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}function u(l,f){return o===1?l[f]:l.readUInt16BE(f*o)}let c;if(i){let l=-1;for(c=r;c<s;c++)if(u(t,c)===u(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===a)return l*o}else l!==-1&&(c-=c-l),l=-1}else for(r+a>s&&(r=s-a),c=r;c>=0;c--){let l=!0;for(let f=0;f<a;f++)if(u(t,c+f)!==u(e,f)){l=!1;break}if(l)return c}return-1}w.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};w.prototype.indexOf=function(e,r,n){return Tf(this,e,r,n,!0)};w.prototype.lastIndexOf=function(e,r,n){return Tf(this,e,r,n,!1)};function Ob(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let a=parseInt(e.substr(s*2,2),16);if(va(a))return s;t[r+s]=a}return s}function kb(t,e,r,n){return Fi(Sa(e,t.length-r),t,r,n)}function Mb(t,e,r,n){return Fi(Zb(e),t,r,n)}function Fb(t,e,r,n){return Fi(Of(e),t,r,n)}function qb(t,e,r,n){return Fi(Xb(e,t.length-r),t,r,n)}w.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return Ob(this,e,r,n);case"utf8":case"utf-8":return kb(this,e,r,n);case"ascii":case"latin1":case"binary":return Mb(this,e,r,n);case"base64":return Fb(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qb(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Hb(t,e,r){return e===0&&r===t.length?ga.fromByteArray(t):ga.fromByteArray(t.slice(e,r))}function Bf(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){let u,c,l,f;switch(a){case 1:o<128&&(s=o);break;case 2:u=t[i+1],(u&192)===128&&(f=(o&31)<<6|u&63,f>127&&(s=f));break;case 3:u=t[i+1],c=t[i+2],(u&192)===128&&(c&192)===128&&(f=(o&15)<<12|(u&63)<<6|c&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:u=t[i+1],c=t[i+2],l=t[i+3],(u&192)===128&&(c&192)===128&&(l&192)===128&&(f=(o&15)<<18|(u&63)<<12|(c&63)<<6|l&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return $b(n)}var _f=4096;function $b(t){let e=t.length;if(e<=_f)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=_f));return r}function Kb(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function Wb(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function jb(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=Qb[t[o]];return i}function Vb(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}w.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,w.prototype),i};function xe(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}w.prototype.readUintLE=w.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||xe(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return i};w.prototype.readUintBE=w.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||xe(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};w.prototype.readUint8=w.prototype.readUInt8=function(e,r){return e=e>>>0,r||xe(e,1,this.length),this[e]};w.prototype.readUint16LE=w.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||xe(e,2,this.length),this[e]|this[e+1]<<8};w.prototype.readUint16BE=w.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||xe(e,2,this.length),this[e]<<8|this[e+1]};w.prototype.readUint32LE=w.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||xe(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};w.prototype.readUint32BE=w.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||xe(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};w.prototype.readBigUInt64LE=$t(function(e){e=e>>>0,$r(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Dn(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});w.prototype.readBigUInt64BE=$t(function(e){e=e>>>0,$r(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Dn(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});w.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||xe(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};w.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||xe(e,r,this.length);let i=r,o=1,s=this[e+--i];for(;i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};w.prototype.readInt8=function(e,r){return e=e>>>0,r||xe(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};w.prototype.readInt16LE=function(e,r){e=e>>>0,r||xe(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};w.prototype.readInt16BE=function(e,r){e=e>>>0,r||xe(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};w.prototype.readInt32LE=function(e,r){return e=e>>>0,r||xe(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};w.prototype.readInt32BE=function(e,r){return e=e>>>0,r||xe(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};w.prototype.readBigInt64LE=$t(function(e){e=e>>>0,$r(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Dn(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});w.prototype.readBigInt64BE=$t(function(e){e=e>>>0,$r(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Dn(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});w.prototype.readFloatLE=function(e,r){return e=e>>>0,r||xe(e,4,this.length),Hr.read(this,e,!0,23,4)};w.prototype.readFloatBE=function(e,r){return e=e>>>0,r||xe(e,4,this.length),Hr.read(this,e,!1,23,4)};w.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||xe(e,8,this.length),Hr.read(this,e,!0,52,8)};w.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||xe(e,8,this.length),Hr.read(this,e,!1,52,8)};function De(t,e,r,n,i,o){if(!w.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}w.prototype.writeUintLE=w.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;De(this,e,r,n,a,0)}let o=1,s=0;for(this[r]=e&255;++s<n&&(o*=256);)this[r+s]=e/o&255;return r+n};w.prototype.writeUintBE=w.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;De(this,e,r,n,a,0)}let o=n-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+n};w.prototype.writeUint8=w.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,1,255,0),this[r]=e&255,r+1};w.prototype.writeUint16LE=w.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};w.prototype.writeUint16BE=w.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};w.prototype.writeUint32LE=w.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};w.prototype.writeUint32BE=w.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Lf(t,e,r,n,i){Df(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}function Cf(t,e,r,n,i){Df(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}w.prototype.writeBigUInt64LE=$t(function(e,r=0){return Lf(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});w.prototype.writeBigUInt64BE=$t(function(e,r=0){return Cf(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});w.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let u=Math.pow(2,8*n-1);De(this,e,r,n,u-1,-u)}let o=0,s=1,a=0;for(this[r]=e&255;++o<n&&(s*=256);)e<0&&a===0&&this[r+o-1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+n};w.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let u=Math.pow(2,8*n-1);De(this,e,r,n,u-1,-u)}let o=n-1,s=1,a=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&a===0&&this[r+o+1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+n};w.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};w.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};w.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};w.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};w.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||De(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};w.prototype.writeBigInt64LE=$t(function(e,r=0){return Lf(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});w.prototype.writeBigInt64BE=$t(function(e,r=0){return Cf(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Nf(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Pf(t,e,r,n,i){return e=+e,r=r>>>0,i||Nf(t,e,r,4,34028234663852886e22,-34028234663852886e22),Hr.write(t,e,r,n,23,4),r+4}w.prototype.writeFloatLE=function(e,r,n){return Pf(this,e,r,!0,n)};w.prototype.writeFloatBE=function(e,r,n){return Pf(this,e,r,!1,n)};function Uf(t,e,r,n,i){return e=+e,r=r>>>0,i||Nf(t,e,r,8,17976931348623157e292,-17976931348623157e292),Hr.write(t,e,r,n,52,8),r+8}w.prototype.writeDoubleLE=function(e,r,n){return Uf(this,e,r,!0,n)};w.prototype.writeDoubleBE=function(e,r,n){return Uf(this,e,r,!1,n)};w.prototype.copy=function(e,r,n,i){if(!w.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};w.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!w.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{let s=w.isBuffer(e)?e:w.from(e,i),a=s.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=s[o%a]}return this};var qr={};function Ia(t,e,r){qr[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}Ia("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ia("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Ia("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Af(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Af(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Af(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function zb(t,e,r){$r(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Dn(e,t.length-(r+1))}function Df(t,e,r,n,i,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",a;throw o>3?e===0||e===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${e}${s} and <= ${r}${s}`,new qr.ERR_OUT_OF_RANGE("value",a,t)}zb(n,i,o)}function $r(t,e){if(typeof t!="number")throw new qr.ERR_INVALID_ARG_TYPE(e,"number",t)}function Dn(t,e,r){throw Math.floor(t)!==t?($r(t,r),new qr.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new qr.ERR_BUFFER_OUT_OF_BOUNDS:new qr.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Gb=/[^+/0-9A-Za-z-_]/g;function Yb(t){if(t=t.split("=")[0],t=t.trim().replace(Gb,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Sa(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Zb(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Xb(t,e){let r,n,i,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function Of(t){return ga.toByteArray(Yb(t))}function Fi(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function st(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function va(t){return t!==t}var Qb=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function $t(t){return typeof BigInt>"u"?Jb:t}function Jb(){throw new Error("BigInt not supported")}});var ne=V((m3,kf)=>{"use strict";var Ra=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n<e.length;n++)r+=` ${e[n].stack}
|
|
3
|
+
`;super(r),this.name="AggregateError",this.errors=e}};kf.exports={AggregateError:Ra,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.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(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Ta=V((g3,Mf)=>{"use strict";Mf.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}});var Re=V((x3,Hf)=>{"use strict";var{format:em,inspect:qi}=Ta(),{AggregateError:tm}=ne(),rm=globalThis.AggregateError||tm,nm=Symbol("kIsNodeError"),im=["string","function","number","object","Function","Object","boolean","bigint","symbol"],om=/^([A-Z][a-z0-9]*)+$/,sm="__node_internal_",Hi={};function lr(t,e){if(!t)throw new Hi.ERR_INTERNAL_ASSERTION(e)}function Ff(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function am(t,e,r){if(typeof e=="function")return lr(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return lr(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:em(e,...r)}function _e(t,e,r){r||(r=Error);class n extends r{constructor(...o){super(am(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[nm]=!0,Hi[t]=n}function qf(t){let e=sm+t.name;return Object.defineProperty(t,"name",{value:e}),t}function um(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new rm([e,t],e.message);return r.code=e.code,r}return t||e}var Ba=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Hi.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};_e("ERR_ASSERTION","%s",Error);_e("ERR_INVALID_ARG_TYPE",(t,e,r)=>{lr(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],o=[],s=[];for(let u of e)lr(typeof u=="string","All expected entries have to be of type string"),im.includes(u)?i.push(u.toLowerCase()):om.test(u)?o.push(u):(lr(u!=="object",'The value "object" should be written as "Object"'),s.push(u));if(o.length>0){let u=i.indexOf("object");u!==-1&&(i.splice(i,u,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let u=i.pop();n+=`one of type ${i.join(", ")}, or ${u}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let u=o.pop();n+=`an instance of ${o.join(", ")}, or ${u}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{let u=s.pop();n+=`one of ${s.join(", ")}, or ${u}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else{let u=qi(r,{depth:-1});n+=`. Received ${u}`}}else{let u=qi(r,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),n+=`. Received type ${typeof r} (${u})`}return n},TypeError);_e("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=qi(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);_e("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);_e("ERR_MISSING_ARGS",(...t)=>{lr(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);_e("ERR_OUT_OF_RANGE",(t,e,r)=>{lr(e,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=Ff(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=Ff(n)),n+="n"}else n=qi(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);_e("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);_e("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);_e("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);_e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);_e("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);_e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);_e("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);_e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);_e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);_e("ERR_STREAM_WRITE_AFTER_END","write after end",Error);_e("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Hf.exports={AbortError:Ba,aggregateTwoErrors:qf(um),hideStackFrames:qf,codes:Hi}});var Wr=V((E3,$i)=>{"use strict";var{AbortController:$f,AbortSignal:cm}=typeof self<"u"?self:typeof window<"u"?window:void 0;$i.exports=$f;$i.exports.AbortSignal=cm;$i.exports.default=$f});var On=V((S3,La)=>{"use strict";var jr=typeof Reflect=="object"?Reflect:null,Kf=jr&&typeof jr.apply=="function"?jr.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Ki;jr&&typeof jr.ownKeys=="function"?Ki=jr.ownKeys:Object.getOwnPropertySymbols?Ki=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ki=function(e){return Object.getOwnPropertyNames(e)};function lm(t){console&&console.warn&&console.warn(t)}var jf=Number.isNaN||function(e){return e!==e};function Q(){Q.init.call(this)}La.exports=Q;La.exports.once=pm;Q.EventEmitter=Q;Q.prototype._events=void 0;Q.prototype._eventsCount=0;Q.prototype._maxListeners=void 0;var Wf=10;function Wi(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Q,"defaultMaxListeners",{enumerable:!0,get:function(){return Wf},set:function(t){if(typeof t!="number"||t<0||jf(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Wf=t}});Q.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Q.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||jf(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Vf(t){return t._maxListeners===void 0?Q.defaultMaxListeners:t._maxListeners}Q.prototype.getMaxListeners=function(){return Vf(this)};Q.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(u===void 0)return!1;if(typeof u=="function")Kf(u,this,r);else for(var c=u.length,l=Xf(u,c),n=0;n<c;++n)Kf(l[n],this,r);return!0};function zf(t,e,r,n){var i,o,s;if(Wi(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=Vf(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,lm(a)}return t}Q.prototype.addListener=function(e,r){return zf(this,e,r,!1)};Q.prototype.on=Q.prototype.addListener;Q.prototype.prependListener=function(e,r){return zf(this,e,r,!0)};function fm(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Gf(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=fm.bind(n);return i.listener=r,n.wrapFn=i,i}Q.prototype.once=function(e,r){return Wi(r),this.on(e,Gf(this,e,r)),this};Q.prototype.prependOnceListener=function(e,r){return Wi(r),this.prependListener(e,Gf(this,e,r)),this};Q.prototype.removeListener=function(e,r){var n,i,o,s,a;if(Wi(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){a=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():dm(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};Q.prototype.off=Q.prototype.removeListener;Q.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Yf(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?hm(i):Xf(i,i.length)}Q.prototype.listeners=function(e){return Yf(this,e,!0)};Q.prototype.rawListeners=function(e){return Yf(this,e,!1)};Q.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Zf.call(t,e)};Q.prototype.listenerCount=Zf;function Zf(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Q.prototype.eventNames=function(){return this._eventsCount>0?Ki(this._events):[]};function Xf(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function dm(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function hm(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function pm(t,e){return new Promise(function(r,n){function i(s){t.removeListener(e,o),n(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}Qf(t,e,o,{once:!0}),e!=="error"&&ym(t,i,{once:!0})})}function ym(t,e,r){typeof t.on=="function"&&Qf(t,"error",e,r)}function Qf(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var Ce=V((_3,Na)=>{"use strict";var wm=Rt(),{format:bm,inspect:mm}=Ta(),{codes:{ERR_INVALID_ARG_TYPE:Ca}}=Re(),{kResistStopPropagation:gm,AggregateError:xm,SymbolDispose:Em}=ne(),Sm=globalThis.AbortSignal||Wr().AbortSignal,_m=globalThis.AbortController||Wr().AbortController,Am=Object.getPrototypeOf(async function(){}).constructor,Jf=globalThis.Blob||wm.Blob,Im=typeof Jf<"u"?function(e){return e instanceof Jf}:function(e){return!1},ed=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Ca(e,"AbortSignal",t)},vm=(t,e)=>{if(typeof t!="function")throw new Ca(e,"Function",t)};Na.exports={AggregateError:xm,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format:bm,inspect:mm,types:{isAsyncFunction(t){return t instanceof Am},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Im,deprecate(t,e){return t},addAbortListener:On().addAbortListener||function(e,r){if(e===void 0)throw new Ca("signal","AbortSignal",e);ed(e,"signal"),vm(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[gm]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[Em](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Sm.any||function(e){if(e.length===1)return e[0];let r=new _m,n=()=>r.abort();return e.forEach(i=>{ed(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};Na.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var zr=V((A3,ld)=>{"use strict";var{ArrayIsArray:Ua,ArrayPrototypeIncludes:id,ArrayPrototypeJoin:od,ArrayPrototypeMap:Rm,NumberIsInteger:Da,NumberIsNaN:Tm,NumberMAX_SAFE_INTEGER:Bm,NumberMIN_SAFE_INTEGER:Lm,NumberParseInt:Cm,ObjectPrototypeHasOwnProperty:Nm,RegExpPrototypeExec:sd,String:Pm,StringPrototypeToUpperCase:Um,StringPrototypeTrim:Dm}=ne(),{hideStackFrames:je,codes:{ERR_SOCKET_BAD_PORT:Om,ERR_INVALID_ARG_TYPE:Te,ERR_INVALID_ARG_VALUE:Vr,ERR_OUT_OF_RANGE:fr,ERR_UNKNOWN_SIGNAL:td}}=Re(),{normalizeEncoding:km}=Ce(),{isAsyncFunction:Mm,isArrayBufferView:Fm}=Ce().types,rd={};function qm(t){return t===(t|0)}function Hm(t){return t===t>>>0}var $m=/^[0-7]+$/,Km="must be a 32-bit unsigned integer or an octal string";function Wm(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(sd($m,t)===null)throw new Vr(e,t,Km);t=Cm(t,8)}return ad(t,e),t}var jm=je((t,e,r=Lm,n=Bm)=>{if(typeof t!="number")throw new Te(e,"number",t);if(!Da(t))throw new fr(e,"an integer",t);if(t<r||t>n)throw new fr(e,`>= ${r} && <= ${n}`,t)}),Vm=je((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new Te(e,"number",t);if(!Da(t))throw new fr(e,"an integer",t);if(t<r||t>n)throw new fr(e,`>= ${r} && <= ${n}`,t)}),ad=je((t,e,r=!1)=>{if(typeof t!="number")throw new Te(e,"number",t);if(!Da(t))throw new fr(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new fr(e,`>= ${n} && <= ${i}`,t)});function Oa(t,e){if(typeof t!="string")throw new Te(e,"string",t)}function zm(t,e,r=void 0,n){if(typeof t!="number")throw new Te(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&Tm(t))throw new fr(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var Gm=je((t,e,r)=>{if(!id(r,t)){let i="must be one of: "+od(Rm(r,o=>typeof o=="string"?`'${o}'`:Pm(o)),", ");throw new Vr(e,t,i)}});function ud(t,e){if(typeof t!="boolean")throw new Te(e,"boolean",t)}function Pa(t,e,r){return t==null||!Nm(t,e)?r:t[e]}var Ym=je((t,e,r=null)=>{let n=Pa(r,"allowArray",!1),i=Pa(r,"allowFunction",!1);if(!Pa(r,"nullable",!1)&&t===null||!n&&Ua(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new Te(e,"Object",t)}),Zm=je((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Te(e,"a dictionary",t)}),ji=je((t,e,r=0)=>{if(!Ua(t))throw new Te(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Vr(e,t,n)}});function Xm(t,e){ji(t,e);for(let r=0;r<t.length;r++)Oa(t[r],`${e}[${r}]`)}function Qm(t,e){ji(t,e);for(let r=0;r<t.length;r++)ud(t[r],`${e}[${r}]`)}function Jm(t,e){ji(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new Te(i,"AbortSignal",n);cd(n,i)}}function eg(t,e="signal"){if(Oa(t,e),rd[t]===void 0)throw rd[Um(t)]!==void 0?new td(t+" (signals must use all capital letters)"):new td(t)}var tg=je((t,e="buffer")=>{if(!Fm(t))throw new Te(e,["Buffer","TypedArray","DataView"],t)});function rg(t,e){let r=km(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Vr("encoding",e,`is invalid for data of length ${n}`)}function ng(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Dm(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Om(e,t,r);return t|0}var cd=je((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Te(e,"AbortSignal",t)}),ig=je((t,e)=>{if(typeof t!="function")throw new Te(e,"Function",t)}),og=je((t,e)=>{if(typeof t!="function"||Mm(t))throw new Te(e,"Function",t)}),sg=je((t,e)=>{if(t!==void 0)throw new Te(e,"undefined",t)});function ag(t,e,r){if(!id(r,t))throw new Te(e,`('${od(r,"|")}')`,t)}var ug=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function nd(t,e){if(typeof t>"u"||!sd(ug,t))throw new Vr(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function cg(t){if(typeof t=="string")return nd(t,"hints"),t;if(Ua(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];nd(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new Vr("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}ld.exports={isInt32:qm,isUint32:Hm,parseFileMode:Wm,validateArray:ji,validateStringArray:Xm,validateBooleanArray:Qm,validateAbortSignalArray:Jm,validateBoolean:ud,validateBuffer:tg,validateDictionary:Zm,validateEncoding:rg,validateFunction:ig,validateInt32:Vm,validateInteger:jm,validateNumber:zm,validateObject:Ym,validateOneOf:Gm,validatePlainFunction:og,validatePort:ng,validateSignalName:eg,validateString:Oa,validateUint32:ad,validateUndefined:sg,validateUnion:ag,validateAbortSignal:cd,validateLinkHeaderValue:cg}});var Kt=V((I3,pd)=>{var ae=pd.exports={},at,ut;function ka(){throw new Error("setTimeout has not been defined")}function Ma(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?at=setTimeout:at=ka}catch{at=ka}try{typeof clearTimeout=="function"?ut=clearTimeout:ut=Ma}catch{ut=Ma}})();function fd(t){if(at===setTimeout)return setTimeout(t,0);if((at===ka||!at)&&setTimeout)return at=setTimeout,setTimeout(t,0);try{return at(t,0)}catch{try{return at.call(null,t,0)}catch{return at.call(this,t,0)}}}function lg(t){if(ut===clearTimeout)return clearTimeout(t);if((ut===Ma||!ut)&&clearTimeout)return ut=clearTimeout,clearTimeout(t);try{return ut(t)}catch{try{return ut.call(null,t)}catch{return ut.call(this,t)}}}var Tt=[],Gr=!1,dr,Vi=-1;function fg(){!Gr||!dr||(Gr=!1,dr.length?Tt=dr.concat(Tt):Vi=-1,Tt.length&&dd())}function dd(){if(!Gr){var t=fd(fg);Gr=!0;for(var e=Tt.length;e;){for(dr=Tt,Tt=[];++Vi<e;)dr&&dr[Vi].run();Vi=-1,e=Tt.length}dr=null,Gr=!1,lg(t)}}ae.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Tt.push(new hd(t,e)),Tt.length===1&&!Gr&&fd(dd)};function hd(t,e){this.fun=t,this.array=e}hd.prototype.run=function(){this.fun.apply(null,this.array)};ae.title="browser";ae.browser=!0;ae.env={};ae.argv=[];ae.version="";ae.versions={};function Bt(){}ae.on=Bt;ae.addListener=Bt;ae.once=Bt;ae.off=Bt;ae.removeListener=Bt;ae.removeAllListeners=Bt;ae.emit=Bt;ae.prependListener=Bt;ae.prependOnceListener=Bt;ae.listeners=function(t){return[]};ae.binding=function(t){throw new Error("process.binding is not supported")};ae.cwd=function(){return"/"};ae.chdir=function(t){throw new Error("process.chdir is not supported")};ae.umask=function(){return 0}});var lt=V((v3,Bd)=>{"use strict";var{SymbolAsyncIterator:yd,SymbolIterator:wd,SymbolFor:hr}=ne(),bd=hr("nodejs.stream.destroyed"),md=hr("nodejs.stream.errored"),Fa=hr("nodejs.stream.readable"),qa=hr("nodejs.stream.writable"),gd=hr("nodejs.stream.disturbed"),dg=hr("nodejs.webstream.isClosedPromise"),hg=hr("nodejs.webstream.controllerErrorFunction");function zi(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function Gi(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function pg(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function ct(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function xd(t){return!!(t&&!ct(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Ed(t){return!!(t&&!ct(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Sd(t){return!!(t&&!ct(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function yg(t){return xd(t)||Ed(t)||Sd(t)}function wg(t,e){return t==null?!1:e===!0?typeof t[yd]=="function":e===!1?typeof t[wd]=="function":typeof t[yd]=="function"||typeof t[wd]=="function"}function Yi(t){if(!ct(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[bd]||n!=null&&n.destroyed)}function _d(t){if(!Gi(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function bg(t,e){if(!Gi(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function mg(t){if(!zi(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function Ad(t,e){if(!zi(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Id(t){return t&&t[Fa]!=null?t[Fa]:typeof t?.readable!="boolean"?null:Yi(t)?!1:zi(t)&&t.readable&&!Ad(t)}function vd(t){return t&&t[qa]!=null?t[qa]:typeof t?.writable!="boolean"?null:Yi(t)?!1:Gi(t)&&t.writable&&!_d(t)}function gg(t,e){return ct(t)?Yi(t)?!0:!(e?.readable!==!1&&Id(t)||e?.writable!==!1&&vd(t)):null}function xg(t){var e,r;return ct(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Eg(t){var e,r;return ct(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Sg(t){if(!ct(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Rd(t)?t._closed:null}function Rd(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Td(t){return typeof t._sent100=="boolean"&&Rd(t)}function _g(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function Ag(t){if(!ct(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&Td(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Ig(t){var e;return!!(t&&((e=t[gd])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function vg(t){var e,r,n,i,o,s,a,u,c,l;return!!(t&&((e=(r=(n=(i=(o=(s=t[md])!==null&&s!==void 0?s:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&i!==void 0?i:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&r!==void 0?r:(c=t._readableState)===null||c===void 0?void 0:c.errored)!==null&&e!==void 0?e:!((l=t._writableState)===null||l===void 0)&&l.errored))}Bd.exports={isDestroyed:Yi,kIsDestroyed:bd,isDisturbed:Ig,kIsDisturbed:gd,isErrored:vg,kIsErrored:md,isReadable:Id,kIsReadable:Fa,kIsClosedPromise:dg,kControllerErrorFunction:hg,kIsWritable:qa,isClosed:Sg,isDuplexNodeStream:pg,isFinished:gg,isIterable:wg,isReadableNodeStream:zi,isReadableStream:xd,isReadableEnded:mg,isReadableFinished:Ad,isReadableErrored:Eg,isNodeStream:ct,isWebStream:yg,isWritable:vd,isWritableNodeStream:Gi,isWritableStream:Ed,isWritableEnded:_d,isWritableFinished:bg,isWritableErrored:xg,isServerRequest:_g,isServerResponse:Td,willEmitClose:Ag,isTransformStream:Sd}});var Lt=V((R3,ja)=>{"use strict";var Wt=Kt(),{AbortError:Md,codes:Rg}=Re(),{ERR_INVALID_ARG_TYPE:Tg,ERR_STREAM_PREMATURE_CLOSE:Ld}=Rg,{kEmptyObject:$a,once:Ka}=Ce(),{validateAbortSignal:Bg,validateFunction:Lg,validateObject:Cg,validateBoolean:Ng}=zr(),{Promise:Pg,PromisePrototypeThen:Ug,SymbolDispose:Fd}=ne(),{isClosed:Dg,isReadable:Cd,isReadableNodeStream:Ha,isReadableStream:Og,isReadableFinished:Nd,isReadableErrored:Pd,isWritable:Ud,isWritableNodeStream:Dd,isWritableStream:kg,isWritableFinished:Od,isWritableErrored:kd,isNodeStream:Mg,willEmitClose:Fg,kIsClosedPromise:qg}=lt(),Yr;function Hg(t){return t.setHeader&&typeof t.abort=="function"}var Wa=()=>{};function qd(t,e,r){var n,i;if(arguments.length===2?(r=e,e=$a):e==null?e=$a:Cg(e,"options"),Lg(r,"callback"),Bg(e.signal,"options.signal"),r=Ka(r),Og(t)||kg(t))return $g(t,e,r);if(!Mg(t))throw new Tg("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:Ha(t),s=(i=e.writable)!==null&&i!==void 0?i:Dd(t),a=t._writableState,u=t._readableState,c=()=>{t.writable||y()},l=Fg(t)&&Ha(t)===o&&Dd(t)===s,f=Od(t,!1),y=()=>{f=!0,t.destroyed&&(l=!1),!(l&&(!t.readable||o))&&(!o||p)&&r.call(t)},p=Nd(t,!1),g=()=>{p=!0,t.destroyed&&(l=!1),!(l&&(!t.writable||s))&&(!s||f)&&r.call(t)},h=m=>{r.call(t,m)},T=Dg(t),S=()=>{T=!0;let m=kd(t)||Pd(t);if(m&&typeof m!="boolean")return r.call(t,m);if(o&&!p&&Ha(t,!0)&&!Nd(t,!1))return r.call(t,new Ld);if(s&&!f&&!Od(t,!1))return r.call(t,new Ld);r.call(t)},U=()=>{T=!0;let m=kd(t)||Pd(t);if(m&&typeof m!="boolean")return r.call(t,m);r.call(t)},E=()=>{t.req.on("finish",y)};Hg(t)?(t.on("complete",y),l||t.on("abort",S),t.req?E():t.on("request",E)):s&&!a&&(t.on("end",c),t.on("close",c)),!l&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",g),t.on("finish",y),e.error!==!1&&t.on("error",h),t.on("close",S),T?Wt.nextTick(S):a!=null&&a.errorEmitted||u!=null&&u.errorEmitted?l||Wt.nextTick(U):(!o&&(!l||Cd(t))&&(f||Ud(t)===!1)||!s&&(!l||Ud(t))&&(p||Cd(t)===!1)||u&&t.req&&t.aborted)&&Wt.nextTick(U);let d=()=>{r=Wa,t.removeListener("aborted",S),t.removeListener("complete",y),t.removeListener("abort",S),t.removeListener("request",E),t.req&&t.req.removeListener("finish",y),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",y),t.removeListener("end",g),t.removeListener("error",h),t.removeListener("close",S)};if(e.signal&&!T){let m=()=>{let B=r;d(),B.call(t,new Md(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Wt.nextTick(m);else{Yr=Yr||Ce().addAbortListener;let B=Yr(e.signal,m),R=r;r=Ka((...L)=>{B[Fd](),R.apply(t,L)})}}return d}function $g(t,e,r){let n=!1,i=Wa;if(e.signal)if(i=()=>{n=!0,r.call(t,new Md(void 0,{cause:e.signal.reason}))},e.signal.aborted)Wt.nextTick(i);else{Yr=Yr||Ce().addAbortListener;let s=Yr(e.signal,i),a=r;r=Ka((...u)=>{s[Fd](),a.apply(t,u)})}let o=(...s)=>{n||Wt.nextTick(()=>r.apply(t,s))};return Ug(t[qg].promise,o,o),Wa}function Kg(t,e){var r;let n=!1;return e===null&&(e=$a),(r=e)!==null&&r!==void 0&&r.cleanup&&(Ng(e.cleanup,"cleanup"),n=e.cleanup),new Pg((i,o)=>{let s=qd(t,e,a=>{n&&s(),a?o(a):i()})})}ja.exports=qd;ja.exports.finished=Kg});var pr=V((T3,Gd)=>{"use strict";var ft=Kt(),{aggregateTwoErrors:Wg,codes:{ERR_MULTIPLE_CALLBACK:jg},AbortError:Vg}=Re(),{Symbol:Kd}=ne(),{kIsDestroyed:zg,isDestroyed:Gg,isFinished:Yg,isServerRequest:Zg}=lt(),Wd=Kd("kDestroy"),Va=Kd("kConstruct");function jd(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Xg(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(jd(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?Hd(this,t,e):this.once(Wd,function(o){Hd(this,Wg(o,t),e)}),this)}function Hd(t,e,r){let n=!1;function i(o){if(n)return;n=!0;let s=t._readableState,a=t._writableState;jd(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?ft.nextTick(Qg,t,o):ft.nextTick(Vd,t)}try{t._destroy(e||null,i)}catch(o){i(o)}}function Qg(t,e){za(t,e),Vd(t)}function Vd(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function za(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function Jg(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function Ga(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?ft.nextTick(za,t,e):za(t,e))}function ex(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(Va,e),!(t.listenerCount(Va)>1)&&ft.nextTick(tx,t)}function tx(t){let e=!1;function r(n){if(e){Ga(t,n??new jg);return}e=!0;let i=t._readableState,o=t._writableState,s=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),s.destroyed?t.emit(Wd,n):n?Ga(t,n,!0):ft.nextTick(rx,t)}try{t._construct(n=>{ft.nextTick(r,n)})}catch(n){ft.nextTick(r,n)}}function rx(t){t.emit(Va)}function $d(t){return t?.setHeader&&typeof t.abort=="function"}function zd(t){t.emit("close")}function nx(t,e){t.emit("error",e),ft.nextTick(zd,t)}function ix(t,e){!t||Gg(t)||(!e&&!Yg(t)&&(e=new Vg),Zg(t)?(t.socket=null,t.destroy(e)):$d(t)?t.abort():$d(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ft.nextTick(nx,t,e):ft.nextTick(zd,t),t.destroyed||(t[zg]=!0))}Gd.exports={construct:ex,destroyer:ix,destroy:Xg,undestroy:Jg,errorOrDestroy:Ga}});var Qi=V((B3,Zd)=>{"use strict";var{ArrayIsArray:ox,ObjectSetPrototypeOf:Yd}=ne(),{EventEmitter:Zi}=On();function Xi(t){Zi.call(this,t)}Yd(Xi.prototype,Zi.prototype);Yd(Xi,Zi);Xi.prototype.pipe=function(t,e){let r=this;function n(l){t.writable&&t.write(l)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",a));let o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function u(l){c(),Zi.listenerCount(this,"error")===0&&this.emit("error",l)}Ya(r,"error",u),Ya(t,"error",u);function c(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t};function Ya(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):ox(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}Zd.exports={Stream:Xi,prependListener:Ya}});var kn=V((L3,Ji)=>{"use strict";var{SymbolDispose:sx}=ne(),{AbortError:Xd,codes:ax}=Re(),{isNodeStream:Qd,isWebStream:ux,kControllerErrorFunction:cx}=lt(),lx=Lt(),{ERR_INVALID_ARG_TYPE:Jd}=ax,Za,fx=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Jd(e,"AbortSignal",t)};Ji.exports.addAbortSignal=function(e,r){if(fx(e,"signal"),!Qd(r)&&!ux(r))throw new Jd("stream",["ReadableStream","WritableStream","Stream"],r);return Ji.exports.addAbortSignalNoValidate(e,r)};Ji.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Qd(e)?()=>{e.destroy(new Xd(void 0,{cause:t.reason}))}:()=>{e[cx](new Xd(void 0,{cause:t.reason}))};if(t.aborted)r();else{Za=Za||Ce().addAbortListener;let n=Za(t,r);lx(e,n[sx])}return e}});var rh=V((N3,th)=>{"use strict";var{StringPrototypeSlice:eh,SymbolIterator:dx,TypedArrayPrototypeSet:eo,Uint8Array:hx}=ne(),{Buffer:Xa}=Rt(),{inspect:px}=Ce();th.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Xa.alloc(0);let r=Xa.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)eo(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[dx](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",n=this.head,i=0;do{let o=n.data;if(e>o.length)r+=o,e-=o.length;else{e===o.length?(r+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=eh(o,0,e),this.head=n,n.data=eh(o,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Xa.allocUnsafe(e),n=e,i=this.head,o=0;do{let s=i.data;if(e>s.length)eo(r,s,n-e),e-=s.length;else{e===s.length?(eo(r,s,n-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(eo(r,new hx(s.buffer,s.byteOffset,e),n-e),this.head=i,i.data=s.slice(e));break}++o}while((i=i.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return px(this,{...r,depth:0,customInspect:!1})}}});var Mn=V((P3,sh)=>{"use strict";var{MathFloor:yx,NumberIsInteger:wx}=ne(),{validateInteger:bx}=zr(),{ERR_INVALID_ARG_VALUE:mx}=Re().codes,nh=16*1024,ih=16;function gx(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function oh(t){return t?ih:nh}function xx(t,e){bx(e,"value",0),t?ih=e:nh=e}function Ex(t,e,r,n){let i=gx(e,n,r);if(i!=null){if(!wx(i)||i<0){let o=n?`options.${r}`:"options.highWaterMark";throw new mx(o,i)}return yx(i)}return oh(t.objectMode)}sh.exports={getHighWaterMark:Ex,getDefaultHighWaterMark:oh,setDefaultHighWaterMark:xx}});var ch=V((Qa,uh)=>{var to=Rt(),dt=to.Buffer;function ah(t,e){for(var r in t)e[r]=t[r]}dt.from&&dt.alloc&&dt.allocUnsafe&&dt.allocUnsafeSlow?uh.exports=to:(ah(to,Qa),Qa.Buffer=yr);function yr(t,e,r){return dt(t,e,r)}yr.prototype=Object.create(dt.prototype);ah(dt,yr);yr.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return dt(t,e,r)};yr.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=dt(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};yr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return dt(t)};yr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return to.SlowBuffer(t)}});var dh=V(fh=>{"use strict";var eu=ch().Buffer,lh=eu.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Sx(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function _x(t){var e=Sx(t);if(typeof e!="string"&&(eu.isEncoding===lh||!lh(t)))throw new Error("Unknown encoding: "+t);return e||t}fh.StringDecoder=Fn;function Fn(t){this.encoding=_x(t);var e;switch(this.encoding){case"utf16le":this.text=Bx,this.end=Lx,e=4;break;case"utf8":this.fillLast=vx,e=4;break;case"base64":this.text=Cx,this.end=Nx,e=3;break;default:this.write=Px,this.end=Ux;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=eu.allocUnsafe(e)}Fn.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Fn.prototype.end=Tx;Fn.prototype.text=Rx;Fn.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ja(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Ax(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Ja(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Ja(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Ja(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function Ix(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function vx(t){var e=this.lastTotal-this.lastNeed,r=Ix(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function Rx(t,e){var r=Ax(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function Tx(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Bx(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Lx(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Cx(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Nx(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Px(t){return t.toString(this.encoding)}function Ux(t){return t&&t.length?this.write(t):""}});var tu=V((D3,wh)=>{"use strict";var hh=Kt(),{PromisePrototypeThen:Dx,SymbolAsyncIterator:ph,SymbolIterator:yh}=ne(),{Buffer:Ox}=Rt(),{ERR_INVALID_ARG_TYPE:kx,ERR_STREAM_NULL_VALUES:Mx}=Re().codes;function Fx(t,e,r){let n;if(typeof e=="string"||e instanceof Ox)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[ph])i=!0,n=e[ph]();else if(e&&e[yh])i=!1,n=e[yh]();else throw new kx("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,u())},o._destroy=function(c,l){Dx(a(c),()=>hh.nextTick(l,c),f=>hh.nextTick(l,f||c))};async function a(c){let l=c!=null,f=typeof n.throw=="function";if(l&&f){let{value:y,done:p}=await n.throw(c);if(await y,p)return}if(typeof n.return=="function"){let{value:y}=await n.return();await y}}async function u(){for(;;){try{let{value:c,done:l}=i?await n.next():n.next();if(l)o.push(null);else{let f=c&&typeof c.then=="function"?await c:c;if(f===null)throw s=!1,new Mx;if(o.push(f))continue;s=!1}}catch(c){o.destroy(c)}break}}return o}wh.exports=Fx});var Hn=V((O3,Uh)=>{"use strict";var et=Kt(),{ArrayPrototypeIndexOf:qx,NumberIsInteger:Hx,NumberIsNaN:$x,NumberParseInt:Kx,ObjectDefineProperties:cu,ObjectKeys:Wx,ObjectSetPrototypeOf:gh,Promise:xh,SafeSet:jx,SymbolAsyncDispose:Vx,SymbolAsyncIterator:zx,Symbol:Gx}=ne();Uh.exports=H;H.ReadableState=oo;var{EventEmitter:Yx}=On(),{Stream:jt,prependListener:Zx}=Qi(),{Buffer:ru}=Rt(),{addAbortSignal:Xx}=kn(),Eh=Lt(),K=Ce().debuglog("stream",t=>{K=t}),Qx=rh(),Qr=pr(),{getHighWaterMark:Jx,getDefaultHighWaterMark:e1}=Mn(),{aggregateTwoErrors:bh,codes:{ERR_INVALID_ARG_TYPE:t1,ERR_METHOD_NOT_IMPLEMENTED:r1,ERR_OUT_OF_RANGE:n1,ERR_STREAM_PUSH_AFTER_EOF:i1,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:o1},AbortError:s1}=Re(),{validateObject:a1}=zr(),wr=Gx("kPaused"),{StringDecoder:Sh}=dh(),u1=tu();gh(H.prototype,jt.prototype);gh(H,jt);var nu=()=>{},{errorOrDestroy:Zr}=Qr,Xr=1,c1=2,_h=4,qn=8,Ah=16,ro=32,no=64,Ih=128,l1=256,f1=512,d1=1024,au=2048,uu=4096,h1=8192,p1=16384,y1=32768,vh=65536,w1=1<<17,b1=1<<18;function pe(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}cu(oo.prototype,{objectMode:pe(Xr),ended:pe(c1),endEmitted:pe(_h),reading:pe(qn),constructed:pe(Ah),sync:pe(ro),needReadable:pe(no),emittedReadable:pe(Ih),readableListening:pe(l1),resumeScheduled:pe(f1),errorEmitted:pe(d1),emitClose:pe(au),autoDestroy:pe(uu),destroyed:pe(h1),closed:pe(p1),closeEmitted:pe(y1),multiAwaitDrain:pe(vh),readingMore:pe(w1),dataEmitted:pe(b1)});function oo(t,e,r){typeof r!="boolean"&&(r=e instanceof ht()),this.state=au|uu|Ah|ro,t&&t.objectMode&&(this.state|=Xr),r&&t&&t.readableObjectMode&&(this.state|=Xr),this.highWaterMark=t?Jx(this,t,"readableHighWaterMark",r):e1(!1),this.buffer=new Qx,this.length=0,this.pipes=[],this.flowing=null,this[wr]=null,t&&t.emitClose===!1&&(this.state&=~au),t&&t.autoDestroy===!1&&(this.state&=~uu),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Sh(t.encoding),this.encoding=t.encoding)}function H(t){if(!(this instanceof H))return new H(t);let e=this instanceof ht();this._readableState=new oo(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Xx(t.signal,this)),jt.call(this,t),Qr.construct(this,()=>{this._readableState.needReadable&&io(this,this._readableState)})}H.prototype.destroy=Qr.destroy;H.prototype._undestroy=Qr.undestroy;H.prototype._destroy=function(t,e){e(t)};H.prototype[Yx.captureRejectionSymbol]=function(t){this.destroy(t)};H.prototype[Vx]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new s1,this.destroy(t)),new xh((e,r)=>Eh(this,n=>n&&n!==t?r(n):e(null)))};H.prototype.push=function(t,e){return Rh(this,t,e,!1)};H.prototype.unshift=function(t,e){return Rh(this,t,e,!0)};function Rh(t,e,r,n){K("readableAddChunk",e);let i=t._readableState,o;if((i.state&Xr)===0&&(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=ru.from(e,r).toString(i.encoding):(e=ru.from(e,r),r=""))):e instanceof ru?r="":jt._isUint8Array(e)?(e=jt._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new t1("chunk",["string","Buffer","Uint8Array"],e))),o)Zr(t,o);else if(e===null)i.state&=~qn,x1(t,i);else if((i.state&Xr)!==0||e&&e.length>0)if(n)if((i.state&_h)!==0)Zr(t,new o1);else{if(i.destroyed||i.errored)return!1;iu(t,i,e,!0)}else if(i.ended)Zr(t,new i1);else{if(i.destroyed||i.errored)return!1;i.state&=~qn,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?iu(t,i,e,!1):io(t,i)):iu(t,i,e,!1)}else n||(i.state&=~qn,io(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function iu(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&vh)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),(e.state&no)!==0&&so(t)),io(t,e)}H.prototype.isPaused=function(){let t=this._readableState;return t[wr]===!0||t.flowing===!1};H.prototype.setEncoding=function(t){let e=new Sh(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var m1=1073741824;function g1(t){if(t>m1)throw new n1("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function mh(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Xr)!==0?1:$x(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}H.prototype.read=function(t){K("read",t),t===void 0?t=NaN:Hx(t)||(t=Kx(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=g1(t)),t!==0&&(e.state&=~Ih),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return K("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ou(this):so(this),null;if(t=mh(t,e),t===0&&e.ended)return e.length===0&&ou(this),null;let n=(e.state&no)!==0;if(K("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,K("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,K("reading, ended or constructing",n);else if(n){K("do read"),e.state|=qn|ro,e.length===0&&(e.state|=no);try{this._read(e.highWaterMark)}catch(o){Zr(this,o)}e.state&=~ro,e.reading||(t=mh(r,e))}let i;return t>0?i=Nh(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ou(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function x1(t,e){if(K("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?so(t):(e.needReadable=!1,e.emittedReadable=!0,Th(t))}}function so(t){let e=t._readableState;K("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(K("emitReadable",e.flowing),e.emittedReadable=!0,et.nextTick(Th,t))}function Th(t){let e=t._readableState;K("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Lh(t)}function io(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,et.nextTick(E1,t,e))}function E1(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(K("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}H.prototype._read=function(t){throw new r1("_read()")};H.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new jx(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),K("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==et.stdout&&t!==et.stderr?a:T;n.endEmitted?et.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(S,U){K("onunpipe"),S===r&&U&&U.hasUnpiped===!1&&(U.hasUnpiped=!0,l())}function a(){K("onend"),t.end()}let u,c=!1;function l(){K("cleanup"),t.removeListener("close",g),t.removeListener("finish",h),u&&t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",T),r.removeListener("data",y),c=!0,u&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&u()}function f(){c||(n.pipes.length===1&&n.pipes[0]===t?(K("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(K("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),u||(u=S1(r,t),t.on("drain",u))}r.on("data",y);function y(S){K("ondata");let U=t.write(S);K("dest.write",U),U===!1&&f()}function p(S){if(K("onerror",S),T(),t.removeListener("error",p),t.listenerCount("error")===0){let U=t._writableState||t._readableState;U&&!U.errorEmitted?Zr(t,S):t.emit("error",S)}}Zx(t,"error",p);function g(){t.removeListener("finish",h),T()}t.once("close",g);function h(){K("onfinish"),t.removeListener("close",g),T()}t.once("finish",h);function T(){K("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?f():n.flowing||(K("pipe resume"),r.resume()),t};function S1(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(K("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(K("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}H.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let o=0;o<i.length;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=qx(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};H.prototype.on=function(t,e){let r=jt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,K("on readable",n.length,n.reading),n.length?so(this):n.reading||et.nextTick(_1,this)),r};H.prototype.addListener=H.prototype.on;H.prototype.removeListener=function(t,e){let r=jt.prototype.removeListener.call(this,t,e);return t==="readable"&&et.nextTick(Bh,this),r};H.prototype.off=H.prototype.removeListener;H.prototype.removeAllListeners=function(t){let e=jt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&et.nextTick(Bh,this),e};function Bh(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[wr]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function _1(t){K("readable nexttick read 0"),t.read(0)}H.prototype.resume=function(){let t=this._readableState;return t.flowing||(K("resume"),t.flowing=!t.readableListening,A1(this,t)),t[wr]=!1,this};function A1(t,e){e.resumeScheduled||(e.resumeScheduled=!0,et.nextTick(I1,t,e))}function I1(t,e){K("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Lh(t),e.flowing&&!e.reading&&t.read(0)}H.prototype.pause=function(){return K("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(K("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[wr]=!0,this};function Lh(t){let e=t._readableState;for(K("flow",e.flowing);e.flowing&&t.read()!==null;);}H.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{Zr(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Wx(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};H.prototype[zx]=function(){return Ch(this)};H.prototype.iterator=function(t){return t!==void 0&&a1(t,"options"),Ch(this,t)};function Ch(t,e){typeof t.read!="function"&&(t=H.wrap(t,{objectMode:!0}));let r=v1(t,e);return r.stream=t,r}async function*v1(t,e){let r=nu;function n(s){this===t?(r(),r=nu):r=s}t.on("readable",n);let i,o=Eh(t,{writable:!1},s=>{i=s?bh(i,s):null,r(),r=nu});try{for(;;){let s=t.destroyed?null:t.read();if(s!==null)yield s;else{if(i)throw i;if(i===null)return;await new xh(n)}}}catch(s){throw i=bh(i,s),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?Qr.destroyer(t,null):(t.off("readable",n),o())}}cu(H.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},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(t){this._readableState&&(this._readableState.flowing=t)}},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(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});cu(oo.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[wr]!==!1},set(t){this[wr]=!!t}}});H._fromList=Nh;function Nh(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function ou(t){let e=t._readableState;K("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,et.nextTick(R1,e,t))}function R1(t,e){if(K("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)et.nextTick(T1,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function T1(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}H.from=function(t,e){return u1(H,t,e)};var su;function Ph(){return su===void 0&&(su={}),su}H.fromWeb=function(t,e){return Ph().newStreamReadableFromReadableStream(t,e)};H.toWeb=function(t,e){return Ph().newReadableStreamFromStreamReadable(t,e)};H.wrap=function(t,e){var r,n;return new H({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,o){Qr.destroyer(t,i),o(i)}}).wrap(t)}});var fo=V((k3,Vh)=>{"use strict";var br=Kt(),{ArrayPrototypeSlice:kh,Error:B1,FunctionPrototypeSymbolHasInstance:Mh,ObjectDefineProperty:Fh,ObjectDefineProperties:L1,ObjectSetPrototypeOf:qh,StringPrototypeToLowerCase:C1,Symbol:N1,SymbolHasInstance:P1}=ne();Vh.exports=ie;ie.WritableState=Wn;var{EventEmitter:U1}=On(),$n=Qi().Stream,{Buffer:ao}=Rt(),lo=pr(),{addAbortSignal:D1}=kn(),{getHighWaterMark:O1,getDefaultHighWaterMark:k1}=Mn(),{ERR_INVALID_ARG_TYPE:M1,ERR_METHOD_NOT_IMPLEMENTED:F1,ERR_MULTIPLE_CALLBACK:Hh,ERR_STREAM_CANNOT_PIPE:q1,ERR_STREAM_DESTROYED:Kn,ERR_STREAM_ALREADY_FINISHED:H1,ERR_STREAM_NULL_VALUES:$1,ERR_STREAM_WRITE_AFTER_END:K1,ERR_UNKNOWN_ENCODING:$h}=Re().codes,{errorOrDestroy:Jr}=lo;qh(ie.prototype,$n.prototype);qh(ie,$n);function du(){}var en=N1("kOnFinished");function Wn(t,e,r){typeof r!="boolean"&&(r=e instanceof ht()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?O1(this,t,"writableHighWaterMark",r):k1(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=j1.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,co(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[en]=[]}function co(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Wn.prototype.getBuffer=function(){return kh(this.buffered,this.bufferedIndex)};Fh(Wn.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function ie(t){let e=this instanceof ht();if(!e&&!Mh(ie,this))return new ie(t);this._writableState=new Wn(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&D1(t.signal,this)),$n.call(this,t),lo.construct(this,()=>{let r=this._writableState;r.writing||pu(this,r),yu(this,r)})}Fh(ie,P1,{__proto__:null,value:function(t){return Mh(this,t)?!0:this!==ie?!1:t&&t._writableState instanceof Wn}});ie.prototype.pipe=function(){Jr(this,new q1)};function Kh(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!ao.isEncoding(r))throw new $h(r);typeof n!="function"&&(n=du)}if(e===null)throw new $1;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=ao.from(e,r),r="buffer");else if(e instanceof ao)r="buffer";else if($n._isUint8Array(e))e=$n._uint8ArrayToBuffer(e),r="buffer";else throw new M1("chunk",["string","Buffer","Uint8Array"],e);let o;return i.ending?o=new K1:i.destroyed&&(o=new Kn("write")),o?(br.nextTick(n,o),Jr(t,o,!0),o):(i.pendingcb++,W1(t,i,e,r,n))}ie.prototype.write=function(t,e,r){return Kh(this,t,e,r)===!0};ie.prototype.cork=function(){this._writableState.corked++};ie.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||pu(this,t))};ie.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=C1(e)),!ao.isEncoding(e))throw new $h(e);return this._writableState.defaultEncoding=e,this};function W1(t,e,r,n,i){let o=e.objectMode?1:r.length;e.length+=o;let s=e.length<e.highWaterMark;return s||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==du&&(e.allNoop=!1)):(e.writelen=o,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),s&&!e.errored&&!e.destroyed}function Dh(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Kn("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Oh(t,e,r,n){--e.pendingcb,n(r),hu(e),Jr(t,r)}function j1(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){Jr(t,new Hh);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?br.nextTick(Oh,t,r,e,i):Oh(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&pu(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},br.nextTick(V1,r.afterWriteTickInfo)):Wh(t,r,1,i))}function V1({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,Wh(t,e,r,n)}function Wh(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&hu(e),yu(t,e)}function hu(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:o,callback:s}=t.buffered[i],a=t.objectMode?1:o.length;t.length-=a,s((e=t.errored)!==null&&e!==void 0?e:new Kn("write"))}let r=t[en].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new Kn("end"))}co(t)}function pu(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,o=r.length-n;if(!o)return;let s=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let a=e.allNoop?du:c=>{for(let l=s;l<r.length;++l)r[l].callback(c)},u=e.allNoop&&s===0?r:kh(r,s);u.allBuffers=e.allBuffers,Dh(t,e,!0,e.length,u,"",a),co(e)}else{do{let{chunk:a,encoding:u,callback:c}=r[s];r[s++]=null;let l=i?1:a.length;Dh(t,e,!1,l,a,u,c)}while(s<r.length&&!e.writing);s===r.length?co(e):s>256?(r.splice(0,s),e.bufferedIndex=0):e.bufferedIndex=s}e.bufferProcessing=!1}ie.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new F1("_write()")};ie.prototype._writev=null;ie.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let o=Kh(this,t,e);o instanceof B1&&(i=o)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,yu(this,n,!0),n.ended=!0):n.finished?i=new H1("end"):n.destroyed&&(i=new Kn("end"))),typeof r=="function"&&(i||n.finished?br.nextTick(r,i):n[en].push(r)),this};function uo(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function z1(t,e){let r=!1;function n(i){if(r){Jr(t,i??Hh());return}if(r=!0,e.pendingcb--,i){let o=e[en].splice(0);for(let s=0;s<o.length;s++)o[s](i);Jr(t,i,e.sync)}else uo(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,br.nextTick(fu,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function G1(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,z1(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function yu(t,e,r){uo(e)&&(G1(t,e),e.pendingcb===0&&(r?(e.pendingcb++,br.nextTick((n,i)=>{uo(i)?fu(n,i):i.pendingcb--},t,e)):uo(e)&&(e.pendingcb++,fu(t,e))))}function fu(t,e){e.pendingcb--,e.finished=!0;let r=e[en].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}L1(ie.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},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 t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Y1=lo.destroy;ie.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[en].length)&&br.nextTick(hu,r),Y1.call(this,t,e),this};ie.prototype._undestroy=lo.undestroy;ie.prototype._destroy=function(t,e){e(t)};ie.prototype[U1.captureRejectionSymbol]=function(t){this.destroy(t)};var lu;function jh(){return lu===void 0&&(lu={}),lu}ie.fromWeb=function(t,e){return jh().newStreamWritableFromWritableStream(t,e)};ie.toWeb=function(t){return jh().newWritableStreamFromStreamWritable(t)}});var ap=V((M3,sp)=>{var wu=Kt(),Z1=Rt(),{isReadable:X1,isWritable:Q1,isIterable:zh,isNodeStream:J1,isReadableNodeStream:Gh,isWritableNodeStream:Yh,isDuplexNodeStream:eE,isReadableStream:Zh,isWritableStream:Xh}=lt(),Qh=Lt(),{AbortError:ip,codes:{ERR_INVALID_ARG_TYPE:tE,ERR_INVALID_RETURN_VALUE:Jh}}=Re(),{destroyer:rn}=pr(),rE=ht(),op=Hn(),nE=fo(),{createDeferredPromise:ep}=Ce(),tp=tu(),rp=globalThis.Blob||Z1.Blob,iE=typeof rp<"u"?function(e){return e instanceof rp}:function(e){return!1},oE=globalThis.AbortController||Wr().AbortController,{FunctionPrototypeCall:np}=ne(),Vt=class extends rE{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};sp.exports=function t(e,r){if(eE(e))return e;if(Gh(e))return tn({readable:e});if(Yh(e))return tn({writable:e});if(J1(e))return tn({writable:!1,readable:!1});if(Zh(e))return tn({readable:op.fromWeb(e)});if(Xh(e))return tn({writable:nE.fromWeb(e)});if(typeof e=="function"){let{value:i,write:o,final:s,destroy:a}=sE(e);if(zh(i))return tp(Vt,i,{objectMode:!0,write:o,final:s,destroy:a});let u=i?.then;if(typeof u=="function"){let c,l=np(u,i,f=>{if(f!=null)throw new Jh("nully","body",f)},f=>{rn(c,f)});return c=new Vt({objectMode:!0,readable:!1,write:o,final(f){s(async()=>{try{await l,wu.nextTick(f,null)}catch(y){wu.nextTick(f,y)}})},destroy:a})}throw new Jh("Iterable, AsyncIterable or AsyncFunction",r,i)}if(iE(e))return t(e.arrayBuffer());if(zh(e))return tp(Vt,e,{objectMode:!0,writable:!1});if(Zh(e?.readable)&&Xh(e?.writable))return Vt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?Gh(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?Yh(e?.writable)?e?.writable:t(e.writable):void 0;return tn({readable:i,writable:o})}let n=e?.then;if(typeof n=="function"){let i;return np(n,e,o=>{o!=null&&i.push(o),i.push(null)},o=>{rn(i,o)}),i=new Vt({objectMode:!0,writable:!1,read(){}})}throw new tE(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function sE(t){let{promise:e,resolve:r}=ep(),n=new oE,i=n.signal;return{value:t(async function*(){for(;;){let s=e;e=null;let{chunk:a,done:u,cb:c}=await s;if(wu.nextTick(c),u)return;if(i.aborted)throw new ip(void 0,{cause:i.reason});({promise:e,resolve:r}=ep()),yield a}}(),{signal:i}),write(s,a,u){let c=r;r=null,c({chunk:s,done:!1,cb:u})},final(s){let a=r;r=null,a({done:!0,cb:s})},destroy(s,a){n.abort(),a(s)}}}function tn(t){let e=t.readable&&typeof t.readable.read!="function"?op.wrap(t.readable):t.readable,r=t.writable,n=!!X1(e),i=!!Q1(r),o,s,a,u,c;function l(f){let y=u;u=null,y?y(f):f&&c.destroy(f)}return c=new Vt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(Qh(r,f=>{i=!1,f&&rn(e,f),l(f)}),c._write=function(f,y,p){r.write(f,y)?p():o=p},c._final=function(f){r.end(),s=f},r.on("drain",function(){if(o){let f=o;o=null,f()}}),r.on("finish",function(){if(s){let f=s;s=null,f()}})),n&&(Qh(e,f=>{n=!1,f&&rn(e,f),l(f)}),e.on("readable",function(){if(a){let f=a;a=null,f()}}),e.on("end",function(){c.push(null)}),c._read=function(){for(;;){let f=e.read();if(f===null){a=c._read;return}if(!c.push(f))return}}),c._destroy=function(f,y){!f&&u!==null&&(f=new ip),a=null,o=null,s=null,u===null?y(f):(u=y,rn(r,f),rn(e,f))},c}});var ht=V((F3,lp)=>{"use strict";var{ObjectDefineProperties:aE,ObjectGetOwnPropertyDescriptor:Ct,ObjectKeys:uE,ObjectSetPrototypeOf:up}=ne();lp.exports=tt;var gu=Hn(),Ve=fo();up(tt.prototype,gu.prototype);up(tt,gu);{let t=uE(Ve.prototype);for(let e=0;e<t.length;e++){let r=t[e];tt.prototype[r]||(tt.prototype[r]=Ve.prototype[r])}}function tt(t){if(!(this instanceof tt))return new tt(t);gu.call(this,t),Ve.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}aE(tt.prototype,{writable:{__proto__:null,...Ct(Ve.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Ct(Ve.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Ct(Ve.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Ct(Ve.prototype,"writableBuffer")},writableLength:{__proto__:null,...Ct(Ve.prototype,"writableLength")},writableFinished:{__proto__:null,...Ct(Ve.prototype,"writableFinished")},writableCorked:{__proto__:null,...Ct(Ve.prototype,"writableCorked")},writableEnded:{__proto__:null,...Ct(Ve.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Ct(Ve.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var bu;function cp(){return bu===void 0&&(bu={}),bu}tt.fromWeb=function(t,e){return cp().newStreamDuplexFromReadableWritablePair(t,e)};tt.toWeb=function(t){return cp().newReadableWritablePairFromDuplex(t)};var mu;tt.from=function(t){return mu||(mu=ap()),mu(t,"body")}});var Su=V((q3,dp)=>{"use strict";var{ObjectSetPrototypeOf:fp,Symbol:cE}=ne();dp.exports=Nt;var{ERR_METHOD_NOT_IMPLEMENTED:lE}=Re().codes,Eu=ht(),{getHighWaterMark:fE}=Mn();fp(Nt.prototype,Eu.prototype);fp(Nt,Eu);var jn=cE("kCallback");function Nt(t){if(!(this instanceof Nt))return new Nt(t);let e=t?fE(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Eu.call(this,t),this._readableState.sync=!1,this[jn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",dE)}function xu(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function dE(){this._final!==xu&&xu.call(this)}Nt.prototype._final=xu;Nt.prototype._transform=function(t,e,r){throw new lE("_transform()")};Nt.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(t,e,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),i.ended||o===n.length||n.length<n.highWaterMark?r():this[jn]=r})};Nt.prototype._read=function(){if(this[jn]){let t=this[jn];this[jn]=null,t()}}});var Au=V((H3,pp)=>{"use strict";var{ObjectSetPrototypeOf:hp}=ne();pp.exports=nn;var _u=Su();hp(nn.prototype,_u.prototype);hp(nn,_u);function nn(t){if(!(this instanceof nn))return new nn(t);_u.call(this,t)}nn.prototype._transform=function(t,e,r){r(null,t)}});var wo=V(($3,gp)=>{var Vn=Kt(),{ArrayIsArray:hE,Promise:pE,SymbolAsyncIterator:yE,SymbolDispose:wE}=ne(),yo=Lt(),{once:bE}=Ce(),mE=pr(),yp=ht(),{aggregateTwoErrors:gE,codes:{ERR_INVALID_ARG_TYPE:Pu,ERR_INVALID_RETURN_VALUE:Iu,ERR_MISSING_ARGS:xE,ERR_STREAM_DESTROYED:EE,ERR_STREAM_PREMATURE_CLOSE:SE},AbortError:_E}=Re(),{validateFunction:AE,validateAbortSignal:IE}=zr(),{isIterable:mr,isReadable:vu,isReadableNodeStream:po,isNodeStream:wp,isTransformStream:on,isWebStream:vE,isReadableStream:Ru,isReadableFinished:RE}=lt(),TE=globalThis.AbortController||Wr().AbortController,Tu,Bu,Lu;function bp(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=yo(t,{readable:e,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,mE.destroyer(t,o||new EE("pipe")))},cleanup:i}}function BE(t){return AE(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Cu(t){if(mr(t))return t;if(po(t))return LE(t);throw new Pu("val",["Readable","Iterable","AsyncIterable"],t)}async function*LE(t){Bu||(Bu=Hn()),yield*Bu.prototype[yE].call(t)}async function ho(t,e,r,{end:n}){let i,o=null,s=c=>{if(c&&(i=c),o){let l=o;o=null,l()}},a=()=>new pE((c,l)=>{i?l(i):o=()=>{i?l(i):c()}});e.on("drain",s);let u=yo(e,{readable:!1},s);try{e.writableNeedDrain&&await a();for await(let c of t)e.write(c)||await a();n&&(e.end(),await a()),r()}catch(c){r(i!==c?gE(i,c):c)}finally{u(),e.off("drain",s)}}async function Nu(t,e,r,{end:n}){on(e)&&(e=e.writable);let i=e.getWriter();try{for await(let o of t)await i.ready,i.write(o).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(s){r(s)}}}function CE(...t){return mp(t,bE(BE(t)))}function mp(t,e,r){if(t.length===1&&hE(t[0])&&(t=t[0]),t.length<2)throw new xE("streams");let n=new TE,i=n.signal,o=r?.signal,s=[];IE(o,"options.signal");function a(){g(new _E)}Lu=Lu||Ce().addAbortListener;let u;o&&(u=Lu(o,a));let c,l,f=[],y=0;function p(E){g(E,--y===0)}function g(E,d){var m;if(E&&(!c||c.code==="ERR_STREAM_PREMATURE_CLOSE")&&(c=E),!(!c&&!d)){for(;f.length;)f.shift()(c);(m=u)===null||m===void 0||m[wE](),n.abort(),d&&(c||s.forEach(B=>B()),Vn.nextTick(e,c,l))}}let h;for(let E=0;E<t.length;E++){let d=t[E],m=E<t.length-1,B=E>0,R=m||r?.end!==!1,L=E===t.length-1;if(wp(d)){let C=function(M){M&&M.name!=="AbortError"&&M.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(M)};var U=C;if(R){let{destroy:M,cleanup:D}=bp(d,m,B);f.push(M),vu(d)&&L&&s.push(D)}d.on("error",C),vu(d)&&L&&s.push(()=>{d.removeListener("error",C)})}if(E===0)if(typeof d=="function"){if(h=d({signal:i}),!mr(h))throw new Iu("Iterable, AsyncIterable or Stream","source",h)}else mr(d)||po(d)||on(d)?h=d:h=yp.from(d);else if(typeof d=="function"){if(on(h)){var T;h=Cu((T=h)===null||T===void 0?void 0:T.readable)}else h=Cu(h);if(h=d(h,{signal:i}),m){if(!mr(h,!0))throw new Iu("AsyncIterable",`transform[${E-1}]`,h)}else{var S;Tu||(Tu=Au());let C=new Tu({objectMode:!0}),M=(S=h)===null||S===void 0?void 0:S.then;if(typeof M=="function")y++,M.call(h,P=>{l=P,P!=null&&C.write(P),R&&C.end(),Vn.nextTick(p)},P=>{C.destroy(P),Vn.nextTick(p,P)});else if(mr(h,!0))y++,ho(h,C,p,{end:R});else if(Ru(h)||on(h)){let P=h.readable||h;y++,ho(P,C,p,{end:R})}else throw new Iu("AsyncIterable or Promise","destination",h);h=C;let{destroy:D,cleanup:F}=bp(h,!1,!0);f.push(D),L&&s.push(F)}}else if(wp(d)){if(po(h)){y+=2;let C=NE(h,d,p,{end:R});vu(d)&&L&&s.push(C)}else if(on(h)||Ru(h)){let C=h.readable||h;y++,ho(C,d,p,{end:R})}else if(mr(h))y++,ho(h,d,p,{end:R});else throw new Pu("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],h);h=d}else if(vE(d)){if(po(h))y++,Nu(Cu(h),d,p,{end:R});else if(Ru(h)||mr(h))y++,Nu(h,d,p,{end:R});else if(on(h))y++,Nu(h.readable,d,p,{end:R});else throw new Pu("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],h);h=d}else h=yp.from(d)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&Vn.nextTick(a),h}function NE(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new SE)}),t.pipe(e,{end:!1}),n){let s=function(){i=!0,e.end()};var o=s;RE(t)?Vn.nextTick(s):t.once("end",s)}else r();return yo(t,{readable:!0,writable:!1},s=>{let a=t._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(s)}),yo(e,{readable:!1,writable:!0},r)}gp.exports={pipelineImpl:mp,pipeline:CE}});var Du=V((K3,Ip)=>{"use strict";var{pipeline:PE}=wo(),bo=ht(),{destroyer:UE}=pr(),{isNodeStream:mo,isReadable:xp,isWritable:Ep,isWebStream:Uu,isTransformStream:gr,isWritableStream:Sp,isReadableStream:_p}=lt(),{AbortError:DE,codes:{ERR_INVALID_ARG_VALUE:Ap,ERR_MISSING_ARGS:OE}}=Re(),kE=Lt();Ip.exports=function(...e){if(e.length===0)throw new OE("streams");if(e.length===1)return bo.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=bo.from(e[0])),typeof e[e.length-1]=="function"){let p=e.length-1;e[p]=bo.from(e[p])}for(let p=0;p<e.length;++p)if(!(!mo(e[p])&&!Uu(e[p]))){if(p<e.length-1&&!(xp(e[p])||_p(e[p])||gr(e[p])))throw new Ap(`streams[${p}]`,r[p],"must be readable");if(p>0&&!(Ep(e[p])||Sp(e[p])||gr(e[p])))throw new Ap(`streams[${p}]`,r[p],"must be writable")}let n,i,o,s,a;function u(p){let g=s;s=null,g?g(p):p?a.destroy(p):!y&&!f&&a.destroy()}let c=e[0],l=PE(e,u),f=!!(Ep(c)||Sp(c)||gr(c)),y=!!(xp(l)||_p(l)||gr(l));if(a=new bo({writableObjectMode:!!(c!=null&&c.writableObjectMode),readableObjectMode:!!(l!=null&&l.readableObjectMode),writable:f,readable:y}),f){if(mo(c))a._write=function(g,h,T){c.write(g,h)?T():n=T},a._final=function(g){c.end(),i=g},c.on("drain",function(){if(n){let g=n;n=null,g()}});else if(Uu(c)){let h=(gr(c)?c.writable:c).getWriter();a._write=async function(T,S,U){try{await h.ready,h.write(T).catch(()=>{}),U()}catch(E){U(E)}},a._final=async function(T){try{await h.ready,h.close().catch(()=>{}),i=T}catch(S){T(S)}}}let p=gr(l)?l.readable:l;kE(p,()=>{if(i){let g=i;i=null,g()}})}if(y){if(mo(l))l.on("readable",function(){if(o){let p=o;o=null,p()}}),l.on("end",function(){a.push(null)}),a._read=function(){for(;;){let p=l.read();if(p===null){o=a._read;return}if(!a.push(p))return}};else if(Uu(l)){let g=(gr(l)?l.readable:l).getReader();a._read=async function(){for(;;)try{let{value:h,done:T}=await g.read();if(!a.push(h))return;if(T){a.push(null);return}}catch{return}}}}return a._destroy=function(p,g){!p&&s!==null&&(p=new DE),o=null,n=null,i=null,s===null?g(p):(s=g,mo(l)&&UE(l,p))},a}});var Dp=V((W3,Mu)=>{"use strict";var ME=globalThis.AbortController||Wr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:FE,ERR_INVALID_ARG_TYPE:zn,ERR_MISSING_ARGS:qE,ERR_OUT_OF_RANGE:HE},AbortError:pt}=Re(),{validateAbortSignal:xr,validateInteger:vp,validateObject:Er}=zr(),$E=ne().Symbol("kWeak"),KE=ne().Symbol("kResistStopPropagation"),{finished:WE}=Lt(),jE=Du(),{addAbortSignalNoValidate:VE}=kn(),{isWritable:zE,isNodeStream:GE}=lt(),{deprecate:YE}=Ce(),{ArrayPrototypePush:ZE,Boolean:XE,MathFloor:Rp,Number:QE,NumberIsNaN:JE,Promise:Tp,PromiseReject:Bp,PromiseResolve:e2,PromisePrototypeThen:Lp,Symbol:Np}=ne(),go=Np("kEmpty"),Cp=Np("kEof");function t2(t,e){if(e!=null&&Er(e,"options"),e?.signal!=null&&xr(e.signal,"options.signal"),GE(t)&&!zE(t))throw new FE("stream",t,"must be writable");let r=jE(this,t);return e!=null&&e.signal&&VE(e.signal,r),r}function xo(t,e){if(typeof t!="function")throw new zn("fn",["Function","AsyncFunction"],t);e!=null&&Er(e,"options"),e?.signal!=null&&xr(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=Rp(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=Rp(e.highWaterMark)),vp(r,"options.concurrency",1),vp(n,"options.highWaterMark",0),n+=r,async function*(){let o=Ce().AbortSignalAny([e?.signal].filter(XE)),s=this,a=[],u={signal:o},c,l,f=!1,y=0;function p(){f=!0,g()}function g(){y-=1,h()}function h(){l&&!f&&y<r&&a.length<n&&(l(),l=null)}async function T(){try{for await(let S of s){if(f)return;if(o.aborted)throw new pt;try{if(S=t(S,u),S===go)continue;S=e2(S)}catch(U){S=Bp(U)}y+=1,Lp(S,g,p),a.push(S),c&&(c(),c=null),!f&&(a.length>=n||y>=r)&&await new Tp(U=>{l=U})}a.push(Cp)}catch(S){let U=Bp(S);Lp(U,g,p),a.push(U)}finally{f=!0,c&&(c(),c=null)}}T();try{for(;;){for(;a.length>0;){let S=await a[0];if(S===Cp)return;if(o.aborted)throw new pt;S!==go&&(yield S),a.shift(),h()}await new Tp(S=>{c=S})}}finally{f=!0,l&&(l(),l=null)}}.call(this)}function r2(t=void 0){return t!=null&&Er(t,"options"),t?.signal!=null&&xr(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new pt({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function Pp(t,e=void 0){for await(let r of ku.call(this,t,e))return!0;return!1}async function n2(t,e=void 0){if(typeof t!="function")throw new zn("fn",["Function","AsyncFunction"],t);return!await Pp.call(this,async(...r)=>!await t(...r),e)}async function i2(t,e){for await(let r of ku.call(this,t,e))return r}async function o2(t,e){if(typeof t!="function")throw new zn("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),go}for await(let n of xo.call(this,r,e));}function ku(t,e){if(typeof t!="function")throw new zn("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:go}return xo.call(this,r,e)}var Ou=class extends qE{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function s2(t,e,r){var n;if(typeof t!="function")throw new zn("reducer",["Function","AsyncFunction"],t);r!=null&&Er(r,"options"),r?.signal!=null&&xr(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let c=new pt(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await WE(this.destroy(c)),c}let o=new ME,s=o.signal;if(r!=null&&r.signal){let c={once:!0,[$E]:this,[KE]:!0};r.signal.addEventListener("abort",()=>o.abort(),c)}let a=!1;try{for await(let c of this){var u;if(a=!0,r!=null&&(u=r.signal)!==null&&u!==void 0&&u.aborted)throw new pt;i?e=await t(e,c,{signal:s}):(e=c,i=!0)}if(!a&&!i)throw new Ou}finally{o.abort()}return e}async function a2(t){t!=null&&Er(t,"options"),t?.signal!=null&&xr(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new pt(void 0,{cause:t.signal.reason});ZE(e,n)}return e}function u2(t,e){let r=xo.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function Up(t){if(t=QE(t),JE(t))return 0;if(t<0)throw new HE("number",">= 0",t);return t}function c2(t,e=void 0){return e!=null&&Er(e,"options"),e?.signal!=null&&xr(e.signal,"options.signal"),t=Up(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new pt;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new pt;t--<=0&&(yield o)}}.call(this)}function l2(t,e=void 0){return e!=null&&Er(e,"options"),e?.signal!=null&&xr(e.signal,"options.signal"),t=Up(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new pt;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new pt;if(t-- >0&&(yield o),t<=0)return}}.call(this)}Mu.exports.streamReturningOperators={asIndexedPairs:YE(r2,"readable.asIndexedPairs will be removed in a future version."),drop:c2,filter:ku,flatMap:u2,map:xo,take:l2,compose:t2};Mu.exports.promiseReturningOperators={every:n2,forEach:o2,reduce:s2,toArray:a2,some:Pp,find:i2}});var Fu=V((j3,Op)=>{"use strict";var{ArrayPrototypePop:f2,Promise:d2}=ne(),{isIterable:h2,isNodeStream:p2,isWebStream:y2}=lt(),{pipelineImpl:w2}=wo(),{finished:b2}=Lt();qu();function m2(...t){return new d2((e,r)=>{let n,i,o=t[t.length-1];if(o&&typeof o=="object"&&!p2(o)&&!h2(o)&&!y2(o)){let s=f2(t);n=s.signal,i=s.end}w2(t,(s,a)=>{s?r(s):e(a)},{signal:n,end:i})})}Op.exports={finished:b2,pipeline:m2}});var qu=V((V3,jp)=>{"use strict";var{Buffer:g2}=Rt(),{ObjectDefineProperty:Pt,ObjectKeys:Fp,ReflectApply:qp}=ne(),{promisify:{custom:Hp}}=Ce(),{streamReturningOperators:kp,promiseReturningOperators:Mp}=Dp(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:$p}}=Re(),x2=Du(),{setDefaultHighWaterMark:E2,getDefaultHighWaterMark:S2}=Mn(),{pipeline:Kp}=wo(),{destroyer:_2}=pr(),Wp=Lt(),Hu=Fu(),Gn=lt(),J=jp.exports=Qi().Stream;J.isDestroyed=Gn.isDestroyed;J.isDisturbed=Gn.isDisturbed;J.isErrored=Gn.isErrored;J.isReadable=Gn.isReadable;J.isWritable=Gn.isWritable;J.Readable=Hn();for(let t of Fp(kp)){let r=function(...n){if(new.target)throw $p();return J.Readable.from(qp(e,this,n))},e=kp[t];Pt(r,"name",{__proto__:null,value:e.name}),Pt(r,"length",{__proto__:null,value:e.length}),Pt(J.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of Fp(Mp)){let r=function(...n){if(new.target)throw $p();return qp(e,this,n)},e=Mp[t];Pt(r,"name",{__proto__:null,value:e.name}),Pt(r,"length",{__proto__:null,value:e.length}),Pt(J.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}J.Writable=fo();J.Duplex=ht();J.Transform=Su();J.PassThrough=Au();J.pipeline=Kp;var{addAbortSignal:A2}=kn();J.addAbortSignal=A2;J.finished=Wp;J.destroy=_2;J.compose=x2;J.setDefaultHighWaterMark=E2;J.getDefaultHighWaterMark=S2;Pt(J,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Hu}});Pt(Kp,Hp,{__proto__:null,enumerable:!0,get(){return Hu.pipeline}});Pt(Wp,Hp,{__proto__:null,enumerable:!0,get(){return Hu.finished}});J.Stream=J;J._isUint8Array=function(e){return e instanceof Uint8Array};J._uint8ArrayToBuffer=function(e){return g2.from(e.buffer,e.byteOffset,e.byteLength)}});var Vp=V((z3,ue)=>{"use strict";var ye=qu(),I2=Fu(),v2=ye.Readable.destroy;ue.exports=ye.Readable;ue.exports._uint8ArrayToBuffer=ye._uint8ArrayToBuffer;ue.exports._isUint8Array=ye._isUint8Array;ue.exports.isDisturbed=ye.isDisturbed;ue.exports.isErrored=ye.isErrored;ue.exports.isReadable=ye.isReadable;ue.exports.Readable=ye.Readable;ue.exports.Writable=ye.Writable;ue.exports.Duplex=ye.Duplex;ue.exports.Transform=ye.Transform;ue.exports.PassThrough=ye.PassThrough;ue.exports.addAbortSignal=ye.addAbortSignal;ue.exports.finished=ye.finished;ue.exports.destroy=ye.destroy;ue.exports.destroy=v2;ue.exports.pipeline=ye.pipeline;ue.exports.compose=ye.compose;Object.defineProperty(ye,"promises",{configurable:!0,enumerable:!0,get(){return I2}});ue.exports.Stream=ye.Stream;ue.exports.default=ue.exports});var K2={};ke(K2,{BAD_REQUEST:()=>P2,DNS4_CODEC:()=>o3,DNS6_CODEC:()=>s3,DNSADDR_CODEC:()=>a3,DNS_CODEC:()=>i3,DNS_CODECS:()=>ha,HTTP_CODEC:()=>wf,HTTP_PATH_CODEC:()=>da,INTERNAL_SERVER_ERROR:()=>U2,NOT_FOUND_RESPONSE:()=>N2,NOT_IMPLEMENTED_ERROR:()=>D2,Request:()=>Pn,Response:()=>wa,STATUS_CODES:()=>pa,getHeader:()=>M2,getHeaders:()=>Un,getHost:()=>Qp,getServerUpgradeHeaders:()=>H2,isWebSocketUpgrade:()=>ya,normalizeMethod:()=>F2,normalizeUrl:()=>e0,readHeaders:()=>$2,responseToStream:()=>C2,streamToRequest:()=>L2,streamToSocket:()=>R2,stripHTTPPath:()=>Jp,toResource:()=>k2,toURL:()=>T2,toUint8Array:()=>B2,writeHeaders:()=>Xp});var vo={};ke(vo,{base10:()=>m0});var j2=new Uint8Array(0);function ju(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function yt(t){if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")}function Vu(t){return new TextEncoder().encode(t)}function zu(t){return new TextDecoder().decode(t)}function d0(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,u=t.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var h=0,T=0,S=0,U=g.length;S!==U&&g[S]===0;)S++,h++;for(var E=(U-S)*l+1>>>0,d=new Uint8Array(E);S!==U;){for(var m=g[S],B=0,R=E-1;(m!==0||B<T)&&R!==-1;R--,B++)m+=256*d[R]>>>0,d[R]=m%a>>>0,m=m/a>>>0;if(m!==0)throw new Error("Non-zero carry");T=B,S++}for(var L=E-T;L!==E&&d[L]===0;)L++;for(var C=u.repeat(h);L<E;++L)C+=t.charAt(d[L]);return C}function y(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var h=0;if(g[h]!==" "){for(var T=0,S=0;g[h]===u;)T++,h++;for(var U=(g.length-h)*c+1>>>0,E=new Uint8Array(U);g[h];){var d=r[g.charCodeAt(h)];if(d===255)return;for(var m=0,B=U-1;(d!==0||m<S)&&B!==-1;B--,m++)d+=a*E[B]>>>0,E[B]=d%256>>>0,d=d/256>>>0;if(d!==0)throw new Error("Non-zero carry");S=m,h++}if(g[h]!==" "){for(var R=U-S;R!==U&&E[R]===0;)R++;for(var L=new Uint8Array(T+(U-R)),C=T;R!==U;)L[C++]=E[R++];return L}}}function p(g){var h=y(g);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:y,decode:p}}var h0=d0,p0=h0,Yu=p0;var So=class{name;prefix;baseEncode;constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},_o=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,n){this.name=e,this.prefix=r;let i=r.codePointAt(0);if(i===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zu(this,e)}},Ao=class{decoders;constructor(e){this.decoders=e}or(e){return Zu(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Zu(t,e){return new Ao({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var Io=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new So(e,r,n),this.decoder=new _o(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Sr({name:t,prefix:e,encode:r,decode:n}){return new Io(t,e,r,n)}function Ut({name:t,prefix:e,alphabet:r}){let{encode:n,decode:i}=Yu(r,t);return Sr({prefix:e,name:t,encode:n,decode:o=>yt(i(o))})}function y0(t,e,r,n){let i=t.length;for(;t[i-1]==="=";)--i;let o=new Uint8Array(i*r/8|0),s=0,a=0,u=0;for(let c=0;c<i;++c){let l=e[t[c]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|l,s+=r,s>=8&&(s-=8,o[u++]=255&a>>s)}if(s>=r||(255&a<<8-s)!==0)throw new SyntaxError("Unexpected end of data");return o}function w0(t,e,r){let n=e[e.length-1]==="=",i=(1<<r)-1,o="",s=0,a=0;for(let u=0;u<t.length;++u)for(a=a<<8|t[u],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s!==0&&(o+=e[i&a<<r-s]),n)for(;(o.length*r&7)!==0;)o+="=";return o}function b0(t){let e={};for(let r=0;r<t.length;++r)e[t[r]]=r;return e}function oe({name:t,prefix:e,bitsPerChar:r,alphabet:n}){let i=b0(n);return Sr({prefix:e,name:t,encode(o){return w0(o,n,r)},decode(o){return y0(o,i,r,t)}})}var m0=Ut({prefix:"9",name:"base10",alphabet:"0123456789"});var Ro={};ke(Ro,{base16:()=>g0,base16upper:()=>x0});var g0=oe({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),x0=oe({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var To={};ke(To,{base2:()=>E0});var E0=oe({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Bo={};ke(Bo,{base256emoji:()=>v0});var Xu=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),S0=Xu.reduce((t,e,r)=>(t[r]=e,t),[]),_0=Xu.reduce((t,e,r)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return t[n]=r,t},[]);function A0(t){return t.reduce((e,r)=>(e+=S0[r],e),"")}function I0(t){let e=[];for(let r of t){let n=r.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${r}`);let i=_0[n];if(i==null)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}var v0=Sr({prefix:"\u{1F680}",name:"base256emoji",encode:A0,decode:I0});var Lo={};ke(Lo,{base32:()=>wt,base32hex:()=>L0,base32hexpad:()=>N0,base32hexpadupper:()=>P0,base32hexupper:()=>C0,base32pad:()=>T0,base32padupper:()=>B0,base32upper:()=>R0,base32z:()=>U0});var wt=oe({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),R0=oe({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),T0=oe({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),B0=oe({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),L0=oe({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),C0=oe({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),N0=oe({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),P0=oe({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),U0=oe({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Co={};ke(Co,{base36:()=>zt,base36upper:()=>D0});var zt=Ut({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),D0=Ut({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var No={};ke(No,{base58btc:()=>ee,base58flickr:()=>O0});var ee=Ut({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),O0=Ut({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Uo={};ke(Uo,{base64:()=>k0,base64pad:()=>Po,base64url:()=>M0,base64urlpad:()=>F0});var k0=oe({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Po=oe({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),M0=oe({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),F0=oe({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Do={};ke(Do,{base8:()=>q0});var q0=oe({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Oo={};ke(Oo,{identity:()=>H0});var H0=Sr({prefix:"\0",name:"identity",encode:t=>zu(t),decode:t=>Vu(t)});var aS=new TextEncoder,uS=new TextDecoder;var Mo={};ke(Mo,{identity:()=>Ge});var W0=ec,Qu=128,j0=127,V0=~j0,z0=Math.pow(2,31);function ec(t,e,r){e=e||[],r=r||0;for(var n=r;t>=z0;)e[r++]=t&255|Qu,t/=128;for(;t&V0;)e[r++]=t&255|Qu,t>>>=7;return e[r]=t|0,ec.bytes=r-n+1,e}var G0=ko,Y0=128,Ju=127;function ko(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw ko.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&Ju)<<i:(s&Ju)*Math.pow(2,i),i+=7}while(s>=Y0);return ko.bytes=o-n,r}var Z0=Math.pow(2,7),X0=Math.pow(2,14),Q0=Math.pow(2,21),J0=Math.pow(2,28),ey=Math.pow(2,35),ty=Math.pow(2,42),ry=Math.pow(2,49),ny=Math.pow(2,56),iy=Math.pow(2,63),oy=function(t){return t<Z0?1:t<X0?2:t<Q0?3:t<J0?4:t<ey?5:t<ty?6:t<ry?7:t<ny?8:t<iy?9:10},sy={encode:W0,decode:G0,encodingLength:oy},ay=sy,an=ay;function un(t,e=0){return[an.decode(t,e),an.decode.bytes]}function _r(t,e,r=0){return an.encode(t,e,r),e}function Ar(t){return an.encodingLength(t)}function Gt(t,e){let r=e.byteLength,n=Ar(t),i=n+Ar(r),o=new Uint8Array(i+r);return _r(t,o,0),_r(r,o,n),o.set(e,i),new Ir(t,r,e,o)}function Yt(t){let e=yt(t),[r,n]=un(e),[i,o]=un(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ir(r,i,s,e)}function tc(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&ju(t.bytes,r.bytes)}}var Ir=class{code;size;digest;bytes;constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var rc=0,uy="identity",nc=yt;function cy(t){return Gt(rc,nc(t))}var Ge={code:rc,name:uy,encode:nc,digest:cy};var qo={};ke(qo,{sha256:()=>ln,sha512:()=>ly});function cn({name:t,code:e,encode:r}){return new Fo(t,e,r)}var Fo=class{name;code;encode;constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Gt(this.code,r):r.then(n=>Gt(this.code,n))}else throw Error("Unknown type, must be binary type")}};function oc(t){return async e=>new Uint8Array(await crypto.subtle.digest(t,e))}var ln=cn({name:"sha2-256",code:18,encode:oc("SHA-256")}),ly=cn({name:"sha2-512",code:19,encode:oc("SHA-512")});function sc(t,e){let{bytes:r,version:n}=t;switch(n){case 0:return dy(r,Ho(t),e??ee.encoder);default:return hy(r,Ho(t),e??wt.encoder)}}var ac=new WeakMap;function Ho(t){let e=ac.get(t);if(e==null){let r=new Map;return ac.set(t,r),r}return e}var de=class t{code;version;multihash;bytes;"/";constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==fn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==py)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Gt(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n!=null&&e.code===n.code&&e.version===n.version&&tc(e.multihash,n.multihash)}toString(e){return sc(this,e)}toJSON(){return{"/":sc(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:o,bytes:s}=r;return new t(n,i,o,s??uc(n,i,o.bytes))}else if(r[yy]===!0){let{version:n,multihash:i,code:o}=r,s=Yt(i);return t.create(n,o,s)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==fn)throw new Error(`Version 0 CID must use dag-pb (code: ${fn}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=uc(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,fn,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=yt(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),s=new Ir(r.multihashCode,r.digestSize,o,i);return[r.version===0?t.createV0(s):t.createV1(r.codec,s),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[f,y]=un(e.subarray(r));return r+=y,f},i=n(),o=fn;if(i===18?(i=0,r=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,a=n(),u=n(),c=r+u,l=c-s;return{version:i,codec:o,multihashCode:a,digestSize:u,multihashSize:l,size:c}}static parse(e,r){let[n,i]=fy(e,r),o=t.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ho(o).set(n,e),o}};function fy(t,e){switch(t[0]){case"Q":{let r=e??ee;return[ee.prefix,r.decode(`${ee.prefix}${t}`)]}case ee.prefix:{let r=e??ee;return[ee.prefix,r.decode(t)]}case wt.prefix:{let r=e??wt;return[wt.prefix,r.decode(t)]}case zt.prefix:{let r=e??zt;return[zt.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function dy(t,e,r){let{prefix:n}=r;if(n!==ee.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let o=r.encode(t).slice(1);return e.set(n,o),o}else return i}function hy(t,e,r){let{prefix:n}=r,i=e.get(n);if(i==null){let o=r.encode(t);return e.set(n,o),o}else return i}var fn=112,py=18;function uc(t,e,r){let n=Ar(t),i=n+Ar(e),o=new Uint8Array(i+r.byteLength);return _r(t,o,0),_r(e,o,n),o.set(r,i),o}var yy=Symbol.for("@ipld/js-cid/CID");var dn={...Oo,...To,...Do,...vo,...Ro,...Lo,...Co,...No,...Uo,...Bo},LS={...qo,...Mo};function bt(t=0){return new Uint8Array(t)}function Pe(t=0){return new Uint8Array(t)}function lc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var cc=lc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),$o=lc("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=Pe(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),wy={utf8:cc,"utf-8":cc,hex:dn.base16,latin1:$o,ascii:$o,binary:$o,...dn},Qn=wy;function G(t,e="utf8"){let r=Qn[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return r.encoder.encode(t).substring(1)}function N(t){if(t!==void 0&&t!==N.REQUEST&&t!==N.RESPONSE)throw new Error("type must be REQUEST or RESPONSE");t===void 0||this.initialize(t),this.maxHeaderSize=N.maxHeaderSize}N.prototype.initialize=function(t,e){if(t!==N.REQUEST&&t!==N.RESPONSE)throw new Error("type must be REQUEST or RESPONSE");this.type=t,this.state=t+"_LINE",this.info={headers:[],upgrade:!1},this.trailers=[],this.line="",this.isChunked=!1,this.connection="",this.headerSize=0,this.body_bytes=null,this.isUserCall=!1,this.hadError=!1};N.encoding="ascii";N.maxHeaderSize=80*1024;N.REQUEST="REQUEST";N.RESPONSE="RESPONSE";var fc=N.kOnHeaders=1,Ko=N.kOnHeadersComplete=2,Jn=N.kOnBody=3,Wo=N.kOnMessageComplete=4;N.prototype[fc]=N.prototype[Ko]=N.prototype[Jn]=N.prototype[Wo]=function(){};var dc=!0;Object.defineProperty(N,"kOnExecute",{get:function(){return dc=!1,99}});var hc=N.methods=["DELETE","GET","HEAD","POST","PUT","CONNECT","OPTIONS","TRACE","COPY","LOCK","MKCOL","MOVE","PROPFIND","PROPPATCH","SEARCH","UNLOCK","BIND","REBIND","UNBIND","ACL","REPORT","MKACTIVITY","CHECKOUT","MERGE","M-SEARCH","NOTIFY","SUBSCRIBE","UNSUBSCRIBE","PATCH","PURGE","MKCALENDAR","LINK","UNLINK","SOURCE"],pc=hc.indexOf("CONNECT");N.prototype.reinitialize=N;N.prototype.close=N.prototype.pause=N.prototype.resume=N.prototype.remove=N.prototype.free=function(){};N.prototype._compatMode0_11=!1;N.prototype.getAsyncId=function(){return 0};var by={REQUEST_LINE:!0,RESPONSE_LINE:!0,HEADER:!0};N.prototype.execute=function(t,e,r){if(!(this instanceof N))throw new TypeError("not a HTTPParser");e=e||0,r=typeof r=="number"?r:t.length,this.chunk=t,this.offset=e;var n=this.end=e+r;try{for(;this.offset<n&&!this[this.state](););}catch(i){if(this.isUserCall)throw i;return this.hadError=!0,i}return this.chunk=null,r=this.offset-e,by[this.state]&&(this.headerSize+=r,this.headerSize>(this.maxHeaderSize||N.maxHeaderSize))?new Error("max header size exceeded"):r};var my={REQUEST_LINE:!0,RESPONSE_LINE:!0,BODY_RAW:!0};N.prototype.finish=function(){if(!this.hadError){if(!my[this.state])return new Error("invalid state for EOF");this.state==="BODY_RAW"&&this.userCall()(this[Wo]())}};N.prototype.consume=N.prototype.unconsume=N.prototype.getCurrentBuffer=function(){};N.prototype.userCall=function(){this.isUserCall=!0;var t=this;return function(e){return t.isUserCall=!1,e}};N.prototype.nextRequest=function(){this.userCall()(this[Wo]()),this.reinitialize(this.type)};N.prototype.consumeLine=function(){for(var t=this.end,e=this.chunk,r=this.offset;r<t;r++)if(e[r]===10){var n=this.line+G(e.subarray(this.offset,r),N.encoding);return n.charAt(n.length-1)==="\r"&&(n=n.substr(0,n.length-1)),this.line="",this.offset=r+1,n}this.line+=G(e.subarray(this.offset,this.end),N.encoding),this.offset=this.end};var gy=/^([^: \t]+):[ \t]*((?:.*[^ \t])|)/,xy=/^[ \t]+(.*[^ \t])/;N.prototype.parseHeader=function(t,e){if(t.indexOf("\r")!==-1)throw ei("HPE_LF_EXPECTED");var r=gy.exec(t),n=r&&r[1];if(n)e.push(n),e.push(r[2]);else{var i=xy.exec(t);i&&e.length&&(e[e.length-1]&&(e[e.length-1]+=" "),e[e.length-1]+=i[1])}};var Ey=/^([A-Z-]+) ([^ ]+) HTTP\/(\d)\.(\d)$/;N.prototype.REQUEST_LINE=function(){var t=this.consumeLine();if(t){var e=Ey.exec(t);if(e===null)throw ei("HPE_INVALID_CONSTANT");if(this.info.method=this._compatMode0_11?e[1]:hc.indexOf(e[1]),this.info.method===-1)throw new Error("invalid request method");this.info.url=e[2],this.info.versionMajor=+e[3],this.info.versionMinor=+e[4],this.body_bytes=0,this.state="HEADER"}};var Sy=/^HTTP\/(\d)\.(\d) (\d{3}) ?(.*)$/;N.prototype.RESPONSE_LINE=function(){var t=this.consumeLine();if(t){var e=Sy.exec(t);if(e===null)throw ei("HPE_INVALID_CONSTANT");this.info.versionMajor=+e[1],this.info.versionMinor=+e[2];var r=this.info.statusCode=+e[3];this.info.statusMessage=e[4],((r/100|0)===1||r===204||r===304)&&(this.body_bytes=0),this.state="HEADER"}};N.prototype.shouldKeepAlive=function(){if(this.info.versionMajor>0&&this.info.versionMinor>0){if(this.connection.indexOf("close")!==-1)return!1}else if(this.connection.indexOf("keep-alive")===-1)return!1;return!!(this.body_bytes!==null||this.isChunked)};N.prototype.HEADER=function(){var t=this.consumeLine();if(t!==void 0){var e=this.info;if(t)this.parseHeader(t,e.headers);else{for(var r=e.headers,n=!1,i,o=!1,s=0;s<r.length;s+=2)switch(r[s].toLowerCase()){case"transfer-encoding":this.isChunked=r[s+1].toLowerCase()==="chunked";break;case"content-length":if(i=+r[s+1],n){if(i!==this.body_bytes)throw ei("HPE_UNEXPECTED_CONTENT_LENGTH")}else n=!0,this.body_bytes=i;break;case"connection":this.connection+=r[s+1].toLowerCase();break;case"upgrade":o=!0;break}this.isChunked&&n&&(n=!1,this.body_bytes=null),o&&this.connection.indexOf("upgrade")!=-1?e.upgrade=this.type===N.REQUEST||e.statusCode===101:e.upgrade=e.method===pc,this.isChunked&&e.upgrade&&(this.isChunked=!1),e.shouldKeepAlive=this.shouldKeepAlive();var a;if(dc?a=this.userCall()(this[Ko](e)):a=this.userCall()(this[Ko](e.versionMajor,e.versionMinor,e.headers,e.method,e.url,e.statusCode,e.statusMessage,e.upgrade,e.shouldKeepAlive)),a===2)return this.nextRequest(),!0;if(this.isChunked&&!a)this.state="BODY_CHUNKHEAD";else{if(a||this.body_bytes===0)return this.nextRequest(),e.upgrade;this.body_bytes===null?this.state="BODY_RAW":this.state="BODY_SIZED"}}}};N.prototype.BODY_CHUNKHEAD=function(){var t=this.consumeLine();t!==void 0&&(this.body_bytes=parseInt(t,16),this.body_bytes?this.state="BODY_CHUNK":this.state="BODY_CHUNKTRAILERS")};N.prototype.BODY_CHUNK=function(){var t=Math.min(this.end-this.offset,this.body_bytes);this.userCall()(this[Jn](this.chunk.slice(this.offset,this.offset+t),0,t)),this.offset+=t,this.body_bytes-=t,this.body_bytes||(this.state="BODY_CHUNKEMPTYLINE")};N.prototype.BODY_CHUNKEMPTYLINE=function(){var t=this.consumeLine();if(t!==void 0){if(t!=="")throw new Error("Expected empty line");this.state="BODY_CHUNKHEAD"}};N.prototype.BODY_CHUNKTRAILERS=function(){var t=this.consumeLine();t!==void 0&&(t?this.parseHeader(t,this.trailers):(this.trailers.length&&this.userCall()(this[fc](this.trailers,"")),this.nextRequest()))};N.prototype.BODY_RAW=function(){this.userCall()(this[Jn](this.chunk.slice(this.offset,this.end),0,this.end-this.offset)),this.offset=this.end};N.prototype.BODY_SIZED=function(){var t=Math.min(this.end-this.offset,this.body_bytes);this.userCall()(this[Jn](this.chunk.slice(this.offset,this.offset+t),0,t)),this.offset+=t,this.body_bytes-=t,this.body_bytes||this.nextRequest()};["Headers","HeadersComplete","Body","MessageComplete"].forEach(function(t){var e=N["kOn"+t];Object.defineProperty(N.prototype,"on"+t,{get:function(){return this[e]},set:function(r){return this._compatMode0_11=!0,pc="CONNECT",this[e]=r}})});function ei(t){var e=new Error("Parse Error");return e.code=t,e}var ti=Symbol.for("@libp2p/peer-id");function yc(t){return!!t?.[ti]}var Me=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}},ri=class extends Error{static name="InvalidPublicKeyError";constructor(e="Invalid public key"){super(e),this.name="InvalidPublicKeyError"}};var ni=class extends Error{static name="InvalidCIDError";constructor(e="Invalid CID"){super(e),this.name="InvalidCIDError"}},ii=class extends Error{static name="InvalidMultihashError";constructor(e="Invalid Multihash"){super(e),this.name="InvalidMultihashError"}};var hn=class extends Error{static name="ProtocolError";constructor(e="Protocol error"){super(e),this.name="ProtocolError"}};var pn=class extends Error{static name="UnsupportedKeyTypeError";constructor(e="Unsupported key type"){super(e),this.name="UnsupportedKeyTypeError"}};function Fe(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function qe(t,e){e==null&&(e=t.reduce((i,o)=>i+o.length,0));let r=Pe(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var bc=Symbol.for("@achingbrain/uint8arraylist");function wc(t,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let r=0;for(let n of t){let i=r+n.byteLength;if(e<i)return{buf:n,index:e-r};r=i}throw new RangeError("index is out of bounds")}function oi(t){return!!t?.[bc]}var be=class t{bufs;length;[bc]=!0;constructor(...e){this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(oi(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(oi(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=wc(this.bufs,e);return r.buf[r.index]}set(e,r){let n=wc(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(r+n,e[n]);else if(oi(e))for(let n=0;n<e.length;n++)this.set(r+n,e.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0)){if(e===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return qe(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:qe(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),o=new t;return o.length=i,o.bufs=[...n],o}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:this.bufs,length:this.length};let n=[],i=0;for(let o=0;o<this.bufs.length;o++){let s=this.bufs[o],a=i,u=a+s.byteLength;if(i=u,e>=u)continue;let c=e>=a&&e<u,l=r>a&&r<=u;if(c&&l){if(e===a&&r===u){n.push(s);break}let f=e-a;n.push(s.subarray(f,f+(r-e)));break}if(c){if(e===0){n.push(s);continue}n.push(s.subarray(e-a));continue}if(l){if(r===u){n.push(s);break}n.push(s.subarray(0,r-a));break}n.push(s)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!oi(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let o=256,s=new Int32Array(o);for(let f=0;f<o;f++)s[f]=-1;for(let f=0;f<i;f++)s[n[f]]=f;let a=s,u=this.byteLength-n.byteLength,c=n.byteLength-1,l;for(let f=r;f<=u;f+=l){l=0;for(let y=c;y>=0;y--){let p=this.get(f+y);if(n[y]!==p){l=Math.max(1,y-a[p]);break}}if(l===0)return f}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=Pe(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=bt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=bt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=bt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=Pe(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=bt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=bt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=bt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=bt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=bt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;r<this.bufs.length;r++)if(!Fe(this.bufs[r],e.bufs[r]))return!1;return!0}static fromUint8Arrays(e,r){let n=new t;return n.bufs=e,r==null&&(r=e.reduce((i,o)=>i+o.byteLength,0)),n.length=r,n}};function he(t,e="utf8"){let r=Qn[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return r.decoder.decode(`${r.prefix}${t}`)}var _y=parseInt("11111",2),jo=parseInt("10000000",2),Ay=parseInt("01111111",2),mc={0:yn,1:yn,2:Iy,3:Ty,4:By,5:Ry,6:vy,16:yn,22:yn,48:yn};function Vo(t,e={offset:0}){let r=t[e.offset]&_y;if(e.offset++,mc[r]!=null)return mc[r](t,e);throw new Error("No decoder for tag "+r)}function wn(t,e){let r=0;if((t[e.offset]&jo)===jo){let n=t[e.offset]&Ay,i="0x";e.offset++;for(let o=0;o<n;o++,e.offset++)i+=t[e.offset].toString(16).padStart(2,"0");r=parseInt(i,16)}else r=t[e.offset],e.offset++;return r}function yn(t,e){wn(t,e);let r=[];for(;!(e.offset>=t.byteLength);){let n=Vo(t,e);if(n===null)break;r.push(n)}return r}function Iy(t,e){let r=wn(t,e),n=e.offset,i=e.offset+r,o=[];for(let s=n;s<i;s++)s===n&&t[s]===0||o.push(t[s]);return e.offset+=r,Uint8Array.from(o)}function vy(t,e){let r=wn(t,e),n=e.offset+r,i=t[e.offset];e.offset++;let o=0,s=0;i<40?(o=0,s=i):i<80?(o=1,s=i-40):(o=2,s=i-80);let a=`${o}.${s}`,u=[];for(;e.offset<n;){let c=t[e.offset];if(e.offset++,u.push(c&127),c<128){u.reverse();let l=0;for(let f=0;f<u.length;f++)l+=u[f]<<f*7;a+=`.${l}`,u=[]}}return a}function Ry(t,e){return e.offset++,null}function Ty(t,e){let r=wn(t,e),n=t[e.offset];e.offset++;let i=t.subarray(e.offset,e.offset+r-1);if(e.offset+=r,n!==0)throw new Error("Unused bits in bit string is unimplemented");return i}function By(t,e){let r=wn(t,e),n=t.subarray(e.offset,e.offset+r);return e.offset+=r,n}function Ly(t){let e=t.toString(16);e.length%2===1&&(e="0"+e);let r=new be;for(let n=0;n<e.length;n+=2)r.append(Uint8Array.from([parseInt(`${e[n]}${e[n+1]}`,16)]));return r}function zo(t){if(t.byteLength<128)return Uint8Array.from([t.byteLength]);let e=Ly(t.byteLength);return new be(Uint8Array.from([e.byteLength|jo]),e)}function gc(t){let e=new be,r=128;return(t.subarray()[0]&r)===r&&e.append(Uint8Array.from([0])),e.append(t),new be(Uint8Array.from([2]),zo(e),e)}function xc(t){let e=Uint8Array.from([0]),r=new be(e,t);return new be(Uint8Array.from([3]),zo(r),r)}function si(t,e=48){let r=new be;for(let n of t)r.append(n);return new be(Uint8Array.from([e]),zo(r),r)}async function Ec(t,e,r){let n=await crypto.subtle.importKey("jwk",t,{name:"ECDSA",namedCurve:t.crv??"P-256"},!1,["verify"]);return crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},n,e,r.subarray())}var Cy=Uint8Array.from([6,8,42,134,72,206,61,3,1,7]),Ny=Uint8Array.from([6,5,43,129,4,0,34]),Py=Uint8Array.from([6,5,43,129,4,0,35]),Uy={ext:!0,kty:"EC",crv:"P-256"},Dy={ext:!0,kty:"EC",crv:"P-384"},Oy={ext:!0,kty:"EC",crv:"P-521"},Go=32,Yo=48,Zo=66;function Sc(t){let e=Vo(t);return _c(e)}function _c(t){let e=t[1][1][0],r=1,n,i;if(e.byteLength===Go*2+1)return n=G(e.subarray(r,r+Go),"base64url"),i=G(e.subarray(r+Go),"base64url"),new vr({...Uy,key_ops:["verify"],x:n,y:i});if(e.byteLength===Yo*2+1)return n=G(e.subarray(r,r+Yo),"base64url"),i=G(e.subarray(r+Yo),"base64url"),new vr({...Dy,key_ops:["verify"],x:n,y:i});if(e.byteLength===Zo*2+1)return n=G(e.subarray(r,r+Zo),"base64url"),i=G(e.subarray(r+Zo),"base64url"),new vr({...Oy,key_ops:["verify"],x:n,y:i});throw new Me(`coordinates were wrong length, got ${e.byteLength}, expected 65, 97 or 133`)}function Ac(t){return si([gc(Uint8Array.from([1])),si([ky(t.crv)],160),si([xc(new be(Uint8Array.from([4]),he(t.x??"","base64url"),he(t.y??"","base64url")))],161)]).subarray()}function ky(t){if(t==="P-256")return Cy;if(t==="P-384")return Ny;if(t==="P-521")return Py;throw new Me(`Invalid curve ${t}`)}var vr=class{type="ECDSA";jwk;_raw;constructor(e){this.jwk=e}get raw(){return this._raw==null&&(this._raw=Ac(this.jwk)),this._raw}toMultihash(){return Ge.digest(Rr(this))}toCID(){return de.createV1(114,this.toMultihash())}toString(){return ee.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:Fe(this.raw,e.raw)}async verify(e,r){return Ec(this.jwk,r,e)}};var Xt=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function My(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ai(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Qt(t,...e){if(!My(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Ic(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");ai(t.outputLen),ai(t.blockLen)}function Br(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function vc(t,e){Qt(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function mt(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function ui(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Ye(t,e){return t<<32-e|t>>>e}function Rc(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function bn(t){return typeof t=="string"&&(t=Rc(t)),Qt(t),t}function Xo(...t){let e=0;for(let n=0;n<t.length;n++){let i=t[n];Qt(i),e+=i.length}let r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){let o=t[n];r.set(o,i),i+=o.length}return r}var Tr=class{};function Qo(t){let e=n=>t().update(bn(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function ci(t=32){if(Xt&&typeof Xt.getRandomValues=="function")return Xt.getRandomValues(new Uint8Array(t));if(Xt&&typeof Xt.randomBytes=="function")return Uint8Array.from(Xt.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}function Fy(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),u=n?4:0,c=n?0:4;t.setUint32(e+u,s,n),t.setUint32(e+c,a,n)}function Tc(t,e,r){return t&e^~t&r}function Bc(t,e,r){return t&e^t&r^e&r}var mn=class extends Tr{constructor(e,r,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=ui(this.buffer)}update(e){Br(this),e=bn(e),Qt(e);let{view:r,buffer:n,blockLen:i}=this,o=e.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let u=ui(e);for(;i<=o-s;s+=i)this.process(u,s);continue}n.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Br(this),vc(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:i,isLE:o}=this,{pos:s}=this;r[s++]=128,mt(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(n,0),s=0);for(let f=s;f<i;f++)r[f]=0;Fy(n,i-8,BigInt(this.length*8),o),this.process(n,0);let a=ui(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<c;f++)a.setUint32(4*f,l[f],o)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:i,finished:o,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=o,e.length=i,e.pos=a,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}},gt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var Se=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var li=BigInt(4294967295),Lc=BigInt(32);function qy(t,e=!1){return e?{h:Number(t&li),l:Number(t>>Lc&li)}:{h:Number(t>>Lc&li)|0,l:Number(t&li)|0}}function Cc(t,e=!1){let r=t.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){let{h:s,l:a}=qy(t[o],e);[n[o],i[o]]=[s,a]}return[n,i]}var Jo=(t,e,r)=>t>>>r,es=(t,e,r)=>t<<32-r|e>>>r,Jt=(t,e,r)=>t>>>r|e<<32-r,er=(t,e,r)=>t<<32-r|e>>>r,gn=(t,e,r)=>t<<64-r|e>>>r-32,xn=(t,e,r)=>t>>>r-32|e<<64-r;function rt(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var Nc=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Pc=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Uc=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Dc=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,Oc=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),kc=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;var $y=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Dt=new Uint32Array(64),ts=class extends mn{constructor(e=32){super(64,e,8,!1),this.A=gt[0]|0,this.B=gt[1]|0,this.C=gt[2]|0,this.D=gt[3]|0,this.E=gt[4]|0,this.F=gt[5]|0,this.G=gt[6]|0,this.H=gt[7]|0}get(){let{A:e,B:r,C:n,D:i,E:o,F:s,G:a,H:u}=this;return[e,r,n,i,o,s,a,u]}set(e,r,n,i,o,s,a,u){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=u|0}process(e,r){for(let f=0;f<16;f++,r+=4)Dt[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){let y=Dt[f-15],p=Dt[f-2],g=Ye(y,7)^Ye(y,18)^y>>>3,h=Ye(p,17)^Ye(p,19)^p>>>10;Dt[f]=h+Dt[f-7]+g+Dt[f-16]|0}let{A:n,B:i,C:o,D:s,E:a,F:u,G:c,H:l}=this;for(let f=0;f<64;f++){let y=Ye(a,6)^Ye(a,11)^Ye(a,25),p=l+y+Tc(a,u,c)+$y[f]+Dt[f]|0,h=(Ye(n,2)^Ye(n,13)^Ye(n,22))+Bc(n,i,o)|0;l=c,c=u,u=a,a=s+p|0,s=o,o=i,i=n,n=p+h|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,u=u+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,i,o,s,a,u,c,l)}roundClean(){mt(Dt)}destroy(){this.set(0,0,0,0,0,0,0,0),mt(this.buffer)}};var Mc=Cc(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ky=Mc[0],Wy=Mc[1],Ot=new Uint32Array(80),kt=new Uint32Array(80),rs=class extends mn{constructor(e=64){super(128,e,16,!1),this.Ah=Se[0]|0,this.Al=Se[1]|0,this.Bh=Se[2]|0,this.Bl=Se[3]|0,this.Ch=Se[4]|0,this.Cl=Se[5]|0,this.Dh=Se[6]|0,this.Dl=Se[7]|0,this.Eh=Se[8]|0,this.El=Se[9]|0,this.Fh=Se[10]|0,this.Fl=Se[11]|0,this.Gh=Se[12]|0,this.Gl=Se[13]|0,this.Hh=Se[14]|0,this.Hl=Se[15]|0}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:o,Cl:s,Dh:a,Dl:u,Eh:c,El:l,Fh:f,Fl:y,Gh:p,Gl:g,Hh:h,Hl:T}=this;return[e,r,n,i,o,s,a,u,c,l,f,y,p,g,h,T]}set(e,r,n,i,o,s,a,u,c,l,f,y,p,g,h,T){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=u|0,this.Eh=c|0,this.El=l|0,this.Fh=f|0,this.Fl=y|0,this.Gh=p|0,this.Gl=g|0,this.Hh=h|0,this.Hl=T|0}process(e,r){for(let E=0;E<16;E++,r+=4)Ot[E]=e.getUint32(r),kt[E]=e.getUint32(r+=4);for(let E=16;E<80;E++){let d=Ot[E-15]|0,m=kt[E-15]|0,B=Jt(d,m,1)^Jt(d,m,8)^Jo(d,m,7),R=er(d,m,1)^er(d,m,8)^es(d,m,7),L=Ot[E-2]|0,C=kt[E-2]|0,M=Jt(L,C,19)^gn(L,C,61)^Jo(L,C,6),D=er(L,C,19)^xn(L,C,61)^es(L,C,6),F=Uc(R,D,kt[E-7],kt[E-16]),P=Dc(F,B,M,Ot[E-7],Ot[E-16]);Ot[E]=P|0,kt[E]=F|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:a,Cl:u,Dh:c,Dl:l,Eh:f,El:y,Fh:p,Fl:g,Gh:h,Gl:T,Hh:S,Hl:U}=this;for(let E=0;E<80;E++){let d=Jt(f,y,14)^Jt(f,y,18)^gn(f,y,41),m=er(f,y,14)^er(f,y,18)^xn(f,y,41),B=f&p^~f&h,R=y&g^~y&T,L=Oc(U,m,R,Wy[E],kt[E]),C=kc(L,S,d,B,Ky[E],Ot[E]),M=L|0,D=Jt(n,i,28)^gn(n,i,34)^gn(n,i,39),F=er(n,i,28)^xn(n,i,34)^xn(n,i,39),P=n&o^n&a^o&a,ce=i&s^i&u^s&u;S=h|0,U=T|0,h=p|0,T=g|0,p=f|0,g=y|0,{h:f,l:y}=rt(c|0,l|0,C|0,M|0),c=a|0,l=u|0,a=o|0,u=s|0,o=n|0,s=i|0;let I=Nc(M,F,ce);n=Pc(I,C,D,P),i=I|0}({h:n,l:i}=rt(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=rt(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l:u}=rt(this.Ch|0,this.Cl|0,a|0,u|0),{h:c,l}=rt(this.Dh|0,this.Dl|0,c|0,l|0),{h:f,l:y}=rt(this.Eh|0,this.El|0,f|0,y|0),{h:p,l:g}=rt(this.Fh|0,this.Fl|0,p|0,g|0),{h,l:T}=rt(this.Gh|0,this.Gl|0,h|0,T|0),{h:S,l:U}=rt(this.Hh|0,this.Hl|0,S|0,U|0),this.set(n,i,o,s,a,u,c,l,f,y,p,g,h,T,S,U)}roundClean(){mt(Ot,kt)}destroy(){mt(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var Fc=Qo(()=>new ts);var qc=Qo(()=>new rs);var ss=BigInt(0),os=BigInt(1);function Lr(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function as(t){if(!Lr(t))throw new Error("Uint8Array expected")}function nt(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function En(t){let e=t.toString(16);return e.length&1?"0"+e:e}function Kc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?ss:BigInt("0x"+t)}var Wc=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",jy=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Mt(t){if(as(t),Wc)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=jy[t[r]];return e}var xt={_0:48,_9:57,A:65,F:70,a:97,f:102};function Hc(t){if(t>=xt._0&&t<=xt._9)return t-xt._0;if(t>=xt.A&&t<=xt.F)return t-(xt.A-10);if(t>=xt.a&&t<=xt.f)return t-(xt.a-10)}function Sn(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(Wc)return Uint8Array.fromHex(t);let e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Hc(t.charCodeAt(o)),a=Hc(t.charCodeAt(o+1));if(s===void 0||a===void 0){let u=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+o)}n[i]=s*16+a}return n}function Et(t){return Kc(Mt(t))}function tr(t){return as(t),Kc(Mt(Uint8Array.from(t).reverse()))}function rr(t,e){return Sn(t.toString(16).padStart(e*2,"0"))}function Cr(t,e){return rr(t,e).reverse()}function te(t,e,r){let n;if(typeof e=="string")try{n=Sn(e)}catch(o){throw new Error(t+" must be hex string or Uint8Array, cause: "+o)}else if(Lr(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");let i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}function Ft(...t){let e=0;for(let n=0;n<t.length;n++){let i=t[n];as(i),e+=i.length}let r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){let o=t[n];r.set(o,i),i+=o.length}return r}var ns=t=>typeof t=="bigint"&&ss<=t;function fi(t,e,r){return ns(t)&&ns(e)&&ns(r)&&e<=t&&t<r}function He(t,e,r,n){if(!fi(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function jc(t){let e;for(e=0;t>ss;t>>=os,e+=1);return e}var nr=t=>(os<<BigInt(t))-os,is=t=>new Uint8Array(t),$c=t=>Uint8Array.from(t);function Vc(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=is(t),i=is(t),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...f)=>r(i,n,...f),u=(f=is(0))=>{i=a($c([0]),f),n=a(),f.length!==0&&(i=a($c([1]),f),n=a())},c=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,y=[];for(;f<e;){n=a();let p=n.slice();y.push(p),f+=n.length}return Ft(...y)};return(f,y)=>{s(),u(f);let p;for(;!(p=y(c()));)u();return s(),p}}var Vy={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Lr(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function St(t,e,r={}){let n=(i,o,s)=>{let a=Vy[o];if(typeof a!="function")throw new Error("invalid validator function");let u=t[i];if(!(s&&u===void 0)&&!a(u,t))throw new Error("param "+String(i)+" is invalid. Expected "+o+", got "+u)};for(let[i,o]of Object.entries(e))n(i,o,!1);for(let[i,o]of Object.entries(r))n(i,o,!0);return t}function Nr(t){let e=new WeakMap;return(r,...n)=>{let i=e.get(r);if(i!==void 0)return i;let o=t(r,...n);return e.set(r,o),o}}var Be=BigInt(0),me=BigInt(1),ir=BigInt(2),zy=BigInt(3),Gc=BigInt(4),Yc=BigInt(5),Zc=BigInt(8);function X(t,e){let r=t%e;return r>=Be?r:e+r}function re(t,e,r){let n=t;for(;e-- >Be;)n*=n,n%=r;return n}function di(t,e){if(t===Be)throw new Error("invert: expected non-zero number");if(e<=Be)throw new Error("invert: expected positive modulus, got "+e);let r=X(t,e),n=e,i=Be,o=me,s=me,a=Be;for(;r!==Be;){let c=n/r,l=n%r,f=i-s*c,y=o-a*c;n=r,r=l,i=s,o=a,s=f,a=y}if(n!==me)throw new Error("invert: does not exist");return X(i,e)}function Xc(t,e){let r=(t.ORDER+me)/Gc,n=t.pow(e,r);if(!t.eql(t.sqr(n),e))throw new Error("Cannot find square root");return n}function Gy(t,e){let r=(t.ORDER-Yc)/Zc,n=t.mul(e,ir),i=t.pow(n,r),o=t.mul(e,i),s=t.mul(t.mul(o,ir),i),a=t.mul(o,t.sub(s,t.ONE));if(!t.eql(t.sqr(a),e))throw new Error("Cannot find square root");return a}function Yy(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-me,r=0;for(;e%ir===Be;)e/=ir,r++;let n=ir,i=_t(t);for(;zc(i,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return Xc;let o=i.pow(n,e),s=(e+me)/ir;return function(u,c){if(u.is0(c))return c;if(zc(u,c)!==1)throw new Error("Cannot find square root");let l=r,f=u.mul(u.ONE,o),y=u.pow(c,e),p=u.pow(c,s);for(;!u.eql(y,u.ONE);){if(u.is0(y))return u.ZERO;let g=1,h=u.sqr(y);for(;!u.eql(h,u.ONE);)if(g++,h=u.sqr(h),g===l)throw new Error("Cannot find square root");let T=me<<BigInt(l-g-1),S=u.pow(f,T);l=g,f=u.sqr(S),y=u.mul(y,f),p=u.mul(p,S)}return p}}function Zy(t){return t%Gc===zy?Xc:t%Zc===Yc?Gy:Yy(t)}var Qc=(t,e)=>(X(t,e)&me)===me,Xy=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function us(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Xy.reduce((n,i)=>(n[i]="function",n),e);return St(t,r)}function Qy(t,e,r){if(r<Be)throw new Error("invalid exponent, negatives unsupported");if(r===Be)return t.ONE;if(r===me)return e;let n=t.ONE,i=e;for(;r>Be;)r&me&&(n=t.mul(n,i)),i=t.sqr(i),r>>=me;return n}function Pr(t,e,r=!1){let n=new Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((s,a,u)=>t.is0(a)?s:(n[u]=s,t.mul(s,a)),t.ONE),o=t.inv(i);return e.reduceRight((s,a,u)=>t.is0(a)?s:(n[u]=t.mul(s,n[u]),t.mul(s,a)),o),n}function zc(t,e){let r=(t.ORDER-me)/ir,n=t.pow(e,r),i=t.eql(n,t.ONE),o=t.eql(n,t.ZERO),s=t.eql(n,t.neg(t.ONE));if(!i&&!o&&!s)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function cs(t,e){e!==void 0&&ai(e);let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function _t(t,e,r=!1,n={}){if(t<=Be)throw new Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:i,nByteLength:o}=cs(t,e);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s,a=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:o,MASK:nr(i),ZERO:Be,ONE:me,create:u=>X(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof u);return Be<=u&&u<t},is0:u=>u===Be,isOdd:u=>(u&me)===me,neg:u=>X(-u,t),eql:(u,c)=>u===c,sqr:u=>X(u*u,t),add:(u,c)=>X(u+c,t),sub:(u,c)=>X(u-c,t),mul:(u,c)=>X(u*c,t),pow:(u,c)=>Qy(a,u,c),div:(u,c)=>X(u*di(c,t),t),sqrN:u=>u*u,addN:(u,c)=>u+c,subN:(u,c)=>u-c,mulN:(u,c)=>u*c,inv:u=>di(u,t),sqrt:n.sqrt||(u=>(s||(s=Zy(t)),s(a,u))),toBytes:u=>r?Cr(u,o):rr(u,o),fromBytes:u=>{if(u.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+u.length);return r?tr(u):Et(u)},invertBatch:u=>Pr(a,u),cmov:(u,c,l)=>l?c:u});return Object.freeze(a)}function Jc(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function ls(t){let e=Jc(t);return e+Math.ceil(e/2)}function el(t,e,r=!1){let n=t.length,i=Jc(e),o=ls(e);if(n<16||n<o||n>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+n);let s=r?tr(t):Et(t),a=X(s,e-me)+me;return r?Cr(a,i):rr(a,i)}var tl=BigInt(0),ys=BigInt(1);function fs(t,e){let r=e.negate();return t?r:e}function nl(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function ds(t,e){nl(t,e);let r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t,o=nr(t),s=BigInt(t);return{windows:r,windowSize:n,mask:o,maxNumber:i,shiftBy:s}}function rl(t,e,r){let{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=r,a=Number(t&i),u=t>>s;a>n&&(a-=o,u+=ys);let c=e*n,l=c+Math.abs(a)-1,f=a===0,y=a<0,p=e%2!==0;return{nextN:u,offset:l,isZero:f,isNeg:y,isNegF:p,offsetF:c}}function Jy(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function ew(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}var hs=new WeakMap,il=new WeakMap;function ps(t){return il.get(t)||1}function hi(t,e){return{constTimeNegate:fs,hasPrecomputes(r){return ps(r)!==1},unsafeLadder(r,n,i=t.ZERO){let o=r;for(;n>tl;)n&ys&&(i=i.add(o)),o=o.double(),n>>=ys;return i},precomputeWindow(r,n){let{windows:i,windowSize:o}=ds(n,e),s=[],a=r,u=a;for(let c=0;c<i;c++){u=a,s.push(u);for(let l=1;l<o;l++)u=u.add(a),s.push(u);a=u.double()}return s},wNAF(r,n,i){let o=t.ZERO,s=t.BASE,a=ds(r,e);for(let u=0;u<a.windows;u++){let{nextN:c,offset:l,isZero:f,isNeg:y,isNegF:p,offsetF:g}=rl(i,u,a);i=c,f?s=s.add(fs(p,n[g])):o=o.add(fs(y,n[l]))}return{p:o,f:s}},wNAFUnsafe(r,n,i,o=t.ZERO){let s=ds(r,e);for(let a=0;a<s.windows&&i!==tl;a++){let{nextN:u,offset:c,isZero:l,isNeg:f}=rl(i,a,s);if(i=u,!l){let y=n[c];o=o.add(f?y.negate():y)}}return o},getPrecomputes(r,n,i){let o=hs.get(n);return o||(o=this.precomputeWindow(n,r),r!==1&&hs.set(n,i(o))),o},wNAFCached(r,n,i){let o=ps(r);return this.wNAF(o,this.getPrecomputes(o,r,i),n)},wNAFCachedUnsafe(r,n,i,o){let s=ps(r);return s===1?this.unsafeLadder(r,n,o):this.wNAFUnsafe(s,this.getPrecomputes(s,r,i),n,o)},setWindowSize(r,n){nl(n,e),il.set(r,n),hs.delete(r)}}}function pi(t,e,r,n){Jy(r,t),ew(n,e);let i=r.length,o=n.length;if(i!==o)throw new Error("arrays of points and scalars must have equal length");let s=t.ZERO,a=jc(BigInt(i)),u=1;a>12?u=a-3:a>4?u=a-2:a>0&&(u=2);let c=nr(u),l=new Array(Number(c)+1).fill(s),f=Math.floor((e.BITS-1)/u)*u,y=s;for(let p=f;p>=0;p-=u){l.fill(s);for(let h=0;h<o;h++){let T=n[h],S=Number(T>>BigInt(p)&c);l[S]=l[S].add(r[h])}let g=s;for(let h=l.length-1,T=s;h>0;h--)T=T.add(l[h]),g=g.add(T);if(y=y.add(g),p!==0)for(let h=0;h<u;h++)y=y.double()}return y}function _n(t){return us(t.Fp),St(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var it=BigInt(0),Le=BigInt(1),ol=BigInt(2),tw=BigInt(8),rw={zip215:!0};function nw(t){let e=_n(t);return St(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function sl(t){let e=nw(t),{Fp:r,n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:u}=e,c=ol<<BigInt(a*8)-Le,l=r.create,f=_t(e.n,e.nBitLength);function y(_,b){let x=r.sqr(_),v=r.sqr(b),k=r.add(r.mul(e.a,x),v),q=r.add(r.ONE,r.mul(e.d,r.mul(x,v)));return r.eql(k,q)}if(!y(e.Gx,e.Gy))throw new Error("bad curve params: generator point");let p=e.uvRatio||((_,b)=>{try{return{isValid:!0,value:r.sqrt(_*r.inv(b))}}catch{return{isValid:!1,value:it}}}),g=e.adjustScalarBytes||(_=>_),h=e.domain||((_,b,x)=>{if(nt("phflag",x),b.length||x)throw new Error("Contexts/pre-hash are not supported");return _});function T(_,b,x=!1){let v=x?Le:it;He("coordinate "+_,b,v,c)}function S(_){if(!(_ instanceof d))throw new Error("ExtendedPoint expected")}let U=Nr((_,b)=>{let{ex:x,ey:v,ez:k}=_,q=_.is0();b==null&&(b=q?tw:r.inv(k));let W=l(x*b),j=l(v*b),z=l(k*b);if(q)return{x:it,y:Le};if(z!==Le)throw new Error("invZ was invalid");return{x:W,y:j}}),E=Nr(_=>{let{a:b,d:x}=e;if(_.is0())throw new Error("bad point: ZERO");let{ex:v,ey:k,ez:q,et:W}=_,j=l(v*v),z=l(k*k),Z=l(q*q),le=l(Z*Z),se=l(j*b),Ee=l(Z*l(se+z)),Ne=l(le+l(x*l(j*z)));if(Ee!==Ne)throw new Error("bad point: equation left != right (1)");let we=l(v*k),Ae=l(q*W);if(we!==Ae)throw new Error("bad point: equation left != right (2)");return!0});class d{constructor(b,x,v,k){T("x",b),T("y",x),T("z",v,!0),T("t",k),this.ex=b,this.ey=x,this.ez=v,this.et=k,Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(b){if(b instanceof d)throw new Error("extended point not allowed");let{x,y:v}=b||{};return T("x",x),T("y",v),new d(x,v,Le,l(x*v))}static normalizeZ(b){let x=Pr(r,b.map(v=>v.ez));return b.map((v,k)=>v.toAffine(x[k])).map(d.fromAffine)}static msm(b,x){return pi(d,f,b,x)}_setWindowSize(b){R.setWindowSize(this,b)}assertValidity(){E(this)}equals(b){S(b);let{ex:x,ey:v,ez:k}=this,{ex:q,ey:W,ez:j}=b,z=l(x*j),Z=l(q*k),le=l(v*j),se=l(W*k);return z===Z&&le===se}is0(){return this.equals(d.ZERO)}negate(){return new d(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:b}=e,{ex:x,ey:v,ez:k}=this,q=l(x*x),W=l(v*v),j=l(ol*l(k*k)),z=l(b*q),Z=x+v,le=l(l(Z*Z)-q-W),se=z+W,Ee=se-j,Ne=z-W,we=l(le*Ee),Ae=l(se*Ne),Oe=l(le*Ne),ze=l(Ee*se);return new d(we,Ae,ze,Oe)}add(b){S(b);let{a:x,d:v}=e,{ex:k,ey:q,ez:W,et:j}=this,{ex:z,ey:Z,ez:le,et:se}=b,Ee=l(k*z),Ne=l(q*Z),we=l(j*v*se),Ae=l(W*le),Oe=l((k+q)*(z+Z)-Ee-Ne),ze=Ae-we,sn=Ae+we,Ku=l(Ne-x*Ee),t0=l(Oe*ze),r0=l(sn*Ku),n0=l(Oe*Ku),i0=l(ze*sn);return new d(t0,r0,i0,n0)}subtract(b){return this.add(b.negate())}wNAF(b){return R.wNAFCached(this,b,d.normalizeZ)}multiply(b){let x=b;He("scalar",x,Le,n);let{p:v,f:k}=this.wNAF(x);return d.normalizeZ([v,k])[0]}multiplyUnsafe(b,x=d.ZERO){let v=b;return He("scalar",v,it,n),v===it?B:this.is0()||v===Le?this:R.wNAFCachedUnsafe(this,v,d.normalizeZ,x)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return R.unsafeLadder(this,n).is0()}toAffine(b){return U(this,b)}clearCofactor(){let{h:b}=e;return b===Le?this:this.multiplyUnsafe(b)}static fromHex(b,x=!1){let{d:v,a:k}=e,q=r.BYTES;b=te("pointHex",b,q),nt("zip215",x);let W=b.slice(),j=b[q-1];W[q-1]=j&-129;let z=tr(W),Z=x?c:r.ORDER;He("pointHex.y",z,it,Z);let le=l(z*z),se=l(le-Le),Ee=l(v*le-k),{isValid:Ne,value:we}=p(se,Ee);if(!Ne)throw new Error("Point.fromHex: invalid y coordinate");let Ae=(we&Le)===Le,Oe=(j&128)!==0;if(!x&&we===it&&Oe)throw new Error("Point.fromHex: x=0 and x_0=1");return Oe!==Ae&&(we=l(-we)),d.fromAffine({x:we,y:z})}static fromPrivateKey(b){let{scalar:x}=M(b);return m.multiply(x)}toRawBytes(){let{x:b,y:x}=this.toAffine(),v=Cr(x,r.BYTES);return v[v.length-1]|=b&Le?128:0,v}toHex(){return Mt(this.toRawBytes())}}d.BASE=new d(e.Gx,e.Gy,Le,l(e.Gx*e.Gy)),d.ZERO=new d(it,Le,Le,it);let{BASE:m,ZERO:B}=d,R=hi(d,a*8);function L(_){return X(_,n)}function C(_){return L(tr(_))}function M(_){let b=r.BYTES;_=te("private key",_,b);let x=te("hashed private key",o(_),2*b),v=g(x.slice(0,b)),k=x.slice(b,2*b),q=C(v);return{head:v,prefix:k,scalar:q}}function D(_){let{head:b,prefix:x,scalar:v}=M(_),k=m.multiply(v),q=k.toRawBytes();return{head:b,prefix:x,scalar:v,point:k,pointBytes:q}}function F(_){return D(_).pointBytes}function P(_=Uint8Array.of(),...b){let x=Ft(...b);return C(o(h(x,te("context",_),!!i)))}function ce(_,b,x={}){_=te("message",_),i&&(_=i(_));let{prefix:v,scalar:k,pointBytes:q}=D(b),W=P(x.context,v,_),j=m.multiply(W).toRawBytes(),z=P(x.context,j,q,_),Z=L(W+z*k);He("signature.s",Z,it,n);let le=Ft(j,Cr(Z,r.BYTES));return te("result",le,r.BYTES*2)}let I=rw;function A(_,b,x,v=I){let{context:k,zip215:q}=v,W=r.BYTES;_=te("signature",_,2*W),b=te("message",b),x=te("publicKey",x,W),q!==void 0&&nt("zip215",q),i&&(b=i(b));let j=tr(_.slice(W,2*W)),z,Z,le;try{z=d.fromHex(x,q),Z=d.fromHex(_.slice(0,W),q),le=m.multiplyUnsafe(j)}catch{return!1}if(!q&&z.isSmallOrder())return!1;let se=P(k,Z.toRawBytes(),z.toRawBytes(),b);return Z.add(z.multiplyUnsafe(se)).subtract(le).clearCofactor().equals(d.ZERO)}return m._setWindowSize(8),{CURVE:e,getPublicKey:F,sign:ce,verify:A,ExtendedPoint:d,utils:{getExtendedPublicKey:D,randomPrivateKey:()=>s(r.BYTES),precompute(_=8,b=d.BASE){return b._setWindowSize(_),b.multiply(BigInt(3)),b}}}}var ws=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),al=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),G_=BigInt(0),iw=BigInt(1),ul=BigInt(2),Y_=BigInt(3),ow=BigInt(5),sw=BigInt(8);function aw(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=ws,a=t*t%o*t%o,u=re(a,ul,o)*a%o,c=re(u,iw,o)*t%o,l=re(c,ow,o)*c%o,f=re(l,e,o)*l%o,y=re(f,r,o)*f%o,p=re(y,n,o)*y%o,g=re(p,i,o)*p%o,h=re(g,i,o)*p%o,T=re(h,e,o)*l%o;return{pow_p_5_8:re(T,ul,o)*t%o,b2:a}}function uw(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function cw(t,e){let r=ws,n=X(e*e*e,r),i=X(n*n*e,r),o=aw(t*i).pow_p_5_8,s=X(t*n*o,r),a=X(e*s*s,r),u=s,c=X(s*al,r),l=a===t,f=a===X(-t,r),y=a===X(-t*al,r);return l&&(s=u),(f||y)&&(s=c),Qc(s,r)&&(s=X(-s,r)),{isValid:l||f,value:s}}var cl=_t(ws,void 0,!0),lw={a:cl.create(BigInt(-1)),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:cl,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:sw,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:qc,randomBytes:ci,adjustScalarBytes:uw,uvRatio:cw},ll=sl(lw);var yi=32;function fl(t,e,r){return ll.verify(e,r instanceof Uint8Array?r:r.subarray(),t)}var wi=class{type="Ed25519";raw;constructor(e){this.raw=bs(e,yi)}toMultihash(){return Ge.digest(Rr(this))}toCID(){return de.createV1(114,this.toMultihash())}toString(){return ee.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:Fe(this.raw,e.raw)}verify(e,r){return fl(this.raw,r,e)}};function hl(t){return t=bs(t,yi),new wi(t)}function bs(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new Me(`Key must be a Uint8Array of length ${e}, got ${t.length}`);return t}var dw=Math.pow(2,7),hw=Math.pow(2,14),pw=Math.pow(2,21),ms=Math.pow(2,28),gs=Math.pow(2,35),xs=Math.pow(2,42),Es=Math.pow(2,49),Y=128,Ie=127;function Ue(t){if(t<dw)return 1;if(t<hw)return 2;if(t<pw)return 3;if(t<ms)return 4;if(t<gs)return 5;if(t<xs)return 6;if(t<Es)return 7;if(Number.MAX_SAFE_INTEGER!=null&&t>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Ss(t,e,r=0){switch(Ue(t)){case 8:e[r++]=t&255|Y,t/=128;case 7:e[r++]=t&255|Y,t/=128;case 6:e[r++]=t&255|Y,t/=128;case 5:e[r++]=t&255|Y,t/=128;case 4:e[r++]=t&255|Y,t>>>=7;case 3:e[r++]=t&255|Y,t>>>=7;case 2:e[r++]=t&255|Y,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function yw(t,e,r=0){switch(Ue(t)){case 8:e.set(r++,t&255|Y),t/=128;case 7:e.set(r++,t&255|Y),t/=128;case 6:e.set(r++,t&255|Y),t/=128;case 5:e.set(r++,t&255|Y),t/=128;case 4:e.set(r++,t&255|Y),t>>>=7;case 3:e.set(r++,t&255|Y),t>>>=7;case 2:e.set(r++,t&255|Y),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function _s(t,e){let r=t[e],n=0;if(n+=r&Ie,r<Y||(r=t[e+1],n+=(r&Ie)<<7,r<Y)||(r=t[e+2],n+=(r&Ie)<<14,r<Y)||(r=t[e+3],n+=(r&Ie)<<21,r<Y)||(r=t[e+4],n+=(r&Ie)*ms,r<Y)||(r=t[e+5],n+=(r&Ie)*gs,r<Y)||(r=t[e+6],n+=(r&Ie)*xs,r<Y)||(r=t[e+7],n+=(r&Ie)*Es,r<Y))return n;throw new RangeError("Could not decode varint")}function ww(t,e){let r=t.get(e),n=0;if(n+=r&Ie,r<Y||(r=t.get(e+1),n+=(r&Ie)<<7,r<Y)||(r=t.get(e+2),n+=(r&Ie)<<14,r<Y)||(r=t.get(e+3),n+=(r&Ie)<<21,r<Y)||(r=t.get(e+4),n+=(r&Ie)*ms,r<Y)||(r=t.get(e+5),n+=(r&Ie)*gs,r<Y)||(r=t.get(e+6),n+=(r&Ie)*xs,r<Y)||(r=t.get(e+7),n+=(r&Ie)*Es,r<Y))return n;throw new RangeError("Could not decode varint")}function Ur(t,e,r=0){return e==null&&(e=Pe(Ue(t))),e instanceof Uint8Array?Ss(t,e,r):yw(t,e,r)}function or(t,e=0){return t instanceof Uint8Array?_s(t,e):ww(t,e)}var As=new Float32Array([-0]),qt=new Uint8Array(As.buffer);function yl(t,e,r){As[0]=t,e[r]=qt[0],e[r+1]=qt[1],e[r+2]=qt[2],e[r+3]=qt[3]}function wl(t,e){return qt[0]=t[e],qt[1]=t[e+1],qt[2]=t[e+2],qt[3]=t[e+3],As[0]}var Is=new Float64Array([-0]),ve=new Uint8Array(Is.buffer);function bl(t,e,r){Is[0]=t,e[r]=ve[0],e[r+1]=ve[1],e[r+2]=ve[2],e[r+3]=ve[3],e[r+4]=ve[4],e[r+5]=ve[5],e[r+6]=ve[6],e[r+7]=ve[7]}function ml(t,e){return ve[0]=t[e],ve[1]=t[e+1],ve[2]=t[e+2],ve[3]=t[e+3],ve[4]=t[e+4],ve[5]=t[e+5],ve[6]=t[e+6],ve[7]=t[e+7],Is[0]}var bw=BigInt(Number.MAX_SAFE_INTEGER),mw=BigInt(Number.MIN_SAFE_INTEGER),$e=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return sr;if(e<bw&&e>mw)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>gl&&(i=0n,++n>gl&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return sr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):sr}},sr=new $e(0,0);sr.toBigInt=function(){return 0n};sr.zzEncode=sr.zzDecode=function(){return this};sr.length=function(){return 1};var gl=4294967296n;function xl(t){let e=0,r=0;for(let n=0;n<t.length;++n)r=t.charCodeAt(n),r<128?e+=1:r<2048?e+=2:(r&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function El(t,e,r){if(r-e<1)return"";let i,o=[],s=0,a;for(;e<r;)a=t[e++],a<128?o[s++]=a:a>191&&a<224?o[s++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,o[s++]=55296+(a>>10),o[s++]=56320+(a&1023)):o[s++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,s>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i!=null?(s>0&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))}function vs(t,e,r){let n=r,i,o;for(let s=0;s<t.length;++s)i=t.charCodeAt(s),i<128?e[r++]=i:i<2048?(e[r++]=i>>6|192,e[r++]=i&63|128):(i&64512)===55296&&((o=t.charCodeAt(s+1))&64512)===56320?(i=65536+((i&1023)<<10)+(o&1023),++s,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function Ze(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function bi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Rs=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Ze(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Ze(this,4);return bi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Ze(this,4);return bi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Ze(this,4);let e=wl(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Ze(this,4);let e=ml(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw Ze(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return El(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Ze(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Ze(this);while((this.buf[this.pos++]&128)!==0);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new $e(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw Ze(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw Ze(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Ze(this,8);let e=bi(this.buf,this.pos+=4),r=bi(this.buf,this.pos+=4);return new $e(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=_s(this.buf,this.pos);return this.pos+=Ue(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Ts(t){return new Rs(t instanceof Uint8Array?t:t.subarray())}function mi(t,e,r){let n=Ts(t);return e.decode(n,void 0,r)}function Bs(t){let e=t??8192,r=e>>>1,n,i=e;return function(s){if(s<1||s>r)return Pe(s);i+s>e&&(n=Pe(e),i=0);let a=n.subarray(i,i+=s);return(i&7)!==0&&(i=(i|7)+1),a}}var ar=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function Ls(){}var Ns=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},gw=Bs();function xw(t){return globalThis.Buffer!=null?Pe(t):gw(t)}var In=class{len;head;tail;states;constructor(){this.len=0,this.head=new ar(Ls,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new ar(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Ps((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(gi,10,$e.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=$e.fromBigInt(e);return this._push(gi,r.length(),r)}uint64Number(e){return this._push(Ss,Ue(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=$e.fromBigInt(e).zzEncode();return this._push(gi,r.length(),r)}sint64Number(e){let r=$e.fromNumber(e).zzEncode();return this._push(gi,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Cs,1,e?1:0)}fixed32(e){return this._push(An,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=$e.fromBigInt(e);return this._push(An,4,r.lo)._push(An,4,r.hi)}fixed64Number(e){let r=$e.fromNumber(e);return this._push(An,4,r.lo)._push(An,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(yl,4,e)}double(e){return this._push(bl,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Cs,1,0):this.uint32(r)._push(Sw,r,e)}string(e){let r=xl(e);return r!==0?this.uint32(r)._push(vs,r,e):this._push(Cs,1,0)}fork(){return this.states=new Ns(this),this.head=this.tail=new ar(Ls,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new ar(Ls,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=xw(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Cs(t,e,r){e[r]=t&255}function Ew(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Ps=class extends ar{next;constructor(e,r){super(Ew,e,r),this.next=void 0}};function gi(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function An(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Sw(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(In.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(_w,e,t),this},In.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Aw,e,t),this});function _w(t,e,r){e.set(t,r)}function Aw(t,e,r){t.length<40?vs(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(he(t),r)}function Us(){return new In}function xi(t,e){let r=Us();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Dr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Dr||(Dr={}));function Ei(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ds(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(o,s){let a=e(o);s.int32(a)},n=function(o){let s=o.int32();return e(s)};return Ei("enum",Dr.VARINT,r,n)}function Si(t,e){return Ei("message",Dr.LENGTH_DELIMITED,t,e)}var Ke;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.secp256k1="secp256k1",t.ECDSA="ECDSA"})(Ke||(Ke={}));var Os;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.secp256k1=2]="secp256k1",t[t.ECDSA=3]="ECDSA"})(Os||(Os={}));(function(t){t.codec=()=>Ds(Os)})(Ke||(Ke={}));var vn;(function(t){let e;t.codec=()=>(e==null&&(e=Si((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ke.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n,i={})=>{let o={},s=n==null?r.len:r.pos+n;for(;r.pos<s;){let a=r.uint32();switch(a>>>3){case 1:{o.Type=Ke.codec().decode(r);break}case 2:{o.Data=r.bytes();break}default:{r.skipType(a&7);break}}}return o})),e),t.encode=r=>xi(r,t.codec()),t.decode=(r,n)=>mi(r,t.codec(),n)})(vn||(vn={}));var ks;(function(t){let e;t.codec=()=>(e==null&&(e=Si((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ke.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n,i={})=>{let o={},s=n==null?r.len:r.pos+n;for(;r.pos<s;){let a=r.uint32();switch(a>>>3){case 1:{o.Type=Ke.codec().decode(r);break}case 2:{o.Data=r.bytes();break}default:{r.skipType(a&7);break}}}return o})),e),t.encode=r=>xi(r,t.codec()),t.decode=(r,n)=>mi(r,t.codec(),n)})(ks||(ks={}));var Rn=class extends Error{constructor(e="An error occurred while verifying a message"){super(e),this.name="VerificationError"}};var _i=class extends Tr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,Ic(e);let n=bn(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?e.create().update(n).digest():n);for(let s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=e.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),mt(o)}update(e){return Br(this),this.iHash.update(e),this}digestInto(e){Br(this),Qt(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:i,destroyed:o,blockLen:s,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=s,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Ms=(t,e,r)=>new _i(t,e).update(r).digest();Ms.create=(t,e)=>new _i(t,e);function _l(t){t.lowS!==void 0&&nt("lowS",t.lowS),t.prehash!==void 0&&nt("prehash",t.prehash)}function vw(t){let e=_n(t);St(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...e})}var Hs=class extends Error{constructor(e=""){super(e)}},At={Err:Hs,_tlv:{encode:(t,e)=>{let{Err:r}=At;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");let n=e.length/2,i=En(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?En(i.length/2|128):"";return En(t)+o+i+e},decode(t,e){let{Err:r}=At,n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");let i=e[n++],o=!!(i&128),s=0;if(!o)s=i;else{let u=i&127;if(!u)throw new r("tlv.decode(long): indefinite length not supported");if(u>4)throw new r("tlv.decode(long): byte length is too big");let c=e.subarray(n,n+u);if(c.length!==u)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let l of c)s=s<<8|l;if(n+=u,s<128)throw new r("tlv.decode(long): not minimal encoding")}let a=e.subarray(n,n+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:e.subarray(n+s)}}},_int:{encode(t){let{Err:e}=At;if(t<It)throw new e("integer: negative integers are not allowed");let r=En(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=At;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Et(t)}},toSig(t){let{Err:e,_int:r,_tlv:n}=At,i=te("signature",t),{v:o,l:s}=n.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l:u}=n.decode(2,o),{v:c,l}=n.decode(2,u);if(l.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(c)}},hexFromSig(t){let{_tlv:e,_int:r}=At,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),o=n+i;return e.encode(48,o)}};function Fs(t,e){return Mt(rr(t,e))}var It=BigInt(0),ge=BigInt(1),X8=BigInt(2),qs=BigInt(3),Rw=BigInt(4);function Tw(t){let e=vw(t),{Fp:r}=e,n=_t(e.n,e.nBitLength),i=e.toBytes||((E,d,m)=>{let B=d.toAffine();return Ft(Uint8Array.from([4]),r.toBytes(B.x),r.toBytes(B.y))}),o=e.fromBytes||(E=>{let d=E.subarray(1),m=r.fromBytes(d.subarray(0,r.BYTES)),B=r.fromBytes(d.subarray(r.BYTES,2*r.BYTES));return{x:m,y:B}});function s(E){let{a:d,b:m}=e,B=r.sqr(E),R=r.mul(B,E);return r.add(r.add(R,r.mul(E,d)),m)}function a(E,d){let m=r.sqr(d),B=s(E);return r.eql(m,B)}if(!a(e.Gx,e.Gy))throw new Error("bad curve params: generator point");let u=r.mul(r.pow(e.a,qs),Rw),c=r.mul(r.sqr(e.b),BigInt(27));if(r.is0(r.add(u,c)))throw new Error("bad curve params: a or b");function l(E){return fi(E,ge,e.n)}function f(E){let{allowedPrivateKeyLengths:d,nByteLength:m,wrapPrivateKey:B,n:R}=e;if(d&&typeof E!="bigint"){if(Lr(E)&&(E=Mt(E)),typeof E!="string"||!d.includes(E.length))throw new Error("invalid private key");E=E.padStart(m*2,"0")}let L;try{L=typeof E=="bigint"?E:Et(te("private key",E,m))}catch{throw new Error("invalid private key, expected hex or "+m+" bytes, got "+typeof E)}return B&&(L=X(L,R)),He("private key",L,ge,R),L}function y(E){if(!(E instanceof h))throw new Error("ProjectivePoint expected")}let p=Nr((E,d)=>{let{px:m,py:B,pz:R}=E;if(r.eql(R,r.ONE))return{x:m,y:B};let L=E.is0();d==null&&(d=L?r.ONE:r.inv(R));let C=r.mul(m,d),M=r.mul(B,d),D=r.mul(R,d);if(L)return{x:r.ZERO,y:r.ZERO};if(!r.eql(D,r.ONE))throw new Error("invZ was invalid");return{x:C,y:M}}),g=Nr(E=>{if(E.is0()){if(e.allowInfinityPoint&&!r.is0(E.py))return;throw new Error("bad point: ZERO")}let{x:d,y:m}=E.toAffine();if(!r.isValid(d)||!r.isValid(m))throw new Error("bad point: x or y not FE");if(!a(d,m))throw new Error("bad point: equation left != right");if(!E.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(d,m,B){if(d==null||!r.isValid(d))throw new Error("x required");if(m==null||!r.isValid(m)||r.is0(m))throw new Error("y required");if(B==null||!r.isValid(B))throw new Error("z required");this.px=d,this.py=m,this.pz=B,Object.freeze(this)}static fromAffine(d){let{x:m,y:B}=d||{};if(!d||!r.isValid(m)||!r.isValid(B))throw new Error("invalid affine point");if(d instanceof h)throw new Error("projective point not allowed");let R=L=>r.eql(L,r.ZERO);return R(m)&&R(B)?h.ZERO:new h(m,B,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(d){let m=Pr(r,d.map(B=>B.pz));return d.map((B,R)=>B.toAffine(m[R])).map(h.fromAffine)}static fromHex(d){let m=h.fromAffine(o(te("pointHex",d)));return m.assertValidity(),m}static fromPrivateKey(d){return h.BASE.multiply(f(d))}static msm(d,m){return pi(h,n,d,m)}_setWindowSize(d){U.setWindowSize(this,d)}assertValidity(){g(this)}hasEvenY(){let{y:d}=this.toAffine();if(r.isOdd)return!r.isOdd(d);throw new Error("Field doesn't support isOdd")}equals(d){y(d);let{px:m,py:B,pz:R}=this,{px:L,py:C,pz:M}=d,D=r.eql(r.mul(m,M),r.mul(L,R)),F=r.eql(r.mul(B,M),r.mul(C,R));return D&&F}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:d,b:m}=e,B=r.mul(m,qs),{px:R,py:L,pz:C}=this,M=r.ZERO,D=r.ZERO,F=r.ZERO,P=r.mul(R,R),ce=r.mul(L,L),I=r.mul(C,C),A=r.mul(R,L);return A=r.add(A,A),F=r.mul(R,C),F=r.add(F,F),M=r.mul(d,F),D=r.mul(B,I),D=r.add(M,D),M=r.sub(ce,D),D=r.add(ce,D),D=r.mul(M,D),M=r.mul(A,M),F=r.mul(B,F),I=r.mul(d,I),A=r.sub(P,I),A=r.mul(d,A),A=r.add(A,F),F=r.add(P,P),P=r.add(F,P),P=r.add(P,I),P=r.mul(P,A),D=r.add(D,P),I=r.mul(L,C),I=r.add(I,I),P=r.mul(I,A),M=r.sub(M,P),F=r.mul(I,ce),F=r.add(F,F),F=r.add(F,F),new h(M,D,F)}add(d){y(d);let{px:m,py:B,pz:R}=this,{px:L,py:C,pz:M}=d,D=r.ZERO,F=r.ZERO,P=r.ZERO,ce=e.a,I=r.mul(e.b,qs),A=r.mul(m,L),O=r.mul(B,C),_=r.mul(R,M),b=r.add(m,B),x=r.add(L,C);b=r.mul(b,x),x=r.add(A,O),b=r.sub(b,x),x=r.add(m,R);let v=r.add(L,M);return x=r.mul(x,v),v=r.add(A,_),x=r.sub(x,v),v=r.add(B,R),D=r.add(C,M),v=r.mul(v,D),D=r.add(O,_),v=r.sub(v,D),P=r.mul(ce,x),D=r.mul(I,_),P=r.add(D,P),D=r.sub(O,P),P=r.add(O,P),F=r.mul(D,P),O=r.add(A,A),O=r.add(O,A),_=r.mul(ce,_),x=r.mul(I,x),O=r.add(O,_),_=r.sub(A,_),_=r.mul(ce,_),x=r.add(x,_),A=r.mul(O,x),F=r.add(F,A),A=r.mul(v,x),D=r.mul(b,D),D=r.sub(D,A),A=r.mul(b,O),P=r.mul(v,P),P=r.add(P,A),new h(D,F,P)}subtract(d){return this.add(d.negate())}is0(){return this.equals(h.ZERO)}wNAF(d){return U.wNAFCached(this,d,h.normalizeZ)}multiplyUnsafe(d){let{endo:m,n:B}=e;He("scalar",d,It,B);let R=h.ZERO;if(d===It)return R;if(this.is0()||d===ge)return this;if(!m||U.hasPrecomputes(this))return U.wNAFCachedUnsafe(this,d,h.normalizeZ);let{k1neg:L,k1:C,k2neg:M,k2:D}=m.splitScalar(d),F=R,P=R,ce=this;for(;C>It||D>It;)C&ge&&(F=F.add(ce)),D&ge&&(P=P.add(ce)),ce=ce.double(),C>>=ge,D>>=ge;return L&&(F=F.negate()),M&&(P=P.negate()),P=new h(r.mul(P.px,m.beta),P.py,P.pz),F.add(P)}multiply(d){let{endo:m,n:B}=e;He("scalar",d,ge,B);let R,L;if(m){let{k1neg:C,k1:M,k2neg:D,k2:F}=m.splitScalar(d),{p:P,f:ce}=this.wNAF(M),{p:I,f:A}=this.wNAF(F);P=U.constTimeNegate(C,P),I=U.constTimeNegate(D,I),I=new h(r.mul(I.px,m.beta),I.py,I.pz),R=P.add(I),L=ce.add(A)}else{let{p:C,f:M}=this.wNAF(d);R=C,L=M}return h.normalizeZ([R,L])[0]}multiplyAndAddUnsafe(d,m,B){let R=h.BASE,L=(M,D)=>D===It||D===ge||!M.equals(R)?M.multiplyUnsafe(D):M.multiply(D),C=L(this,m).add(L(d,B));return C.is0()?void 0:C}toAffine(d){return p(this,d)}isTorsionFree(){let{h:d,isTorsionFree:m}=e;if(d===ge)return!0;if(m)return m(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:d,clearCofactor:m}=e;return d===ge?this:m?m(h,this):this.multiplyUnsafe(e.h)}toRawBytes(d=!0){return nt("isCompressed",d),this.assertValidity(),i(h,this,d)}toHex(d=!0){return nt("isCompressed",d),Mt(this.toRawBytes(d))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let{endo:T,nBitLength:S}=e,U=hi(h,T?Math.ceil(S/2):S);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:l}}function Bw(t){let e=_n(t);return St(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Al(t){let e=Bw(t),{Fp:r,n,nByteLength:i,nBitLength:o}=e,s=r.BYTES+1,a=2*r.BYTES+1;function u(I){return X(I,n)}function c(I){return di(I,n)}let{ProjectivePoint:l,normPrivateKeyToScalar:f,weierstrassEquation:y,isWithinCurveOrder:p}=Tw({...e,toBytes(I,A,O){let _=A.toAffine(),b=r.toBytes(_.x),x=Ft;return nt("isCompressed",O),O?x(Uint8Array.from([A.hasEvenY()?2:3]),b):x(Uint8Array.from([4]),b,r.toBytes(_.y))},fromBytes(I){let A=I.length,O=I[0],_=I.subarray(1);if(A===s&&(O===2||O===3)){let b=Et(_);if(!fi(b,ge,r.ORDER))throw new Error("Point is not on curve");let x=y(b),v;try{v=r.sqrt(x)}catch(W){let j=W instanceof Error?": "+W.message:"";throw new Error("Point is not on curve"+j)}let k=(v&ge)===ge;return(O&1)===1!==k&&(v=r.neg(v)),{x:b,y:v}}else if(A===a&&O===4){let b=r.fromBytes(_.subarray(0,r.BYTES)),x=r.fromBytes(_.subarray(r.BYTES,2*r.BYTES));return{x:b,y:x}}else{let b=s,x=a;throw new Error("invalid Point, expected length of "+b+", or uncompressed "+x+", got "+A)}}});function g(I){let A=n>>ge;return I>A}function h(I){return g(I)?u(-I):I}let T=(I,A,O)=>Et(I.slice(A,O));class S{constructor(A,O,_){He("r",A,ge,n),He("s",O,ge,n),this.r=A,this.s=O,_!=null&&(this.recovery=_),Object.freeze(this)}static fromCompact(A){let O=i;return A=te("compactSignature",A,O*2),new S(T(A,0,O),T(A,O,2*O))}static fromDER(A){let{r:O,s:_}=At.toSig(te("DER",A));return new S(O,_)}assertValidity(){}addRecoveryBit(A){return new S(this.r,this.s,A)}recoverPublicKey(A){let{r:O,s:_,recovery:b}=this,x=R(te("msgHash",A));if(b==null||![0,1,2,3].includes(b))throw new Error("recovery id invalid");let v=b===2||b===3?O+e.n:O;if(v>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let k=(b&1)===0?"02":"03",q=l.fromHex(k+Fs(v,r.BYTES)),W=c(v),j=u(-x*W),z=u(_*W),Z=l.BASE.multiplyAndAddUnsafe(q,j,z);if(!Z)throw new Error("point at infinify");return Z.assertValidity(),Z}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return Sn(this.toDERHex())}toDERHex(){return At.hexFromSig(this)}toCompactRawBytes(){return Sn(this.toCompactHex())}toCompactHex(){let A=i;return Fs(this.r,A)+Fs(this.s,A)}}let U={isValidPrivateKey(I){try{return f(I),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{let I=ls(e.n);return el(e.randomBytes(I),e.n)},precompute(I=8,A=l.BASE){return A._setWindowSize(I),A.multiply(BigInt(3)),A}};function E(I,A=!0){return l.fromPrivateKey(I).toRawBytes(A)}function d(I){if(typeof I=="bigint")return!1;if(I instanceof l)return!0;let O=te("key",I).length,_=r.BYTES,b=_+1,x=2*_+1;if(!(e.allowedPrivateKeyLengths||i===b))return O===b||O===x}function m(I,A,O=!0){if(d(I)===!0)throw new Error("first arg must be private key");if(d(A)===!1)throw new Error("second arg must be public key");return l.fromHex(A).multiply(f(I)).toRawBytes(O)}let B=e.bits2int||function(I){if(I.length>8192)throw new Error("input is too large");let A=Et(I),O=I.length*8-o;return O>0?A>>BigInt(O):A},R=e.bits2int_modN||function(I){return u(B(I))},L=nr(o);function C(I){return He("num < 2^"+o,I,It,L),rr(I,i)}function M(I,A,O=D){if(["recovered","canonical"].some(se=>se in O))throw new Error("sign() legacy options not supported");let{hash:_,randomBytes:b}=e,{lowS:x,prehash:v,extraEntropy:k}=O;x==null&&(x=!0),I=te("msgHash",I),_l(O),v&&(I=te("prehashed msgHash",_(I)));let q=R(I),W=f(A),j=[C(W),C(q)];if(k!=null&&k!==!1){let se=k===!0?b(r.BYTES):k;j.push(te("extraEntropy",se))}let z=Ft(...j),Z=q;function le(se){let Ee=B(se);if(!p(Ee))return;let Ne=c(Ee),we=l.BASE.multiply(Ee).toAffine(),Ae=u(we.x);if(Ae===It)return;let Oe=u(Ne*u(Z+Ae*W));if(Oe===It)return;let ze=(we.x===Ae?0:2)|Number(we.y&ge),sn=Oe;return x&&g(Oe)&&(sn=h(Oe),ze^=1),new S(Ae,sn,ze)}return{seed:z,k2sig:le}}let D={lowS:e.lowS,prehash:!1},F={lowS:e.lowS,prehash:!1};function P(I,A,O=D){let{seed:_,k2sig:b}=M(I,A,O),x=e;return Vc(x.hash.outputLen,x.nByteLength,x.hmac)(_,b)}l.BASE._setWindowSize(8);function ce(I,A,O,_=F){let b=I;A=te("msgHash",A),O=te("publicKey",O);let{lowS:x,prehash:v,format:k}=_;if(_l(_),"strict"in _)throw new Error("options.strict was renamed to lowS");if(k!==void 0&&k!=="compact"&&k!=="der")throw new Error("format must be compact or der");let q=typeof b=="string"||Lr(b),W=!q&&!k&&typeof b=="object"&&b!==null&&typeof b.r=="bigint"&&typeof b.s=="bigint";if(!q&&!W)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let j,z;try{if(W&&(j=new S(b.r,b.s)),q){try{k!=="compact"&&(j=S.fromDER(b))}catch(ze){if(!(ze instanceof At.Err))throw ze}!j&&k!=="der"&&(j=S.fromCompact(b))}z=l.fromHex(O)}catch{return!1}if(!j||x&&j.hasHighS())return!1;v&&(A=e.hash(A));let{r:Z,s:le}=j,se=R(A),Ee=c(le),Ne=u(se*Ee),we=u(Z*Ee),Ae=l.BASE.multiplyAndAddUnsafe(z,Ne,we)?.toAffine();return Ae?u(Ae.x)===Z:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:m,sign:P,verify:ce,ProjectivePoint:l,Signature:S,utils:U}}function Lw(t){return{hash:t,hmac:(e,...r)=>Ms(t,e,Xo(...r)),randomBytes:ci}}function Il(t,e){let r=n=>Al({...t,...Lw(n)});return{...r(e),create:r}}var Tl=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),vl=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Cw=BigInt(0),Nw=BigInt(1),$s=BigInt(2),Rl=(t,e)=>(t+e/$s)/e;function Pw(t){let e=Tl,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),u=BigInt(88),c=t*t*t%e,l=c*c*t%e,f=re(l,r,e)*l%e,y=re(f,r,e)*l%e,p=re(y,$s,e)*c%e,g=re(p,i,e)*p%e,h=re(g,o,e)*g%e,T=re(h,a,e)*h%e,S=re(T,u,e)*T%e,U=re(S,a,e)*h%e,E=re(U,r,e)*l%e,d=re(E,s,e)*g%e,m=re(d,n,e)*c%e,B=re(m,$s,e);if(!Ks.eql(Ks.sqr(B),t))throw new Error("Cannot find square root");return B}var Ks=_t(Tl,void 0,void 0,{sqrt:Pw}),Or=Il({a:Cw,b:BigInt(7),Fp:Ks,n:vl,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=vl,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Nw*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),a=Rl(o*t,e),u=Rl(-n*t,e),c=X(t-a*r-u*i,e),l=X(-a*n-u*o,e),f=c>s,y=l>s;if(f&&(c=e-c),y&&(l=e-l),c>s||l>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:y,k2:l}}}},Fc);function Bl(t){return t==null?!1:typeof t.then=="function"&&typeof t.catch=="function"&&typeof t.finally=="function"}function Ll(t,e,r){let n=ln.digest(r instanceof Uint8Array?r:r.subarray());if(Bl(n))return n.then(({digest:i})=>Or.verify(e,i,t)).catch(i=>{throw new Rn(String(i))});try{return Or.verify(e,n.digest,t)}catch(i){throw new Rn(String(i))}}var Ai=class{type="secp256k1";raw;_key;constructor(e){this._key=Nl(e),this.raw=Cl(this._key)}toMultihash(){return Ge.digest(Rr(this))}toCID(){return de.createV1(114,this.toMultihash())}toString(){return ee.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:Fe(this.raw,e.raw)}verify(e,r){return Ll(this._key,r,e)}};function Pl(t){return new Ai(t)}function Cl(t){return Or.ProjectivePoint.fromHex(t).toRawBytes(!0)}function Nl(t){try{return Or.ProjectivePoint.fromHex(t),t}catch(e){throw new ri(String(e))}}function Ul(t){let{Type:e,Data:r}=vn.decode(t.digest),n=r??new Uint8Array;switch(e){case Ke.Ed25519:return hl(n);case Ke.secp256k1:return Pl(n);case Ke.ECDSA:return Sc(n);default:throw new pn}}function Rr(t){return vn.encode({Type:Ke[t.type],Data:t.raw})}var Dl=Symbol.for("nodejs.util.inspect.custom"),Uw=114,Tn=class{type;multihash;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[ti]=!0;toString(){return this.string==null&&(this.string=ee.encode(this.multihash.bytes).slice(1)),this.string}toMultihash(){return this.multihash}toCID(){return de.createV1(Uw,this.multihash)}toJSON(){return this.toString()}equals(e){if(e==null)return!1;if(e instanceof Uint8Array)return Fe(this.multihash.bytes,e);if(typeof e=="string")return this.toString()===e;if(e?.toMultihash()?.bytes!=null)return Fe(this.multihash.bytes,e.toMultihash().bytes);throw new Error("not valid Id")}[Dl](){return`PeerId(${this.toString()})`}},Ii=class extends Tn{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},vi=class extends Tn{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.publicKey}},Ri=class extends Tn{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.publicKey}},Dw=2336,Bn=class{type="url";multihash;publicKey;url;constructor(e){this.url=e.toString(),this.multihash=Ge.digest(he(this.url))}[Dl](){return`PeerId(${this.url})`}[ti]=!0;toString(){return this.toCID().toString()}toMultihash(){return this.multihash}toCID(){return de.createV1(Dw,this.toMultihash())}toJSON(){return this.toString()}equals(e){return e==null?!1:(e instanceof Uint8Array&&(e=G(e)),e.toString()===this.toString())}};var Ow=114,Ol=2336;function kl(t,e){let r;if(t.charAt(0)==="1"||t.charAt(0)==="Q")r=Yt(ee.decode(`z${t}`));else{if(t.startsWith("k51qzi5uqu5")||t.startsWith("kzwfwjn5ji4")||t.startsWith("k2k4r8")||t.startsWith("bafz"))return kw(de.parse(t));if(e==null)throw new Me('Please pass a multibase decoder for strings that do not start with "1" or "Q"');r=Yt(e.decode(t))}return Ml(r)}function Ml(t){if(Fw(t))return new Ii({multihash:t});if(Mw(t))try{let e=Ul(t);if(e.type==="Ed25519")return new vi({multihash:t,publicKey:e});if(e.type==="secp256k1")return new Ri({multihash:t,publicKey:e})}catch{let r=G(t.digest);return new Bn(new URL(r))}throw new ii("Supplied PeerID Multihash is invalid")}function kw(t){if(t?.multihash==null||t.version==null||t.version===1&&t.code!==Ow&&t.code!==Ol)throw new ni("Supplied PeerID CID is invalid");if(t.code===Ol){let e=G(t.multihash.digest);return new Bn(new URL(e))}return Ml(t.multihash)}function Mw(t){return t.code===Ge.code}function Fw(t){return t.code===ln.code}var Ti=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let r=this.index,n=e();return n===void 0&&(this.index=r),n}parseWith(e){let r=e();if(this.index===this.input.length)return r}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let r=this.readChar();if(r===e)return r})}readSeparator(e,r,n){return this.readAtomically(()=>{if(!(r>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,r,n,i){return this.readAtomically(()=>{let o=0,s=0,a=this.peekChar();if(a===void 0)return;let u=a==="0",c=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let f=this.readChar();if(f===void 0)return;let y=Number.parseInt(f,e);if(!Number.isNaN(y))return y});if(l===void 0)break;if(o*=e,o+=l,o>c||(s+=1,r!==void 0&&s>r))return}if(s!==0)return!n&&u&&s>1?void 0:o})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let r=0;r<e.length;r++){let n=this.readSeparator(".",r,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;e[r]=n}return e})}readIPv6Addr(){let e=r=>{for(let n=0;n<r.length/2;n++){let i=n*2;if(n<r.length-3){let s=this.readSeparator(":",n,()=>this.readIPv4Addr());if(s!==void 0)return r[i]=s[0],r[i+1]=s[1],r[i+2]=s[2],r[i+3]=s[3],[i+4,!0]}let o=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(o===void 0)return[i,!1];r[i]=o>>8,r[i+1]=o&255}return[r.length,!1]};return this.readAtomically(()=>{let r=new Uint8Array(16),[n,i]=e(r);if(n===16)return r;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let o=new Uint8Array(14),s=16-(n+2),[a]=e(o.subarray(0,s));return r.set(o.subarray(0,a),16-a),r})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Fl=45,qw=15,kr=new Ti;function Ws(t){if(!(t.length>qw))return kr.new(t).parseWith(()=>kr.readIPv4Addr())}function js(t){if(t.includes("%")&&(t=t.split("%")[0]),!(t.length>Fl))return kr.new(t).parseWith(()=>kr.readIPv6Addr())}function Bi(t,e=!1){if(t.includes("%")&&(t=t.split("%")[0]),t.length>Fl)return;let r=kr.new(t).parseWith(()=>kr.readIPAddr());if(r)return e&&r.length===4?Uint8Array.from([0,0,0,0,0,0,0,0,0,0,255,255,r[0],r[1],r[2],r[3]]):r}var m4=parseInt("0xFFFF",16),g4=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function $l(t){return!!Ws(t)}function Kl(t){return!!js(t)}function Li(t){return!!Bi(t)}var Wl=$l,jw=Kl,Vs=function(t){let e=0;if(t=t.toString().trim(),Wl(t)){let r=new Uint8Array(e+4);return t.split(/\./g).forEach(n=>{r[e++]=parseInt(n,10)&255}),r}if(jw(t)){let r=t.split(":",8),n;for(n=0;n<r.length;n++){let o=Wl(r[n]),s;o&&(s=Vs(r[n]),r[n]=G(s.slice(0,2),"base16")),s!=null&&++n<8&&r.splice(n,0,G(s.slice(2,4),"base16"))}if(r[0]==="")for(;r.length<8;)r.unshift("0");else if(r[r.length-1]==="")for(;r.length<8;)r.push("0");else if(r.length<8){for(n=0;n<r.length&&r[n]!=="";n++);let o=[n,1];for(n=9-r.length;n>0;n--)o.push("0");r.splice.apply(r,o)}let i=new Uint8Array(e+16);for(n=0;n<r.length;n++){let o=parseInt(r[n],16);i[e++]=o>>8&255,i[e++]=o&255}return i}throw new Error("invalid ip address")},jl=function(t,e=0,r){e=~~e,r=r??t.length-e;let n=new DataView(t.buffer);if(r===4){let i=[];for(let o=0;o<r;o++)i.push(t[e+o]);return i.join(".")}if(r===16){let i=[];for(let o=0;o<r;o+=2)i.push(n.getUint16(e+o).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Mr={},zs={},zw=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[481,-1,"http-path"],[777,-1,"memory"]];zw.forEach(t=>{let e=Gw(...t);zs[e.code]=e,Mr[e.name]=e});function Gw(t,e,r,n,i){return{code:t,size:e,name:r,resolvable:!!n,path:!!i}}function $(t){if(typeof t=="number"){if(zs[t]!=null)return zs[t];throw new Error(`no protocol with code: ${t}`)}else if(typeof t=="string"){if(Mr[t]!=null)return Mr[t];throw new Error(`no protocol with name: ${t}`)}throw new Error(`invalid protocol id type: ${typeof t}`)}var r6=$("ip4"),n6=$("ip6"),i6=$("ipcidr");function Xs(t,e){switch($(t).code){case 4:case 41:return Zw(e);case 42:return Zs(e);case 43:return G(e,"base10");case 6:case 273:case 33:case 132:return Gl(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Zs(e);case 421:return eb(e);case 444:return zl(e);case 445:return zl(e);case 466:return Jw(e);case 481:return globalThis.encodeURIComponent(Zs(e));default:return G(e,"base16")}}function Ci(t,e){switch($(t).code){case 4:return Vl(e);case 41:return Vl(e);case 42:return Ys(e);case 43:return he(e,"base10");case 6:case 273:case 33:case 132:return Qs(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Ys(e);case 421:return Xw(e);case 444:return tb(e);case 445:return rb(e);case 466:return Qw(e);case 481:return Ys(globalThis.decodeURIComponent(e));default:return he(e,"base16")}}var Gs=Object.values(dn).map(t=>t.decoder),Yw=function(){let t=Gs[0].or(Gs[1]);return Gs.slice(2).forEach(e=>t=t.or(e)),t}();function Vl(t){if(!Li(t))throw new Error("invalid ip address");return Vs(t)}function Zw(t){let e=jl(t,0,t.length);if(e==null)throw new Error("ipBuff is required");if(!Li(e))throw new Error("invalid ip address");return e}function Qs(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function Gl(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function Ys(t){let e=he(t),r=Uint8Array.from(Ur(e.length));return qe([r,e],r.length+e.length)}function Zs(t){let e=or(t);if(t=t.slice(Ue(e)),t.length!==e)throw new Error("inconsistent lengths");return G(t)}function Xw(t){let e;t[0]==="Q"||t[0]==="1"?e=Yt(ee.decode(`z${t}`)).bytes:e=de.parse(t).multihash.bytes;let r=Uint8Array.from(Ur(e.length));return qe([r,e],r.length+e.length)}function Qw(t){let e=Yw.decode(t),r=Uint8Array.from(Ur(e.length));return qe([r,e],r.length+e.length)}function Jw(t){let e=or(t),r=t.slice(Ue(e));if(r.length!==e)throw new Error("inconsistent lengths");return"u"+G(r,"base64url")}function eb(t){let e=or(t),r=t.slice(Ue(e));if(r.length!==e)throw new Error("inconsistent lengths");return G(r,"base58btc")}function tb(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let r=wt.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Qs(n);return qe([r,i],r.length+i.length)}function rb(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let r=wt.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Qs(n);return qe([r,i],r.length+i.length)}function zl(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),n=G(e,"base32"),i=Gl(r);return`${n}:${i}`}function Yl(t){t=Js(t);let e=[],r=[],n=null,i=t.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let o=0;o<i.length;o++){let s=i[o],a=$(s);if(a.size===0){e.push([a.code]),r.push([a.code]);continue}if(o++,o>=i.length)throw new Ni("invalid address: "+t);if(a.path===!0){n=Js(i.slice(o).join("/")),e.push([a.code,Ci(a.code,n)]),r.push([a.code,n]);break}let u=Ci(a.code,i[o]);e.push([a.code,u]),r.push([a.code,Xs(a.code,u)])}return{string:Xl(r),bytes:Ln(e),tuples:e,stringTuples:r,path:n}}function ea(t){let e=[],r=[],n=null,i=0;for(;i<t.length;){let o=or(t,i),s=Ue(o),a=$(o),u=nb(a,t.slice(i+s));if(u===0){e.push([o]),r.push([o]),i+=s;continue}let c=t.slice(i+s,i+s+u);if(i+=u+s,i>t.length)throw new Ni("Invalid address Uint8Array: "+G(t,"base16"));e.push([o,c]);let l=Xs(o,c);if(r.push([o,l]),a.path===!0){n=l;break}}return{bytes:Uint8Array.from(t),string:Xl(r),tuples:e,stringTuples:r,path:n}}function Zl(t){let e=[];return t.forEach(([r,n])=>{let i=[r];n!=null&&(i[1]=Ci(r,n)),e.push(i)}),e}function Xl(t){let e=[];return t.map(r=>{let n=$(r[0]);return e.push(n.name),r.length>1&&r[1]!=null&&e.push(r[1]),null}),Js(e.join("/"))}function Ln(t){return qe(t.map(e=>{let r=$(e[0]),n=Uint8Array.from(Ur(r.code));return e.length>1&&e[1]!=null&&(n=qe([n,e[1]])),n}))}function nb(t,e){if(t.size>0)return t.size/8;if(t.size===0)return 0;{let r=or(e instanceof Uint8Array?e:Uint8Array.from(e));return r+Ue(r)}}function Js(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}var Ni=class extends Error{static name="ParseError";name="ParseError";constructor(e){super(`Error parsing address: ${e}`)}};var ib=Symbol.for("nodejs.util.inspect.custom"),ra=Symbol.for("@multiformats/js-multiaddr/multiaddr"),ob=[$("dns").code,$("dns4").code,$("dns6").code,$("dnsaddr").code],ta=class extends Error{constructor(e="No available resolver"){super(e),this.name="NoAvailableResolverError"}},Pi=class t{bytes;#t;#e;#r;#n;[ra]=!0;constructor(e){e==null&&(e="");let r;if(e instanceof Uint8Array)r=ea(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);r=Yl(e)}else if(Ui(e))r=ea(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=r.bytes,this.#t=r.string,this.#e=r.tuples,this.#r=r.stringTuples,this.#n=r.path}toString(){return this.#t}toJSON(){return this.toString()}toOptions(){let e,r,n,i,o="",s=$("tcp"),a=$("udp"),u=$("ip4"),c=$("ip6"),l=$("dns6"),f=$("ip6zone");for(let[p,g]of this.stringTuples())p===f.code&&(o=`%${g??""}`),ob.includes(p)&&(r=s.name==="tcp"?"tcp":"udp",i=443,n=`${g??""}${o}`,e=p===l.code?6:4),(p===s.code||p===a.code)&&(r=$(p).name==="tcp"?"tcp":"udp",i=parseInt(g??"")),(p===u.code||p===c.code)&&(r=$(p).name==="tcp"?"tcp":"udp",n=`${g??""}${o}`,e=p===c.code?6:4);if(e==null||r==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:r,port:i}}protos(){return this.#e.map(([e])=>Object.assign({},$(e)))}protoCodes(){return this.#e.map(([e])=>e)}protoNames(){return this.#e.map(([e])=>$(e).name)}tuples(){return this.#e.map(([e,r])=>r==null?[e]:[e,r])}stringTuples(){return this.#r.map(([e,r])=>r==null?[e]:[e,r])}encapsulate(e){return e=new t(e),new t(this.toString()+e.toString())}decapsulate(e){let r=e.toString(),n=this.toString(),i=n.lastIndexOf(r);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new t(n.slice(0,i))}decapsulateCode(e){let r=this.tuples();for(let n=r.length-1;n>=0;n--)if(r[n][0]===e)return new t(Ln(r.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Mr.p2p.code&&e.push([n,i]),n===Mr["p2p-circuit"].code&&(e=[])});let r=e.pop();if(r?.[1]!=null){let n=r[1];return n[0]==="Q"||n[0]==="1"?G(ee.decode(`z${n}`),"base58btc"):G(de.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return Fe(this.bytes,e.bytes)}async resolve(e){let r=this.protos().find(o=>o.resolvable);if(r==null)return[this];let n=Ql.get(r.name);if(n==null)throw new ta(`no available resolver for ${r.name}`);return(await n(this,e)).map(o=>Xe(o))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let r=(e??this).protos();return!(r.length!==2||r[0].code!==4&&r[0].code!==41||r[1].code!==6&&r[1].code!==273)}[ib](){return`Multiaddr(${this.#t})`}};var Ql=new Map;function sb(t){return Xe(Ln(t))}function Jl(t){return sb(Zl(t))}function Ui(t){return!!t?.[ra]}function Xe(t){return new Pi(t)}var ab=[$("tcp").code,$("dns").code,$("dnsaddr").code,$("dns4").code,$("dns6").code];function ef(t){return nf("sni",t)?.[1]}function tf(t){let e=nf("tcp",t)?.[1];return e==null?"":`:${e}`}function nf(t,e){let r;try{r=$(t).code}catch{return}for(let[n,i]of e)if(n===r&&i!=null)return[n,i]}function rf(t){return t.some(([e,r])=>e===$("tls").code)}function Qe(t,e,r){let n=of[$(t).name];if(n==null)throw new Error(`Can't interpret protocol ${$(t).name}`);let i=n(e,r);return t===$("ip6").code?`[${i}]`:i}var of={ip4:(t,e)=>t,ip6:(t,e)=>e.length===0?t:`[${t}]`,tcp:(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");return`tcp://${Qe(r[0],r[1]??"",e)}:${t}`},udp:(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");return`udp://${Qe(r[0],r[1]??"",e)}:${t}`},dnsaddr:(t,e)=>t,dns4:(t,e)=>t,dns6:(t,e)=>t,dns:(t,e)=>t,ipfs:(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");return`${Qe(r[0],r[1]??"",e)}`},p2p:(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");return`${Qe(r[0],r[1]??"",e)}`},http:(t,e)=>{let r=rf(e),n=ef(e),i=tf(e);if(r&&n!=null)return`https://${n}${i}`;let o=r?"https://":"http://",s=e.pop();if(s==null)throw new Error("Unexpected end of multiaddr");let a=Qe(s[0],s[1]??"",e);return a=a.replace("tcp://",""),`${o}${a}`},"http-path":(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");let n=Qe(r[0],r[1]??"",e),i=decodeURIComponent(t);return`${n}/${i}`},tls:(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");return Qe(r[0],r[1]??"",e)},sni:(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");return Qe(r[0],r[1]??"",e)},https:(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");let n=Qe(r[0],r[1]??"",e);return n=n.replace("tcp://",""),`https://${n}`},ws:(t,e)=>{let r=rf(e),n=ef(e),i=tf(e);if(r&&n!=null)return`wss://${n}${i}`;let o=r?"wss://":"ws://",s=e.pop();if(s==null)throw new Error("Unexpected end of multiaddr");let a=Qe(s[0],s[1]??"",e);return a=a.replace("tcp://",""),`${o}${a}`},wss:(t,e)=>{let r=e.pop();if(r==null)throw new Error("Unexpected end of multiaddr");let n=Qe(r[0],r[1]??"",e);return n=n.replace("tcp://",""),`wss://${n}`}};function sf(t,e){let n=Xe(t).stringTuples(),i=n.pop();if(i==null)throw new Error("Unexpected end of multiaddr");let o=$(i[0]),s=of[o.name];if(s==null)throw new Error(`No interpreter found for ${o.name}`);let a=s(i[1]??"",n);return e?.assumeHttp!==!1&&ab.includes(i[0])&&(a=a.replace(/^.*:\/\//,""),i[1]==="443"?a=`https://${a}`:a=`http://${a}`),(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("ws://")||a.startsWith("wss://"))&&(a=new URL(a).toString(),a.endsWith("/")&&(a=a.substring(0,a.length-1))),a}var af="[a-fA-F\\d:]",Ht=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${af})|(?<=${af})(?=\\s|$))`:"",Je="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",fe="[a-fA-F\\d]{1,4}",Di=`
|
|
4
|
+
(?:
|
|
5
|
+
(?:${fe}:){7}(?:${fe}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
6
|
+
(?:${fe}:){6}(?:${Je}|:${fe}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
7
|
+
(?:${fe}:){5}(?::${Je}|(?::${fe}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
8
|
+
(?:${fe}:){4}(?:(?::${fe}){0,1}:${Je}|(?::${fe}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
9
|
+
(?:${fe}:){3}(?:(?::${fe}){0,2}:${Je}|(?::${fe}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
10
|
+
(?:${fe}:){2}(?:(?::${fe}){0,3}:${Je}|(?::${fe}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
11
|
+
(?:${fe}:){1}(?:(?::${fe}){0,4}:${Je}|(?::${fe}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
12
|
+
(?::(?:(?::${fe}){0,5}:${Je}|(?::${fe}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
13
|
+
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
14
|
+
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),ub=new RegExp(`(?:^${Je}$)|(?:^${Di}$)`),cb=new RegExp(`^${Je}$`),lb=new RegExp(`^${Di}$`),na=t=>t&&t.exact?ub:new RegExp(`(?:${Ht(t)}${Je}${Ht(t)})|(?:${Ht(t)}${Di}${Ht(t)})`,"g");na.v4=t=>t&&t.exact?cb:new RegExp(`${Ht(t)}${Je}${Ht(t)}`,"g");na.v6=t=>t&&t.exact?lb:new RegExp(`${Ht(t)}${Di}${Ht(t)}`,"g");var ia=na;function oa(t){let e=(...r)=>t(...r);return Object.defineProperty(e,"name",{value:`functionTimeout(${t.name||"<anonymous>"})`,configurable:!0}),e}function uf(){return!1}var{toString:fb}=Object.prototype;function sa(t){return fb.call(t)==="[object RegExp]"}var cf={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function aa(t,e={}){if(!sa(t))throw new TypeError("Expected a RegExp instance");let r=Object.keys(cf).map(i=>(typeof e[i]=="boolean"?e[i]:t[i])?cf[i]:"").join(""),n=new RegExp(e.source||t.source,r);return n.lastIndex=typeof e.lastIndex=="number"?e.lastIndex:t.lastIndex,n}function ua(t,e,{timeout:r}={}){try{return oa(()=>aa(t).test(e),{timeout:r})()}catch(n){if(uf(n))return!1;throw n}}var db=15,hb=45,lf={timeout:400};function ca(t){return t.length>hb?!1:ua(ia.v6({exact:!0}),t,lf)}function ff(t){return t.length>db?!1:ua(ia.v4({exact:!0}),t,lf)}var df={http:"80",https:"443",ws:"80",wss:"443"},pb=["http","https","ws","wss"];function hf(t,e){e=e??{};let r=e.defaultDnsType??"dns",{scheme:n,hostname:i,port:o,path:s}=yb(t),a=[wb(i,r),bb(o,n),mb(n)];s!=null&&a.push(gb(s));let u="/"+a.filter(c=>!!c).reduce((c,l)=>c.concat(l),[]).join("/");return Xe(u)}function yb(t){let[e]=t.split(":");pb.includes(e)||(t="http"+t.substring(e.length));let{protocol:r,hostname:n,port:i,pathname:o,search:s}=new URL(t);if(i==null||i===""){let u=xb(e);u!=null&&(i=u),u==null&&r==="http:"&&(i="80")}let a;return o!=null&&o!==""&&o!=="/"&&(o.startsWith("/")&&(o=o.substring(1)),a=o),s!=null&&s!==""&&(a=a??"",a+=s),{scheme:e,hostname:n,port:i,path:a}}function wb(t,e){if(!(t==null||t==="")){if(ff(t))return["ip4",t];if(ca(t))return["ip6",t];if(t[0]==="["){let r=t.substring(1,t.length-1);if(ca(r))return["ip6",r]}return[e,t]}}function bb(t,e){if(!(t==null||t===""))return e==="udp"?["udp",t]:["tcp",t]}function mb(t){if(t.match(/^tcp$|^udp$/)==null)return t==="https"?["/tls/http"]:t==="wss"?["/tls/ws"]:[t]}function gb(t){if(!(t==null||t===""))return["http-path",encodeURIComponent(t)]}function xb(t){if(!(t==null||t===""||df[t]==null))return df[t]}function Fr(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var Oi=class extends Error{type;code;constructor(e,r,n){super(e??"The operation was aborted"),this.type="aborted",this.name=n??"AbortError",this.code=r??"ABORT_ERR"}};async function Cn(t,e,r){if(e==null)return t;if(e.aborted)return t.catch(()=>{}),Promise.reject(new Oi(r?.errorMessage,r?.errorCode,r?.errorName));let n,i=new Oi(r?.errorMessage,r?.errorCode,r?.errorName);try{return await Promise.race([t,new Promise((o,s)=>{n=()=>{s(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var la=class{readNext;haveNext;ended;nextResult;error;constructor(){this.ended=!1,this.readNext=Fr(),this.haveNext=Fr()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("HaveNext promise resolved but nextResult was undefined");let e=this.nextResult;return this.nextResult=void 0,this.readNext.resolve(),this.readNext=Fr(),e}async throw(e){return this.ended=!0,this.error=e,e!=null&&(this.haveNext.promise.catch(()=>{}),this.haveNext.reject(e)),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return this.ended=!0,this.nextResult=e,this.haveNext.resolve(),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw this.error??new Error("Cannot push value onto an ended pushable");for(;this.nextResult!=null;)await this.readNext.promise;e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=Fr(),await Cn(this.readNext.promise,r?.signal,r)}};function Nn(){return new la}function pf(t){if(t!=null){if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]();if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t.next=="function")return t}throw new Error("argument is not an iterator or iterable")}function fa(t,e={}){let r=pf(t),n={_cancelled:!1,async start(){this._cancelled=!1},async pull(i){try{let{value:o,done:s}=await r.next();if(this._cancelled)return;if(s===!0){i.close();return}i.enqueue(o)}catch(o){i.error(o)}},cancel(){this._cancelled=!0}};return new globalThis.ReadableStream(n,e)}var Eb=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),yf=cn({name:"sha-1",code:17,encode:Eb("SHA-1")});var da=481,wf=480,i3=53,o3=54,s3=55,a3=56,ha=[53,54,55,56],pa={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};var Pn=class extends globalThis.Request{constructor(e,r={}){let n=r.method??"GET",i=Un(r),o=r.body;ya(n,i)&&(r.method="UPGRADE"),super(e,r),Object.defineProperties(this,{body:{value:o,writable:!1},method:{value:n,writable:!1},headers:{value:i,writable:!1}})}};var wa=class extends globalThis.Response{constructor(e,r={}){let n=Un(r),i=r.status??200;(i<200||i>599)&&(r.status=200),super(e,r),Object.defineProperties(this,{status:{value:i,writable:!1},statusText:{value:pa[i],writable:!1},headers:{value:n,writable:!1}})}};var Yp=l0(Vp(),1);var Eo=class extends Error{name="UnexpectedEOFError";code="ERR_UNEXPECTED_EOF"};function zp(t,e){let r=Nn();t.sink(r).catch(async s=>{await r.end(s)}),t.sink=async s=>{for await(let a of s)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new be;return{read:async s=>{if(s?.signal?.throwIfAborted(),s?.bytes==null){let{done:u,value:c}=await Cn(n.next(),s?.signal);return u===!0?null:c}for(;i.byteLength<s.bytes;){let{value:u,done:c}=await Cn(n.next(),s?.signal);if(c===!0)throw new Eo("unexpected end of input");i.append(u)}let a=i.sublist(0,s.bytes);return i.consume(s.bytes),a},write:async(s,a)=>{a?.signal?.throwIfAborted(),s instanceof Uint8Array?await r.push(s,a):await r.push(s.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let s=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*s}()}return t}}}var Gp=2147483647,$u=class extends Yp.Duplex{autoSelectFamilyAttemptedAddresses=[];connecting=!1;pending=!1;remoteAddress;bytesRead;bytesWritten;timeout=Gp;allowHalfOpen;stream;constructor(e,r){let n=zp(e);super({write:(i,o,s)=>{this.stream.log("write %d bytes",i.byteLength),this.bytesWritten+=i.byteLength,n.write(i).then(()=>{s()},a=>{s(a)})},read:i=>{this.stream.log("asked to read %d bytes",i),Promise.resolve().then(async()=>{try{for(;;){let o=await n.read({signal:AbortSignal.timeout(this.timeout)});if(o==null){this.stream.log("socket readable end closed"),this.push(null);return}if(this.bytesRead+=o.byteLength,this.stream.log("socket read %d bytes",o.byteLength),!this.push(o.subarray()))break}}catch(o){this.destroy(o)}})},destroy:(i,o)=>{this.stream.log("destroy with %d bytes buffered - %e",this.bufferSize,i),i!=null?(n.unwrap().abort(i),o()):n.unwrap().close().then(()=>{o()}).catch(s=>{e.abort(s),o(s)})},final:i=>{this.stream.log("final"),n.unwrap().closeWrite().then(()=>{i()}).catch(o=>{n.unwrap().abort(o),i(o)})}}),this.stream=e,this.remoteAddress=r.remoteAddr.toString(),this.bytesRead=0,this.bytesWritten=0,this.allowHalfOpen=!0}get readyState(){return this.stream.status==="closed"?"closed":this.stream.writeStatus==="closed"||this.stream.writeStatus==="closing"?"readOnly":this.stream.readStatus==="closed"||this.stream.readStatus==="closing"?"writeOnly":"open"}get bufferSize(){return this.writableLength}destroySoon(){this.stream.log("destroySoon with %d bytes buffered",this.bufferSize),this.destroy()}connect(...e){return this.stream.log("connect %o",e),this}setEncoding(e){return this.stream.log("setEncoding %s",e),this}resetAndDestroy(){return this.stream.log("resetAndDestroy"),this.stream.abort(new Error("Libp2pSocket.resetAndDestroy")),this}setTimeout(e,r){return this.stream.log("setTimeout %d",e),r!=null&&this.addListener("timeout",r),this.timeout=e===0?Gp:e,this}setNoDelay(e){return this.stream.log("setNoDelay %b",e),this}setKeepAlive(e,r){return this.stream.log("setKeepAlive %b %d",e,r),this}address(){return this.stream.log("address"),{}}unref(){return this.stream.log("unref"),this}ref(){return this.stream.log("ref"),this}write(e,r,n){return super.write(e,r,n)}};function R2(t,e){return new $u(t,e)}function T2(t,e){if(t instanceof URL)return t;let r=Qp(t,e),{httpPath:n}=Jp(t);return new URL(`http://${r}${n}`)}function B2(t){return t instanceof Uint8Array?t:t instanceof DataView?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t,0,t.byteLength)}function L2(t,e){let r={method:t.method,headers:t.headers};if((r.method!=="GET"||t.upgrade)&&r.method!=="HEAD"){let n=e.source;t.upgrade||(n=O2(e.source,t.headers.get("content-length"))),r.body=fa(n),r.duplex="half"}return new Pn(e0(t).toString(),r)}async function C2(t,e){let r=Nn();if(e.sink(r).catch(o=>{e.abort(o)}),await r.push(he([`HTTP/1.1 ${t.status} ${t.statusText}`,...Xp(t.headers),"",""].join(`\r
|
|
15
|
+
`))),t.body==null){await r.end();return}let n=t.body.getReader(),i=await n.read();for(;i.value!=null&&await r.push(i.value),!i.done;)i=await n.read();await r.end(),await e.closeWrite().catch(o=>{e.abort(o)})}var N2=he(["HTTP/1.1 404 Not Found","Connection: close","",""].join(`\r
|
|
16
|
+
`)),P2=he(["HTTP/1.1 400 Bad Request","Connection: close","",""].join(`\r
|
|
17
|
+
`)),U2=he(["HTTP/1.1 500 Internal Server Error","Connection: close","",""].join(`\r
|
|
18
|
+
`)),D2=he(["HTTP/1.1 501 Not Implemented","Connection: close","",""].join(`\r
|
|
19
|
+
`));function Xp(t){let e=[];t.get("Connection")==null&&t.set("Connection","close");for(let[r,n]of t.entries())e.push(`${r}: ${n}`);return e}async function*O2(t,e){if(e=parseInt(`${e??""}`),e==null||isNaN(e))return t;let r=0;for await(let n of t){if(r+=n.byteLength,r>e){yield n.subarray(0,r-e);return}if(yield n.subarray(),r===e)return}}function k2(t,e){if(typeof t=="string"&&(t.startsWith("/")?t=Xe(t):t=new URL(t)),yc(t)&&(t=Xe(`/p2p/${t}`)),t instanceof URL&&t.protocol==="multiaddr:"&&(t=hf(t.toString())),Ui(t)&&(t=[t]),Array.isArray(t)){for(let r of t)if(r.stringTuples().find(([i])=>i===480)!=null){let i=sf(r);return new URL(`${i}${e??""}`)}}return e==null?t:t instanceof URL?new URL(`${t}${e.substring(1)}`):t.map(r=>r.encapsulate(`/http-path/${encodeURIComponent(e.substring(1))}`))}function Un(t={}){return t.headers instanceof Headers||(t.headers=new Headers(t.headers)),t.headers}function M2(t,e={}){return e instanceof Headers?e.get(t)??void 0:Array.isArray(e)?e.find(([r,n])=>{if(r===t)return n})?.[1]:e[t]}function Yn(t){return t!=null&&t!==""}function Qp(t,e){let r,n=80,i="http:";if(t instanceof URL&&(r=t.hostname,n=parseInt(t.port,10),i=t.protocol),Yn(r)||(r=e.get("host")??void 0),!Yn(r)&&Array.isArray(t))for(let o of t){let a=o.stringTuples().filter(([u])=>ha.includes(u))?.[0]?.[1];if(a!=null){r=a;break}}if(!Yn(r)&&Array.isArray(t))for(let o of t){let s=o.getPeerId();try{n=o.toOptions().port}catch{}if(s!=null){r=kl(s).toCID().toString(zt);break}}if(!Yn(r)&&Array.isArray(t))for(let o of t)try{r=o.toOptions().host;break}catch{}if(Yn(r))return i==="http:"&&n!==80&&(r=`${r}:${n}`),i==="https:"&&n!==443&&(r=`${r}:${n}`),r;throw new Me("Could not determine request host name - a request must have a host header, be made to a DNS or IP-based multiaddr or an http(s) URL")}function Jp(t){let e="/";return t=t.map(r=>Jl(r.stringTuples().filter(n=>(n[0]===481&&n[1]!=null&&(e=`/${n[1]}`),n[0]!==481)))),{httpPath:e,addresses:t}}function F2(t,e=["GET"]){return t==null?e:(typeof t=="string"&&(t=[t]),t.map(r=>r.toUpperCase()))}function e0(t){let e=t.url??"/";if(e.startsWith("http"))return new URL(e);let r=q2(t);return new URL(`http://${r}${e}`)}function q2(t){let e=t.headers?.host;if(e==null&&(e=t.headers?.Host),e==null&&typeof t.headers.get=="function"&&(e=t.headers.get("host")),e==null)throw new Me("Could not read host");return e}function ya(t,e){return t==="GET"&&e.get("connection")?.toLowerCase()==="upgrade"&&e.get("upgrade")?.toLowerCase()==="websocket"}function Zp(t,e){if(t instanceof Headers)return t.get(e)??void 0;let r=t[e];return Array.isArray(r)?r.join(","):r}async function H2(t){if(Zp(t,"sec-websocket-version")!=="13")throw new hn("Invalid version");let e=Zp(t,"sec-websocket-key");if(e==null)throw new hn("Missing sec-websocket-key");let r=`${e}258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,n=await yf.digest(he(r)),i=Po.encode(n.digest).substring(1);return new Headers({Upgrade:"websocket",Connection:"upgrade","Sec-WebSocket-Accept":i})}async function $2(t){return new Promise((e,r)=>{let n=new N("REQUEST"),i=Nn(),o=new be,s=!1;n[N.kOnHeadersComplete]=u=>{s=!0;let c=new Headers;for(let l=0;l<u.headers.length;l+=2)c.set(u.headers[l].toLowerCase(),u.headers[l+1]);e({...u,headers:c,raw:o,method:N.methods[u.method]})};let a=t.source;t.source=i,Promise.resolve().then(async()=>{for await(let u of a)s?await i.push(new be(u)):(o.append(u),n.execute(u.subarray()));await i.end()}).catch(u=>{t.abort(u),r(u)}).finally(()=>{n.finish()})})}return f0(K2);})();
|
|
20
|
+
/*! Bundled license information:
|
|
21
|
+
|
|
22
|
+
ieee754/index.js:
|
|
23
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
24
|
+
|
|
25
|
+
buffer/index.js:
|
|
26
|
+
(*!
|
|
27
|
+
* The buffer module from node.js, for the browser.
|
|
28
|
+
*
|
|
29
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
30
|
+
* @license MIT
|
|
31
|
+
*)
|
|
32
|
+
|
|
33
|
+
safe-buffer/index.js:
|
|
34
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
35
|
+
|
|
36
|
+
@noble/hashes/esm/utils.js:
|
|
37
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
38
|
+
|
|
39
|
+
@noble/curves/esm/abstract/utils.js:
|
|
40
|
+
@noble/curves/esm/abstract/modular.js:
|
|
41
|
+
@noble/curves/esm/abstract/curve.js:
|
|
42
|
+
@noble/curves/esm/abstract/edwards.js:
|
|
43
|
+
@noble/curves/esm/ed25519.js:
|
|
44
|
+
@noble/curves/esm/abstract/weierstrass.js:
|
|
45
|
+
@noble/curves/esm/_shortw_utils.js:
|
|
46
|
+
@noble/curves/esm/secp256k1.js:
|
|
47
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
48
|
+
*/
|
|
49
|
+
return Libp2PHttpUtils}));
|
|
50
|
+
//# sourceMappingURL=index.min.js.map
|