@libp2p/pnet 2.0.46-cf9aab5c8 → 2.0.47-0f07e3df5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +4 -4
- package/dist/src/crypto.d.ts +20 -9
- package/dist/src/crypto.d.ts.map +1 -1
- package/dist/src/crypto.js +57 -21
- package/dist/src/crypto.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +24 -29
- package/dist/src/index.js.map +1 -1
- package/package.json +6 -14
- package/src/crypto.ts +69 -21
- package/src/index.ts +27 -42
package/dist/index.min.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PPnet = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
2
|
-
"use strict";var Libp2PPnet=(()=>{var $t=Object.create;var le=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var tr=Object.getPrototypeOf,rr=Object.prototype.hasOwnProperty;var it=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),q=(r,e)=>{for(var t in e)le(r,t,{get:e[t],enumerable:!0})},at=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of er(e))!rr.call(r,o)&&o!==t&&le(r,o,{get:()=>e[o],enumerable:!(n=Zt(e,o))||n.enumerable});return r};var nr=(r,e,t)=>(t=r!=null?$t(tr(r)):{},at(e||!r||!r.__esModule?le(t,"default",{value:r,enumerable:!0}):t,r)),or=r=>at(le({},"__esModule",{value:!0}),r);var Gt=it((Es,Pt)=>{var Cn=(r,e)=>function(){return e||(0,r[Object.keys(r)[0]])((e={exports:{}}).exports,e),e.exports},vn=(()=>{for(var r=new Uint8Array(128),e=0;e<64;e++)r[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return t=>{for(var n=t.length,o=new Uint8Array((n-(t[n-1]=="=")-(t[n-2]=="="))*3/4|0),i=0,a=0;i<n;){var f=r[t.charCodeAt(i++)],c=r[t.charCodeAt(i++)],A=r[t.charCodeAt(i++)],w=r[t.charCodeAt(i++)];o[a++]=f<<2|c>>4,o[a++]=c<<4|A>>2,o[a++]=A<<6|w}return o}})(),Qn=Cn({"wasm-binary:./xsalsa20.wat"(r,e){e.exports=vn("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")}}),Sn=Qn(),Dn=new WebAssembly.Module(Sn);Pt.exports=r=>new WebAssembly.Instance(Dn,r).exports});var Ht=it((Is,Vt)=>{var he=typeof WebAssembly<"u"&&Gt()(),Ce=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),k=144,ne=k,Be=[];Vt.exports=P;P.NONCEBYTES=24;P.KEYBYTES=32;P.core_hsalsa20=Kt;P.SIGMA=Ce;function P(r,e){if(!(this instanceof P))return new P(r,e);if(!r||r.length<24)throw new Error("nonce must be at least 24 bytes");if(!e||e.length<32)throw new Error("key must be at least 32 bytes");this._xor=he?new ve(r,e):new et(r,e)}P.prototype.update=function(r,e){if(!r)throw new Error("input must be Uint8Array or Buffer");return e||(e=new Uint8Array(r.length)),r.length&&this._xor.update(r,e),e};P.prototype.final=P.prototype.finalize=function(){this._xor.finalize(),this._xor=null};function ve(r,e){Be.length||(Be.push(k),k+=64),this._pointer=Be.pop(),this._nonce=this._pointer+8,this._key=this._nonce+24,this._overflow=0,this._memory=new Uint8Array(he.memory.buffer),this._memory.fill(0,this._pointer,this._pointer+8),this._memory.set(r,this._nonce),this._memory.set(e,this._key)}ve.prototype.realloc=function(r){he.memory.grow(Math.ceil(Math.abs(r-this._memory.length)/65536)),this._memory=new Uint8Array(he.memory.buffer)};ve.prototype.update=function(r,e){var t=this._overflow+r.length,n=k+this._overflow;ne=k+t,ne>=this._memory.length&&this.realloc(ne),this._memory.set(r,n),he.xsalsa20_xor(this._pointer,k,k,t,this._nonce,this._key),e.set(this._memory.subarray(n,k+t)),this._overflow=t&63};ve.prototype.finalize=function(){this._memory.fill(0,this._pointer,this._key+32),ne>k&&(this._memory.fill(0,k,ne),ne=0),Be.push(this._pointer)};function et(r,e){this._s=new Uint8Array(32),this._z=new Uint8Array(16),this._overflow=0,Kt(this._s,r,e,Ce);for(var t=0;t<8;t++)this._z[t]=r[t+16]}et.prototype.update=function(r,e){for(var t=new Uint8Array(64),n=0,o=this._overflow,i=r.length+this._overflow,a=this._z,f=-this._overflow,c=-this._overflow;i>=64;){for(jt(t,a,this._s,Ce);o<64;o++)e[c+o]=r[f+o]^t[o];for(n=1,o=8;o<16;o++)n+=a[o]&255|0,a[o]=n&255,n>>>=8;i-=64,c+=64,f+=64,o=0}if(i>0)for(jt(t,a,this._s,Ce);o<i;o++)e[c+o]=r[f+o]^t[o];this._overflow=i&63};et.prototype.finalize=function(){this._s.fill(0),this._z.fill(0)};function jt(r,e,t,n){for(var o=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,i=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,a=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,c=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,A=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,w=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,m=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,L=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,z=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,l=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,b=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,u=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,E=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,N=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,D=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,h=o,p=i,g=a,d=f,x=c,y=A,I=w,B=m,C=L,v=z,Q=l,M=b,T=u,_=E,R=N,S=D,s,oe=0;oe<20;oe+=2)s=h+T|0,x^=s<<7|s>>>25,s=x+h|0,C^=s<<9|s>>>23,s=C+x|0,T^=s<<13|s>>>19,s=T+C|0,h^=s<<18|s>>>14,s=y+p|0,v^=s<<7|s>>>25,s=v+y|0,_^=s<<9|s>>>23,s=_+v|0,p^=s<<13|s>>>19,s=p+_|0,y^=s<<18|s>>>14,s=Q+I|0,R^=s<<7|s>>>25,s=R+Q|0,g^=s<<9|s>>>23,s=g+R|0,I^=s<<13|s>>>19,s=I+g|0,Q^=s<<18|s>>>14,s=S+M|0,d^=s<<7|s>>>25,s=d+S|0,B^=s<<9|s>>>23,s=B+d|0,M^=s<<13|s>>>19,s=M+B|0,S^=s<<18|s>>>14,s=h+d|0,p^=s<<7|s>>>25,s=p+h|0,g^=s<<9|s>>>23,s=g+p|0,d^=s<<13|s>>>19,s=d+g|0,h^=s<<18|s>>>14,s=y+x|0,I^=s<<7|s>>>25,s=I+y|0,B^=s<<9|s>>>23,s=B+I|0,x^=s<<13|s>>>19,s=x+B|0,y^=s<<18|s>>>14,s=Q+v|0,M^=s<<7|s>>>25,s=M+Q|0,C^=s<<9|s>>>23,s=C+M|0,v^=s<<13|s>>>19,s=v+C|0,Q^=s<<18|s>>>14,s=S+R|0,T^=s<<7|s>>>25,s=T+S|0,_^=s<<9|s>>>23,s=_+T|0,R^=s<<13|s>>>19,s=R+_|0,S^=s<<18|s>>>14;h=h+o|0,p=p+i|0,g=g+a|0,d=d+f|0,x=x+c|0,y=y+A|0,I=I+w|0,B=B+m|0,C=C+L|0,v=v+z|0,Q=Q+l|0,M=M+b|0,T=T+u|0,_=_+E|0,R=R+N|0,S=S+D|0,r[0]=h>>>0&255,r[1]=h>>>8&255,r[2]=h>>>16&255,r[3]=h>>>24&255,r[4]=p>>>0&255,r[5]=p>>>8&255,r[6]=p>>>16&255,r[7]=p>>>24&255,r[8]=g>>>0&255,r[9]=g>>>8&255,r[10]=g>>>16&255,r[11]=g>>>24&255,r[12]=d>>>0&255,r[13]=d>>>8&255,r[14]=d>>>16&255,r[15]=d>>>24&255,r[16]=x>>>0&255,r[17]=x>>>8&255,r[18]=x>>>16&255,r[19]=x>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=I>>>0&255,r[25]=I>>>8&255,r[26]=I>>>16&255,r[27]=I>>>24&255,r[28]=B>>>0&255,r[29]=B>>>8&255,r[30]=B>>>16&255,r[31]=B>>>24&255,r[32]=C>>>0&255,r[33]=C>>>8&255,r[34]=C>>>16&255,r[35]=C>>>24&255,r[36]=v>>>0&255,r[37]=v>>>8&255,r[38]=v>>>16&255,r[39]=v>>>24&255,r[40]=Q>>>0&255,r[41]=Q>>>8&255,r[42]=Q>>>16&255,r[43]=Q>>>24&255,r[44]=M>>>0&255,r[45]=M>>>8&255,r[46]=M>>>16&255,r[47]=M>>>24&255,r[48]=T>>>0&255,r[49]=T>>>8&255,r[50]=T>>>16&255,r[51]=T>>>24&255,r[52]=_>>>0&255,r[53]=_>>>8&255,r[54]=_>>>16&255,r[55]=_>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=S>>>0&255,r[61]=S>>>8&255,r[62]=S>>>16&255,r[63]=S>>>24&255}function Kt(r,e,t,n){for(var o=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,i=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,a=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,c=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,A=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,w=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,m=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,L=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,z=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,l=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,b=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,u=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,E=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,N=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,D=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,h=o,p=i,g=a,d=f,x=c,y=A,I=w,B=m,C=L,v=z,Q=l,M=b,T=u,_=E,R=N,S=D,s,oe=0;oe<20;oe+=2)s=h+T|0,x^=s<<7|s>>>25,s=x+h|0,C^=s<<9|s>>>23,s=C+x|0,T^=s<<13|s>>>19,s=T+C|0,h^=s<<18|s>>>14,s=y+p|0,v^=s<<7|s>>>25,s=v+y|0,_^=s<<9|s>>>23,s=_+v|0,p^=s<<13|s>>>19,s=p+_|0,y^=s<<18|s>>>14,s=Q+I|0,R^=s<<7|s>>>25,s=R+Q|0,g^=s<<9|s>>>23,s=g+R|0,I^=s<<13|s>>>19,s=I+g|0,Q^=s<<18|s>>>14,s=S+M|0,d^=s<<7|s>>>25,s=d+S|0,B^=s<<9|s>>>23,s=B+d|0,M^=s<<13|s>>>19,s=M+B|0,S^=s<<18|s>>>14,s=h+d|0,p^=s<<7|s>>>25,s=p+h|0,g^=s<<9|s>>>23,s=g+p|0,d^=s<<13|s>>>19,s=d+g|0,h^=s<<18|s>>>14,s=y+x|0,I^=s<<7|s>>>25,s=I+y|0,B^=s<<9|s>>>23,s=B+I|0,x^=s<<13|s>>>19,s=x+B|0,y^=s<<18|s>>>14,s=Q+v|0,M^=s<<7|s>>>25,s=M+Q|0,C^=s<<9|s>>>23,s=C+M|0,v^=s<<13|s>>>19,s=v+C|0,Q^=s<<18|s>>>14,s=S+R|0,T^=s<<7|s>>>25,s=T+S|0,_^=s<<9|s>>>23,s=_+T|0,R^=s<<13|s>>>19,s=R+_|0,S^=s<<18|s>>>14;r[0]=h>>>0&255,r[1]=h>>>8&255,r[2]=h>>>16&255,r[3]=h>>>24&255,r[4]=y>>>0&255,r[5]=y>>>8&255,r[6]=y>>>16&255,r[7]=y>>>24&255,r[8]=Q>>>0&255,r[9]=Q>>>8&255,r[10]=Q>>>16&255,r[11]=Q>>>24&255,r[12]=S>>>0&255,r[13]=S>>>8&255,r[14]=S>>>16&255,r[15]=S>>>24&255,r[16]=I>>>0&255,r[17]=I>>>8&255,r[18]=I>>>16&255,r[19]=I>>>24&255,r[20]=B>>>0&255,r[21]=B>>>8&255,r[22]=B>>>16&255,r[23]=B>>>24&255,r[24]=C>>>0&255,r[25]=C>>>8&255,r[26]=C>>>16&255,r[27]=C>>>24&255,r[28]=v>>>0&255,r[29]=v>>>8&255,r[30]=v>>>16&255,r[31]=v>>>24&255}});var Ln={};q(Ln,{generateKey:()=>Jt,preSharedKey:()=>Nn});var Y=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}};var Ne={};q(Ne,{base58btc:()=>O,base58flickr:()=>hr});var _n=new Uint8Array(0);function ft(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function G(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function ct(r){return new TextEncoder().encode(r)}function ut(r){return new TextDecoder().decode(r)}function sr(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<r.length;o++){var i=r.charAt(o),a=i.charCodeAt(0);if(t[a]!==255)throw new TypeError(i+" is ambiguous");t[a]=o}var f=r.length,c=r.charAt(0),A=Math.log(f)/Math.log(256),w=Math.log(256)/Math.log(f);function m(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var b=0,u=0,E=0,N=l.length;E!==N&&l[E]===0;)E++,b++;for(var D=(N-E)*w+1>>>0,h=new Uint8Array(D);E!==N;){for(var p=l[E],g=0,d=D-1;(p!==0||g<u)&&d!==-1;d--,g++)p+=256*h[d]>>>0,h[d]=p%f>>>0,p=p/f>>>0;if(p!==0)throw new Error("Non-zero carry");u=g,E++}for(var x=D-u;x!==D&&h[x]===0;)x++;for(var y=c.repeat(b);x<D;++x)y+=r.charAt(h[x]);return y}function L(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var b=0;if(l[b]!==" "){for(var u=0,E=0;l[b]===c;)u++,b++;for(var N=(l.length-b)*A+1>>>0,D=new Uint8Array(N);l[b];){var h=t[l.charCodeAt(b)];if(h===255)return;for(var p=0,g=N-1;(h!==0||p<E)&&g!==-1;g--,p++)h+=f*D[g]>>>0,D[g]=h%256>>>0,h=h/256>>>0;if(h!==0)throw new Error("Non-zero carry");E=p,b++}if(l[b]!==" "){for(var d=N-E;d!==N&&D[d]===0;)d++;for(var x=new Uint8Array(u+(N-d)),y=u;d!==N;)x[y++]=D[d++];return x}}}function z(l){var b=L(l);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:m,decodeUnsafe:L,decode:z}}var ir=sr,ar=ir,lt=ar;var Qe=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Se=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let o=t.codePointAt(0);if(o===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=o,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 pt(this,e)}},De=class{decoders;constructor(e){this.decoders=e}or(e){return pt(this,e)}decode(e){let t=e[0],n=this.decoders[t];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 pt(r,e){return new De({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var Ue=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,o){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new Qe(e,t,n),this.decoder=new Se(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function X({name:r,prefix:e,encode:t,decode:n}){return new Ue(r,e,t,n)}function K({name:r,prefix:e,alphabet:t}){let{encode:n,decode:o}=lt(t,r);return X({prefix:e,name:r,encode:n,decode:i=>G(o(i))})}function fr(r,e,t,n){let o=r.length;for(;r[o-1]==="=";)--o;let i=new Uint8Array(o*t/8|0),a=0,f=0,c=0;for(let A=0;A<o;++A){let w=e[r[A]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|w,a+=t,a>=8&&(a-=8,i[c++]=255&f>>a)}if(a>=t||(255&f<<8-a)!==0)throw new SyntaxError("Unexpected end of data");return i}function cr(r,e,t){let n=e[e.length-1]==="=",o=(1<<t)-1,i="",a=0,f=0;for(let c=0;c<r.length;++c)for(f=f<<8|r[c],a+=8;a>t;)a-=t,i+=e[o&f>>a];if(a!==0&&(i+=e[o&f<<t-a]),n)for(;(i.length*t&7)!==0;)i+="=";return i}function ur(r){let e={};for(let t=0;t<r.length;++t)e[r[t]]=t;return e}function U({name:r,prefix:e,bitsPerChar:t,alphabet:n}){let o=ur(n);return X({prefix:e,name:r,encode(i){return cr(i,n,t)},decode(i){return fr(i,o,t,r)}})}var O=K({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),hr=K({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Le={};q(Le,{base32:()=>W,base32hex:()=>Ar,base32hexpad:()=>mr,base32hexpadupper:()=>gr,base32hexupper:()=>xr,base32pad:()=>pr,base32padupper:()=>dr,base32upper:()=>lr,base32z:()=>yr});var W=U({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),lr=U({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),pr=U({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dr=U({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ar=U({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),xr=U({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),mr=U({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),gr=U({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),yr=U({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Me={};q(Me,{base36:()=>se,base36upper:()=>br});var se=K({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),br=K({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var wr=xt,dt=128,Er=127,Ir=~Er,Br=Math.pow(2,31);function xt(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Br;)e[t++]=r&255|dt,r/=128;for(;r&Ir;)e[t++]=r&255|dt,r>>>=7;return e[t]=r|0,xt.bytes=t-n+1,e}var Cr=Te,vr=128,At=127;function Te(r,n){var t=0,n=n||0,o=0,i=n,a,f=r.length;do{if(i>=f)throw Te.bytes=0,new RangeError("Could not decode varint");a=r[i++],t+=o<28?(a&At)<<o:(a&At)*Math.pow(2,o),o+=7}while(a>=vr);return Te.bytes=i-n,t}var Qr=Math.pow(2,7),Sr=Math.pow(2,14),Dr=Math.pow(2,21),Ur=Math.pow(2,28),Nr=Math.pow(2,35),Lr=Math.pow(2,42),Mr=Math.pow(2,49),Tr=Math.pow(2,56),_r=Math.pow(2,63),Rr=function(r){return r<Qr?1:r<Sr?2:r<Dr?3:r<Ur?4:r<Nr?5:r<Lr?6:r<Mr?7:r<Tr?8:r<_r?9:10},qr={encode:wr,decode:Cr,encodingLength:Rr},zr=qr,ie=zr;function ae(r,e=0){return[ie.decode(r,e),ie.decode.bytes]}function $(r,e,t=0){return ie.encode(r,e,t),e}function Z(r){return ie.encodingLength(r)}function V(r,e){let t=e.byteLength,n=Z(r),o=n+Z(t),i=new Uint8Array(o+t);return $(r,i,0),$(t,i,n),i.set(e,o),new ee(r,t,e,i)}function mt(r){let e=G(r),[t,n]=ae(e),[o,i]=ae(e.subarray(n)),a=e.subarray(n+i);if(a.byteLength!==o)throw new Error("Incorrect length");return new ee(t,o,a,e)}function gt(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&ft(r.bytes,t.bytes)}}var ee=class{code;size;digest;bytes;constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};function yt(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return Or(t,_e(r),e??O.encoder);default:return kr(t,_e(r),e??W.encoder)}}var bt=new WeakMap;function _e(r){let e=bt.get(r);if(e==null){let t=new Map;return bt.set(r,t),t}return e}var de=class r{code;version;multihash;bytes;"/";constructor(e,t,n,o){this.code=t,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}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:t}=this;if(e!==ce)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Pr)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}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:t}=this.multihash,n=V(e,t);return r.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 r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&>(e.multihash,n.multihash)}toString(e){return yt(this,e)}toJSON(){return{"/":yt(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 t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:i,bytes:a}=t;return new r(n,o,i,a??wt(n,o,i.bytes))}else if(t[Gr]===!0){let{version:n,multihash:o,code:i}=t,a=mt(o);return r.create(n,i,a)}else return null}static create(e,t,n){if(typeof t!="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(t!==ce)throw new Error(`Version 0 CID must use dag-pb (code: ${ce}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let o=wt(e,t,n.bytes);return new r(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,ce,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,o=G(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=o.subarray(t.multihashSize-t.digestSize),a=new ee(t.multihashCode,t.digestSize,i,o);return[t.version===0?r.createV0(a):r.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[m,L]=ae(e.subarray(t));return t+=L,m},o=n(),i=ce;if(o===18?(o=0,t=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let a=t,f=n(),c=n(),A=t+c,w=A-a;return{version:o,codec:i,multihashCode:f,digestSize:c,multihashSize:w,size:A}}static parse(e,t){let[n,o]=Fr(e,t),i=r.decode(o);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return _e(i).set(n,e),i}};function Fr(r,e){switch(r[0]){case"Q":{let t=e??O;return[O.prefix,t.decode(`${O.prefix}${r}`)]}case O.prefix:{let t=e??O;return[O.prefix,t.decode(r)]}case W.prefix:{let t=e??W;return[W.prefix,t.decode(r)]}case se.prefix:{let t=e??se;return[se.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function Or(r,e,t){let{prefix:n}=t;if(n!==O.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let i=t.encode(r).slice(1);return e.set(n,i),i}else return o}function kr(r,e,t){let{prefix:n}=t,o=e.get(n);if(o==null){let i=t.encode(r);return e.set(n,i),i}else return o}var ce=112,Pr=18;function wt(r,e,t){let n=Z(r),o=n+Z(e),i=new Uint8Array(o+t.byteLength);return $(r,i,0),$(e,i,n),i.set(t,o),i}var Gr=Symbol.for("@ipld/js-cid/CID");var Re={};q(Re,{identity:()=>Vr});var Et=0,jr="identity",It=G;function Kr(r){return V(Et,It(r))}var Vr={code:Et,name:jr,encode:It,digest:Kr};function Bt(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function j(r=0){return new Uint8Array(r)}function H(r=0){return new Uint8Array(r)}function qe(r,e){e==null&&(e=r.reduce((o,i)=>o+i.length,0));let t=H(e),n=0;for(let o of r)t.set(o,n),n+=o.length;return t}var vt=Symbol.for("@achingbrain/uint8arraylist");function Ct(r,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let n of r){let o=t+n.byteLength;if(e<o)return{buf:n,index:e-t};t=o}throw new RangeError("index is out of bounds")}function Ae(r){return!!r?.[vt]}var xe=class r{bufs;length;[vt]=!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 t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(Ae(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(Ae(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=Ct(this.bufs,e);return t.buf[t.index]}set(e,t){let n=Ct(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(t+n,e[n]);else if(Ae(e))for(let n=0;n<e.length;n++)this.set(t+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,t){let{bufs:n,length:o}=this._subList(e,t);return qe(n,o)}subarray(e,t){let{bufs:n,length:o}=this._subList(e,t);return n.length===1?n[0]:qe(n,o)}sublist(e,t){let{bufs:n,length:o}=this._subList(e,t),i=new r;return i.length=o,i.bufs=[...n],i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:this.bufs,length:this.length};let n=[],o=0;for(let i=0;i<this.bufs.length;i++){let a=this.bufs[i],f=o,c=f+a.byteLength;if(o=c,e>=c)continue;let A=e>=f&&e<c,w=t>f&&t<=c;if(A&&w){if(e===f&&t===c){n.push(a);break}let m=e-f;n.push(a.subarray(m,m+(t-e)));break}if(A){if(e===0){n.push(a);continue}n.push(a.subarray(e-f));continue}if(w){if(t===c){n.push(a);break}n.push(a.subarray(0,t-f));break}n.push(a)}return{bufs:n,length:t-e}}indexOf(e,t=0){if(!Ae(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(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let o=n.byteLength;if(o===0)throw new TypeError("search must be at least 1 byte long");let i=256,a=new Int32Array(i);for(let m=0;m<i;m++)a[m]=-1;for(let m=0;m<o;m++)a[n[m]]=m;let f=a,c=this.byteLength-n.byteLength,A=n.byteLength-1,w;for(let m=t;m<=c;m+=w){w=0;for(let L=A;L>=0;L--){let z=this.get(m+L);if(n[L]!==z){w=Math.max(1,L-f[z]);break}}if(w===0)return m}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=H(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let o=j(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt16(0,t,n),this.write(o,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let o=j(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt32(0,t,n),this.write(o,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let o=j(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigInt64(0,t,n),this.write(o,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=H(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let o=j(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint16(0,t,n),this.write(o,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let o=j(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint32(0,t,n),this.write(o,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let o=j(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigUint64(0,t,n),this.write(o,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let o=j(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat32(0,t,n),this.write(o,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let o=j(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat64(0,t,n),this.write(o,e)}equals(e){if(e==null||!(e instanceof r)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!Bt(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let n=new r;return n.bufs=e,t==null&&(t=e.reduce((o,i)=>o+i.byteLength,0)),n.length=t,n}};var ze={};q(ze,{base10:()=>Hr});var Hr=K({prefix:"9",name:"base10",alphabet:"0123456789"});var Fe={};q(Fe,{base16:()=>Jr,base16upper:()=>Yr});var Jr=U({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Yr=U({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Oe={};q(Oe,{base2:()=>Xr});var Xr=U({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ke={};q(ke,{base256emoji:()=>tn});var Qt=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}"),Wr=Qt.reduce((r,e,t)=>(r[t]=e,r),[]),$r=Qt.reduce((r,e,t)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return r[n]=t,r},[]);function Zr(r){return r.reduce((e,t)=>(e+=Wr[t],e),"")}function en(r){let e=[];for(let t of r){let n=t.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${t}`);let o=$r[n];if(o==null)throw new Error(`Non-base256emoji character: ${t}`);e.push(o)}return new Uint8Array(e)}var tn=X({prefix:"\u{1F680}",name:"base256emoji",encode:Zr,decode:en});var Pe={};q(Pe,{base64:()=>rn,base64pad:()=>nn,base64url:()=>on,base64urlpad:()=>sn});var rn=U({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),nn=U({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),on=U({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),sn=U({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ge={};q(Ge,{base8:()=>an});var an=U({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var je={};q(je,{identity:()=>fn});var fn=X({prefix:"\0",name:"identity",encode:r=>ut(r),decode:r=>ct(r)});var yo=new TextEncoder,bo=new TextDecoder;var He={};q(He,{sha256:()=>hn,sha512:()=>ln});function Ve({name:r,code:e,encode:t}){return new Ke(r,e,t)}var Ke=class{name;code;encode;constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?V(this.code,t):t.then(n=>V(this.code,n))}else throw Error("Unknown type, must be binary type")}};function Dt(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var hn=Ve({name:"sha2-256",code:18,encode:Dt("SHA-256")}),ln=Ve({name:"sha2-512",code:19,encode:Dt("SHA-512")});var Je={...je,...Oe,...Ge,...ze,...Fe,...Le,...Me,...Ne,...Pe,...ke},Lo={...He,...Re};function Nt(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var Ut=Nt("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Ye=Nt("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=H(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),pn={utf8:Ut,"utf-8":Ut,hex:Je.base16,latin1:Ye,ascii:Ye,binary:Ye,...Je},me=pn;function ge(r,e="utf8"){let t=me[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}function ye(r,e="utf8"){let t=me[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var J=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Lt(r=32){if(J&&typeof J.getRandomValues=="function")return J.getRandomValues(new Uint8Array(r));if(J&&typeof J.randomBytes=="function")return Uint8Array.from(J.randomBytes(r));throw new Error("crypto.getRandomValues must be defined")}function te(r){if(isNaN(r)||r<=0)throw new Y("random bytes length must be a Number bigger than 0");return Lt(r)}function F(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var be=class extends Error{type;code;constructor(e,t,n){super(e??"The operation was aborted"),this.type="aborted",this.name=n??"AbortError",this.code=t??"ABORT_ERR"}};async function ue(r,e,t){if(e==null)return r;if(e.aborted)return r.catch(()=>{}),Promise.reject(new be(t?.errorMessage,t?.errorCode,t?.errorName));let n,o=new be(t?.errorMessage,t?.errorCode,t?.errorName);try{return await Promise.race([r,new Promise((i,a)=>{n=()=>{a(o)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var Xe=class{readNext;haveNext;ended;nextResult;error;constructor(){this.ended=!1,this.readNext=F(),this.haveNext=F()}[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=F(),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,t){await this._push(e,t)}async end(e,t){e!=null?await this.throw(e):await this._push(void 0,t)}async _push(e,t){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=F(),await ue(this.readNext.promise,t?.signal,t)}};function we(){return new Xe}var Ee=class extends Error{name="UnexpectedEOFError";code="ERR_UNEXPECTED_EOF"};function Mt(r,e){let t=we();r.sink(t).catch(async a=>{await t.end(a)}),r.sink=async a=>{for await(let f of a)await t.push(f);await t.end()};let n=r.source;r.source[Symbol.iterator]!=null?n=r.source[Symbol.iterator]():r.source[Symbol.asyncIterator]!=null&&(n=r.source[Symbol.asyncIterator]());let o=new xe;return{read:async a=>{if(a?.signal?.throwIfAborted(),a?.bytes==null){let{done:c,value:A}=await ue(n.next(),a?.signal);return c===!0?null:A}for(;o.byteLength<a.bytes;){let{value:c,done:A}=await ue(n.next(),a?.signal);if(A===!0)throw new Ee("unexpected end of input");o.append(c)}let f=o.sublist(0,a.bytes);return o.consume(a.bytes),f},write:async(a,f)=>{f?.signal?.throwIfAborted(),a instanceof Uint8Array?await t.push(a,f):await t.push(a.subarray(),f)},unwrap:()=>{if(o.byteLength>0){let a=r.source;r.source=async function*(){e?.yieldBytes===!1?yield o:yield*o,yield*a}()}return r}}}function dn(r){let[e,t]=r[Symbol.asyncIterator]!=null?[r[Symbol.asyncIterator](),Symbol.asyncIterator]:[r[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:o=>{n.push(o)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[t](){return this}}}var Tt=dn;function An(r){return r[Symbol.asyncIterator]!=null}function xn(r,e){let t=0;if(An(r))return async function*(){for await(let c of r)yield e(c,t++)}();let n=Tt(r),{value:o,done:i}=n.next();if(i===!0)return function*(){}();let a=e(o,t++);if(typeof a.then=="function")return async function*(){yield await a;for(let c of n)yield e(c,t++)}();let f=e;return function*(){yield a;for(let c of n)yield f(c,t++)}()}var _t=xn;function We(){let r=F(),e=!1;return{sink:async t=>{if(e)throw new Error("already piped");e=!0,r.resolve(t)},source:async function*(){yield*await r.promise}()}}function Rt(){let r=We(),e=We();return[{source:r.source,sink:e.sink},{source:e.source,sink:r.sink}]}var Ie=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||(e-1&e)!==0)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},re=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Ie(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new Ie(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var $e=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function qt(r={}){return mn(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function mn(r,e){e=e??{};let t=e.onEnd,n=new re,o,i,a,f=F(),c=async()=>{try{return n.isEmpty()?a?{done:!0}:await new Promise((u,E)=>{i=N=>{i=null,n.push(N);try{u(r(n))}catch(D){E(D)}return o}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{f.resolve(),f=F()})}},A=u=>i!=null?i(u):(n.push(u),o),w=u=>(n=new re,i!=null?i({error:u}):(n.push({error:u}),o)),m=u=>{if(a)return o;if(e?.objectMode!==!0&&u?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return A({done:!1,value:u})},L=u=>a?o:(a=!0,u!=null?w(u):A({done:!0})),z=()=>(n=new re,L(),{done:!0}),l=u=>(L(u),{done:!0});if(o={[Symbol.asyncIterator](){return this},next:c,return:z,throw:l,push:m,end:L,get readableLength(){return n.size},onEmpty:async u=>{let E=u?.signal;if(E?.throwIfAborted(),n.isEmpty())return;let N,D;E!=null&&(N=new Promise((h,p)=>{D=()=>{p(new $e)},E.addEventListener("abort",D)}));try{await Promise.race([f.promise,N])}finally{D!=null&&E!=null&&E?.removeEventListener("abort",D)}}},t==null)return o;let b=o;return o={[Symbol.asyncIterator](){return this},next(){return b.next()},throw(u){return b.throw(u),t!=null&&(t(u),t=void 0),{done:!0}},return(){return b.return(),t!=null&&(t(),t=void 0),{done:!0}},push:m,end(u){return b.end(u),t!=null&&(t(u),t=void 0),o},get readableLength(){return b.readableLength},onEmpty:u=>b.onEmpty(u)},o}function gn(r){return r[Symbol.asyncIterator]!=null}async function yn(r,e,t){try{await Promise.all(r.map(async n=>{for await(let o of n)await e.push(o,{signal:t}),t.throwIfAborted()})),await e.end(void 0,{signal:t})}catch(n){await e.end(n,{signal:t}).catch(()=>{})}}async function*bn(r){let e=new AbortController,t=we();yn(r,t,e.signal).catch(()=>{});try{yield*t}finally{e.abort()}}function*wn(r){for(let e of r)yield*e}function En(...r){let e=[];for(let t of r)gn(t)||e.push(t);return e.length===r.length?wn(e):bn(r)}var zt=En;function Ft(r,...e){if(r==null)throw new Error("Empty pipeline");if(Ze(r)){let n=r;r=()=>n.source}else if(kt(r)||Ot(r)){let n=r;r=()=>n}let t=[r,...e];if(t.length>1&&Ze(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let n=1;n<t.length-1;n++)Ze(t[n])&&(t[n]=Bn(t[n]));return In(...t)}var In=(...r)=>{let e;for(;r.length>0;)e=r.shift()(e);return e},Ot=r=>r?.[Symbol.asyncIterator]!=null,kt=r=>r?.[Symbol.iterator]!=null,Ze=r=>r==null?!1:r.sink!=null&&r.source!=null,Bn=r=>e=>{let t=r.sink(e);if(t?.then!=null){let n=qt({objectMode:!0});t.then(()=>{n.end()},a=>{n.end(a)});let o,i=r.source;if(Ot(i))o=async function*(){yield*i,n.end()};else if(kt(i))o=function*(){yield*i,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return zt(n,o())}return r.source};var ot=nr(Ht(),1);var tt="Your private shared key is invalid";function Jt(r){let e=ye(te(nt),"base16"),t=ge(`/key/swarm/psk/1.0.0/
|
2
|
+
"use strict";var Libp2PPnet=(()=>{var sr=Object.create;var xe=Object.defineProperty;var or=Object.getOwnPropertyDescriptor;var ir=Object.getOwnPropertyNames;var ar=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty;var At=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),P=(r,e)=>{for(var t in e)xe(r,t,{get:e[t],enumerable:!0})},wt=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ir(e))!fr.call(r,s)&&s!==t&&xe(r,s,{get:()=>e[s],enumerable:!(n=or(e,s))||n.enumerable});return r};var cr=(r,e,t)=>(t=r!=null?sr(ar(r)):{},wt(e||!r||!r.__esModule?xe(t,"default",{value:r,enumerable:!0}):t,r)),ur=r=>wt(xe({},"__esModule",{value:!0}),r);var Yt=At((Zo,Jt)=>{var Nn=(r,e)=>function(){return e||(0,r[Object.keys(r)[0]])((e={exports:{}}).exports,e),e.exports},Mn=(()=>{for(var r=new Uint8Array(128),e=0;e<64;e++)r[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return t=>{for(var n=t.length,s=new Uint8Array((n-(t[n-1]=="=")-(t[n-2]=="="))*3/4|0),i=0,a=0;i<n;){var f=r[t.charCodeAt(i++)],h=r[t.charCodeAt(i++)],x=r[t.charCodeAt(i++)],c=r[t.charCodeAt(i++)];s[a++]=f<<2|h>>4,s[a++]=h<<4|x>>2,s[a++]=x<<6|c}return s}})(),Un=Nn({"wasm-binary:./xsalsa20.wat"(r,e){e.exports=Mn("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")}}),Rn=Un(),Tn=new WebAssembly.Module(Rn);Jt.exports=r=>new WebAssembly.Instance(Tn,r).exports});var tr=At((ei,er)=>{var me=typeof WebAssembly<"u"&&Yt()(),Te=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),q=144,oe=q,Re=[];er.exports=z;z.NONCEBYTES=24;z.KEYBYTES=32;z.core_hsalsa20=Zt;z.SIGMA=Te;function z(r,e){if(!(this instanceof z))return new z(r,e);if(!r||r.length<24)throw new Error("nonce must be at least 24 bytes");if(!e||e.length<32)throw new Error("key must be at least 32 bytes");this._xor=me?new Fe(r,e):new lt(r,e)}z.prototype.update=function(r,e){if(!r)throw new Error("input must be Uint8Array or Buffer");return e||(e=new Uint8Array(r.length)),r.length&&this._xor.update(r,e),e};z.prototype.final=z.prototype.finalize=function(){this._xor.finalize(),this._xor=null};function Fe(r,e){Re.length||(Re.push(q),q+=64),this._pointer=Re.pop(),this._nonce=this._pointer+8,this._key=this._nonce+24,this._overflow=0,this._memory=new Uint8Array(me.memory.buffer),this._memory.fill(0,this._pointer,this._pointer+8),this._memory.set(r,this._nonce),this._memory.set(e,this._key)}Fe.prototype.realloc=function(r){me.memory.grow(Math.ceil(Math.abs(r-this._memory.length)/65536)),this._memory=new Uint8Array(me.memory.buffer)};Fe.prototype.update=function(r,e){var t=this._overflow+r.length,n=q+this._overflow;oe=q+t,oe>=this._memory.length&&this.realloc(oe),this._memory.set(r,n),me.xsalsa20_xor(this._pointer,q,q,t,this._nonce,this._key),e.set(this._memory.subarray(n,q+t)),this._overflow=t&63};Fe.prototype.finalize=function(){this._memory.fill(0,this._pointer,this._key+32),oe>q&&(this._memory.fill(0,q,oe),oe=0),Re.push(this._pointer)};function lt(r,e){this._s=new Uint8Array(32),this._z=new Uint8Array(16),this._overflow=0,Zt(this._s,r,e,Te);for(var t=0;t<8;t++)this._z[t]=r[t+16]}lt.prototype.update=function(r,e){for(var t=new Uint8Array(64),n=0,s=this._overflow,i=r.length+this._overflow,a=this._z,f=-this._overflow,h=-this._overflow;i>=64;){for(Xt(t,a,this._s,Te);s<64;s++)e[h+s]=r[f+s]^t[s];for(n=1,s=8;s<16;s++)n+=a[s]&255|0,a[s]=n&255,n>>>=8;i-=64,h+=64,f+=64,s=0}if(i>0)for(Xt(t,a,this._s,Te);s<i;s++)e[h+s]=r[f+s]^t[s];this._overflow=i&63};lt.prototype.finalize=function(){this._s.fill(0),this._z.fill(0)};function Xt(r,e,t,n){for(var s=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,i=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,a=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,h=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,x=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,c=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,u=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,A=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,p=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,m=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,I=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,l=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,B=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,U=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,N=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,d=s,g=i,y=a,w=f,b=h,E=x,v=c,L=u,S=A,C=p,D=m,R=I,T=l,F=B,_=U,Q=N,o,ie=0;ie<20;ie+=2)o=d+T|0,b^=o<<7|o>>>25,o=b+d|0,S^=o<<9|o>>>23,o=S+b|0,T^=o<<13|o>>>19,o=T+S|0,d^=o<<18|o>>>14,o=E+g|0,C^=o<<7|o>>>25,o=C+E|0,F^=o<<9|o>>>23,o=F+C|0,g^=o<<13|o>>>19,o=g+F|0,E^=o<<18|o>>>14,o=D+v|0,_^=o<<7|o>>>25,o=_+D|0,y^=o<<9|o>>>23,o=y+_|0,v^=o<<13|o>>>19,o=v+y|0,D^=o<<18|o>>>14,o=Q+R|0,w^=o<<7|o>>>25,o=w+Q|0,L^=o<<9|o>>>23,o=L+w|0,R^=o<<13|o>>>19,o=R+L|0,Q^=o<<18|o>>>14,o=d+w|0,g^=o<<7|o>>>25,o=g+d|0,y^=o<<9|o>>>23,o=y+g|0,w^=o<<13|o>>>19,o=w+y|0,d^=o<<18|o>>>14,o=E+b|0,v^=o<<7|o>>>25,o=v+E|0,L^=o<<9|o>>>23,o=L+v|0,b^=o<<13|o>>>19,o=b+L|0,E^=o<<18|o>>>14,o=D+C|0,R^=o<<7|o>>>25,o=R+D|0,S^=o<<9|o>>>23,o=S+R|0,C^=o<<13|o>>>19,o=C+S|0,D^=o<<18|o>>>14,o=Q+_|0,T^=o<<7|o>>>25,o=T+Q|0,F^=o<<9|o>>>23,o=F+T|0,_^=o<<13|o>>>19,o=_+F|0,Q^=o<<18|o>>>14;d=d+s|0,g=g+i|0,y=y+a|0,w=w+f|0,b=b+h|0,E=E+x|0,v=v+c|0,L=L+u|0,S=S+A|0,C=C+p|0,D=D+m|0,R=R+I|0,T=T+l|0,F=F+B|0,_=_+U|0,Q=Q+N|0,r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=g>>>0&255,r[5]=g>>>8&255,r[6]=g>>>16&255,r[7]=g>>>24&255,r[8]=y>>>0&255,r[9]=y>>>8&255,r[10]=y>>>16&255,r[11]=y>>>24&255,r[12]=w>>>0&255,r[13]=w>>>8&255,r[14]=w>>>16&255,r[15]=w>>>24&255,r[16]=b>>>0&255,r[17]=b>>>8&255,r[18]=b>>>16&255,r[19]=b>>>24&255,r[20]=E>>>0&255,r[21]=E>>>8&255,r[22]=E>>>16&255,r[23]=E>>>24&255,r[24]=v>>>0&255,r[25]=v>>>8&255,r[26]=v>>>16&255,r[27]=v>>>24&255,r[28]=L>>>0&255,r[29]=L>>>8&255,r[30]=L>>>16&255,r[31]=L>>>24&255,r[32]=S>>>0&255,r[33]=S>>>8&255,r[34]=S>>>16&255,r[35]=S>>>24&255,r[36]=C>>>0&255,r[37]=C>>>8&255,r[38]=C>>>16&255,r[39]=C>>>24&255,r[40]=D>>>0&255,r[41]=D>>>8&255,r[42]=D>>>16&255,r[43]=D>>>24&255,r[44]=R>>>0&255,r[45]=R>>>8&255,r[46]=R>>>16&255,r[47]=R>>>24&255,r[48]=T>>>0&255,r[49]=T>>>8&255,r[50]=T>>>16&255,r[51]=T>>>24&255,r[52]=F>>>0&255,r[53]=F>>>8&255,r[54]=F>>>16&255,r[55]=F>>>24&255,r[56]=_>>>0&255,r[57]=_>>>8&255,r[58]=_>>>16&255,r[59]=_>>>24&255,r[60]=Q>>>0&255,r[61]=Q>>>8&255,r[62]=Q>>>16&255,r[63]=Q>>>24&255}function Zt(r,e,t,n){for(var s=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,i=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,a=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,h=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,x=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,c=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,u=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,A=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,p=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,m=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,I=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,l=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,B=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,U=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,N=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,d=s,g=i,y=a,w=f,b=h,E=x,v=c,L=u,S=A,C=p,D=m,R=I,T=l,F=B,_=U,Q=N,o,ie=0;ie<20;ie+=2)o=d+T|0,b^=o<<7|o>>>25,o=b+d|0,S^=o<<9|o>>>23,o=S+b|0,T^=o<<13|o>>>19,o=T+S|0,d^=o<<18|o>>>14,o=E+g|0,C^=o<<7|o>>>25,o=C+E|0,F^=o<<9|o>>>23,o=F+C|0,g^=o<<13|o>>>19,o=g+F|0,E^=o<<18|o>>>14,o=D+v|0,_^=o<<7|o>>>25,o=_+D|0,y^=o<<9|o>>>23,o=y+_|0,v^=o<<13|o>>>19,o=v+y|0,D^=o<<18|o>>>14,o=Q+R|0,w^=o<<7|o>>>25,o=w+Q|0,L^=o<<9|o>>>23,o=L+w|0,R^=o<<13|o>>>19,o=R+L|0,Q^=o<<18|o>>>14,o=d+w|0,g^=o<<7|o>>>25,o=g+d|0,y^=o<<9|o>>>23,o=y+g|0,w^=o<<13|o>>>19,o=w+y|0,d^=o<<18|o>>>14,o=E+b|0,v^=o<<7|o>>>25,o=v+E|0,L^=o<<9|o>>>23,o=L+v|0,b^=o<<13|o>>>19,o=b+L|0,E^=o<<18|o>>>14,o=D+C|0,R^=o<<7|o>>>25,o=R+D|0,S^=o<<9|o>>>23,o=S+R|0,C^=o<<13|o>>>19,o=C+S|0,D^=o<<18|o>>>14,o=Q+_|0,T^=o<<7|o>>>25,o=T+Q|0,F^=o<<9|o>>>23,o=F+T|0,_^=o<<13|o>>>19,o=_+F|0,Q^=o<<18|o>>>14;r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=E>>>0&255,r[5]=E>>>8&255,r[6]=E>>>16&255,r[7]=E>>>24&255,r[8]=D>>>0&255,r[9]=D>>>8&255,r[10]=D>>>16&255,r[11]=D>>>24&255,r[12]=Q>>>0&255,r[13]=Q>>>8&255,r[14]=Q>>>16&255,r[15]=Q>>>24&255,r[16]=v>>>0&255,r[17]=v>>>8&255,r[18]=v>>>16&255,r[19]=v>>>24&255,r[20]=L>>>0&255,r[21]=L>>>8&255,r[22]=L>>>16&255,r[23]=L>>>24&255,r[24]=S>>>0&255,r[25]=S>>>8&255,r[26]=S>>>16&255,r[27]=S>>>24&255,r[28]=C>>>0&255,r[29]=C>>>8&255,r[30]=C>>>16&255,r[31]=C>>>24&255}});var Pn={};P(Pn,{generateKey:()=>rr,preSharedKey:()=>_n});var V=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}};var ge=class extends Error{static name="StreamResetError";constructor(e="The stream has been reset"){super(e),this.name="StreamResetError"}};var W=class extends Error{static name="StreamStateError";constructor(e="The stream is in an invalid state"){super(e),this.name="StreamStateError"}},ae=class extends Error{static name="StreamBufferError";constructor(e="The stream buffer was full"){super(e),this.name="StreamBufferError"}};var Ae=class extends Event{data;constructor(e,t){super("message",t),this.data=e}},J=class extends Event{error;local;constructor(e,t,n){super("close",n),this.error=t,this.local=e}},we=class extends J{constructor(e,t){super(!0,e,t)}},be=class extends J{constructor(e,t){super(!1,e,t)}};var ye=class extends EventTarget{#e=new Map;constructor(){super()}listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,n){super.addEventListener(e,t,n);let s=this.#e.get(e);s==null&&(s=[],this.#e.set(e,s)),s.push({callback:t,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,t,n){super.removeEventListener(e.toString(),t??null,n);let s=this.#e.get(e);s!=null&&(s=s.filter(({callback:i})=>i!==t),this.#e.set(e,s))}dispatchEvent(e){let t=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:s})=>!s),this.#e.set(e.type,n)),t}safeDispatchEvent(e,t={}){return this.dispatchEvent(new CustomEvent(e,t))}};var ke={};P(ke,{base58btc:()=>O,base58flickr:()=>gr});var Gn=new Uint8Array(0);function bt(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function k(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function yt(r){return new TextEncoder().encode(r)}function Et(r){return new TextDecoder().decode(r)}function hr(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var s=0;s<r.length;s++){var i=r.charAt(s),a=i.charCodeAt(0);if(t[a]!==255)throw new TypeError(i+" is ambiguous");t[a]=s}var f=r.length,h=r.charAt(0),x=Math.log(f)/Math.log(256),c=Math.log(256)/Math.log(f);function u(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var I=0,l=0,B=0,U=m.length;B!==U&&m[B]===0;)B++,I++;for(var N=(U-B)*c+1>>>0,d=new Uint8Array(N);B!==U;){for(var g=m[B],y=0,w=N-1;(g!==0||y<l)&&w!==-1;w--,y++)g+=256*d[w]>>>0,d[w]=g%f>>>0,g=g/f>>>0;if(g!==0)throw new Error("Non-zero carry");l=y,B++}for(var b=N-l;b!==N&&d[b]===0;)b++;for(var E=h.repeat(I);b<N;++b)E+=r.charAt(d[b]);return E}function A(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var I=0;if(m[I]!==" "){for(var l=0,B=0;m[I]===h;)l++,I++;for(var U=(m.length-I)*x+1>>>0,N=new Uint8Array(U);m[I];){var d=t[m.charCodeAt(I)];if(d===255)return;for(var g=0,y=U-1;(d!==0||g<B)&&y!==-1;y--,g++)d+=f*N[y]>>>0,N[y]=d%256>>>0,d=d/256>>>0;if(d!==0)throw new Error("Non-zero carry");B=g,I++}if(m[I]!==" "){for(var w=U-B;w!==U&&N[w]===0;)w++;for(var b=new Uint8Array(l+(U-w)),E=l;w!==U;)b[E++]=N[w++];return b}}}function p(m){var I=A(m);if(I)return I;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:A,decode:p}}var lr=hr,dr=lr,Bt=dr;var Pe=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Oe=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let s=t.codePointAt(0);if(s===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s,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 vt(this,e)}},qe=class{decoders;constructor(e){this.decoders=e}or(e){return vt(this,e)}decode(e){let t=e[0],n=this.decoders[t];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 vt(r,e){return new qe({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var ze=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,s){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=s,this.encoder=new Pe(e,t,n),this.decoder=new Oe(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Y({name:r,prefix:e,encode:t,decode:n}){return new ze(r,e,t,n)}function j({name:r,prefix:e,alphabet:t}){let{encode:n,decode:s}=Bt(t,r);return Y({prefix:e,name:r,encode:n,decode:i=>k(s(i))})}function pr(r,e,t,n){let s=r.length;for(;r[s-1]==="=";)--s;let i=new Uint8Array(s*t/8|0),a=0,f=0,h=0;for(let x=0;x<s;++x){let c=e[r[x]];if(c===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|c,a+=t,a>=8&&(a-=8,i[h++]=255&f>>a)}if(a>=t||(255&f<<8-a)!==0)throw new SyntaxError("Unexpected end of data");return i}function mr(r,e,t){let n=e[e.length-1]==="=",s=(1<<t)-1,i="",a=0,f=0;for(let h=0;h<r.length;++h)for(f=f<<8|r[h],a+=8;a>t;)a-=t,i+=e[s&f>>a];if(a!==0&&(i+=e[s&f<<t-a]),n)for(;(i.length*t&7)!==0;)i+="=";return i}function xr(r){let e={};for(let t=0;t<r.length;++t)e[r[t]]=t;return e}function M({name:r,prefix:e,bitsPerChar:t,alphabet:n}){let s=xr(n);return Y({prefix:e,name:r,encode(i){return mr(i,n,t)},decode(i){return pr(i,s,t,r)}})}var O=j({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gr=j({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ge={};P(Ge,{base32:()=>X,base32hex:()=>yr,base32hexpad:()=>Ir,base32hexpadupper:()=>Br,base32hexupper:()=>Er,base32pad:()=>wr,base32padupper:()=>br,base32upper:()=>Ar,base32z:()=>vr});var X=M({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ar=M({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),wr=M({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),br=M({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),yr=M({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Er=M({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ir=M({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Br=M({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),vr=M({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ve={};P(Ve,{base36:()=>fe,base36upper:()=>Lr});var fe=j({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Lr=j({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Sr=Ct,Lt=128,Cr=127,Dr=~Cr,Qr=Math.pow(2,31);function Ct(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Qr;)e[t++]=r&255|Lt,r/=128;for(;r&Dr;)e[t++]=r&255|Lt,r>>>=7;return e[t]=r|0,Ct.bytes=t-n+1,e}var Nr=je,Mr=128,St=127;function je(r,n){var t=0,n=n||0,s=0,i=n,a,f=r.length;do{if(i>=f)throw je.bytes=0,new RangeError("Could not decode varint");a=r[i++],t+=s<28?(a&St)<<s:(a&St)*Math.pow(2,s),s+=7}while(a>=Mr);return je.bytes=i-n,t}var Ur=Math.pow(2,7),Rr=Math.pow(2,14),Tr=Math.pow(2,21),Fr=Math.pow(2,28),_r=Math.pow(2,35),Pr=Math.pow(2,42),Or=Math.pow(2,49),qr=Math.pow(2,56),zr=Math.pow(2,63),kr=function(r){return r<Ur?1:r<Rr?2:r<Tr?3:r<Fr?4:r<_r?5:r<Pr?6:r<Or?7:r<qr?8:r<zr?9:10},Gr={encode:Sr,decode:Nr,encodingLength:kr},Vr=Gr,ce=Vr;function ue(r,e=0){return[ce.decode(r,e),ce.decode.bytes]}function Z(r,e,t=0){return ce.encode(r,e,t),e}function ee(r){return ce.encodingLength(r)}function re(r,e){let t=e.byteLength,n=ee(r),s=n+ee(t),i=new Uint8Array(s+t);return Z(r,i,0),Z(t,i,n),i.set(e,s),new te(r,t,e,i)}function Dt(r){let e=k(r),[t,n]=ue(e),[s,i]=ue(e.subarray(n)),a=e.subarray(n+i);if(a.byteLength!==s)throw new Error("Incorrect length");return new te(t,s,a,e)}function Qt(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&bt(r.bytes,t.bytes)}}var te=class{code;size;digest;bytes;constructor(e,t,n,s){this.code=e,this.size=t,this.digest=n,this.bytes=s}};function Nt(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return Hr(t,He(r),e??O.encoder);default:return Kr(t,He(r),e??X.encoder)}}var Mt=new WeakMap;function He(r){let e=Mt.get(r);if(e==null){let t=new Map;return Mt.set(r,t),t}return e}var Ie=class r{code;version;multihash;bytes;"/";constructor(e,t,n,s){this.code=t,this.version=e,this.multihash=n,this.bytes=s,this["/"]=s}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:t}=this;if(e!==le)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Wr)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}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:t}=this.multihash,n=re(e,t);return r.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 r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&Qt(e.multihash,n.multihash)}toString(e){return Nt(this,e)}toJSON(){return{"/":Nt(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 t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:s,multihash:i,bytes:a}=t;return new r(n,s,i,a??Ut(n,s,i.bytes))}else if(t[$r]===!0){let{version:n,multihash:s,code:i}=t,a=Dt(s);return r.create(n,i,a)}else return null}static create(e,t,n){if(typeof t!="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(t!==le)throw new Error(`Version 0 CID must use dag-pb (code: ${le}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let s=Ut(e,t,n.bytes);return new r(e,t,n,s)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,le,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,s=k(e.subarray(n,n+t.multihashSize));if(s.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=s.subarray(t.multihashSize-t.digestSize),a=new te(t.multihashCode,t.digestSize,i,s);return[t.version===0?r.createV0(a):r.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[u,A]=ue(e.subarray(t));return t+=A,u},s=n(),i=le;if(s===18?(s=0,t=0):i=n(),s!==0&&s!==1)throw new RangeError(`Invalid CID version ${s}`);let a=t,f=n(),h=n(),x=t+h,c=x-a;return{version:s,codec:i,multihashCode:f,digestSize:h,multihashSize:c,size:x}}static parse(e,t){let[n,s]=jr(e,t),i=r.decode(s);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return He(i).set(n,e),i}};function jr(r,e){switch(r[0]){case"Q":{let t=e??O;return[O.prefix,t.decode(`${O.prefix}${r}`)]}case O.prefix:{let t=e??O;return[O.prefix,t.decode(r)]}case X.prefix:{let t=e??X;return[X.prefix,t.decode(r)]}case fe.prefix:{let t=e??fe;return[fe.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function Hr(r,e,t){let{prefix:n}=t;if(n!==O.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let s=e.get(n);if(s==null){let i=t.encode(r).slice(1);return e.set(n,i),i}else return s}function Kr(r,e,t){let{prefix:n}=t,s=e.get(n);if(s==null){let i=t.encode(r);return e.set(n,i),i}else return s}var le=112,Wr=18;function Ut(r,e,t){let n=ee(r),s=n+ee(e),i=new Uint8Array(s+t.byteLength);return Z(r,i,0),Z(e,i,n),i.set(t,s),i}var $r=Symbol.for("@ipld/js-cid/CID");var Ke={};P(Ke,{identity:()=>Xr});var Rt=0,Jr="identity",Tt=k;function Yr(r,e){if(e?.truncate!=null&&e.truncate!==r.byteLength){if(e.truncate<0||e.truncate>r.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${r.byteLength}`);r=r.subarray(0,e.truncate)}return re(Rt,Tt(r))}var Xr={code:Rt,name:Jr,encode:Tt,digest:Yr};function Ft(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function G(r=0){return new Uint8Array(r)}function H(r=0){return new Uint8Array(r)}function We(r,e){e==null&&(e=r.reduce((s,i)=>s+i.length,0));let t=H(e),n=0;for(let s of r)t.set(s,n),n+=s.length;return t}var Pt=Symbol.for("@achingbrain/uint8arraylist");function _t(r,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let n of r){let s=t+n.byteLength;if(e<s)return{buf:n,index:e-t};t=s}throw new RangeError("index is out of bounds")}function Be(r){return!!r?.[Pt]}var K=class r{bufs;length;[Pt]=!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 t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(Be(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(Be(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=_t(this.bufs,e);return t.buf[t.index]}set(e,t){let n=_t(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(t+n,e[n]);else if(Be(e))for(let n=0;n<e.length;n++)this.set(t+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,t){let{bufs:n,length:s}=this._subList(e,t);return We(n,s)}subarray(e,t){let{bufs:n,length:s}=this._subList(e,t);return n.length===1?n[0]:We(n,s)}sublist(e,t){let{bufs:n,length:s}=this._subList(e,t),i=new r;return i.length=s,i.bufs=[...n],i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:this.bufs,length:this.length};let n=[],s=0;for(let i=0;i<this.bufs.length;i++){let a=this.bufs[i],f=s,h=f+a.byteLength;if(s=h,e>=h)continue;let x=e>=f&&e<h,c=t>f&&t<=h;if(x&&c){if(e===f&&t===h){n.push(a);break}let u=e-f;n.push(a.subarray(u,u+(t-e)));break}if(x){if(e===0){n.push(a);continue}n.push(a.subarray(e-f));continue}if(c){if(t===h){n.push(a);break}n.push(a.subarray(0,t-f));break}n.push(a)}return{bufs:n,length:t-e}}indexOf(e,t=0){if(!Be(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(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let s=n.byteLength;if(s===0)throw new TypeError("search must be at least 1 byte long");let i=256,a=new Int32Array(i);for(let u=0;u<i;u++)a[u]=-1;for(let u=0;u<s;u++)a[n[u]]=u;let f=a,h=this.byteLength-n.byteLength,x=n.byteLength-1,c;for(let u=t;u<=h;u+=c){c=0;for(let A=x;A>=0;A--){let p=this.get(u+A);if(n[A]!==p){c=Math.max(1,A-f[p]);break}}if(c===0)return u}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=H(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let s=G(2);new DataView(s.buffer,s.byteOffset,s.byteLength).setInt16(0,t,n),this.write(s,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let s=G(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setInt32(0,t,n),this.write(s,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let s=G(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setBigInt64(0,t,n),this.write(s,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=H(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let s=G(2);new DataView(s.buffer,s.byteOffset,s.byteLength).setUint16(0,t,n),this.write(s,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let s=G(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setUint32(0,t,n),this.write(s,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let s=G(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setBigUint64(0,t,n),this.write(s,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let s=G(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setFloat32(0,t,n),this.write(s,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let s=G(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setFloat64(0,t,n),this.write(s,e)}equals(e){if(e==null||!(e instanceof r)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!Ft(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let n=new r;return n.bufs=e,t==null&&(t=e.reduce((s,i)=>s+i.byteLength,0)),n.length=t,n}};var $e={};P($e,{base10:()=>Zr});var Zr=j({prefix:"9",name:"base10",alphabet:"0123456789"});var Je={};P(Je,{base16:()=>en,base16upper:()=>tn});var en=M({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),tn=M({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Ye={};P(Ye,{base2:()=>rn});var rn=M({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Xe={};P(Xe,{base256emoji:()=>fn});var Ot=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}"),nn=Ot.reduce((r,e,t)=>(r[t]=e,r),[]),sn=Ot.reduce((r,e,t)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return r[n]=t,r},[]);function on(r){return r.reduce((e,t)=>(e+=nn[t],e),"")}function an(r){let e=[];for(let t of r){let n=t.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${t}`);let s=sn[n];if(s==null)throw new Error(`Non-base256emoji character: ${t}`);e.push(s)}return new Uint8Array(e)}var fn=Y({prefix:"\u{1F680}",name:"base256emoji",encode:on,decode:an});var Ze={};P(Ze,{base64:()=>cn,base64pad:()=>un,base64url:()=>hn,base64urlpad:()=>ln});var cn=M({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),un=M({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),hn=M({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=M({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var et={};P(et,{base8:()=>dn});var dn=M({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var tt={};P(tt,{identity:()=>pn});var pn=Y({prefix:"\0",name:"identity",encode:r=>Et(r),decode:r=>yt(r)});var Ls=new TextEncoder,Ss=new TextDecoder;var st={};P(st,{sha256:()=>An,sha512:()=>wn});var gn=20;function nt({name:r,code:e,encode:t,minDigestLength:n,maxDigestLength:s}){return new rt(r,e,t,n,s)}var rt=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,s,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=s??gn,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?qt(n,this.code,t?.truncate):n.then(s=>qt(s,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function qt(r,e,t){if(t!=null&&t!==r.byteLength){if(t>r.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${r.byteLength}`);r=r.subarray(0,t)}return re(e,r)}function kt(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var An=nt({name:"sha2-256",code:18,encode:kt("SHA-256")}),wn=nt({name:"sha2-512",code:19,encode:kt("SHA-512")});var ot={...tt,...Ye,...et,...$e,...Je,...Ge,...Ve,...ke,...Ze,...Xe},Os={...st,...Ke};function Vt(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var Gt=Vt("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),it=Vt("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=H(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),bn={utf8:Gt,"utf-8":Gt,hex:ot.base16,latin1:it,ascii:it,binary:it,...ot},ve=bn;function Le(r,e="utf8"){let t=ve[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}function Se(r,e="utf8"){let t=ve[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var $=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function jt(r=32){if($&&typeof $.getRandomValues=="function")return $.getRandomValues(new Uint8Array(r));if($&&typeof $.randomBytes=="function")return Uint8Array.from($.randomBytes(r));throw new Error("crypto.getRandomValues must be defined")}var Xs=Math.pow(2,7),Zs=Math.pow(2,14),eo=Math.pow(2,21),to=Math.pow(2,28),ro=Math.pow(2,35),no=Math.pow(2,42),so=Math.pow(2,49);function ne(r){if(isNaN(r)||r<=0)throw new V("random bytes length must be a Number bigger than 0");return jt(r)}function Ce(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var De=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||(e-1&e)!==0)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},se=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new De(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new De(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var at=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function Qe(r={}){return En(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function En(r,e){e=e??{};let t=e.onEnd,n=new se,s,i,a,f=Ce(),h=async()=>{try{return n.isEmpty()?a?{done:!0}:await new Promise((l,B)=>{i=U=>{i=null,n.push(U);try{l(r(n))}catch(N){B(N)}return s}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{f.resolve(),f=Ce()})}},x=l=>i!=null?i(l):(n.push(l),s),c=l=>(n=new se,i!=null?i({error:l}):(n.push({error:l}),s)),u=l=>{if(a)return s;if(e?.objectMode!==!0&&l?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return x({done:!1,value:l})},A=l=>a?s:(a=!0,l!=null?c(l):x({done:!0})),p=()=>(n=new se,A(),{done:!0}),m=l=>(A(l),{done:!0});if(s={[Symbol.asyncIterator](){return this},next:h,return:p,throw:m,push:u,end:A,get readableLength(){return n.size},onEmpty:async l=>{let B=l?.signal;if(B?.throwIfAborted(),n.isEmpty())return;let U,N;B!=null&&(U=new Promise((d,g)=>{N=()=>{g(new at)},B.addEventListener("abort",N)}));try{await Promise.race([f.promise,U])}finally{N!=null&&B!=null&&B?.removeEventListener("abort",N)}}},t==null)return s;let I=s;return s={[Symbol.asyncIterator](){return this},next(){return I.next()},throw(l){return I.throw(l),t!=null&&(t(l),t=void 0),{done:!0}},return(){return I.return(),t!=null&&(t(),t=void 0),{done:!0}},push:u,end(l){return I.end(l),t!=null&&(t(l),t=void 0),s},get readableLength(){return I.readableLength},onEmpty:l=>I.onEmpty(l)},s}var ft=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},ct=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Ht=r=>globalThis.DOMException===void 0?new ct(r):new DOMException(r),Kt=r=>{let e=r.reason===void 0?Ht("This operation was aborted."):r.reason;return e instanceof Error?e:Ht(e)};function ut(r,e){let{milliseconds:t,fallback:n,message:s,customTimers:i={setTimeout,clearTimeout}}=e,a,f,x=new Promise((c,u)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:p}=e;p.aborted&&u(Kt(p)),f=()=>{u(Kt(p))},p.addEventListener("abort",f,{once:!0})}if(t===Number.POSITIVE_INFINITY){r.then(c,u);return}let A=new ft;a=i.setTimeout.call(void 0,()=>{if(n){try{c(n())}catch(p){u(p)}return}typeof r.cancel=="function"&&r.cancel(),s===!1?c():s instanceof Error?u(s):(A.message=s??`Promise timed out after ${t} milliseconds`,u(A))},t),(async()=>{try{c(await r)}catch(p){u(p)}})()}).finally(()=>{x.clear(),f&&e.signal&&e.signal.removeEventListener("abort",f)});return x.clear=()=>{i.clearTimeout.call(void 0,a),a=void 0},x}var In=r=>{let e=r.addEventListener||r.on||r.addListener,t=r.removeEventListener||r.off||r.removeListener;if(!e||!t)throw new TypeError("Emitter is not compatible");return{addListener:e.bind(r),removeListener:t.bind(r)}};function Bn(r,e,t){let n,s=new Promise((i,a)=>{if(t={rejectionEvents:["error"],multiArgs:!1,resolveImmediately:!1,...t},!(t.count>=0&&(t.count===Number.POSITIVE_INFINITY||Number.isInteger(t.count))))throw new TypeError("The `count` option should be at least 0 or more");t.signal?.throwIfAborted();let f=[e].flat(),h=[],{addListener:x,removeListener:c}=In(r),u=(...p)=>{let m=t.multiArgs?p:p[0];t.filter&&!t.filter(m)||(h.push(m),t.count===h.length&&(n(),i(h)))},A=p=>{n(),a(p)};n=()=>{for(let p of f)c(p,u);for(let p of t.rejectionEvents)c(p,A)};for(let p of f)x(p,u);for(let p of t.rejectionEvents)x(p,A);t.signal&&t.signal.addEventListener("abort",()=>{A(t.signal.reason)},{once:!0}),t.resolveImmediately&&i(h)});if(s.cancel=n,typeof t.timeout=="number"){let i=ut(s,{milliseconds:t.timeout});return i.cancel=n,i}return s}function de(r,e,t){typeof t=="function"&&(t={filter:t}),t={...t,count:1,resolveImmediately:!1};let n=Bn(r,e,t),s=n.then(i=>i[0]);return s.cancel=n.cancel,s}var pe=class extends Error{static name="UnexpectedEOFError";name="UnexpectedEOFError"};function vn(r){return r.reason}async function Wt(r,e,t){if(e==null)return r;let n=t?.translateError??vn;if(e.aborted)return r.catch(()=>{}),Promise.reject(n(e));let s;try{return await Promise.race([r,new Promise((i,a)=>{s=()=>{a(n(e))},e.addEventListener("abort",s)})])}finally{s!=null&&e.removeEventListener("abort",s)}}var Ln=Math.pow(2,20)*4,Ne=class extends ye{status;timeline;inactivityTimeout;maxReadBufferLength;maxWriteBufferLength;log;direction;maxMessageSize;readStatus;writeStatus;remoteReadStatus;remoteWriteStatus;writableNeedsDrain;readBuffer;writeBuffer;sendingData;constructor(e){super(),this.status="open",this.log=e.log,this.direction=e.direction??"outbound",this.inactivityTimeout=e.inactivityTimeout??12e4,this.maxReadBufferLength=e.maxReadBufferLength??Ln,this.maxWriteBufferLength=e.maxWriteBufferLength,this.maxMessageSize=e.maxMessageSize,this.readBuffer=new K,this.writeBuffer=new K,this.readStatus="readable",this.remoteReadStatus="readable",this.writeStatus="writable",this.remoteWriteStatus="writable",this.sendingData=!1,this.writableNeedsDrain=!1,this.timeline={open:Date.now()},this.processSendQueue=this.processSendQueue.bind(this);let t=()=>{this.log.trace("drain event received, continue sending data"),this.writableNeedsDrain=!1,this.processSendQueue()};this.addEventListener("drain",t)}async*[Symbol.asyncIterator](){if(this.readStatus!=="readable"&&this.readStatus!=="paused")return;let e=Qe(),t=i=>{e.push(i.data)};this.addEventListener("message",t);let n=i=>{e.end(i.error)};this.addEventListener("close",n);let s=()=>{e.end()};this.addEventListener("remoteCloseWrite",s);try{yield*e}finally{this.removeEventListener("message",t),this.removeEventListener("close",n),this.removeEventListener("remoteCloseWrite",s)}}isReadable(){return this.status==="open"}send(e){if(this.writeStatus==="closed"||this.writeStatus==="closing")throw new W(`Cannot write to a stream that is ${this.writeStatus}`);return this.log.trace("append %d bytes to write buffer",e.byteLength),this.writeBuffer.append(e),this.processSendQueue()}abort(e){if(!(this.status==="aborted"||this.status==="reset"||this.status==="closed")){this.log.error("abort with error - %e",e),this.status="aborted",this.readBuffer.byteLength>0&&this.readBuffer.consume(this.readBuffer.byteLength),this.writeBuffer.byteLength>0&&(this.writeBuffer.consume(this.writeBuffer.byteLength),this.safeDispatchEvent("idle")),this.writeStatus="closed",this.remoteWriteStatus="closed",this.readStatus="closed",this.remoteReadStatus="closed",this.timeline.close=Date.now();try{this.sendReset(e)}catch(t){this.log("failed to send reset to remote - %e",t)}this.dispatchEvent(new we(e))}}pause(){if(this.readStatus==="closed"||this.readStatus==="closing")throw new W("Cannot pause a stream that is closing/closed");this.readStatus!=="paused"&&(this.readStatus="paused",this.sendPause())}resume(){if(this.readStatus==="closed"||this.readStatus==="closing")throw new W("Cannot resume a stream that is closing/closed");this.readStatus!=="readable"&&(this.readStatus="readable",this.dispatchReadBuffer(),this.sendResume())}push(e){if(this.readStatus==="closed"||this.readStatus==="closing")throw new W(`Cannot push data onto a stream that is ${this.readStatus}`);if(e.byteLength!==0){if(this.readBuffer.append(e),this.readStatus==="paused"||this.listenerCount("message")===0){this.checkReadBufferLength();return}setTimeout(()=>{this.dispatchReadBuffer()},0)}}onData(e){if(e.byteLength!==0){if(this.readStatus==="closing"||this.readStatus==="closed"){this.log("ignoring data - read status %s",this.readStatus);return}this.readBuffer.append(e),this.dispatchReadBuffer()}}addEventListener(...e){super.addEventListener.apply(this,e),e[0]==="message"&&this.readBuffer.byteLength>0&&queueMicrotask(()=>{this.dispatchReadBuffer()})}onRemoteReset(){this.log("remote reset"),this.status="reset",this.writeStatus="closed",this.remoteWriteStatus="closed",this.remoteReadStatus="closed",this.timeline.close=Date.now(),this.readBuffer.byteLength===0&&(this.readStatus="closed");let e=new ge;this.dispatchEvent(new be(e))}onTransportClosed(e){this.log("transport closed"),this.readStatus==="readable"&&this.readBuffer.byteLength===0&&(this.readStatus="closed"),this.remoteReadStatus!=="closed"&&(this.remoteReadStatus="closed"),this.remoteWriteStatus!=="closed"&&(this.remoteWriteStatus="closed"),this.writeStatus!=="closed"&&(this.writeStatus="closed"),e!=null?this.abort(e):(this.status==="open"||this.status==="closing")&&(this.timeline.close=Date.now(),this.status="closed",this.writeStatus="closed",this.remoteWriteStatus="closed",this.remoteReadStatus="closed",this.dispatchEvent(new J))}onRemoteCloseWrite(){this.remoteWriteStatus!=="closed"&&(this.log.trace("on remote close write"),this.remoteWriteStatus="closed",this.safeDispatchEvent("remoteCloseWrite"),this.writeStatus==="closed"&&this.onTransportClosed())}onRemoteCloseRead(){this.log.trace("on remote close read"),this.remoteReadStatus="closed",this.writeBuffer.byteLength>0&&(this.writeBuffer.consume(this.writeBuffer.byteLength),this.safeDispatchEvent("idle"))}processSendQueue(){if(this.writableNeedsDrain)return this.log.trace("not processing send queue as drain is required"),this.checkWriteBufferLength(),!1;if(this.writeBuffer.byteLength===0)return this.log.trace("not processing send queue as no bytes to send"),!0;if(this.sendingData)return this.log.trace("not processing send queue as already sending data"),!0;this.sendingData=!0,this.log.trace("processing send queue with %d queued bytes",this.writeBuffer.byteLength);try{let e=!0,t=this.writeBuffer.byteLength,n=0;for(;this.writeBuffer.byteLength>0;){let s=Math.min(this.maxMessageSize??this.writeBuffer.byteLength,this.writeBuffer.byteLength);if(s===0){e=!1;break}let i=this.writeBuffer.sublist(0,s),a=new K(i);this.writeBuffer.consume(i.byteLength);let f=this.sendData(i);if(e=f.canSendMore,n+=f.sentBytes,f.sentBytes!==a.byteLength&&(a.consume(f.sentBytes),this.writeBuffer.prepend(a)),!e)break}return e||(this.log.trace("sent %d/%d bytes, pausing sending because underlying stream is full, %d bytes left in the write buffer",n,t,this.writeBuffer.byteLength),this.writableNeedsDrain=!0,this.checkWriteBufferLength()),this.writeBuffer.byteLength===0&&this.safeDispatchEvent("idle"),e}finally{this.sendingData=!1}}dispatchReadBuffer(){try{if(this.listenerCount("message")===0){this.log.trace("not dispatching pause buffer as there are no listeners for the message event");return}if(this.readBuffer.byteLength===0){this.log.trace("not dispatching pause buffer as there is no data to dispatch");return}if(this.readStatus==="paused"){this.log.trace("not dispatching pause buffer we are paused");return}if(this.readStatus==="closing"||this.readStatus==="closed"){this.log("dropping %d bytes because the readable end is %s",this.readBuffer.byteLength,this.readStatus),this.readBuffer.consume(this.readBuffer.byteLength);return}let e=this.readBuffer.sublist();this.readBuffer.consume(e.byteLength),this.dispatchEvent(new Ae(e))}finally{this.remoteWriteStatus==="closed"&&(this.readStatus="closed"),this.checkReadBufferLength()}}checkReadBufferLength(){this.readBuffer.byteLength>this.maxReadBufferLength&&this.abort(new ae(`Read buffer length of ${this.readBuffer.byteLength} exceeded limit of ${this.maxReadBufferLength}, read status is ${this.readStatus}`))}checkWriteBufferLength(){this.maxWriteBufferLength!=null&&this.writeBuffer.byteLength>this.maxWriteBufferLength&&this.abort(new ae(`Write buffer length of ${this.writeBuffer.byteLength} exceeded limit of ${this.maxWriteBufferLength}, write status is ${this.writeStatus}`))}onMuxerNeedsDrain(){this.writableNeedsDrain=!0}onMuxerDrain(){this.safeDispatchEvent("drain")}};var Me=class extends Ne{remoteAddr;metricPrefix;metrics;constructor(e){super(e),this.metricPrefix=e.metricPrefix??"",this.metrics=e.metrics,this.remoteAddr=e.remoteAddr,this.addEventListener("close",t=>{this.metrics?.increment({[`${this.metricPrefix}end`]:!0}),t.error!=null?t.local?this.metrics?.increment({[`${this.metricPrefix}abort`]:!0}):this.metrics?.increment({[`${this.metricPrefix}reset`]:!0}):t.local?this.metrics?.increment({[`${this.metricPrefix}_local_close`]:!0}):this.metrics?.increment({[`${this.metricPrefix}_remote_close`]:!0})})}async close(e){this.status==="open"&&(this.status="closing",this.writeStatus="closing",this.remoteWriteStatus="closing",this.remoteReadStatus="closing",(this.sendingData||this.writeBuffer.byteLength>0)&&(this.log("waiting for write queue to become idle before closing writable end of stream, %d unsent bytes",this.writeBuffer.byteLength),await de(this,"idle",{...e,rejectionEvents:["close"]})),this.writableNeedsDrain&&(this.log("waiting for write queue to drain before closing writable end of stream, %d unsent bytes",this.writeBuffer.byteLength),await de(this,"drain",{...e,rejectionEvents:["close"]})),await this.sendClose(e),this.onTransportClosed())}};var Sn=4194304,Ue=class extends Error{static name="UnwrappedError";name="UnwrappedError"};function Cn(r){return typeof r?.closeRead=="function"}function Dn(r){return typeof r?.close=="function"}function ht(r){return Cn(r)?r.readStatus==="closing"||r.readStatus==="closed":Dn(r)?r.status!=="open":!1}function Qn(r){return r?.addEventListener!=null&&r?.removeEventListener!=null&&r?.send!=null&&r?.push!=null&&r?.log!=null}function $t(r,e){let t=e?.maxBufferSize??Sn,n=new K,s=Promise.withResolvers(),i=!1;if(!Qn(r))throw new V("Argument should be a Stream or a Multiaddr");let a=c=>{if(e?.stopPropagation,n.append(c.data),n.byteLength>t){let u=n.byteLength;n.consume(n.byteLength),s.reject(new Error(`Read buffer overflow - ${u} > ${t}`))}s.resolve()};r.addEventListener("message",a);let f=c=>{c.error!=null?s.reject(c.error):s.resolve()};r.addEventListener("close",f);let h=()=>{s.resolve()};r.addEventListener("remoteCloseWrite",h);let x={readBuffer:n,async read(c){if(i===!0)throw new Ue("Stream was unwrapped");if(ht(r)){if(c?.bytes==null)return null;if(n.byteLength<c.bytes)throw new pe(`Unexpected EOF - stream closed after reading ${n.byteLength}/${c.bytes} bytes`)}let u=c?.bytes??1;for(;;){if(n.byteLength>=u){s.resolve();break}if(await Wt(s.promise,c?.signal),ht(r)){if(n.byteLength===0&&c?.bytes==null)return null;break}s=Promise.withResolvers()}let A=c?.bytes??n.byteLength;if(n.byteLength<A){if(ht(r))throw new pe(`Unexpected EOF - stream closed while reading ${n.byteLength}/${A} bytes`);return x.read(c)}let p=n.sublist(0,A);return n.consume(A),p},async write(c,u){if(i===!0)throw new Ue("Stream was unwrapped");r.send(c)||await de(r,"drain",{signal:u?.signal,rejectionEvents:["close"]})},unwrap(){return i||(i=!0,r.removeEventListener("message",a),r.removeEventListener("close",f),r.removeEventListener("remoteCloseWrite",h),n.byteLength>0&&(r.log("stream unwrapped with %d unread bytes",n.byteLength),r.push(n))),r}};return x}var xt=cr(tr(),1);var dt="Your private shared key is invalid";function rr(r){let e=Se(ne(mt),"base16"),t=Le(`/key/swarm/psk/1.0.0/
|
3
3
|
/base16/
|
4
|
-
`+e);r instanceof Uint8Array?r.set(t):r.write(t)}var
|
4
|
+
`+e);r instanceof Uint8Array?r.set(t):r.write(t)}var pt=24,mt=32;var _e=class extends Me{maConn;inboundXor;outboundXor;constructor(e){super({...e,remoteAddr:e.maConn.remoteAddr,direction:e.maConn.direction}),this.inboundXor=(0,xt.default)(e.remoteNonce,e.psk),this.outboundXor=(0,xt.default)(e.localNonce,e.psk),this.maConn=e.maConn,this.maConn.addEventListener("message",t=>{let n=t.data;if(n instanceof Uint8Array)this.onData(this.inboundXor.update(n));else for(let s of n)this.onData(this.inboundXor.update(s))}),this.maConn.addEventListener("close",t=>{t.error!=null?t.local?this.abort(t.error):this.onRemoteReset():this.onTransportClosed()})}async sendClose(e){await this.maConn.close(e)}sendData(e){return{sentBytes:e.byteLength,canSendMore:this.maConn.send(this.outboundXor.update(e.subarray()))}}sendReset(e){this.maConn.abort(e)}sendPause(){this.maConn.pause()}sendResume(){this.maConn.resume()}};function nr(r){try{let e=Se(r).split(/(?:\r\n|\r|\n)/g),t=e.shift(),n=e.shift(),s=e.shift(),i=Le(s??"","base16");if(i.byteLength!==mt)throw new Error(dt);return{tag:t,codecName:n,psk:i}}catch{throw new Error(dt)}}var gt=class{tag;psk;timeout;constructor(e){this.timeout=e.timeout??1e3;let t=nr(e.psk);this.psk=t.psk,this.tag=t.tag??""}[Symbol.toStringTag]="@libp2p/pnet";async protect(e,t){if(e==null)throw new V("No connection for the handshake provided");let n=e.log.newScope("pnet");n("protecting the connection");let s=ne(pt);t==null&&(t={signal:AbortSignal.timeout(this.timeout)});let i=$t(e),[a]=await Promise.all([i.read({bytes:pt,...t}),i.write(s,t)]),f=a.subarray();return n("exchanged nonces"),new _e({localNonce:s,remoteNonce:f,psk:this.psk,maConn:e,log:n})}};function _n(r){return()=>new gt(r)}return ur(Pn);})();
|
5
5
|
/*! Bundled license information:
|
6
6
|
|
7
7
|
@noble/hashes/esm/utils.js:
|