@libp2p/identify 3.0.1-34455b5f2 → 3.0.1-4fd7eb2e1
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 +1 -1
- package/package.json +8 -8
package/dist/index.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PIdentify = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var Libp2PIdentify=(()=>{var ou=Object.create;var tn=Object.defineProperty;var su=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var au=Object.getPrototypeOf,cu=Object.prototype.hasOwnProperty;var $i=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ae=(r,e)=>{for(var t in e)tn(r,t,{get:e[t],enumerable:!0})},zi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of iu(e))!cu.call(r,o)&&o!==t&&tn(r,o,{get:()=>e[o],enumerable:!(n=su(e,o))||n.enumerable});return r};var Gi=(r,e,t)=>(t=r!=null?ou(au(r)):{},zi(e||!r||!r.__esModule?tn(t,"default",{value:r,enumerable:!0}):t,r)),lu=r=>zi(tn({},"__esModule",{value:!0}),r);var $a=$i(lr=>{"use strict";var Rh="[object ArrayBuffer]",pt=class r{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Rh}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=r.toUint8Array(e),o=r.toUint8Array(t);if(n.length!==o.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==o[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let i of t)n+=i.byteLength;let o=new Uint8Array(n),s=0;for(let i of t){let a=this.toUint8Array(i);o.set(a,s),s+=a.length}return e[e.length-1]instanceof Function?this.toView(o,e[e.length-1]):o.buffer}},Js="string",_h=/^[0-9a-f]+$/i,Oh=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Vh=/^[a-zA-Z0-9-_]+$/,An=class{static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n.buffer}static toString(e){let t=pt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return decodeURIComponent(escape(n))}},Ve=class{static toString(e,t=!1){let n=pt.toArrayBuffer(e),o=new DataView(n),s="";for(let i=0;i<n.byteLength;i+=2){let a=o.getUint16(i,t);s+=String.fromCharCode(a)}return s}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),o=new DataView(n);for(let s=0;s<e.length;s++)o.setUint16(s*2,e.charCodeAt(s),t);return n}},Sn=class r{static isHex(e){return typeof e===Js&&_h.test(e)}static isBase64(e){return typeof e===Js&&Oh.test(e)}static isBase64Url(e){return typeof e===Js&&Vh.test(e)}static ToString(e,t="utf8"){let n=pt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Ve.toString(n,!0);case"utf16":case"utf16be":return Ve.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Ve.fromString(e,!0);case"utf16":case"utf16be":return Ve.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=pt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return An.fromString(e);case"utf16":case"utf16be":return Ve.fromString(e);case"utf16le":case"usc2":return Ve.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return An.toString(e);case"utf16":case"utf16be":return Ve.toString(e);case"utf16le":case"usc2":return Ve.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let o=0;o<t;o++)n[o]=e.charCodeAt(o);return n.buffer}static ToBinary(e){let t=pt.toUint8Array(e),n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return n}static ToHex(e){let t=pt.toUint8Array(e),n="",o=t.length;for(let s=0;s<o;s++){let i=t[s];i<16&&(n+="0"),n+=i.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o=o+2){let s=t.slice(o,o+2);n[o/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,t=!1){return Ve.toString(e,t)}static FromUtf16String(e,t=!1){return Ve.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Sn.DEFAULT_UTF8_ENCODING="utf8";function Ph(r,...e){let t=arguments[0];for(let n=1;n<arguments.length;n++){let o=arguments[n];for(let s in o)t[s]=o[s]}return t}function Dh(...r){let e=r.map(o=>o.byteLength).reduce((o,s)=>o+s),t=new Uint8Array(e),n=0;return r.map(o=>new Uint8Array(o)).forEach(o=>{for(let s of o)t[n++]=s}),t.buffer}function Mh(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let o=0;o<r.byteLength;o++)if(t[o]!==n[o])return!1;return!0}lr.BufferSourceConverter=pt;lr.Convert=Sn;lr.assign=Ph;lr.combine=Dh;lr.isEqual=Mh});var Ll=$i((Xw,Ul)=>{function Cd(){return!!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}Ul.exports=Cd});var Fd={};Ae(Fd,{identify:()=>Md,identifyPush:()=>Hd});var qo=Symbol.for("@libp2p/peer-id");var Se=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}},Jt=class extends Error{static name="InvalidPublicKeyError";constructor(e="Invalid public key"){super(e),this.name="InvalidPublicKeyError"}};var rn=class extends Error{static name="InvalidCIDError";constructor(e="Invalid CID"){super(e),this.name="InvalidCIDError"}},nn=class extends Error{static name="InvalidMultihashError";constructor(e="Invalid Multihash"){super(e),this.name="InvalidMultihashError"}};var De=class extends Error{static name="InvalidMessageError";constructor(e="Invalid message"){super(e),this.name="InvalidMessageError"}};var Dt=class extends Error{static name="UnsupportedKeyTypeError";constructor(e="Unsupported key type"){super(e),this.name="UnsupportedKeyTypeError"}};var Er=(r,...e)=>{try{[...e]}catch{}};var on=Symbol.for("@libp2p/service-capabilities"),Gd=Symbol.for("@libp2p/service-dependencies");var jo={};Ae(jo,{base58btc:()=>J,base58flickr:()=>gu});var mp=new Uint8Array(0);function Wi(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 it(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 ji(r){return new TextEncoder().encode(r)}function Zi(r){return new TextDecoder().decode(r)}function uu(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 s=r.charAt(o),i=s.charCodeAt(0);if(t[i]!==255)throw new TypeError(s+" is ambiguous");t[i]=o}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(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 y=0,d=0,x=0,B=m.length;x!==B&&m[x]===0;)x++,y++;for(var g=(B-x)*l+1>>>0,S=new Uint8Array(g);x!==B;){for(var L=m[x],U=0,I=g-1;(L!==0||U<d)&&I!==-1;I--,U++)L+=256*S[I]>>>0,S[I]=L%a>>>0,L=L/a>>>0;if(L!==0)throw new Error("Non-zero carry");d=U,x++}for(var k=g-d;k!==g&&S[k]===0;)k++;for(var T=c.repeat(y);k<g;++k)T+=r.charAt(S[k]);return T}function h(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var y=0;if(m[y]!==" "){for(var d=0,x=0;m[y]===c;)d++,y++;for(var B=(m.length-y)*u+1>>>0,g=new Uint8Array(B);m[y];){var S=t[m.charCodeAt(y)];if(S===255)return;for(var L=0,U=B-1;(S!==0||L<x)&&U!==-1;U--,L++)S+=a*g[U]>>>0,g[U]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");x=L,y++}if(m[y]!==" "){for(var I=B-x;I!==B&&g[I]===0;)I++;for(var k=new Uint8Array(d+(B-I)),T=d;I!==B;)k[T++]=g[I++];return k}}}function w(m){var y=h(m);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:w}}var fu=uu,hu=fu,Ji=hu;var $o=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")}},zo=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),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 Xi(this,e)}},Go=class{decoders;constructor(e){this.decoders=e}or(e){return Xi(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 Xi(r,e){return new Go({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var Wo=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 $o(e,t,n),this.decoder=new zo(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Xt({name:r,prefix:e,encode:t,decode:n}){return new Wo(r,e,t,n)}function Et({name:r,prefix:e,alphabet:t}){let{encode:n,decode:o}=Ji(t,r);return Xt({prefix:e,name:r,encode:n,decode:s=>it(o(s))})}function du(r,e,t,n){let o={};for(let l=0;l<e.length;++l)o[e[l]]=l;let s=r.length;for(;r[s-1]==="=";)--s;let i=new Uint8Array(s*t/8|0),a=0,c=0,u=0;for(let l=0;l<s;++l){let f=o[r[l]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|f,a+=t,a>=8&&(a-=8,i[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return i}function pu(r,e,t){let n=e[e.length-1]==="=",o=(1<<t)-1,s="",i=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],i+=8;i>t;)i-=t,s+=e[o&a>>i];if(i!==0&&(s+=e[o&a<<t-i]),n)for(;s.length*t&7;)s+="=";return s}function ee({name:r,prefix:e,bitsPerChar:t,alphabet:n}){return Xt({prefix:e,name:r,encode(o){return pu(o,n,t)},decode(o){return du(o,n,t,r)}})}var J=Et({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gu=Et({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Zo={};Ae(Zo,{base32:()=>at,base32hex:()=>wu,base32hexpad:()=>vu,base32hexpadupper:()=>Eu,base32hexupper:()=>xu,base32pad:()=>yu,base32padupper:()=>bu,base32upper:()=>mu,base32z:()=>Bu});var at=ee({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),mu=ee({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yu=ee({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),bu=ee({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),wu=ee({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),xu=ee({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vu=ee({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Eu=ee({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Bu=ee({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Yo={};Ae(Yo,{base36:()=>Br,base36upper:()=>Au});var Br=Et({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Au=Et({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Su=ta,Qi=128,Iu=127,ku=~Iu,Nu=Math.pow(2,31);function ta(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Nu;)e[t++]=r&255|Qi,r/=128;for(;r&ku;)e[t++]=r&255|Qi,r>>>=7;return e[t]=r|0,ta.bytes=t-n+1,e}var Cu=Jo,Tu=128,ea=127;function Jo(r,n){var t=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a)throw Jo.bytes=0,new RangeError("Could not decode varint");i=r[s++],t+=o<28?(i&ea)<<o:(i&ea)*Math.pow(2,o),o+=7}while(i>=Tu);return Jo.bytes=s-n,t}var Uu=Math.pow(2,7),Lu=Math.pow(2,14),Ru=Math.pow(2,21),_u=Math.pow(2,28),Ou=Math.pow(2,35),Vu=Math.pow(2,42),Pu=Math.pow(2,49),Du=Math.pow(2,56),Mu=Math.pow(2,63),Hu=function(r){return r<Uu?1:r<Lu?2:r<Ru?3:r<_u?4:r<Ou?5:r<Vu?6:r<Pu?7:r<Du?8:r<Mu?9:10},Fu={encode:Su,decode:Cu,encodingLength:Hu},Ku=Fu,Ar=Ku;function Sr(r,e=0){return[Ar.decode(r,e),Ar.decode.bytes]}function Qt(r,e,t=0){return Ar.encode(r,e,t),e}function er(r){return Ar.encodingLength(r)}function Me(r,e){let t=e.byteLength,n=er(r),o=n+er(t),s=new Uint8Array(o+t);return Qt(r,s,0),Qt(t,s,n),s.set(e,o),new tr(r,t,e,s)}function Mt(r){let e=it(r),[t,n]=Sr(e),[o,s]=Sr(e.subarray(n)),i=e.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new tr(t,o,i,e)}function ra(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Wi(r.bytes,t.bytes)}}var tr=class{code;size;digest;bytes;constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};function na(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return $u(t,Xo(r),e??J.encoder);default:return zu(t,Xo(r),e??at.encoder)}}var oa=new WeakMap;function Xo(r){let e=oa.get(r);if(e==null){let t=new Map;return oa.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!==Ir)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Gu)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=Me(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&&ra(e.multihash,n.multihash)}toString(e){return na(this,e)}toJSON(){return{"/":na(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:s,bytes:i}=t;return new r(n,o,s,i??sa(n,o,s.bytes))}else if(t[Wu]===!0){let{version:n,multihash:o,code:s}=t,i=Mt(o);return r.create(n,s,i)}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!==Ir)throw new Error(`Version 0 CID must use dag-pb (code: ${Ir}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let o=sa(e,t,n.bytes);return new r(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,Ir,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=it(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=o.subarray(t.multihashSize-t.digestSize),i=new tr(t.multihashCode,t.digestSize,s,o);return[t.version===0?r.createV0(i):r.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[f,h]=Sr(e.subarray(t));return t+=h,f},o=n(),s=Ir;if(o===18?(o=0,t=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,a=n(),c=n(),u=t+c,l=u-i;return{version:o,codec:s,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,o]=qu(e,t),s=r.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Xo(s).set(n,e),s}};function qu(r,e){switch(r[0]){case"Q":{let t=e??J;return[J.prefix,t.decode(`${J.prefix}${r}`)]}case J.prefix:{let t=e??J;return[J.prefix,t.decode(r)]}case at.prefix:{let t=e??at;return[at.prefix,t.decode(r)]}case Br.prefix:{let t=e??Br;return[Br.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 $u(r,e,t){let{prefix:n}=t;if(n!==J.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return o}function zu(r,e,t){let{prefix:n}=t,o=e.get(n);if(o==null){let s=t.encode(r);return e.set(n,s),s}else return o}var Ir=112,Gu=18;function sa(r,e,t){let n=er(r),o=n+er(e),s=new Uint8Array(o+t.byteLength);return Qt(r,s,0),Qt(e,s,n),s.set(t,o),s}var Wu=Symbol.for("@ipld/js-cid/CID");var Qo={};Ae(Qo,{identity:()=>ct});var ia=0,ju="identity",aa=it;function Zu(r){return Me(ia,aa(r))}var ct={code:ia,name:ju,encode:aa,digest:Zu};function be(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 ca(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, not ${r}`)}function Yu(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function rr(r,...e){if(!Yu(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}function la(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ca(r.outputLen),ca(r.blockLen)}function nr(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function ua(r,e){rr(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}var Ht=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var an=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),He=(r,e)=>r<<32-e|r>>>e;var Mp=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function fa(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function kr(r){return typeof r=="string"&&(r=fa(r)),rr(r),r}function es(...r){let e=0;for(let n=0;n<r.length;n++){let o=r[n];rr(o),e+=o.length}let t=new Uint8Array(e);for(let n=0,o=0;n<r.length;n++){let s=r[n];t.set(s,o),o+=s.length}return t}var or=class{clone(){return this._cloneInto()}},Hp={}.toString;function cn(r){let e=n=>r().update(kr(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function ln(r=32){if(Ht&&typeof Ht.getRandomValues=="function")return Ht.getRandomValues(new Uint8Array(r));if(Ht&&typeof Ht.randomBytes=="function")return Ht.randomBytes(r);throw new Error("crypto.getRandomValues must be defined")}function Ju(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(t>>o&s),a=Number(t&s),c=n?4:0,u=n?0:4;r.setUint32(e+c,i,n),r.setUint32(e+u,a,n)}var ha=(r,e,t)=>r&e^~r&t,da=(r,e,t)=>r&e^r&t^e&t,sr=class extends or{constructor(e,t,n,o){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=an(this.buffer)}update(e){nr(this);let{view:t,buffer:n,blockLen:o}=this;e=kr(e);let s=e.length;for(let i=0;i<s;){let a=Math.min(o-this.pos,s-i);if(a===o){let c=an(e);for(;o<=s-i;i+=o)this.process(c,i);continue}n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){nr(this),ua(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:o,isLE:s}=this,{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>o-i&&(this.process(n,0),i=0);for(let f=i;f<o;f++)t[f]=0;Ju(n,o-8,BigInt(this.length*8),s),this.process(n,0);let a=an(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],s)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:o,finished:s,destroyed:i,pos:a}=this;return e.length=o,e.pos=a,e.finished=s,e.destroyed=i,o%t&&e.buffer.set(n),e}};var un=BigInt(4294967295),ts=BigInt(32);function pa(r,e=!1){return e?{h:Number(r&un),l:Number(r>>ts&un)}:{h:Number(r>>ts&un)|0,l:Number(r&un)|0}}function Xu(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:i}=pa(r[o],e);[t[o],n[o]]=[s,i]}return[t,n]}var Qu=(r,e)=>BigInt(r>>>0)<<ts|BigInt(e>>>0),ef=(r,e,t)=>r>>>t,tf=(r,e,t)=>r<<32-t|e>>>t,rf=(r,e,t)=>r>>>t|e<<32-t,nf=(r,e,t)=>r<<32-t|e>>>t,of=(r,e,t)=>r<<64-t|e>>>t-32,sf=(r,e,t)=>r>>>t-32|e<<64-t,af=(r,e)=>e,cf=(r,e)=>r,lf=(r,e,t)=>r<<t|e>>>32-t,uf=(r,e,t)=>e<<t|r>>>32-t,ff=(r,e,t)=>e<<t-32|r>>>64-t,hf=(r,e,t)=>r<<t-32|e>>>64-t;function df(r,e,t,n){let o=(e>>>0)+(n>>>0);return{h:r+t+(o/2**32|0)|0,l:o|0}}var pf=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),gf=(r,e,t,n)=>e+t+n+(r/2**32|0)|0,mf=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),yf=(r,e,t,n,o)=>e+t+n+o+(r/2**32|0)|0,bf=(r,e,t,n,o)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(o>>>0),wf=(r,e,t,n,o,s)=>e+t+n+o+s+(r/2**32|0)|0;var xf={fromBig:pa,split:Xu,toBig:Qu,shrSH:ef,shrSL:tf,rotrSH:rf,rotrSL:nf,rotrBH:of,rotrBL:sf,rotr32H:af,rotr32L:cf,rotlSH:lf,rotlSL:uf,rotlBH:ff,rotlBL:hf,add:df,add3L:pf,add3H:gf,add4L:mf,add4H:yf,add5H:wf,add5L:bf},O=xf;var[vf,Ef]=O.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),At=new Uint32Array(80),St=new Uint32Array(80),rs=class extends sr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:o,Ch:s,Cl:i,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:h,Gh:w,Gl:m,Hh:y,Hl:d}=this;return[e,t,n,o,s,i,a,c,u,l,f,h,w,m,y,d]}set(e,t,n,o,s,i,a,c,u,l,f,h,w,m,y,d){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=i|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=h|0,this.Gh=w|0,this.Gl=m|0,this.Hh=y|0,this.Hl=d|0}process(e,t){for(let g=0;g<16;g++,t+=4)At[g]=e.getUint32(t),St[g]=e.getUint32(t+=4);for(let g=16;g<80;g++){let S=At[g-15]|0,L=St[g-15]|0,U=O.rotrSH(S,L,1)^O.rotrSH(S,L,8)^O.shrSH(S,L,7),I=O.rotrSL(S,L,1)^O.rotrSL(S,L,8)^O.shrSL(S,L,7),k=At[g-2]|0,T=St[g-2]|0,ne=O.rotrSH(k,T,19)^O.rotrBH(k,T,61)^O.shrSH(k,T,6),K=O.rotrSL(k,T,19)^O.rotrBL(k,T,61)^O.shrSL(k,T,6),V=O.add4L(I,K,St[g-7],St[g-16]),oe=O.add4H(V,U,ne,At[g-7],At[g-16]);At[g]=oe|0,St[g]=V|0}let{Ah:n,Al:o,Bh:s,Bl:i,Ch:a,Cl:c,Dh:u,Dl:l,Eh:f,El:h,Fh:w,Fl:m,Gh:y,Gl:d,Hh:x,Hl:B}=this;for(let g=0;g<80;g++){let S=O.rotrSH(f,h,14)^O.rotrSH(f,h,18)^O.rotrBH(f,h,41),L=O.rotrSL(f,h,14)^O.rotrSL(f,h,18)^O.rotrBL(f,h,41),U=f&w^~f&y,I=h&m^~h&d,k=O.add5L(B,L,I,Ef[g],St[g]),T=O.add5H(k,x,S,U,vf[g],At[g]),ne=k|0,K=O.rotrSH(n,o,28)^O.rotrBH(n,o,34)^O.rotrBH(n,o,39),V=O.rotrSL(n,o,28)^O.rotrBL(n,o,34)^O.rotrBL(n,o,39),oe=n&s^n&a^s&a,E=o&i^o&c^i&c;x=y|0,B=d|0,y=w|0,d=m|0,w=f|0,m=h|0,{h:f,l:h}=O.add(u|0,l|0,T|0,ne|0),u=a|0,l=c|0,a=s|0,c=i|0,s=n|0,i=o|0;let N=O.add3L(ne,V,E);n=O.add3H(N,T,K,oe),o=N|0}({h:n,l:o}=O.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:i}=O.add(this.Bh|0,this.Bl|0,s|0,i|0),{h:a,l:c}=O.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=O.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:f,l:h}=O.add(this.Eh|0,this.El|0,f|0,h|0),{h:w,l:m}=O.add(this.Fh|0,this.Fl|0,w|0,m|0),{h:y,l:d}=O.add(this.Gh|0,this.Gl|0,y|0,d|0),{h:x,l:B}=O.add(this.Hh|0,this.Hl|0,x|0,B|0),this.set(n,o,s,i,a,c,u,l,f,h,w,m,y,d,x,B)}roundClean(){At.fill(0),St.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var ga=cn(()=>new rs);var hn={};Ae(hn,{aInRange:()=>Ne,abool:()=>Fe,abytes:()=>ir,bitGet:()=>Nf,bitLen:()=>as,bitMask:()=>Cr,bitSet:()=>Cf,bytesToHex:()=>ut,bytesToNumberBE:()=>ft,bytesToNumberLE:()=>kt,concatBytes:()=>ht,createHmacDrbg:()=>cs,ensureBytes:()=>te,equalBytes:()=>If,hexToBytes:()=>Kt,hexToNumber:()=>is,inRange:()=>Nr,isBytes:()=>It,memoized:()=>$t,notImplemented:()=>Uf,numberToBytesBE:()=>Nt,numberToBytesLE:()=>qt,numberToHexUnpadded:()=>Ft,numberToVarBytesBE:()=>Sf,utf8ToBytes:()=>kf,validateObject:()=>Je});var ss=BigInt(0),fn=BigInt(1),Bf=BigInt(2);function It(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function ir(r){if(!It(r))throw new Error("Uint8Array expected")}function Fe(r,e){if(typeof e!="boolean")throw new Error(`${r} must be valid boolean, got "${e}".`)}var Af=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function ut(r){ir(r);let e="";for(let t=0;t<r.length;t++)e+=Af[r[t]];return e}function Ft(r){let e=r.toString(16);return e.length&1?`0${e}`:e}function is(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}var lt={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function ma(r){if(r>=lt._0&&r<=lt._9)return r-lt._0;if(r>=lt._A&&r<=lt._F)return r-(lt._A-10);if(r>=lt._a&&r<=lt._f)return r-(lt._a-10)}function Kt(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(t);for(let o=0,s=0;o<t;o++,s+=2){let i=ma(r.charCodeAt(s)),a=ma(r.charCodeAt(s+1));if(i===void 0||a===void 0){let c=r[s]+r[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[o]=i*16+a}return n}function ft(r){return is(ut(r))}function kt(r){return ir(r),is(ut(Uint8Array.from(r).reverse()))}function Nt(r,e){return Kt(r.toString(16).padStart(e*2,"0"))}function qt(r,e){return Nt(r,e).reverse()}function Sf(r){return Kt(Ft(r))}function te(r,e,t){let n;if(typeof e=="string")try{n=Kt(e)}catch(s){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${s}`)}else if(It(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let o=n.length;if(typeof t=="number"&&o!==t)throw new Error(`${r} expected ${t} bytes, got ${o}`);return n}function ht(...r){let e=0;for(let n=0;n<r.length;n++){let o=r[n];ir(o),e+=o.length}let t=new Uint8Array(e);for(let n=0,o=0;n<r.length;n++){let s=r[n];t.set(s,o),o+=s.length}return t}function If(r,e){if(r.length!==e.length)return!1;let t=0;for(let n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}function kf(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}var ns=r=>typeof r=="bigint"&&ss<=r;function Nr(r,e,t){return ns(r)&&ns(e)&&ns(t)&&e<=r&&r<t}function Ne(r,e,t,n){if(!Nr(e,t,n))throw new Error(`expected valid ${r}: ${t} <= n < ${n}, got ${typeof e} ${e}`)}function as(r){let e;for(e=0;r>ss;r>>=fn,e+=1);return e}function Nf(r,e){return r>>BigInt(e)&fn}function Cf(r,e,t){return r|(t?fn:ss)<<BigInt(e)}var Cr=r=>(Bf<<BigInt(r-1))-fn,os=r=>new Uint8Array(r),ya=r=>Uint8Array.from(r);function cs(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=os(r),o=os(r),s=0,i=()=>{n.fill(1),o.fill(0),s=0},a=(...f)=>t(o,n,...f),c=(f=os())=>{o=a(ya([0]),f),n=a(),f.length!==0&&(o=a(ya([1]),f),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,h=[];for(;f<e;){n=a();let w=n.slice();h.push(w),f+=n.length}return ht(...h)};return(f,h)=>{i(),c(f);let w;for(;!(w=h(u()));)c();return i(),w}}var Tf={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||It(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Je(r,e,t={}){let n=(o,s,i)=>{let a=Tf[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=r[o];if(!(i&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(o)}=${c} (${typeof c}), expected ${s}`)};for(let[o,s]of Object.entries(e))n(o,s,!1);for(let[o,s]of Object.entries(t))n(o,s,!0);return r}var Uf=()=>{throw new Error("not implemented")};function $t(r){let e=new WeakMap;return(t,...n)=>{let o=e.get(t);if(o!==void 0)return o;let s=r(t,...n);return e.set(t,s),s}}var ie=BigInt(0),X=BigInt(1),zt=BigInt(2),Lf=BigInt(3),ls=BigInt(4),ba=BigInt(5),wa=BigInt(8),Rf=BigInt(9),_f=BigInt(16);function j(r,e){let t=r%e;return t>=ie?t:e+t}function Of(r,e,t){if(t<=ie||e<ie)throw new Error("Expected power/modulo > 0");if(t===X)return ie;let n=X;for(;e>ie;)e&X&&(n=n*r%t),r=r*r%t,e>>=X;return n}function Q(r,e,t){let n=r;for(;e-- >ie;)n*=n,n%=t;return n}function dn(r,e){if(r===ie||e<=ie)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=j(r,e),n=e,o=ie,s=X,i=X,a=ie;for(;t!==ie;){let u=n/t,l=n%t,f=o-i*u,h=s-a*u;n=t,t=l,o=i,s=a,i=f,a=h}if(n!==X)throw new Error("invert: does not exist");return j(o,e)}function Vf(r){let e=(r-X)/zt,t,n,o;for(t=r-X,n=0;t%zt===ie;t/=zt,n++);for(o=zt;o<r&&Of(o,e,r)!==r-X;o++);if(n===1){let i=(r+X)/ls;return function(c,u){let l=c.pow(u,i);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let s=(t+X)/zt;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,o),t),f=a.pow(c,s),h=a.pow(c,t);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let w=1;for(let y=a.sqr(h);w<u&&!a.eql(y,a.ONE);w++)y=a.sqr(y);let m=a.pow(l,X<<BigInt(u-w-1));l=a.sqr(m),f=a.mul(f,m),h=a.mul(h,l),u=w}return f}}function Pf(r){if(r%ls===Lf){let e=(r+X)/ls;return function(n,o){let s=n.pow(o,e);if(!n.eql(n.sqr(s),o))throw new Error("Cannot find square root");return s}}if(r%wa===ba){let e=(r-ba)/wa;return function(n,o){let s=n.mul(o,zt),i=n.pow(s,e),a=n.mul(o,i),c=n.mul(n.mul(a,zt),i),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),o))throw new Error("Cannot find square root");return u}}return r%_f,Vf(r)}var xa=(r,e)=>(j(r,e)&X)===X,Df=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function us(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=Df.reduce((n,o)=>(n[o]="function",n),e);return Je(r,t)}function Mf(r,e,t){if(t<ie)throw new Error("Expected power > 0");if(t===ie)return r.ONE;if(t===X)return e;let n=r.ONE,o=e;for(;t>ie;)t&X&&(n=r.mul(n,o)),o=r.sqr(o),t>>=X;return n}function Hf(r,e){let t=new Array(e.length),n=e.reduce((s,i,a)=>r.is0(i)?s:(t[a]=s,r.mul(s,i)),r.ONE),o=r.inv(n);return e.reduceRight((s,i,a)=>r.is0(i)?s:(t[a]=r.mul(s,t[a]),r.mul(s,i)),o),t}function fs(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function Ct(r,e,t=!1,n={}){if(r<=ie)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:o,nByteLength:s}=fs(r,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let i=Pf(r),a=Object.freeze({ORDER:r,BITS:o,BYTES:s,MASK:Cr(o),ZERO:ie,ONE:X,create:c=>j(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return ie<=c&&c<r},is0:c=>c===ie,isOdd:c=>(c&X)===X,neg:c=>j(-c,r),eql:(c,u)=>c===u,sqr:c=>j(c*c,r),add:(c,u)=>j(c+u,r),sub:(c,u)=>j(c-u,r),mul:(c,u)=>j(c*u,r),pow:(c,u)=>Mf(a,c,u),div:(c,u)=>j(c*dn(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>dn(c,r),sqrt:n.sqrt||(c=>i(a,c)),invertBatch:c=>Hf(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?qt(c,s):Nt(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return t?kt(c):ft(c)}});return Object.freeze(a)}function va(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}function hs(r){let e=va(r);return e+Math.ceil(e/2)}function Ea(r,e,t=!1){let n=r.length,o=va(e),s=hs(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let i=t?ft(r):kt(r),a=j(i,e-X)+X;return t?qt(a,o):Nt(a,o)}var Kf=BigInt(0),ds=BigInt(1),ps=new WeakMap,Ba=new WeakMap;function pn(r,e){let t=(s,i)=>{let a=i.negate();return s?a:i},n=s=>{if(!Number.isSafeInteger(s)||s<=0||s>e)throw new Error(`Wrong window size=${s}, should be [1..${e}]`)},o=s=>{n(s);let i=Math.ceil(e/s)+1,a=2**(s-1);return{windows:i,windowSize:a}};return{constTimeNegate:t,unsafeLadder(s,i){let a=r.ZERO,c=s;for(;i>Kf;)i&ds&&(a=a.add(c)),c=c.double(),i>>=ds;return a},precomputeWindow(s,i){let{windows:a,windowSize:c}=o(i),u=[],l=s,f=l;for(let h=0;h<a;h++){f=l,u.push(f);for(let w=1;w<c;w++)f=f.add(l),u.push(f);l=f.double()}return u},wNAF(s,i,a){let{windows:c,windowSize:u}=o(s),l=r.ZERO,f=r.BASE,h=BigInt(2**s-1),w=2**s,m=BigInt(s);for(let y=0;y<c;y++){let d=y*u,x=Number(a&h);a>>=m,x>u&&(x-=w,a+=ds);let B=d,g=d+Math.abs(x)-1,S=y%2!==0,L=x<0;x===0?f=f.add(t(S,i[B])):l=l.add(t(L,i[g]))}return{p:l,f}},wNAFCached(s,i,a){let c=Ba.get(s)||1,u=ps.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&ps.set(s,a(u))),this.wNAF(c,u,i)},setWindowSize(s,i){n(i),Ba.set(s,i),ps.delete(s)}}}function gn(r,e,t,n){if(!Array.isArray(t)||!Array.isArray(n)||n.length!==t.length)throw new Error("arrays of points and scalars must have equal length");n.forEach((l,f)=>{if(!e.isValid(l))throw new Error(`wrong scalar at index ${f}`)}),t.forEach((l,f)=>{if(!(l instanceof r))throw new Error(`wrong point at index ${f}`)});let o=as(BigInt(t.length)),s=o>12?o-3:o>4?o-2:o?2:1,i=(1<<s)-1,a=new Array(i+1).fill(r.ZERO),c=Math.floor((e.BITS-1)/s)*s,u=r.ZERO;for(let l=c;l>=0;l-=s){a.fill(r.ZERO);for(let h=0;h<n.length;h++){let w=n[h],m=Number(w>>BigInt(l)&BigInt(i));a[m]=a[m].add(t[h])}let f=r.ZERO;for(let h=a.length-1,w=r.ZERO;h>0;h--)w=w.add(a[h]),f=f.add(w);if(u=u.add(f),l!==0)for(let h=0;h<s;h++)u=u.double()}return u}function Tr(r){return us(r.Fp),Je(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...fs(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}var Ke=BigInt(0),Ce=BigInt(1),mn=BigInt(2),qf=BigInt(8),$f={zip215:!0};function zf(r){let e=Tr(r);return Je(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Aa(r){let e=zf(r),{Fp:t,n,prehash:o,hash:s,randomBytes:i,nByteLength:a,h:c}=e,u=mn<<BigInt(a*8)-Ce,l=t.create,f=Ct(e.n,e.nBitLength),h=e.uvRatio||((b,p)=>{try{return{isValid:!0,value:t.sqrt(b*t.inv(p))}}catch{return{isValid:!1,value:Ke}}}),w=e.adjustScalarBytes||(b=>b),m=e.domain||((b,p,v)=>{if(Fe("phflag",v),p.length||v)throw new Error("Contexts/pre-hash are not supported");return b});function y(b,p){Ne("coordinate "+b,p,Ke,u)}function d(b){if(!(b instanceof g))throw new Error("ExtendedPoint expected")}let x=$t((b,p)=>{let{ex:v,ey:C,ez:R}=b,_=b.is0();p==null&&(p=_?qf:t.inv(R));let P=l(v*p),H=l(C*p),D=l(R*p);if(_)return{x:Ke,y:Ce};if(D!==Ce)throw new Error("invZ was invalid");return{x:P,y:H}}),B=$t(b=>{let{a:p,d:v}=e;if(b.is0())throw new Error("bad point: ZERO");let{ex:C,ey:R,ez:_,et:P}=b,H=l(C*C),D=l(R*R),W=l(_*_),Y=l(W*W),le=l(H*p),ue=l(W*l(le+D)),he=l(Y+l(v*l(H*D)));if(ue!==he)throw new Error("bad point: equation left != right (1)");let Be=l(C*R),se=l(_*P);if(Be!==se)throw new Error("bad point: equation left != right (2)");return!0});class g{constructor(p,v,C,R){this.ex=p,this.ey=v,this.ez=C,this.et=R,y("x",p),y("y",v),y("z",C),y("t",R),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(p){if(p instanceof g)throw new Error("extended point not allowed");let{x:v,y:C}=p||{};return y("x",v),y("y",C),new g(v,C,Ce,l(v*C))}static normalizeZ(p){let v=t.invertBatch(p.map(C=>C.ez));return p.map((C,R)=>C.toAffine(v[R])).map(g.fromAffine)}static msm(p,v){return gn(g,f,p,v)}_setWindowSize(p){U.setWindowSize(this,p)}assertValidity(){B(this)}equals(p){d(p);let{ex:v,ey:C,ez:R}=this,{ex:_,ey:P,ez:H}=p,D=l(v*H),W=l(_*R),Y=l(C*H),le=l(P*R);return D===W&&Y===le}is0(){return this.equals(g.ZERO)}negate(){return new g(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:p}=e,{ex:v,ey:C,ez:R}=this,_=l(v*v),P=l(C*C),H=l(mn*l(R*R)),D=l(p*_),W=v+C,Y=l(l(W*W)-_-P),le=D+P,ue=le-H,he=D-P,Be=l(Y*ue),se=l(le*he),ke=l(Y*he),st=l(ue*le);return new g(Be,se,st,ke)}add(p){d(p);let{a:v,d:C}=e,{ex:R,ey:_,ez:P,et:H}=this,{ex:D,ey:W,ez:Y,et:le}=p;if(v===BigInt(-1)){let Pi=l((_-R)*(W+D)),Di=l((_+R)*(W-D)),Ko=l(Di-Pi);if(Ko===Ke)return this.double();let Mi=l(P*mn*le),Hi=l(H*mn*Y),Fi=Hi+Mi,Ki=Di+Pi,qi=Hi-Mi,eu=l(Fi*Ko),tu=l(Ki*qi),ru=l(Fi*qi),nu=l(Ko*Ki);return new g(eu,tu,nu,ru)}let ue=l(R*D),he=l(_*W),Be=l(H*C*le),se=l(P*Y),ke=l((R+_)*(D+W)-ue-he),st=se-Be,xr=se+Be,vr=l(he-v*ue),Yl=l(ke*st),Jl=l(xr*vr),Xl=l(ke*vr),Ql=l(st*xr);return new g(Yl,Jl,Ql,Xl)}subtract(p){return this.add(p.negate())}wNAF(p){return U.wNAFCached(this,p,g.normalizeZ)}multiply(p){let v=p;Ne("scalar",v,Ce,n);let{p:C,f:R}=this.wNAF(v);return g.normalizeZ([C,R])[0]}multiplyUnsafe(p){let v=p;return Ne("scalar",v,Ke,n),v===Ke?L:this.equals(L)||v===Ce?this:this.equals(S)?this.wNAF(v).p:U.unsafeLadder(this,v)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return U.unsafeLadder(this,n).is0()}toAffine(p){return x(this,p)}clearCofactor(){let{h:p}=e;return p===Ce?this:this.multiplyUnsafe(p)}static fromHex(p,v=!1){let{d:C,a:R}=e,_=t.BYTES;p=te("pointHex",p,_),Fe("zip215",v);let P=p.slice(),H=p[_-1];P[_-1]=H&-129;let D=kt(P),W=v?u:t.ORDER;Ne("pointHex.y",D,Ke,W);let Y=l(D*D),le=l(Y-Ce),ue=l(C*Y-R),{isValid:he,value:Be}=h(le,ue);if(!he)throw new Error("Point.fromHex: invalid y coordinate");let se=(Be&Ce)===Ce,ke=(H&128)!==0;if(!v&&Be===Ke&&ke)throw new Error("Point.fromHex: x=0 and x_0=1");return ke!==se&&(Be=l(-Be)),g.fromAffine({x:Be,y:D})}static fromPrivateKey(p){return T(p).point}toRawBytes(){let{x:p,y:v}=this.toAffine(),C=qt(v,t.BYTES);return C[C.length-1]|=p&Ce?128:0,C}toHex(){return ut(this.toRawBytes())}}g.BASE=new g(e.Gx,e.Gy,Ce,l(e.Gx*e.Gy)),g.ZERO=new g(Ke,Ce,Ce,Ke);let{BASE:S,ZERO:L}=g,U=pn(g,a*8);function I(b){return j(b,n)}function k(b){return I(kt(b))}function T(b){let p=a;b=te("private key",b,p);let v=te("hashed private key",s(b),2*p),C=w(v.slice(0,p)),R=v.slice(p,2*p),_=k(C),P=S.multiply(_),H=P.toRawBytes();return{head:C,prefix:R,scalar:_,point:P,pointBytes:H}}function ne(b){return T(b).pointBytes}function K(b=new Uint8Array,...p){let v=ht(...p);return k(s(m(v,te("context",b),!!o)))}function V(b,p,v={}){b=te("message",b),o&&(b=o(b));let{prefix:C,scalar:R,pointBytes:_}=T(p),P=K(v.context,C,b),H=S.multiply(P).toRawBytes(),D=K(v.context,H,_,b),W=I(P+D*R);Ne("signature.s",W,Ke,n);let Y=ht(H,qt(W,t.BYTES));return te("result",Y,a*2)}let oe=$f;function E(b,p,v,C=oe){let{context:R,zip215:_}=C,P=t.BYTES;b=te("signature",b,2*P),p=te("message",p),_!==void 0&&Fe("zip215",_),o&&(p=o(p));let H=kt(b.slice(P,2*P)),D,W,Y;try{D=g.fromHex(v,_),W=g.fromHex(b.slice(0,P),_),Y=S.multiplyUnsafe(H)}catch{return!1}if(!_&&D.isSmallOrder())return!1;let le=K(R,W.toRawBytes(),D.toRawBytes(),p);return W.add(D.multiplyUnsafe(le)).subtract(Y).clearCofactor().equals(g.ZERO)}return S._setWindowSize(8),{CURVE:e,getPublicKey:ne,sign:V,verify:E,ExtendedPoint:g,utils:{getExtendedPublicKey:T,randomPrivateKey:()=>i(t.BYTES),precompute(b=8,p=g.BASE){return p._setWindowSize(b),p.multiply(BigInt(3)),p}}}}var gs=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Sa=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),l0=BigInt(0),Gf=BigInt(1),Ia=BigInt(2),u0=BigInt(3),Wf=BigInt(5),jf=BigInt(8);function Zf(r){let e=BigInt(10),t=BigInt(20),n=BigInt(40),o=BigInt(80),s=gs,a=r*r%s*r%s,c=Q(a,Ia,s)*a%s,u=Q(c,Gf,s)*r%s,l=Q(u,Wf,s)*u%s,f=Q(l,e,s)*l%s,h=Q(f,t,s)*f%s,w=Q(h,n,s)*h%s,m=Q(w,o,s)*w%s,y=Q(m,o,s)*w%s,d=Q(y,e,s)*l%s;return{pow_p_5_8:Q(d,Ia,s)*r%s,b2:a}}function Yf(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function Jf(r,e){let t=gs,n=j(e*e*e,t),o=j(n*n*e,t),s=Zf(r*o).pow_p_5_8,i=j(r*n*s,t),a=j(e*i*i,t),c=i,u=j(i*Sa,t),l=a===r,f=a===j(-r,t),h=a===j(-r*Sa,t);return l&&(i=c),(f||h)&&(i=u),xa(i,t)&&(i=j(-i,t)),{isValid:l||f,value:i}}var Xf=Ct(gs,void 0,!0),Qf={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Xf,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:jf,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ga,randomBytes:ln,adjustScalarBytes:Yf,uvRatio:Jf},ka=Aa(Qf);var yn=32;function Na(r,e,t){return ka.verify(e,t instanceof Uint8Array?t:t.subarray(),r)}var bn=class{type="Ed25519";raw;constructor(e){this.raw=ms(e,yn)}toMultihash(){return ct.digest(Tt(this))}toCID(){return de.createV1(114,this.toMultihash())}toString(){return J.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:be(this.raw,e.raw)}verify(e,t){return Na(this.raw,t,e)}};function ys(r){return r=ms(r,yn),new bn(r)}function ms(r,e){if(r=Uint8Array.from(r??[]),r.length!==e)throw new Se(`Key must be a Uint8Array of length ${e}, got ${r.length}`);return r}function pe(r=0){return new Uint8Array(r)}function Te(r=0){return new Uint8Array(r)}var th=Math.pow(2,7),rh=Math.pow(2,14),nh=Math.pow(2,21),bs=Math.pow(2,28),ws=Math.pow(2,35),xs=Math.pow(2,42),vs=Math.pow(2,49),G=128,we=127;function xe(r){if(r<th)return 1;if(r<rh)return 2;if(r<nh)return 3;if(r<bs)return 4;if(r<ws)return 5;if(r<xs)return 6;if(r<vs)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Es(r,e,t=0){switch(xe(r)){case 8:e[t++]=r&255|G,r/=128;case 7:e[t++]=r&255|G,r/=128;case 6:e[t++]=r&255|G,r/=128;case 5:e[t++]=r&255|G,r/=128;case 4:e[t++]=r&255|G,r>>>=7;case 3:e[t++]=r&255|G,r>>>=7;case 2:e[t++]=r&255|G,r>>>=7;case 1:{e[t++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return e}function oh(r,e,t=0){switch(xe(r)){case 8:e.set(t++,r&255|G),r/=128;case 7:e.set(t++,r&255|G),r/=128;case 6:e.set(t++,r&255|G),r/=128;case 5:e.set(t++,r&255|G),r/=128;case 4:e.set(t++,r&255|G),r>>>=7;case 3:e.set(t++,r&255|G),r>>>=7;case 2:e.set(t++,r&255|G),r>>>=7;case 1:{e.set(t++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return e}function Bs(r,e){let t=r[e],n=0;if(n+=t&we,t<G||(t=r[e+1],n+=(t&we)<<7,t<G)||(t=r[e+2],n+=(t&we)<<14,t<G)||(t=r[e+3],n+=(t&we)<<21,t<G)||(t=r[e+4],n+=(t&we)*bs,t<G)||(t=r[e+5],n+=(t&we)*ws,t<G)||(t=r[e+6],n+=(t&we)*xs,t<G)||(t=r[e+7],n+=(t&we)*vs,t<G))return n;throw new RangeError("Could not decode varint")}function sh(r,e){let t=r.get(e),n=0;if(n+=t&we,t<G||(t=r.get(e+1),n+=(t&we)<<7,t<G)||(t=r.get(e+2),n+=(t&we)<<14,t<G)||(t=r.get(e+3),n+=(t&we)<<21,t<G)||(t=r.get(e+4),n+=(t&we)*bs,t<G)||(t=r.get(e+5),n+=(t&we)*ws,t<G)||(t=r.get(e+6),n+=(t&we)*xs,t<G)||(t=r.get(e+7),n+=(t&we)*vs,t<G))return n;throw new RangeError("Could not decode varint")}function Oe(r,e,t=0){return e==null&&(e=Te(xe(r))),e instanceof Uint8Array?Es(r,e,t):oh(r,e,t)}function dt(r,e=0){return r instanceof Uint8Array?Bs(r,e):sh(r,e)}var As=new Float32Array([-0]),Ut=new Uint8Array(As.buffer);function Ta(r,e,t){As[0]=r,e[t]=Ut[0],e[t+1]=Ut[1],e[t+2]=Ut[2],e[t+3]=Ut[3]}function Ua(r,e){return Ut[0]=r[e],Ut[1]=r[e+1],Ut[2]=r[e+2],Ut[3]=r[e+3],As[0]}var Ss=new Float64Array([-0]),ve=new Uint8Array(Ss.buffer);function La(r,e,t){Ss[0]=r,e[t]=ve[0],e[t+1]=ve[1],e[t+2]=ve[2],e[t+3]=ve[3],e[t+4]=ve[4],e[t+5]=ve[5],e[t+6]=ve[6],e[t+7]=ve[7]}function Ra(r,e){return ve[0]=r[e],ve[1]=r[e+1],ve[2]=r[e+2],ve[3]=r[e+3],ve[4]=r[e+4],ve[5]=r[e+5],ve[6]=r[e+6],ve[7]=r[e+7],Ss[0]}var ih=BigInt(Number.MAX_SAFE_INTEGER),ah=BigInt(Number.MIN_SAFE_INTEGER),Re=class r{lo;hi;constructor(e,t){this.lo=e|0,this.hi=t|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let t=~this.lo+1>>>0,n=~this.hi>>>0;return t===0&&(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let t=~this.lo+1>>>0,n=~this.hi>>>0;return t===0&&(n=n+1>>>0),-(BigInt(t)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Gt;if(e<ih&&e>ah)return this.fromNumber(Number(e));let t=e<0n;t&&(e=-e);let n=e>>32n,o=e-(n<<32n);return t&&(n=~n|0n,o=~o|0n,++o>_a&&(o=0n,++n>_a&&(n=0n))),new r(Number(o),Number(n))}static fromNumber(e){if(e===0)return Gt;let t=e<0;t&&(e=-e);let n=e>>>0,o=(e-n)/4294967296>>>0;return t&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new r(n,o)}static from(e){return typeof e=="number"?r.fromNumber(e):typeof e=="bigint"?r.fromBigInt(e):typeof e=="string"?r.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new r(e.low>>>0,e.high>>>0):Gt}},Gt=new Re(0,0);Gt.toBigInt=function(){return 0n};Gt.zzEncode=Gt.zzDecode=function(){return this};Gt.length=function(){return 1};var _a=4294967296n;function Oa(r){let e=0,t=0;for(let n=0;n<r.length;++n)t=r.charCodeAt(n),t<128?e+=1:t<2048?e+=2:(t&64512)===55296&&(r.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function Va(r,e,t){if(t-e<1)return"";let o,s=[],i=0,a;for(;e<t;)a=r[e++],a<128?s[i++]=a:a>191&&a<224?s[i++]=(a&31)<<6|r[e++]&63:a>239&&a<365?(a=((a&7)<<18|(r[e++]&63)<<12|(r[e++]&63)<<6|r[e++]&63)-65536,s[i++]=55296+(a>>10),s[i++]=56320+(a&1023)):s[i++]=(a&15)<<12|(r[e++]&63)<<6|r[e++]&63,i>8191&&((o??(o=[])).push(String.fromCharCode.apply(String,s)),i=0);return o!=null?(i>0&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))}function Is(r,e,t){let n=t,o,s;for(let i=0;i<r.length;++i)o=r.charCodeAt(i),o<128?e[t++]=o:o<2048?(e[t++]=o>>6|192,e[t++]=o&63|128):(o&64512)===55296&&((s=r.charCodeAt(i+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++i,e[t++]=o>>18|240,e[t++]=o>>12&63|128,e[t++]=o>>6&63|128,e[t++]=o&63|128):(e[t++]=o>>12|224,e[t++]=o>>6&63|128,e[t++]=o&63|128);return t-n}function qe(r,e){return RangeError(`index out of range: ${r.pos} + ${e??1} > ${r.len}`)}function xn(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}var ks=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,qe(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw qe(this,4);return xn(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw qe(this,4);return xn(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw qe(this,4);let e=Ua(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw qe(this,4);let e=Ra(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw qe(this,e);return this.pos+=e,t===n?new Uint8Array(0):this.buf.subarray(t,n)}string(){let e=this.bytes();return Va(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw qe(this,e);this.pos+=e}else do if(this.pos>=this.len)throw qe(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Re(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw qe(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw qe(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw qe(this,8);let e=xn(this.buf,this.pos+=4),t=xn(this.buf,this.pos+=4);return new Re(e,t)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=Bs(this.buf,this.pos);return this.pos+=xe(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Ns(r){return new ks(r instanceof Uint8Array?r:r.subarray())}function $e(r,e,t){let n=Ns(r);return e.decode(n,void 0,t)}var Cs={};Ae(Cs,{base10:()=>ch});var ch=Et({prefix:"9",name:"base10",alphabet:"0123456789"});var Ts={};Ae(Ts,{base16:()=>lh,base16upper:()=>uh});var lh=ee({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),uh=ee({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Us={};Ae(Us,{base2:()=>fh});var fh=ee({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ls={};Ae(Ls,{base256emoji:()=>mh});var Da=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}"),hh=Da.reduce((r,e,t)=>(r[t]=e,r),[]),dh=Da.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function ph(r){return r.reduce((e,t)=>(e+=hh[t],e),"")}function gh(r){let e=[];for(let t of r){let n=dh[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var mh=Xt({prefix:"\u{1F680}",name:"base256emoji",encode:ph,decode:gh});var _s={};Ae(_s,{base64:()=>yh,base64pad:()=>bh,base64url:()=>Rs,base64urlpad:()=>wh});var yh=ee({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bh=ee({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Rs=ee({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wh=ee({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Os={};Ae(Os,{base8:()=>xh});var xh=ee({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Vs={};Ae(Vs,{identity:()=>vh});var vh=Xt({prefix:"\0",name:"identity",encode:r=>Zi(r),decode:r=>ji(r)});var G0=new TextEncoder,W0=new TextDecoder;var Ms={};Ae(Ms,{sha256:()=>Ur,sha512:()=>Ah});function Ds({name:r,code:e,encode:t}){return new Ps(r,e,t)}var Ps=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?Me(this.code,t):t.then(n=>Me(this.code,n))}else throw Error("Unknown type, must be binary type")}};function Ha(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var Ur=Ds({name:"sha2-256",code:18,encode:Ha("SHA-256")}),Ah=Ds({name:"sha2-512",code:19,encode:Ha("SHA-512")});var Lr={...Vs,...Us,...Os,...Cs,...Ts,...Zo,...Yo,...jo,..._s,...Ls},sg={...Ms,...Qo};function Ka(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var Fa=Ka("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Hs=Ka("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=Te(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),Sh={utf8:Fa,"utf-8":Fa,hex:Lr.base16,latin1:Hs,ascii:Hs,binary:Hs,...Lr},vn=Sh;function q(r,e="utf8"){let t=vn[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}function Fs(r){let e=r??8192,t=e>>>1,n,o=e;return function(i){if(i<1||i>t)return Te(i);o+i>e&&(n=Te(e),o=0);let a=n.subarray(o,o+=i);return o&7&&(o=(o|7)+1),a}}var Wt=class{fn;len;next;val;constructor(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}};function Ks(){}var $s=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Ih=Fs();function kh(r){return globalThis.Buffer!=null?Te(r):Ih(r)}var _r=class{len;head;tail;states;constructor(){this.len=0,this.head=new Wt(Ks,0,0),this.tail=this.head,this.states=null}_push(e,t,n){return this.tail=this.tail.next=new Wt(e,t,n),this.len+=t,this}uint32(e){return this.len+=(this.tail=this.tail.next=new zs((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(En,10,Re.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let t=Re.fromBigInt(e);return this._push(En,t.length(),t)}uint64Number(e){return this._push(Es,xe(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let t=Re.fromBigInt(e).zzEncode();return this._push(En,t.length(),t)}sint64Number(e){let t=Re.fromNumber(e).zzEncode();return this._push(En,t.length(),t)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(qs,1,e?1:0)}fixed32(e){return this._push(Rr,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let t=Re.fromBigInt(e);return this._push(Rr,4,t.lo)._push(Rr,4,t.hi)}fixed64Number(e){let t=Re.fromNumber(e);return this._push(Rr,4,t.lo)._push(Rr,4,t.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(Ta,4,e)}double(e){return this._push(La,8,e)}bytes(e){let t=e.length>>>0;return t===0?this._push(qs,1,0):this.uint32(t)._push(Ch,t,e)}string(e){let t=Oa(e);return t!==0?this.uint32(t)._push(Is,t,e):this._push(qs,1,0)}fork(){return this.states=new $s(this),this.head=this.tail=new Wt(Ks,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Wt(Ks,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}finish(){let e=this.head.next,t=kh(this.len),n=0;for(;e!=null;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t}};function qs(r,e,t){e[t]=r&255}function Nh(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}var zs=class extends Wt{next;constructor(e,t){super(Nh,e,t),this.next=void 0}};function En(r,e,t){for(;r.hi!==0;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}function Rr(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Ch(r,e,t){e.set(r,t)}globalThis.Buffer!=null&&(_r.prototype.bytes=function(r){let e=r.length>>>0;return this.uint32(e),e>0&&this._push(Th,e,r),this},_r.prototype.string=function(r){let e=globalThis.Buffer.byteLength(r);return this.uint32(e),e>0&&this._push(Uh,e,r),this});function Th(r,e,t){e.set(r,t)}function Uh(r,e,t){r.length<40?Is(r,e,t):e.utf8Write!=null?e.utf8Write(r,t):e.set(q(r),t)}function Gs(){return new _r}function ze(r,e){let t=Gs();return e.encode(r,t,{lengthDelimited:!1}),t.finish()}var ar;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(ar||(ar={}));function Bn(r,e,t,n){return{name:r,type:e,encode:t,decode:n}}function Ws(r){function e(o){if(r[o.toString()]==null)throw new Error("Invalid enum value");return r[o]}let t=function(s,i){let a=e(s);i.int32(a)},n=function(s){let i=s.int32();return e(i)};return Bn("enum",ar.VARINT,t,n)}function Ge(r,e){return Bn("message",ar.LENGTH_DELIMITED,r,e)}var jt=class extends Error{code="ERR_MAX_LENGTH";name="MaxLengthError"};var ae;(function(r){r.RSA="RSA",r.Ed25519="Ed25519",r.secp256k1="secp256k1"})(ae||(ae={}));var js;(function(r){r[r.RSA=0]="RSA",r[r.Ed25519=1]="Ed25519",r[r.secp256k1=2]="secp256k1"})(js||(js={}));(function(r){r.codec=()=>Ws(js)})(ae||(ae={}));var Xe;(function(r){let e;r.codec=()=>(e==null&&(e=Ge((t,n,o={})=>{o.lengthDelimited!==!1&&n.fork(),t.Type!=null&&(n.uint32(8),ae.codec().encode(t.Type,n)),t.Data!=null&&(n.uint32(18),n.bytes(t.Data)),o.lengthDelimited!==!1&&n.ldelim()},(t,n,o={})=>{let s={},i=n==null?t.len:t.pos+n;for(;t.pos<i;){let a=t.uint32();switch(a>>>3){case 1:{s.Type=ae.codec().decode(t);break}case 2:{s.Data=t.bytes();break}default:{t.skipType(a&7);break}}}return s})),e),r.encode=t=>ze(t,r.codec()),r.decode=(t,n)=>$e(t,r.codec(),n)})(Xe||(Xe={}));var Zs;(function(r){let e;r.codec=()=>(e==null&&(e=Ge((t,n,o={})=>{o.lengthDelimited!==!1&&n.fork(),t.Type!=null&&(n.uint32(8),ae.codec().encode(t.Type,n)),t.Data!=null&&(n.uint32(18),n.bytes(t.Data)),o.lengthDelimited!==!1&&n.ldelim()},(t,n,o={})=>{let s={},i=n==null?t.len:t.pos+n;for(;t.pos<i;){let a=t.uint32();switch(a>>>3){case 1:{s.Type=ae.codec().decode(t);break}case 2:{s.Data=t.bytes();break}default:{t.skipType(a&7);break}}}return s})),e),r.encode=t=>ze(t,r.codec()),r.decode=(t,n)=>$e(t,r.codec(),n)})(Zs||(Zs={}));var $r={};Ae($r,{MAX_RSA_KEY_SIZE:()=>go,generateRSAKeyPair:()=>Mc,jwkToJWKKeyPair:()=>Hc,jwkToPkcs1:()=>Wh,jwkToPkix:()=>oi,jwkToRSAPrivateKey:()=>Dc,pkcs1ToJwk:()=>Oc,pkcs1ToRSAPrivateKey:()=>Pc,pkixToJwk:()=>Vc,pkixToRSAPublicKey:()=>si});var Lh=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Lt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Rt=new Uint32Array(64),Ys=class extends sr{constructor(){super(64,32,8,!1),this.A=Lt[0]|0,this.B=Lt[1]|0,this.C=Lt[2]|0,this.D=Lt[3]|0,this.E=Lt[4]|0,this.F=Lt[5]|0,this.G=Lt[6]|0,this.H=Lt[7]|0}get(){let{A:e,B:t,C:n,D:o,E:s,F:i,G:a,H:c}=this;return[e,t,n,o,s,i,a,c]}set(e,t,n,o,s,i,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)Rt[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){let h=Rt[f-15],w=Rt[f-2],m=He(h,7)^He(h,18)^h>>>3,y=He(w,17)^He(w,19)^w>>>10;Rt[f]=y+Rt[f-7]+m+Rt[f-16]|0}let{A:n,B:o,C:s,D:i,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let h=He(a,6)^He(a,11)^He(a,25),w=l+h+ha(a,c,u)+Lh[f]+Rt[f]|0,y=(He(n,2)^He(n,13)^He(n,22))+da(n,o,s)|0;l=u,u=c,c=a,a=i+w|0,i=s,s=o,o=n,n=w+y|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,o,s,i,a,c,u,l)}roundClean(){Rt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var cr=cn(()=>new Ys);var M=Gi($a());function Zt(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}function _t(r,e,t=-1){let n=t,o=r,s=0,i=Math.pow(2,e);for(let a=1;a<8;a++){if(r<i){let c;if(n<0)c=new ArrayBuffer(a),s=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}let u=new Uint8Array(c);for(let l=a-1;l>=0;l--){let f=Math.pow(2,l*e);u[s-l-1]=Math.floor(o/f),o-=u[s-l-1]*f}return c}i*=Math.pow(2,e)}return new ArrayBuffer(0)}function In(...r){let e=0,t=0;for(let s of r)e+=s.length;let n=new ArrayBuffer(e),o=new Uint8Array(n);for(let s of r)o.set(s,t),t+=s.length;return o}function Xs(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)t[a]=0;t[0]=r[0]&128;let n=Zt(t,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let a=0;a<this.valueHex.byteLength;a++)s[a]=r[a];return s[0]&=127,Zt(s,8)-n}function za(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let i=t-e,a=_t(i,8,n),c=new Uint8Array(a);return c[0]|=128,a}let o=_t(e,8,n),s=new Uint8Array(o);if(s[0]&128){let i=o.slice(0),a=new Uint8Array(i);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let c=0;c<i.byteLength;c++)s[c+1]=a[c];s[0]=0}return o}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function Ga(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let o=0;o<t.length;o++)if(t[o]!==n[o])return!1;return!0}function Ue(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,o=new Array(n);for(let i=0;i<n;i++)o[i]="0";return o.join("").concat(t)}var Hg=Math.log(2);function kn(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Qs(r){let e=0,t=0;for(let o=0;o<r.length;o++){let s=r[o];e+=s.byteLength}let n=new Uint8Array(e);for(let o=0;o<r.length;o++){let s=r[o];n.set(new Uint8Array(s),t),t+=s.byteLength}return n.buffer}function bt(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Vr=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Qs(this.items)}},Or=[new Uint8Array([1])],Wa="0123456789";var dr="",We=new ArrayBuffer(0),ei=new Uint8Array(0),Pr="EndOfContent",Za="OCTET STRING",Ya="BIT STRING";function wt(r){var e;return e=class extends r{constructor(...n){var o;super(...n);let s=n[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?M.BufferSourceConverter.toUint8Array(s.valueHex):ei}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,o,s){let i=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!bt(this,i,o,s))return-1;let a=o+s;return this.valueHexView=i.subarray(o,a),this.valueHexView.length?(this.blockLength=s,a):(this.warnings.push("Zero buffer length"),o)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",We)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:M.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var gt=class{constructor({blockLength:e=0,error:t=dr,warnings:n=[],valueBeforeDecode:o=ei}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=M.BufferSourceConverter.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:M.Convert.ToHex(this.valueBeforeDecodeView)}}};gt.NAME="baseBlock";var Ee=class extends gt{fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Ee.NAME="valueBlock";var Nn=class extends wt(gt){constructor({idBlock:e={}}={}){var t,n,o,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?M.BufferSourceConverter.toUint8Array(e.valueHex):ei,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(o=e.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",We}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let o=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,o[0]=t}return o.buffer}if(!this.isHexOnly){let o=_t(this.tagNumber,7),s=new Uint8Array(o),i=o.byteLength,a=new Uint8Array(i+1);if(a[0]=t|31,!e){for(let c=0;c<i-1;c++)a[c+1]=s[c]|128;a[i]=s[i-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let o=this.valueHexView;for(let s=0;s<o.length-1;s++)n[s+1]=o[s]|128;n[this.valueHexView.byteLength]=o[o.length-1]}return n.buffer}fromBER(e,t,n){let o=M.BufferSourceConverter.toUint8Array(e);if(!bt(this,o,t,n))return-1;let s=o.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;let a=s[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=1,u=this.valueHexView=new Uint8Array(255),l=255;for(;s[c]&128;){if(u[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===l){l+=255;let h=new Uint8Array(l);for(let w=0;w<u.length;w++)h[w]=u[w];u=this.valueHexView=new Uint8Array(l)}}this.blockLength=c+1,u[c-1]=s[c]&127;let f=new Uint8Array(c);for(let h=0;h<c;h++)f[h]=u[h];u=this.valueHexView=new Uint8Array(c),u.set(f),this.blockLength<=9?this.tagNumber=Zt(u,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};Nn.NAME="identificationBlock";var Cn=class extends gt{constructor({lenBlock:e={}}={}){var t,n,o;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(o=e.length)!==null&&o!==void 0?o:0}fromBER(e,t,n){let o=M.BufferSourceConverter.toUint8Array(e);if(!bt(this,o,t,n))return-1;let s=o.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;let i=s[0]&127;if(i>8)return this.error="Too big integer",-1;if(i+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let a=t+1,c=o.subarray(a,a+i);return c[i-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Zt(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=i+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let o=_t(this.length,8);if(o.byteLength>127)return this.error="Too big length",We;if(t=new ArrayBuffer(o.byteLength+1),e)return t;let s=new Uint8Array(o);n=new Uint8Array(t),n[0]=o.byteLength|128;for(let i=0;i<o.byteLength;i++)n[i+1]=s[i];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};Cn.NAME="lengthBlock";var A={},ge=class extends gt{constructor({name:e=dr,optional:t=!1,primitiveSchema:n,...o}={},s){super(o),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new Nn(o),this.lenBlock=new Cn(o),this.valueBlock=s?new s(o):new Ee(o)}fromBER(e,t,n){let o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}toBER(e,t){let n=t||new Vr;t||Ja(this);let o=this.idBlock.toBER(e);if(n.write(o),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let i=this.lenBlock.toBER(e);n.write(i),n.write(s)}return t?We:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():M.Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${M.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Ga(t,n)}};ge.NAME="BaseBlock";function Ja(r){if(r instanceof A.Constructed)for(let e of r.valueBlock.value)Ja(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}var Tn=class extends ge{constructor({value:e=dr,...t}={},n){super(t,n),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,n){let o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};Tn.NAME="BaseStringBlock";var Un=class extends wt(Ee){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};Un.NAME="PrimitiveValueBlock";var Xa,Ln=class extends ge{constructor(e={}){super(e,Un),this.idBlock.isConstructed=!1}};Xa=Ln;A.Primitive=Xa;Ln.NAME="PRIMITIVE";function Fh(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function ho(r,e=0,t=r.length){let n=e,o=new ge({},Ee),s=new gt;if(!bt(s,r,e,t))return o.error=s.error,{offset:-1,result:o};if(!r.subarray(e,e+t).length)return o.error="Zero buffer length",{offset:-1,result:o};let a=o.idBlock.fromBER(r,e,t);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),a===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(e=a,t-=o.idBlock.blockLength,a=o.lenBlock.fromBER(r,e,t),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),a===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(e=a,t-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let c=ge;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};c=A.EndOfContent;break;case 1:c=A.Boolean;break;case 2:c=A.Integer;break;case 3:c=A.BitString;break;case 4:c=A.OctetString;break;case 5:c=A.Null;break;case 6:c=A.ObjectIdentifier;break;case 10:c=A.Enumerated;break;case 12:c=A.Utf8String;break;case 13:c=A.RelativeObjectIdentifier;break;case 14:c=A.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=A.Sequence;break;case 17:c=A.Set;break;case 18:c=A.NumericString;break;case 19:c=A.PrintableString;break;case 20:c=A.TeletexString;break;case 21:c=A.VideotexString;break;case 22:c=A.IA5String;break;case 23:c=A.UTCTime;break;case 24:c=A.GeneralizedTime;break;case 25:c=A.GraphicString;break;case 26:c=A.VisibleString;break;case 27:c=A.GeneralString;break;case 28:c=A.UniversalString;break;case 29:c=A.CharacterString;break;case 30:c=A.BmpString;break;case 31:c=A.DATE;break;case 32:c=A.TimeOfDay;break;case 33:c=A.DateTime;break;case 34:c=A.Duration;break;default:{let u=o.idBlock.isConstructed?new A.Constructed:new A.Primitive;u.idBlock=o.idBlock,u.lenBlock=o.lenBlock,u.warnings=o.warnings,o=u}}break;case 2:case 3:case 4:default:c=o.idBlock.isConstructed?A.Constructed:A.Primitive}return o=Fh(o,c),a=o.fromBER(r,e,o.lenBlock.isIndefiniteForm?t:o.lenBlock.length),o.valueBeforeDecodeView=r.subarray(n,n+o.blockLength),{offset:a,result:o}}function ti(r){if(!r.byteLength){let e=new ge({},Ee);return e.error="Input buffer has zero length",{offset:-1,result:e}}return ho(M.BufferSourceConverter.toUint8Array(r).slice(),0,r.byteLength)}function Kh(r,e){return r?1:e}var Qe=class extends Ee{constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let o=M.BufferSourceConverter.toUint8Array(e);if(!bt(this,o,t,n))return-1;if(this.valueBeforeDecodeView=o.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;Kh(this.isIndefiniteForm,n)>0;){let i=ho(o,s,n);if(i.offset===-1)return this.error=i.result.error,this.warnings.concat(i.result.warnings),-1;if(s=i.offset,this.blockLength+=i.result.blockLength,n-=i.result.blockLength,this.value.push(i.result),this.isIndefiniteForm&&i.result.constructor.NAME===Pr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Pr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){let n=t||new Vr;for(let o=0;o<this.value.length;o++)this.value[o].toBER(e,n);return t?We:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Qe.NAME="ConstructedValueBlock";var Qa,Ot=class extends ge{constructor(e={}){super(e,Qe),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
2
|
+
"use strict";var Libp2PIdentify=(()=>{var ou=Object.create;var tn=Object.defineProperty;var su=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var au=Object.getPrototypeOf,cu=Object.prototype.hasOwnProperty;var $i=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ae=(r,e)=>{for(var t in e)tn(r,t,{get:e[t],enumerable:!0})},zi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of iu(e))!cu.call(r,o)&&o!==t&&tn(r,o,{get:()=>e[o],enumerable:!(n=su(e,o))||n.enumerable});return r};var Gi=(r,e,t)=>(t=r!=null?ou(au(r)):{},zi(e||!r||!r.__esModule?tn(t,"default",{value:r,enumerable:!0}):t,r)),lu=r=>zi(tn({},"__esModule",{value:!0}),r);var $a=$i(lr=>{"use strict";var Rh="[object ArrayBuffer]",pt=class r{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Rh}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=r.toUint8Array(e),o=r.toUint8Array(t);if(n.length!==o.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==o[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let i of t)n+=i.byteLength;let o=new Uint8Array(n),s=0;for(let i of t){let a=this.toUint8Array(i);o.set(a,s),s+=a.length}return e[e.length-1]instanceof Function?this.toView(o,e[e.length-1]):o.buffer}},Js="string",_h=/^[0-9a-f]+$/i,Oh=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Vh=/^[a-zA-Z0-9-_]+$/,An=class{static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n.buffer}static toString(e){let t=pt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return decodeURIComponent(escape(n))}},Ve=class{static toString(e,t=!1){let n=pt.toArrayBuffer(e),o=new DataView(n),s="";for(let i=0;i<n.byteLength;i+=2){let a=o.getUint16(i,t);s+=String.fromCharCode(a)}return s}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),o=new DataView(n);for(let s=0;s<e.length;s++)o.setUint16(s*2,e.charCodeAt(s),t);return n}},Sn=class r{static isHex(e){return typeof e===Js&&_h.test(e)}static isBase64(e){return typeof e===Js&&Oh.test(e)}static isBase64Url(e){return typeof e===Js&&Vh.test(e)}static ToString(e,t="utf8"){let n=pt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Ve.toString(n,!0);case"utf16":case"utf16be":return Ve.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Ve.fromString(e,!0);case"utf16":case"utf16be":return Ve.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=pt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return An.fromString(e);case"utf16":case"utf16be":return Ve.fromString(e);case"utf16le":case"usc2":return Ve.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return An.toString(e);case"utf16":case"utf16be":return Ve.toString(e);case"utf16le":case"usc2":return Ve.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let o=0;o<t;o++)n[o]=e.charCodeAt(o);return n.buffer}static ToBinary(e){let t=pt.toUint8Array(e),n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return n}static ToHex(e){let t=pt.toUint8Array(e),n="",o=t.length;for(let s=0;s<o;s++){let i=t[s];i<16&&(n+="0"),n+=i.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o=o+2){let s=t.slice(o,o+2);n[o/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,t=!1){return Ve.toString(e,t)}static FromUtf16String(e,t=!1){return Ve.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Sn.DEFAULT_UTF8_ENCODING="utf8";function Ph(r,...e){let t=arguments[0];for(let n=1;n<arguments.length;n++){let o=arguments[n];for(let s in o)t[s]=o[s]}return t}function Dh(...r){let e=r.map(o=>o.byteLength).reduce((o,s)=>o+s),t=new Uint8Array(e),n=0;return r.map(o=>new Uint8Array(o)).forEach(o=>{for(let s of o)t[n++]=s}),t.buffer}function Mh(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let o=0;o<r.byteLength;o++)if(t[o]!==n[o])return!1;return!0}lr.BufferSourceConverter=pt;lr.Convert=Sn;lr.assign=Ph;lr.combine=Dh;lr.isEqual=Mh});var Ll=$i((Xw,Ul)=>{function Cd(){return!!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}Ul.exports=Cd});var Fd={};Ae(Fd,{identify:()=>Md,identifyPush:()=>Hd});var qo=Symbol.for("@libp2p/peer-id");var Se=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}},Jt=class extends Error{static name="InvalidPublicKeyError";constructor(e="Invalid public key"){super(e),this.name="InvalidPublicKeyError"}};var rn=class extends Error{static name="InvalidCIDError";constructor(e="Invalid CID"){super(e),this.name="InvalidCIDError"}},nn=class extends Error{static name="InvalidMultihashError";constructor(e="Invalid Multihash"){super(e),this.name="InvalidMultihashError"}};var De=class extends Error{static name="InvalidMessageError";constructor(e="Invalid message"){super(e),this.name="InvalidMessageError"}};var Dt=class extends Error{static name="UnsupportedKeyTypeError";constructor(e="Unsupported key type"){super(e),this.name="UnsupportedKeyTypeError"}};var Er=(r,...e)=>{try{[...e]}catch{}};var on=Symbol.for("@libp2p/service-capabilities"),Gd=Symbol.for("@libp2p/service-dependencies");var jo={};Ae(jo,{base58btc:()=>J,base58flickr:()=>gu});var mp=new Uint8Array(0);function Wi(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 it(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 ji(r){return new TextEncoder().encode(r)}function Zi(r){return new TextDecoder().decode(r)}function uu(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 s=r.charAt(o),i=s.charCodeAt(0);if(t[i]!==255)throw new TypeError(s+" is ambiguous");t[i]=o}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(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 y=0,d=0,x=0,B=m.length;x!==B&&m[x]===0;)x++,y++;for(var g=(B-x)*l+1>>>0,S=new Uint8Array(g);x!==B;){for(var L=m[x],U=0,I=g-1;(L!==0||U<d)&&I!==-1;I--,U++)L+=256*S[I]>>>0,S[I]=L%a>>>0,L=L/a>>>0;if(L!==0)throw new Error("Non-zero carry");d=U,x++}for(var k=g-d;k!==g&&S[k]===0;)k++;for(var T=c.repeat(y);k<g;++k)T+=r.charAt(S[k]);return T}function h(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var y=0;if(m[y]!==" "){for(var d=0,x=0;m[y]===c;)d++,y++;for(var B=(m.length-y)*u+1>>>0,g=new Uint8Array(B);m[y];){var S=t[m.charCodeAt(y)];if(S===255)return;for(var L=0,U=B-1;(S!==0||L<x)&&U!==-1;U--,L++)S+=a*g[U]>>>0,g[U]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");x=L,y++}if(m[y]!==" "){for(var I=B-x;I!==B&&g[I]===0;)I++;for(var k=new Uint8Array(d+(B-I)),T=d;I!==B;)k[T++]=g[I++];return k}}}function w(m){var y=h(m);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:w}}var fu=uu,hu=fu,Ji=hu;var $o=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")}},zo=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 Xi(this,e)}},Go=class{decoders;constructor(e){this.decoders=e}or(e){return Xi(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 Xi(r,e){return new Go({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var Wo=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 $o(e,t,n),this.decoder=new zo(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Xt({name:r,prefix:e,encode:t,decode:n}){return new Wo(r,e,t,n)}function Et({name:r,prefix:e,alphabet:t}){let{encode:n,decode:o}=Ji(t,r);return Xt({prefix:e,name:r,encode:n,decode:s=>it(o(s))})}function du(r,e,t,n){let o={};for(let l=0;l<e.length;++l)o[e[l]]=l;let s=r.length;for(;r[s-1]==="=";)--s;let i=new Uint8Array(s*t/8|0),a=0,c=0,u=0;for(let l=0;l<s;++l){let f=o[r[l]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|f,a+=t,a>=8&&(a-=8,i[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return i}function pu(r,e,t){let n=e[e.length-1]==="=",o=(1<<t)-1,s="",i=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],i+=8;i>t;)i-=t,s+=e[o&a>>i];if(i!==0&&(s+=e[o&a<<t-i]),n)for(;s.length*t&7;)s+="=";return s}function ee({name:r,prefix:e,bitsPerChar:t,alphabet:n}){return Xt({prefix:e,name:r,encode(o){return pu(o,n,t)},decode(o){return du(o,n,t,r)}})}var J=Et({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gu=Et({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Zo={};Ae(Zo,{base32:()=>at,base32hex:()=>wu,base32hexpad:()=>vu,base32hexpadupper:()=>Eu,base32hexupper:()=>xu,base32pad:()=>yu,base32padupper:()=>bu,base32upper:()=>mu,base32z:()=>Bu});var at=ee({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),mu=ee({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yu=ee({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),bu=ee({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),wu=ee({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),xu=ee({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vu=ee({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Eu=ee({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Bu=ee({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Yo={};Ae(Yo,{base36:()=>Br,base36upper:()=>Au});var Br=Et({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Au=Et({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Su=ta,Qi=128,Iu=127,ku=~Iu,Nu=Math.pow(2,31);function ta(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Nu;)e[t++]=r&255|Qi,r/=128;for(;r&ku;)e[t++]=r&255|Qi,r>>>=7;return e[t]=r|0,ta.bytes=t-n+1,e}var Cu=Jo,Tu=128,ea=127;function Jo(r,n){var t=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a)throw Jo.bytes=0,new RangeError("Could not decode varint");i=r[s++],t+=o<28?(i&ea)<<o:(i&ea)*Math.pow(2,o),o+=7}while(i>=Tu);return Jo.bytes=s-n,t}var Uu=Math.pow(2,7),Lu=Math.pow(2,14),Ru=Math.pow(2,21),_u=Math.pow(2,28),Ou=Math.pow(2,35),Vu=Math.pow(2,42),Pu=Math.pow(2,49),Du=Math.pow(2,56),Mu=Math.pow(2,63),Hu=function(r){return r<Uu?1:r<Lu?2:r<Ru?3:r<_u?4:r<Ou?5:r<Vu?6:r<Pu?7:r<Du?8:r<Mu?9:10},Fu={encode:Su,decode:Cu,encodingLength:Hu},Ku=Fu,Ar=Ku;function Sr(r,e=0){return[Ar.decode(r,e),Ar.decode.bytes]}function Qt(r,e,t=0){return Ar.encode(r,e,t),e}function er(r){return Ar.encodingLength(r)}function Me(r,e){let t=e.byteLength,n=er(r),o=n+er(t),s=new Uint8Array(o+t);return Qt(r,s,0),Qt(t,s,n),s.set(e,o),new tr(r,t,e,s)}function Mt(r){let e=it(r),[t,n]=Sr(e),[o,s]=Sr(e.subarray(n)),i=e.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new tr(t,o,i,e)}function ra(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Wi(r.bytes,t.bytes)}}var tr=class{code;size;digest;bytes;constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};function na(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return $u(t,Xo(r),e??J.encoder);default:return zu(t,Xo(r),e??at.encoder)}}var oa=new WeakMap;function Xo(r){let e=oa.get(r);if(e==null){let t=new Map;return oa.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!==Ir)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Gu)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=Me(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&&ra(e.multihash,n.multihash)}toString(e){return na(this,e)}toJSON(){return{"/":na(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:s,bytes:i}=t;return new r(n,o,s,i??sa(n,o,s.bytes))}else if(t[Wu]===!0){let{version:n,multihash:o,code:s}=t,i=Mt(o);return r.create(n,s,i)}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!==Ir)throw new Error(`Version 0 CID must use dag-pb (code: ${Ir}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let o=sa(e,t,n.bytes);return new r(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,Ir,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=it(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=o.subarray(t.multihashSize-t.digestSize),i=new tr(t.multihashCode,t.digestSize,s,o);return[t.version===0?r.createV0(i):r.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[f,h]=Sr(e.subarray(t));return t+=h,f},o=n(),s=Ir;if(o===18?(o=0,t=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,a=n(),c=n(),u=t+c,l=u-i;return{version:o,codec:s,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,o]=qu(e,t),s=r.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Xo(s).set(n,e),s}};function qu(r,e){switch(r[0]){case"Q":{let t=e??J;return[J.prefix,t.decode(`${J.prefix}${r}`)]}case J.prefix:{let t=e??J;return[J.prefix,t.decode(r)]}case at.prefix:{let t=e??at;return[at.prefix,t.decode(r)]}case Br.prefix:{let t=e??Br;return[Br.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 $u(r,e,t){let{prefix:n}=t;if(n!==J.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return o}function zu(r,e,t){let{prefix:n}=t,o=e.get(n);if(o==null){let s=t.encode(r);return e.set(n,s),s}else return o}var Ir=112,Gu=18;function sa(r,e,t){let n=er(r),o=n+er(e),s=new Uint8Array(o+t.byteLength);return Qt(r,s,0),Qt(e,s,n),s.set(t,o),s}var Wu=Symbol.for("@ipld/js-cid/CID");var Qo={};Ae(Qo,{identity:()=>ct});var ia=0,ju="identity",aa=it;function Zu(r){return Me(ia,aa(r))}var ct={code:ia,name:ju,encode:aa,digest:Zu};function be(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 ca(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, not ${r}`)}function Yu(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function rr(r,...e){if(!Yu(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}function la(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ca(r.outputLen),ca(r.blockLen)}function nr(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function ua(r,e){rr(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}var Ht=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var an=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),He=(r,e)=>r<<32-e|r>>>e;var Mp=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function fa(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function kr(r){return typeof r=="string"&&(r=fa(r)),rr(r),r}function es(...r){let e=0;for(let n=0;n<r.length;n++){let o=r[n];rr(o),e+=o.length}let t=new Uint8Array(e);for(let n=0,o=0;n<r.length;n++){let s=r[n];t.set(s,o),o+=s.length}return t}var or=class{clone(){return this._cloneInto()}},Hp={}.toString;function cn(r){let e=n=>r().update(kr(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function ln(r=32){if(Ht&&typeof Ht.getRandomValues=="function")return Ht.getRandomValues(new Uint8Array(r));if(Ht&&typeof Ht.randomBytes=="function")return Ht.randomBytes(r);throw new Error("crypto.getRandomValues must be defined")}function Ju(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(t>>o&s),a=Number(t&s),c=n?4:0,u=n?0:4;r.setUint32(e+c,i,n),r.setUint32(e+u,a,n)}var ha=(r,e,t)=>r&e^~r&t,da=(r,e,t)=>r&e^r&t^e&t,sr=class extends or{constructor(e,t,n,o){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=an(this.buffer)}update(e){nr(this);let{view:t,buffer:n,blockLen:o}=this;e=kr(e);let s=e.length;for(let i=0;i<s;){let a=Math.min(o-this.pos,s-i);if(a===o){let c=an(e);for(;o<=s-i;i+=o)this.process(c,i);continue}n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){nr(this),ua(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:o,isLE:s}=this,{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>o-i&&(this.process(n,0),i=0);for(let f=i;f<o;f++)t[f]=0;Ju(n,o-8,BigInt(this.length*8),s),this.process(n,0);let a=an(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],s)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:o,finished:s,destroyed:i,pos:a}=this;return e.length=o,e.pos=a,e.finished=s,e.destroyed=i,o%t&&e.buffer.set(n),e}};var un=BigInt(4294967295),ts=BigInt(32);function pa(r,e=!1){return e?{h:Number(r&un),l:Number(r>>ts&un)}:{h:Number(r>>ts&un)|0,l:Number(r&un)|0}}function Xu(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:i}=pa(r[o],e);[t[o],n[o]]=[s,i]}return[t,n]}var Qu=(r,e)=>BigInt(r>>>0)<<ts|BigInt(e>>>0),ef=(r,e,t)=>r>>>t,tf=(r,e,t)=>r<<32-t|e>>>t,rf=(r,e,t)=>r>>>t|e<<32-t,nf=(r,e,t)=>r<<32-t|e>>>t,of=(r,e,t)=>r<<64-t|e>>>t-32,sf=(r,e,t)=>r>>>t-32|e<<64-t,af=(r,e)=>e,cf=(r,e)=>r,lf=(r,e,t)=>r<<t|e>>>32-t,uf=(r,e,t)=>e<<t|r>>>32-t,ff=(r,e,t)=>e<<t-32|r>>>64-t,hf=(r,e,t)=>r<<t-32|e>>>64-t;function df(r,e,t,n){let o=(e>>>0)+(n>>>0);return{h:r+t+(o/2**32|0)|0,l:o|0}}var pf=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),gf=(r,e,t,n)=>e+t+n+(r/2**32|0)|0,mf=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),yf=(r,e,t,n,o)=>e+t+n+o+(r/2**32|0)|0,bf=(r,e,t,n,o)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(o>>>0),wf=(r,e,t,n,o,s)=>e+t+n+o+s+(r/2**32|0)|0;var xf={fromBig:pa,split:Xu,toBig:Qu,shrSH:ef,shrSL:tf,rotrSH:rf,rotrSL:nf,rotrBH:of,rotrBL:sf,rotr32H:af,rotr32L:cf,rotlSH:lf,rotlSL:uf,rotlBH:ff,rotlBL:hf,add:df,add3L:pf,add3H:gf,add4L:mf,add4H:yf,add5H:wf,add5L:bf},O=xf;var[vf,Ef]=O.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),At=new Uint32Array(80),St=new Uint32Array(80),rs=class extends sr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:o,Ch:s,Cl:i,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:h,Gh:w,Gl:m,Hh:y,Hl:d}=this;return[e,t,n,o,s,i,a,c,u,l,f,h,w,m,y,d]}set(e,t,n,o,s,i,a,c,u,l,f,h,w,m,y,d){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=i|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=h|0,this.Gh=w|0,this.Gl=m|0,this.Hh=y|0,this.Hl=d|0}process(e,t){for(let g=0;g<16;g++,t+=4)At[g]=e.getUint32(t),St[g]=e.getUint32(t+=4);for(let g=16;g<80;g++){let S=At[g-15]|0,L=St[g-15]|0,U=O.rotrSH(S,L,1)^O.rotrSH(S,L,8)^O.shrSH(S,L,7),I=O.rotrSL(S,L,1)^O.rotrSL(S,L,8)^O.shrSL(S,L,7),k=At[g-2]|0,T=St[g-2]|0,ne=O.rotrSH(k,T,19)^O.rotrBH(k,T,61)^O.shrSH(k,T,6),K=O.rotrSL(k,T,19)^O.rotrBL(k,T,61)^O.shrSL(k,T,6),V=O.add4L(I,K,St[g-7],St[g-16]),oe=O.add4H(V,U,ne,At[g-7],At[g-16]);At[g]=oe|0,St[g]=V|0}let{Ah:n,Al:o,Bh:s,Bl:i,Ch:a,Cl:c,Dh:u,Dl:l,Eh:f,El:h,Fh:w,Fl:m,Gh:y,Gl:d,Hh:x,Hl:B}=this;for(let g=0;g<80;g++){let S=O.rotrSH(f,h,14)^O.rotrSH(f,h,18)^O.rotrBH(f,h,41),L=O.rotrSL(f,h,14)^O.rotrSL(f,h,18)^O.rotrBL(f,h,41),U=f&w^~f&y,I=h&m^~h&d,k=O.add5L(B,L,I,Ef[g],St[g]),T=O.add5H(k,x,S,U,vf[g],At[g]),ne=k|0,K=O.rotrSH(n,o,28)^O.rotrBH(n,o,34)^O.rotrBH(n,o,39),V=O.rotrSL(n,o,28)^O.rotrBL(n,o,34)^O.rotrBL(n,o,39),oe=n&s^n&a^s&a,E=o&i^o&c^i&c;x=y|0,B=d|0,y=w|0,d=m|0,w=f|0,m=h|0,{h:f,l:h}=O.add(u|0,l|0,T|0,ne|0),u=a|0,l=c|0,a=s|0,c=i|0,s=n|0,i=o|0;let N=O.add3L(ne,V,E);n=O.add3H(N,T,K,oe),o=N|0}({h:n,l:o}=O.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:i}=O.add(this.Bh|0,this.Bl|0,s|0,i|0),{h:a,l:c}=O.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=O.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:f,l:h}=O.add(this.Eh|0,this.El|0,f|0,h|0),{h:w,l:m}=O.add(this.Fh|0,this.Fl|0,w|0,m|0),{h:y,l:d}=O.add(this.Gh|0,this.Gl|0,y|0,d|0),{h:x,l:B}=O.add(this.Hh|0,this.Hl|0,x|0,B|0),this.set(n,o,s,i,a,c,u,l,f,h,w,m,y,d,x,B)}roundClean(){At.fill(0),St.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var ga=cn(()=>new rs);var hn={};Ae(hn,{aInRange:()=>Ne,abool:()=>Fe,abytes:()=>ir,bitGet:()=>Nf,bitLen:()=>as,bitMask:()=>Cr,bitSet:()=>Cf,bytesToHex:()=>ut,bytesToNumberBE:()=>ft,bytesToNumberLE:()=>kt,concatBytes:()=>ht,createHmacDrbg:()=>cs,ensureBytes:()=>te,equalBytes:()=>If,hexToBytes:()=>Kt,hexToNumber:()=>is,inRange:()=>Nr,isBytes:()=>It,memoized:()=>$t,notImplemented:()=>Uf,numberToBytesBE:()=>Nt,numberToBytesLE:()=>qt,numberToHexUnpadded:()=>Ft,numberToVarBytesBE:()=>Sf,utf8ToBytes:()=>kf,validateObject:()=>Je});var ss=BigInt(0),fn=BigInt(1),Bf=BigInt(2);function It(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function ir(r){if(!It(r))throw new Error("Uint8Array expected")}function Fe(r,e){if(typeof e!="boolean")throw new Error(`${r} must be valid boolean, got "${e}".`)}var Af=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function ut(r){ir(r);let e="";for(let t=0;t<r.length;t++)e+=Af[r[t]];return e}function Ft(r){let e=r.toString(16);return e.length&1?`0${e}`:e}function is(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}var lt={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function ma(r){if(r>=lt._0&&r<=lt._9)return r-lt._0;if(r>=lt._A&&r<=lt._F)return r-(lt._A-10);if(r>=lt._a&&r<=lt._f)return r-(lt._a-10)}function Kt(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(t);for(let o=0,s=0;o<t;o++,s+=2){let i=ma(r.charCodeAt(s)),a=ma(r.charCodeAt(s+1));if(i===void 0||a===void 0){let c=r[s]+r[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[o]=i*16+a}return n}function ft(r){return is(ut(r))}function kt(r){return ir(r),is(ut(Uint8Array.from(r).reverse()))}function Nt(r,e){return Kt(r.toString(16).padStart(e*2,"0"))}function qt(r,e){return Nt(r,e).reverse()}function Sf(r){return Kt(Ft(r))}function te(r,e,t){let n;if(typeof e=="string")try{n=Kt(e)}catch(s){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${s}`)}else if(It(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let o=n.length;if(typeof t=="number"&&o!==t)throw new Error(`${r} expected ${t} bytes, got ${o}`);return n}function ht(...r){let e=0;for(let n=0;n<r.length;n++){let o=r[n];ir(o),e+=o.length}let t=new Uint8Array(e);for(let n=0,o=0;n<r.length;n++){let s=r[n];t.set(s,o),o+=s.length}return t}function If(r,e){if(r.length!==e.length)return!1;let t=0;for(let n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}function kf(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}var ns=r=>typeof r=="bigint"&&ss<=r;function Nr(r,e,t){return ns(r)&&ns(e)&&ns(t)&&e<=r&&r<t}function Ne(r,e,t,n){if(!Nr(e,t,n))throw new Error(`expected valid ${r}: ${t} <= n < ${n}, got ${typeof e} ${e}`)}function as(r){let e;for(e=0;r>ss;r>>=fn,e+=1);return e}function Nf(r,e){return r>>BigInt(e)&fn}function Cf(r,e,t){return r|(t?fn:ss)<<BigInt(e)}var Cr=r=>(Bf<<BigInt(r-1))-fn,os=r=>new Uint8Array(r),ya=r=>Uint8Array.from(r);function cs(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=os(r),o=os(r),s=0,i=()=>{n.fill(1),o.fill(0),s=0},a=(...f)=>t(o,n,...f),c=(f=os())=>{o=a(ya([0]),f),n=a(),f.length!==0&&(o=a(ya([1]),f),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,h=[];for(;f<e;){n=a();let w=n.slice();h.push(w),f+=n.length}return ht(...h)};return(f,h)=>{i(),c(f);let w;for(;!(w=h(u()));)c();return i(),w}}var Tf={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||It(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Je(r,e,t={}){let n=(o,s,i)=>{let a=Tf[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=r[o];if(!(i&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(o)}=${c} (${typeof c}), expected ${s}`)};for(let[o,s]of Object.entries(e))n(o,s,!1);for(let[o,s]of Object.entries(t))n(o,s,!0);return r}var Uf=()=>{throw new Error("not implemented")};function $t(r){let e=new WeakMap;return(t,...n)=>{let o=e.get(t);if(o!==void 0)return o;let s=r(t,...n);return e.set(t,s),s}}var ie=BigInt(0),X=BigInt(1),zt=BigInt(2),Lf=BigInt(3),ls=BigInt(4),ba=BigInt(5),wa=BigInt(8),Rf=BigInt(9),_f=BigInt(16);function j(r,e){let t=r%e;return t>=ie?t:e+t}function Of(r,e,t){if(t<=ie||e<ie)throw new Error("Expected power/modulo > 0");if(t===X)return ie;let n=X;for(;e>ie;)e&X&&(n=n*r%t),r=r*r%t,e>>=X;return n}function Q(r,e,t){let n=r;for(;e-- >ie;)n*=n,n%=t;return n}function dn(r,e){if(r===ie||e<=ie)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=j(r,e),n=e,o=ie,s=X,i=X,a=ie;for(;t!==ie;){let u=n/t,l=n%t,f=o-i*u,h=s-a*u;n=t,t=l,o=i,s=a,i=f,a=h}if(n!==X)throw new Error("invert: does not exist");return j(o,e)}function Vf(r){let e=(r-X)/zt,t,n,o;for(t=r-X,n=0;t%zt===ie;t/=zt,n++);for(o=zt;o<r&&Of(o,e,r)!==r-X;o++);if(n===1){let i=(r+X)/ls;return function(c,u){let l=c.pow(u,i);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let s=(t+X)/zt;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,o),t),f=a.pow(c,s),h=a.pow(c,t);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let w=1;for(let y=a.sqr(h);w<u&&!a.eql(y,a.ONE);w++)y=a.sqr(y);let m=a.pow(l,X<<BigInt(u-w-1));l=a.sqr(m),f=a.mul(f,m),h=a.mul(h,l),u=w}return f}}function Pf(r){if(r%ls===Lf){let e=(r+X)/ls;return function(n,o){let s=n.pow(o,e);if(!n.eql(n.sqr(s),o))throw new Error("Cannot find square root");return s}}if(r%wa===ba){let e=(r-ba)/wa;return function(n,o){let s=n.mul(o,zt),i=n.pow(s,e),a=n.mul(o,i),c=n.mul(n.mul(a,zt),i),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),o))throw new Error("Cannot find square root");return u}}return r%_f,Vf(r)}var xa=(r,e)=>(j(r,e)&X)===X,Df=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function us(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=Df.reduce((n,o)=>(n[o]="function",n),e);return Je(r,t)}function Mf(r,e,t){if(t<ie)throw new Error("Expected power > 0");if(t===ie)return r.ONE;if(t===X)return e;let n=r.ONE,o=e;for(;t>ie;)t&X&&(n=r.mul(n,o)),o=r.sqr(o),t>>=X;return n}function Hf(r,e){let t=new Array(e.length),n=e.reduce((s,i,a)=>r.is0(i)?s:(t[a]=s,r.mul(s,i)),r.ONE),o=r.inv(n);return e.reduceRight((s,i,a)=>r.is0(i)?s:(t[a]=r.mul(s,t[a]),r.mul(s,i)),o),t}function fs(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function Ct(r,e,t=!1,n={}){if(r<=ie)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:o,nByteLength:s}=fs(r,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let i=Pf(r),a=Object.freeze({ORDER:r,BITS:o,BYTES:s,MASK:Cr(o),ZERO:ie,ONE:X,create:c=>j(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return ie<=c&&c<r},is0:c=>c===ie,isOdd:c=>(c&X)===X,neg:c=>j(-c,r),eql:(c,u)=>c===u,sqr:c=>j(c*c,r),add:(c,u)=>j(c+u,r),sub:(c,u)=>j(c-u,r),mul:(c,u)=>j(c*u,r),pow:(c,u)=>Mf(a,c,u),div:(c,u)=>j(c*dn(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>dn(c,r),sqrt:n.sqrt||(c=>i(a,c)),invertBatch:c=>Hf(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?qt(c,s):Nt(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return t?kt(c):ft(c)}});return Object.freeze(a)}function va(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}function hs(r){let e=va(r);return e+Math.ceil(e/2)}function Ea(r,e,t=!1){let n=r.length,o=va(e),s=hs(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let i=t?ft(r):kt(r),a=j(i,e-X)+X;return t?qt(a,o):Nt(a,o)}var Kf=BigInt(0),ds=BigInt(1),ps=new WeakMap,Ba=new WeakMap;function pn(r,e){let t=(s,i)=>{let a=i.negate();return s?a:i},n=s=>{if(!Number.isSafeInteger(s)||s<=0||s>e)throw new Error(`Wrong window size=${s}, should be [1..${e}]`)},o=s=>{n(s);let i=Math.ceil(e/s)+1,a=2**(s-1);return{windows:i,windowSize:a}};return{constTimeNegate:t,unsafeLadder(s,i){let a=r.ZERO,c=s;for(;i>Kf;)i&ds&&(a=a.add(c)),c=c.double(),i>>=ds;return a},precomputeWindow(s,i){let{windows:a,windowSize:c}=o(i),u=[],l=s,f=l;for(let h=0;h<a;h++){f=l,u.push(f);for(let w=1;w<c;w++)f=f.add(l),u.push(f);l=f.double()}return u},wNAF(s,i,a){let{windows:c,windowSize:u}=o(s),l=r.ZERO,f=r.BASE,h=BigInt(2**s-1),w=2**s,m=BigInt(s);for(let y=0;y<c;y++){let d=y*u,x=Number(a&h);a>>=m,x>u&&(x-=w,a+=ds);let B=d,g=d+Math.abs(x)-1,S=y%2!==0,L=x<0;x===0?f=f.add(t(S,i[B])):l=l.add(t(L,i[g]))}return{p:l,f}},wNAFCached(s,i,a){let c=Ba.get(s)||1,u=ps.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&ps.set(s,a(u))),this.wNAF(c,u,i)},setWindowSize(s,i){n(i),Ba.set(s,i),ps.delete(s)}}}function gn(r,e,t,n){if(!Array.isArray(t)||!Array.isArray(n)||n.length!==t.length)throw new Error("arrays of points and scalars must have equal length");n.forEach((l,f)=>{if(!e.isValid(l))throw new Error(`wrong scalar at index ${f}`)}),t.forEach((l,f)=>{if(!(l instanceof r))throw new Error(`wrong point at index ${f}`)});let o=as(BigInt(t.length)),s=o>12?o-3:o>4?o-2:o?2:1,i=(1<<s)-1,a=new Array(i+1).fill(r.ZERO),c=Math.floor((e.BITS-1)/s)*s,u=r.ZERO;for(let l=c;l>=0;l-=s){a.fill(r.ZERO);for(let h=0;h<n.length;h++){let w=n[h],m=Number(w>>BigInt(l)&BigInt(i));a[m]=a[m].add(t[h])}let f=r.ZERO;for(let h=a.length-1,w=r.ZERO;h>0;h--)w=w.add(a[h]),f=f.add(w);if(u=u.add(f),l!==0)for(let h=0;h<s;h++)u=u.double()}return u}function Tr(r){return us(r.Fp),Je(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...fs(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}var Ke=BigInt(0),Ce=BigInt(1),mn=BigInt(2),qf=BigInt(8),$f={zip215:!0};function zf(r){let e=Tr(r);return Je(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Aa(r){let e=zf(r),{Fp:t,n,prehash:o,hash:s,randomBytes:i,nByteLength:a,h:c}=e,u=mn<<BigInt(a*8)-Ce,l=t.create,f=Ct(e.n,e.nBitLength),h=e.uvRatio||((b,p)=>{try{return{isValid:!0,value:t.sqrt(b*t.inv(p))}}catch{return{isValid:!1,value:Ke}}}),w=e.adjustScalarBytes||(b=>b),m=e.domain||((b,p,v)=>{if(Fe("phflag",v),p.length||v)throw new Error("Contexts/pre-hash are not supported");return b});function y(b,p){Ne("coordinate "+b,p,Ke,u)}function d(b){if(!(b instanceof g))throw new Error("ExtendedPoint expected")}let x=$t((b,p)=>{let{ex:v,ey:C,ez:R}=b,_=b.is0();p==null&&(p=_?qf:t.inv(R));let P=l(v*p),H=l(C*p),D=l(R*p);if(_)return{x:Ke,y:Ce};if(D!==Ce)throw new Error("invZ was invalid");return{x:P,y:H}}),B=$t(b=>{let{a:p,d:v}=e;if(b.is0())throw new Error("bad point: ZERO");let{ex:C,ey:R,ez:_,et:P}=b,H=l(C*C),D=l(R*R),W=l(_*_),Y=l(W*W),le=l(H*p),ue=l(W*l(le+D)),he=l(Y+l(v*l(H*D)));if(ue!==he)throw new Error("bad point: equation left != right (1)");let Be=l(C*R),se=l(_*P);if(Be!==se)throw new Error("bad point: equation left != right (2)");return!0});class g{constructor(p,v,C,R){this.ex=p,this.ey=v,this.ez=C,this.et=R,y("x",p),y("y",v),y("z",C),y("t",R),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(p){if(p instanceof g)throw new Error("extended point not allowed");let{x:v,y:C}=p||{};return y("x",v),y("y",C),new g(v,C,Ce,l(v*C))}static normalizeZ(p){let v=t.invertBatch(p.map(C=>C.ez));return p.map((C,R)=>C.toAffine(v[R])).map(g.fromAffine)}static msm(p,v){return gn(g,f,p,v)}_setWindowSize(p){U.setWindowSize(this,p)}assertValidity(){B(this)}equals(p){d(p);let{ex:v,ey:C,ez:R}=this,{ex:_,ey:P,ez:H}=p,D=l(v*H),W=l(_*R),Y=l(C*H),le=l(P*R);return D===W&&Y===le}is0(){return this.equals(g.ZERO)}negate(){return new g(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:p}=e,{ex:v,ey:C,ez:R}=this,_=l(v*v),P=l(C*C),H=l(mn*l(R*R)),D=l(p*_),W=v+C,Y=l(l(W*W)-_-P),le=D+P,ue=le-H,he=D-P,Be=l(Y*ue),se=l(le*he),ke=l(Y*he),st=l(ue*le);return new g(Be,se,st,ke)}add(p){d(p);let{a:v,d:C}=e,{ex:R,ey:_,ez:P,et:H}=this,{ex:D,ey:W,ez:Y,et:le}=p;if(v===BigInt(-1)){let Pi=l((_-R)*(W+D)),Di=l((_+R)*(W-D)),Ko=l(Di-Pi);if(Ko===Ke)return this.double();let Mi=l(P*mn*le),Hi=l(H*mn*Y),Fi=Hi+Mi,Ki=Di+Pi,qi=Hi-Mi,eu=l(Fi*Ko),tu=l(Ki*qi),ru=l(Fi*qi),nu=l(Ko*Ki);return new g(eu,tu,nu,ru)}let ue=l(R*D),he=l(_*W),Be=l(H*C*le),se=l(P*Y),ke=l((R+_)*(D+W)-ue-he),st=se-Be,xr=se+Be,vr=l(he-v*ue),Yl=l(ke*st),Jl=l(xr*vr),Xl=l(ke*vr),Ql=l(st*xr);return new g(Yl,Jl,Ql,Xl)}subtract(p){return this.add(p.negate())}wNAF(p){return U.wNAFCached(this,p,g.normalizeZ)}multiply(p){let v=p;Ne("scalar",v,Ce,n);let{p:C,f:R}=this.wNAF(v);return g.normalizeZ([C,R])[0]}multiplyUnsafe(p){let v=p;return Ne("scalar",v,Ke,n),v===Ke?L:this.equals(L)||v===Ce?this:this.equals(S)?this.wNAF(v).p:U.unsafeLadder(this,v)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return U.unsafeLadder(this,n).is0()}toAffine(p){return x(this,p)}clearCofactor(){let{h:p}=e;return p===Ce?this:this.multiplyUnsafe(p)}static fromHex(p,v=!1){let{d:C,a:R}=e,_=t.BYTES;p=te("pointHex",p,_),Fe("zip215",v);let P=p.slice(),H=p[_-1];P[_-1]=H&-129;let D=kt(P),W=v?u:t.ORDER;Ne("pointHex.y",D,Ke,W);let Y=l(D*D),le=l(Y-Ce),ue=l(C*Y-R),{isValid:he,value:Be}=h(le,ue);if(!he)throw new Error("Point.fromHex: invalid y coordinate");let se=(Be&Ce)===Ce,ke=(H&128)!==0;if(!v&&Be===Ke&&ke)throw new Error("Point.fromHex: x=0 and x_0=1");return ke!==se&&(Be=l(-Be)),g.fromAffine({x:Be,y:D})}static fromPrivateKey(p){return T(p).point}toRawBytes(){let{x:p,y:v}=this.toAffine(),C=qt(v,t.BYTES);return C[C.length-1]|=p&Ce?128:0,C}toHex(){return ut(this.toRawBytes())}}g.BASE=new g(e.Gx,e.Gy,Ce,l(e.Gx*e.Gy)),g.ZERO=new g(Ke,Ce,Ce,Ke);let{BASE:S,ZERO:L}=g,U=pn(g,a*8);function I(b){return j(b,n)}function k(b){return I(kt(b))}function T(b){let p=a;b=te("private key",b,p);let v=te("hashed private key",s(b),2*p),C=w(v.slice(0,p)),R=v.slice(p,2*p),_=k(C),P=S.multiply(_),H=P.toRawBytes();return{head:C,prefix:R,scalar:_,point:P,pointBytes:H}}function ne(b){return T(b).pointBytes}function K(b=new Uint8Array,...p){let v=ht(...p);return k(s(m(v,te("context",b),!!o)))}function V(b,p,v={}){b=te("message",b),o&&(b=o(b));let{prefix:C,scalar:R,pointBytes:_}=T(p),P=K(v.context,C,b),H=S.multiply(P).toRawBytes(),D=K(v.context,H,_,b),W=I(P+D*R);Ne("signature.s",W,Ke,n);let Y=ht(H,qt(W,t.BYTES));return te("result",Y,a*2)}let oe=$f;function E(b,p,v,C=oe){let{context:R,zip215:_}=C,P=t.BYTES;b=te("signature",b,2*P),p=te("message",p),_!==void 0&&Fe("zip215",_),o&&(p=o(p));let H=kt(b.slice(P,2*P)),D,W,Y;try{D=g.fromHex(v,_),W=g.fromHex(b.slice(0,P),_),Y=S.multiplyUnsafe(H)}catch{return!1}if(!_&&D.isSmallOrder())return!1;let le=K(R,W.toRawBytes(),D.toRawBytes(),p);return W.add(D.multiplyUnsafe(le)).subtract(Y).clearCofactor().equals(g.ZERO)}return S._setWindowSize(8),{CURVE:e,getPublicKey:ne,sign:V,verify:E,ExtendedPoint:g,utils:{getExtendedPublicKey:T,randomPrivateKey:()=>i(t.BYTES),precompute(b=8,p=g.BASE){return p._setWindowSize(b),p.multiply(BigInt(3)),p}}}}var gs=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Sa=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),l0=BigInt(0),Gf=BigInt(1),Ia=BigInt(2),u0=BigInt(3),Wf=BigInt(5),jf=BigInt(8);function Zf(r){let e=BigInt(10),t=BigInt(20),n=BigInt(40),o=BigInt(80),s=gs,a=r*r%s*r%s,c=Q(a,Ia,s)*a%s,u=Q(c,Gf,s)*r%s,l=Q(u,Wf,s)*u%s,f=Q(l,e,s)*l%s,h=Q(f,t,s)*f%s,w=Q(h,n,s)*h%s,m=Q(w,o,s)*w%s,y=Q(m,o,s)*w%s,d=Q(y,e,s)*l%s;return{pow_p_5_8:Q(d,Ia,s)*r%s,b2:a}}function Yf(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function Jf(r,e){let t=gs,n=j(e*e*e,t),o=j(n*n*e,t),s=Zf(r*o).pow_p_5_8,i=j(r*n*s,t),a=j(e*i*i,t),c=i,u=j(i*Sa,t),l=a===r,f=a===j(-r,t),h=a===j(-r*Sa,t);return l&&(i=c),(f||h)&&(i=u),xa(i,t)&&(i=j(-i,t)),{isValid:l||f,value:i}}var Xf=Ct(gs,void 0,!0),Qf={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Xf,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:jf,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ga,randomBytes:ln,adjustScalarBytes:Yf,uvRatio:Jf},ka=Aa(Qf);var yn=32;function Na(r,e,t){return ka.verify(e,t instanceof Uint8Array?t:t.subarray(),r)}var bn=class{type="Ed25519";raw;constructor(e){this.raw=ms(e,yn)}toMultihash(){return ct.digest(Tt(this))}toCID(){return de.createV1(114,this.toMultihash())}toString(){return J.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:be(this.raw,e.raw)}verify(e,t){return Na(this.raw,t,e)}};function ys(r){return r=ms(r,yn),new bn(r)}function ms(r,e){if(r=Uint8Array.from(r??[]),r.length!==e)throw new Se(`Key must be a Uint8Array of length ${e}, got ${r.length}`);return r}function pe(r=0){return new Uint8Array(r)}function Te(r=0){return new Uint8Array(r)}var th=Math.pow(2,7),rh=Math.pow(2,14),nh=Math.pow(2,21),bs=Math.pow(2,28),ws=Math.pow(2,35),xs=Math.pow(2,42),vs=Math.pow(2,49),G=128,we=127;function xe(r){if(r<th)return 1;if(r<rh)return 2;if(r<nh)return 3;if(r<bs)return 4;if(r<ws)return 5;if(r<xs)return 6;if(r<vs)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Es(r,e,t=0){switch(xe(r)){case 8:e[t++]=r&255|G,r/=128;case 7:e[t++]=r&255|G,r/=128;case 6:e[t++]=r&255|G,r/=128;case 5:e[t++]=r&255|G,r/=128;case 4:e[t++]=r&255|G,r>>>=7;case 3:e[t++]=r&255|G,r>>>=7;case 2:e[t++]=r&255|G,r>>>=7;case 1:{e[t++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return e}function oh(r,e,t=0){switch(xe(r)){case 8:e.set(t++,r&255|G),r/=128;case 7:e.set(t++,r&255|G),r/=128;case 6:e.set(t++,r&255|G),r/=128;case 5:e.set(t++,r&255|G),r/=128;case 4:e.set(t++,r&255|G),r>>>=7;case 3:e.set(t++,r&255|G),r>>>=7;case 2:e.set(t++,r&255|G),r>>>=7;case 1:{e.set(t++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return e}function Bs(r,e){let t=r[e],n=0;if(n+=t&we,t<G||(t=r[e+1],n+=(t&we)<<7,t<G)||(t=r[e+2],n+=(t&we)<<14,t<G)||(t=r[e+3],n+=(t&we)<<21,t<G)||(t=r[e+4],n+=(t&we)*bs,t<G)||(t=r[e+5],n+=(t&we)*ws,t<G)||(t=r[e+6],n+=(t&we)*xs,t<G)||(t=r[e+7],n+=(t&we)*vs,t<G))return n;throw new RangeError("Could not decode varint")}function sh(r,e){let t=r.get(e),n=0;if(n+=t&we,t<G||(t=r.get(e+1),n+=(t&we)<<7,t<G)||(t=r.get(e+2),n+=(t&we)<<14,t<G)||(t=r.get(e+3),n+=(t&we)<<21,t<G)||(t=r.get(e+4),n+=(t&we)*bs,t<G)||(t=r.get(e+5),n+=(t&we)*ws,t<G)||(t=r.get(e+6),n+=(t&we)*xs,t<G)||(t=r.get(e+7),n+=(t&we)*vs,t<G))return n;throw new RangeError("Could not decode varint")}function Oe(r,e,t=0){return e==null&&(e=Te(xe(r))),e instanceof Uint8Array?Es(r,e,t):oh(r,e,t)}function dt(r,e=0){return r instanceof Uint8Array?Bs(r,e):sh(r,e)}var As=new Float32Array([-0]),Ut=new Uint8Array(As.buffer);function Ta(r,e,t){As[0]=r,e[t]=Ut[0],e[t+1]=Ut[1],e[t+2]=Ut[2],e[t+3]=Ut[3]}function Ua(r,e){return Ut[0]=r[e],Ut[1]=r[e+1],Ut[2]=r[e+2],Ut[3]=r[e+3],As[0]}var Ss=new Float64Array([-0]),ve=new Uint8Array(Ss.buffer);function La(r,e,t){Ss[0]=r,e[t]=ve[0],e[t+1]=ve[1],e[t+2]=ve[2],e[t+3]=ve[3],e[t+4]=ve[4],e[t+5]=ve[5],e[t+6]=ve[6],e[t+7]=ve[7]}function Ra(r,e){return ve[0]=r[e],ve[1]=r[e+1],ve[2]=r[e+2],ve[3]=r[e+3],ve[4]=r[e+4],ve[5]=r[e+5],ve[6]=r[e+6],ve[7]=r[e+7],Ss[0]}var ih=BigInt(Number.MAX_SAFE_INTEGER),ah=BigInt(Number.MIN_SAFE_INTEGER),Re=class r{lo;hi;constructor(e,t){this.lo=e|0,this.hi=t|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let t=~this.lo+1>>>0,n=~this.hi>>>0;return t===0&&(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let t=~this.lo+1>>>0,n=~this.hi>>>0;return t===0&&(n=n+1>>>0),-(BigInt(t)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Gt;if(e<ih&&e>ah)return this.fromNumber(Number(e));let t=e<0n;t&&(e=-e);let n=e>>32n,o=e-(n<<32n);return t&&(n=~n|0n,o=~o|0n,++o>_a&&(o=0n,++n>_a&&(n=0n))),new r(Number(o),Number(n))}static fromNumber(e){if(e===0)return Gt;let t=e<0;t&&(e=-e);let n=e>>>0,o=(e-n)/4294967296>>>0;return t&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new r(n,o)}static from(e){return typeof e=="number"?r.fromNumber(e):typeof e=="bigint"?r.fromBigInt(e):typeof e=="string"?r.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new r(e.low>>>0,e.high>>>0):Gt}},Gt=new Re(0,0);Gt.toBigInt=function(){return 0n};Gt.zzEncode=Gt.zzDecode=function(){return this};Gt.length=function(){return 1};var _a=4294967296n;function Oa(r){let e=0,t=0;for(let n=0;n<r.length;++n)t=r.charCodeAt(n),t<128?e+=1:t<2048?e+=2:(t&64512)===55296&&(r.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function Va(r,e,t){if(t-e<1)return"";let o,s=[],i=0,a;for(;e<t;)a=r[e++],a<128?s[i++]=a:a>191&&a<224?s[i++]=(a&31)<<6|r[e++]&63:a>239&&a<365?(a=((a&7)<<18|(r[e++]&63)<<12|(r[e++]&63)<<6|r[e++]&63)-65536,s[i++]=55296+(a>>10),s[i++]=56320+(a&1023)):s[i++]=(a&15)<<12|(r[e++]&63)<<6|r[e++]&63,i>8191&&((o??(o=[])).push(String.fromCharCode.apply(String,s)),i=0);return o!=null?(i>0&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))}function Is(r,e,t){let n=t,o,s;for(let i=0;i<r.length;++i)o=r.charCodeAt(i),o<128?e[t++]=o:o<2048?(e[t++]=o>>6|192,e[t++]=o&63|128):(o&64512)===55296&&((s=r.charCodeAt(i+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++i,e[t++]=o>>18|240,e[t++]=o>>12&63|128,e[t++]=o>>6&63|128,e[t++]=o&63|128):(e[t++]=o>>12|224,e[t++]=o>>6&63|128,e[t++]=o&63|128);return t-n}function qe(r,e){return RangeError(`index out of range: ${r.pos} + ${e??1} > ${r.len}`)}function xn(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}var ks=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,qe(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw qe(this,4);return xn(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw qe(this,4);return xn(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw qe(this,4);let e=Ua(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw qe(this,4);let e=Ra(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw qe(this,e);return this.pos+=e,t===n?new Uint8Array(0):this.buf.subarray(t,n)}string(){let e=this.bytes();return Va(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw qe(this,e);this.pos+=e}else do if(this.pos>=this.len)throw qe(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Re(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw qe(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw qe(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw qe(this,8);let e=xn(this.buf,this.pos+=4),t=xn(this.buf,this.pos+=4);return new Re(e,t)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=Bs(this.buf,this.pos);return this.pos+=xe(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Ns(r){return new ks(r instanceof Uint8Array?r:r.subarray())}function $e(r,e,t){let n=Ns(r);return e.decode(n,void 0,t)}var Cs={};Ae(Cs,{base10:()=>ch});var ch=Et({prefix:"9",name:"base10",alphabet:"0123456789"});var Ts={};Ae(Ts,{base16:()=>lh,base16upper:()=>uh});var lh=ee({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),uh=ee({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Us={};Ae(Us,{base2:()=>fh});var fh=ee({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ls={};Ae(Ls,{base256emoji:()=>mh});var Da=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}"),hh=Da.reduce((r,e,t)=>(r[t]=e,r),[]),dh=Da.reduce((r,e,t)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return r[n]=t,r},[]);function ph(r){return r.reduce((e,t)=>(e+=hh[t],e),"")}function gh(r){let e=[];for(let t of r){let n=t.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${t}`);let o=dh[n];if(o==null)throw new Error(`Non-base256emoji character: ${t}`);e.push(o)}return new Uint8Array(e)}var mh=Xt({prefix:"\u{1F680}",name:"base256emoji",encode:ph,decode:gh});var _s={};Ae(_s,{base64:()=>yh,base64pad:()=>bh,base64url:()=>Rs,base64urlpad:()=>wh});var yh=ee({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bh=ee({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Rs=ee({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wh=ee({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Os={};Ae(Os,{base8:()=>xh});var xh=ee({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Vs={};Ae(Vs,{identity:()=>vh});var vh=Xt({prefix:"\0",name:"identity",encode:r=>Zi(r),decode:r=>ji(r)});var G0=new TextEncoder,W0=new TextDecoder;var Ms={};Ae(Ms,{sha256:()=>Ur,sha512:()=>Ah});function Ds({name:r,code:e,encode:t}){return new Ps(r,e,t)}var Ps=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?Me(this.code,t):t.then(n=>Me(this.code,n))}else throw Error("Unknown type, must be binary type")}};function Ha(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var Ur=Ds({name:"sha2-256",code:18,encode:Ha("SHA-256")}),Ah=Ds({name:"sha2-512",code:19,encode:Ha("SHA-512")});var Lr={...Vs,...Us,...Os,...Cs,...Ts,...Zo,...Yo,...jo,..._s,...Ls},sg={...Ms,...Qo};function Ka(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var Fa=Ka("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Hs=Ka("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=Te(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),Sh={utf8:Fa,"utf-8":Fa,hex:Lr.base16,latin1:Hs,ascii:Hs,binary:Hs,...Lr},vn=Sh;function q(r,e="utf8"){let t=vn[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}function Fs(r){let e=r??8192,t=e>>>1,n,o=e;return function(i){if(i<1||i>t)return Te(i);o+i>e&&(n=Te(e),o=0);let a=n.subarray(o,o+=i);return o&7&&(o=(o|7)+1),a}}var Wt=class{fn;len;next;val;constructor(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}};function Ks(){}var $s=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Ih=Fs();function kh(r){return globalThis.Buffer!=null?Te(r):Ih(r)}var _r=class{len;head;tail;states;constructor(){this.len=0,this.head=new Wt(Ks,0,0),this.tail=this.head,this.states=null}_push(e,t,n){return this.tail=this.tail.next=new Wt(e,t,n),this.len+=t,this}uint32(e){return this.len+=(this.tail=this.tail.next=new zs((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(En,10,Re.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let t=Re.fromBigInt(e);return this._push(En,t.length(),t)}uint64Number(e){return this._push(Es,xe(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let t=Re.fromBigInt(e).zzEncode();return this._push(En,t.length(),t)}sint64Number(e){let t=Re.fromNumber(e).zzEncode();return this._push(En,t.length(),t)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(qs,1,e?1:0)}fixed32(e){return this._push(Rr,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let t=Re.fromBigInt(e);return this._push(Rr,4,t.lo)._push(Rr,4,t.hi)}fixed64Number(e){let t=Re.fromNumber(e);return this._push(Rr,4,t.lo)._push(Rr,4,t.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(Ta,4,e)}double(e){return this._push(La,8,e)}bytes(e){let t=e.length>>>0;return t===0?this._push(qs,1,0):this.uint32(t)._push(Ch,t,e)}string(e){let t=Oa(e);return t!==0?this.uint32(t)._push(Is,t,e):this._push(qs,1,0)}fork(){return this.states=new $s(this),this.head=this.tail=new Wt(Ks,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Wt(Ks,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}finish(){let e=this.head.next,t=kh(this.len),n=0;for(;e!=null;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t}};function qs(r,e,t){e[t]=r&255}function Nh(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}var zs=class extends Wt{next;constructor(e,t){super(Nh,e,t),this.next=void 0}};function En(r,e,t){for(;r.hi!==0;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}function Rr(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Ch(r,e,t){e.set(r,t)}globalThis.Buffer!=null&&(_r.prototype.bytes=function(r){let e=r.length>>>0;return this.uint32(e),e>0&&this._push(Th,e,r),this},_r.prototype.string=function(r){let e=globalThis.Buffer.byteLength(r);return this.uint32(e),e>0&&this._push(Uh,e,r),this});function Th(r,e,t){e.set(r,t)}function Uh(r,e,t){r.length<40?Is(r,e,t):e.utf8Write!=null?e.utf8Write(r,t):e.set(q(r),t)}function Gs(){return new _r}function ze(r,e){let t=Gs();return e.encode(r,t,{lengthDelimited:!1}),t.finish()}var ar;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(ar||(ar={}));function Bn(r,e,t,n){return{name:r,type:e,encode:t,decode:n}}function Ws(r){function e(o){if(r[o.toString()]==null)throw new Error("Invalid enum value");return r[o]}let t=function(s,i){let a=e(s);i.int32(a)},n=function(s){let i=s.int32();return e(i)};return Bn("enum",ar.VARINT,t,n)}function Ge(r,e){return Bn("message",ar.LENGTH_DELIMITED,r,e)}var jt=class extends Error{code="ERR_MAX_LENGTH";name="MaxLengthError"};var ae;(function(r){r.RSA="RSA",r.Ed25519="Ed25519",r.secp256k1="secp256k1"})(ae||(ae={}));var js;(function(r){r[r.RSA=0]="RSA",r[r.Ed25519=1]="Ed25519",r[r.secp256k1=2]="secp256k1"})(js||(js={}));(function(r){r.codec=()=>Ws(js)})(ae||(ae={}));var Xe;(function(r){let e;r.codec=()=>(e==null&&(e=Ge((t,n,o={})=>{o.lengthDelimited!==!1&&n.fork(),t.Type!=null&&(n.uint32(8),ae.codec().encode(t.Type,n)),t.Data!=null&&(n.uint32(18),n.bytes(t.Data)),o.lengthDelimited!==!1&&n.ldelim()},(t,n,o={})=>{let s={},i=n==null?t.len:t.pos+n;for(;t.pos<i;){let a=t.uint32();switch(a>>>3){case 1:{s.Type=ae.codec().decode(t);break}case 2:{s.Data=t.bytes();break}default:{t.skipType(a&7);break}}}return s})),e),r.encode=t=>ze(t,r.codec()),r.decode=(t,n)=>$e(t,r.codec(),n)})(Xe||(Xe={}));var Zs;(function(r){let e;r.codec=()=>(e==null&&(e=Ge((t,n,o={})=>{o.lengthDelimited!==!1&&n.fork(),t.Type!=null&&(n.uint32(8),ae.codec().encode(t.Type,n)),t.Data!=null&&(n.uint32(18),n.bytes(t.Data)),o.lengthDelimited!==!1&&n.ldelim()},(t,n,o={})=>{let s={},i=n==null?t.len:t.pos+n;for(;t.pos<i;){let a=t.uint32();switch(a>>>3){case 1:{s.Type=ae.codec().decode(t);break}case 2:{s.Data=t.bytes();break}default:{t.skipType(a&7);break}}}return s})),e),r.encode=t=>ze(t,r.codec()),r.decode=(t,n)=>$e(t,r.codec(),n)})(Zs||(Zs={}));var $r={};Ae($r,{MAX_RSA_KEY_SIZE:()=>go,generateRSAKeyPair:()=>Mc,jwkToJWKKeyPair:()=>Hc,jwkToPkcs1:()=>Wh,jwkToPkix:()=>oi,jwkToRSAPrivateKey:()=>Dc,pkcs1ToJwk:()=>Oc,pkcs1ToRSAPrivateKey:()=>Pc,pkixToJwk:()=>Vc,pkixToRSAPublicKey:()=>si});var Lh=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Lt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Rt=new Uint32Array(64),Ys=class extends sr{constructor(){super(64,32,8,!1),this.A=Lt[0]|0,this.B=Lt[1]|0,this.C=Lt[2]|0,this.D=Lt[3]|0,this.E=Lt[4]|0,this.F=Lt[5]|0,this.G=Lt[6]|0,this.H=Lt[7]|0}get(){let{A:e,B:t,C:n,D:o,E:s,F:i,G:a,H:c}=this;return[e,t,n,o,s,i,a,c]}set(e,t,n,o,s,i,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)Rt[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){let h=Rt[f-15],w=Rt[f-2],m=He(h,7)^He(h,18)^h>>>3,y=He(w,17)^He(w,19)^w>>>10;Rt[f]=y+Rt[f-7]+m+Rt[f-16]|0}let{A:n,B:o,C:s,D:i,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let h=He(a,6)^He(a,11)^He(a,25),w=l+h+ha(a,c,u)+Lh[f]+Rt[f]|0,y=(He(n,2)^He(n,13)^He(n,22))+da(n,o,s)|0;l=u,u=c,c=a,a=i+w|0,i=s,s=o,o=n,n=w+y|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,o,s,i,a,c,u,l)}roundClean(){Rt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var cr=cn(()=>new Ys);var M=Gi($a());function Zt(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}function _t(r,e,t=-1){let n=t,o=r,s=0,i=Math.pow(2,e);for(let a=1;a<8;a++){if(r<i){let c;if(n<0)c=new ArrayBuffer(a),s=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}let u=new Uint8Array(c);for(let l=a-1;l>=0;l--){let f=Math.pow(2,l*e);u[s-l-1]=Math.floor(o/f),o-=u[s-l-1]*f}return c}i*=Math.pow(2,e)}return new ArrayBuffer(0)}function In(...r){let e=0,t=0;for(let s of r)e+=s.length;let n=new ArrayBuffer(e),o=new Uint8Array(n);for(let s of r)o.set(s,t),t+=s.length;return o}function Xs(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)t[a]=0;t[0]=r[0]&128;let n=Zt(t,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let a=0;a<this.valueHex.byteLength;a++)s[a]=r[a];return s[0]&=127,Zt(s,8)-n}function za(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let i=t-e,a=_t(i,8,n),c=new Uint8Array(a);return c[0]|=128,a}let o=_t(e,8,n),s=new Uint8Array(o);if(s[0]&128){let i=o.slice(0),a=new Uint8Array(i);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let c=0;c<i.byteLength;c++)s[c+1]=a[c];s[0]=0}return o}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function Ga(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let o=0;o<t.length;o++)if(t[o]!==n[o])return!1;return!0}function Ue(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,o=new Array(n);for(let i=0;i<n;i++)o[i]="0";return o.join("").concat(t)}var Hg=Math.log(2);function kn(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Qs(r){let e=0,t=0;for(let o=0;o<r.length;o++){let s=r[o];e+=s.byteLength}let n=new Uint8Array(e);for(let o=0;o<r.length;o++){let s=r[o];n.set(new Uint8Array(s),t),t+=s.byteLength}return n.buffer}function bt(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Vr=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Qs(this.items)}},Or=[new Uint8Array([1])],Wa="0123456789";var dr="",We=new ArrayBuffer(0),ei=new Uint8Array(0),Pr="EndOfContent",Za="OCTET STRING",Ya="BIT STRING";function wt(r){var e;return e=class extends r{constructor(...n){var o;super(...n);let s=n[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?M.BufferSourceConverter.toUint8Array(s.valueHex):ei}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,o,s){let i=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!bt(this,i,o,s))return-1;let a=o+s;return this.valueHexView=i.subarray(o,a),this.valueHexView.length?(this.blockLength=s,a):(this.warnings.push("Zero buffer length"),o)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",We)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:M.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var gt=class{constructor({blockLength:e=0,error:t=dr,warnings:n=[],valueBeforeDecode:o=ei}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=M.BufferSourceConverter.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:M.Convert.ToHex(this.valueBeforeDecodeView)}}};gt.NAME="baseBlock";var Ee=class extends gt{fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Ee.NAME="valueBlock";var Nn=class extends wt(gt){constructor({idBlock:e={}}={}){var t,n,o,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?M.BufferSourceConverter.toUint8Array(e.valueHex):ei,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(o=e.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",We}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let o=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,o[0]=t}return o.buffer}if(!this.isHexOnly){let o=_t(this.tagNumber,7),s=new Uint8Array(o),i=o.byteLength,a=new Uint8Array(i+1);if(a[0]=t|31,!e){for(let c=0;c<i-1;c++)a[c+1]=s[c]|128;a[i]=s[i-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let o=this.valueHexView;for(let s=0;s<o.length-1;s++)n[s+1]=o[s]|128;n[this.valueHexView.byteLength]=o[o.length-1]}return n.buffer}fromBER(e,t,n){let o=M.BufferSourceConverter.toUint8Array(e);if(!bt(this,o,t,n))return-1;let s=o.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;let a=s[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=1,u=this.valueHexView=new Uint8Array(255),l=255;for(;s[c]&128;){if(u[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===l){l+=255;let h=new Uint8Array(l);for(let w=0;w<u.length;w++)h[w]=u[w];u=this.valueHexView=new Uint8Array(l)}}this.blockLength=c+1,u[c-1]=s[c]&127;let f=new Uint8Array(c);for(let h=0;h<c;h++)f[h]=u[h];u=this.valueHexView=new Uint8Array(c),u.set(f),this.blockLength<=9?this.tagNumber=Zt(u,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};Nn.NAME="identificationBlock";var Cn=class extends gt{constructor({lenBlock:e={}}={}){var t,n,o;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(o=e.length)!==null&&o!==void 0?o:0}fromBER(e,t,n){let o=M.BufferSourceConverter.toUint8Array(e);if(!bt(this,o,t,n))return-1;let s=o.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;let i=s[0]&127;if(i>8)return this.error="Too big integer",-1;if(i+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let a=t+1,c=o.subarray(a,a+i);return c[i-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Zt(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=i+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let o=_t(this.length,8);if(o.byteLength>127)return this.error="Too big length",We;if(t=new ArrayBuffer(o.byteLength+1),e)return t;let s=new Uint8Array(o);n=new Uint8Array(t),n[0]=o.byteLength|128;for(let i=0;i<o.byteLength;i++)n[i+1]=s[i];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};Cn.NAME="lengthBlock";var A={},ge=class extends gt{constructor({name:e=dr,optional:t=!1,primitiveSchema:n,...o}={},s){super(o),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new Nn(o),this.lenBlock=new Cn(o),this.valueBlock=s?new s(o):new Ee(o)}fromBER(e,t,n){let o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}toBER(e,t){let n=t||new Vr;t||Ja(this);let o=this.idBlock.toBER(e);if(n.write(o),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let i=this.lenBlock.toBER(e);n.write(i),n.write(s)}return t?We:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():M.Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${M.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Ga(t,n)}};ge.NAME="BaseBlock";function Ja(r){if(r instanceof A.Constructed)for(let e of r.valueBlock.value)Ja(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}var Tn=class extends ge{constructor({value:e=dr,...t}={},n){super(t,n),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,n){let o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};Tn.NAME="BaseStringBlock";var Un=class extends wt(Ee){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};Un.NAME="PrimitiveValueBlock";var Xa,Ln=class extends ge{constructor(e={}){super(e,Un),this.idBlock.isConstructed=!1}};Xa=Ln;A.Primitive=Xa;Ln.NAME="PRIMITIVE";function Fh(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function ho(r,e=0,t=r.length){let n=e,o=new ge({},Ee),s=new gt;if(!bt(s,r,e,t))return o.error=s.error,{offset:-1,result:o};if(!r.subarray(e,e+t).length)return o.error="Zero buffer length",{offset:-1,result:o};let a=o.idBlock.fromBER(r,e,t);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),a===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(e=a,t-=o.idBlock.blockLength,a=o.lenBlock.fromBER(r,e,t),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),a===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(e=a,t-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let c=ge;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};c=A.EndOfContent;break;case 1:c=A.Boolean;break;case 2:c=A.Integer;break;case 3:c=A.BitString;break;case 4:c=A.OctetString;break;case 5:c=A.Null;break;case 6:c=A.ObjectIdentifier;break;case 10:c=A.Enumerated;break;case 12:c=A.Utf8String;break;case 13:c=A.RelativeObjectIdentifier;break;case 14:c=A.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=A.Sequence;break;case 17:c=A.Set;break;case 18:c=A.NumericString;break;case 19:c=A.PrintableString;break;case 20:c=A.TeletexString;break;case 21:c=A.VideotexString;break;case 22:c=A.IA5String;break;case 23:c=A.UTCTime;break;case 24:c=A.GeneralizedTime;break;case 25:c=A.GraphicString;break;case 26:c=A.VisibleString;break;case 27:c=A.GeneralString;break;case 28:c=A.UniversalString;break;case 29:c=A.CharacterString;break;case 30:c=A.BmpString;break;case 31:c=A.DATE;break;case 32:c=A.TimeOfDay;break;case 33:c=A.DateTime;break;case 34:c=A.Duration;break;default:{let u=o.idBlock.isConstructed?new A.Constructed:new A.Primitive;u.idBlock=o.idBlock,u.lenBlock=o.lenBlock,u.warnings=o.warnings,o=u}}break;case 2:case 3:case 4:default:c=o.idBlock.isConstructed?A.Constructed:A.Primitive}return o=Fh(o,c),a=o.fromBER(r,e,o.lenBlock.isIndefiniteForm?t:o.lenBlock.length),o.valueBeforeDecodeView=r.subarray(n,n+o.blockLength),{offset:a,result:o}}function ti(r){if(!r.byteLength){let e=new ge({},Ee);return e.error="Input buffer has zero length",{offset:-1,result:e}}return ho(M.BufferSourceConverter.toUint8Array(r).slice(),0,r.byteLength)}function Kh(r,e){return r?1:e}var Qe=class extends Ee{constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let o=M.BufferSourceConverter.toUint8Array(e);if(!bt(this,o,t,n))return-1;if(this.valueBeforeDecodeView=o.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;Kh(this.isIndefiniteForm,n)>0;){let i=ho(o,s,n);if(i.offset===-1)return this.error=i.result.error,this.warnings.concat(i.result.warnings),-1;if(s=i.offset,this.blockLength+=i.result.blockLength,n-=i.result.blockLength,this.value.push(i.result),this.isIndefiniteForm&&i.result.constructor.NAME===Pr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Pr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){let n=t||new Vr;for(let o=0;o<this.value.length;o++)this.value[o].toBER(e,n);return t?We:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Qe.NAME="ConstructedValueBlock";var Qa,Ot=class extends ge{constructor(e={}){super(e,Qe),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
3
3
|
`).map(o=>` ${o}`).join(`
|
|
4
4
|
`));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
|
|
5
5
|
${e.join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/identify",
|
|
3
|
-
"version": "3.0.1-
|
|
3
|
+
"version": "3.0.1-4fd7eb2e1",
|
|
4
4
|
"description": "Implementation of the Identify Protocol",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-identify#readme",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"doc-check": "aegir doc-check"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@libp2p/crypto": "5.0.1-
|
|
56
|
-
"@libp2p/interface": "2.0.1-
|
|
57
|
-
"@libp2p/interface-internal": "2.0.1-
|
|
58
|
-
"@libp2p/peer-id": "5.0.1-
|
|
59
|
-
"@libp2p/peer-record": "8.0.1-
|
|
55
|
+
"@libp2p/crypto": "5.0.1-4fd7eb2e1",
|
|
56
|
+
"@libp2p/interface": "2.0.1-4fd7eb2e1",
|
|
57
|
+
"@libp2p/interface-internal": "2.0.1-4fd7eb2e1",
|
|
58
|
+
"@libp2p/peer-id": "5.0.1-4fd7eb2e1",
|
|
59
|
+
"@libp2p/peer-record": "8.0.1-4fd7eb2e1",
|
|
60
60
|
"@multiformats/multiaddr": "^12.2.3",
|
|
61
61
|
"@multiformats/multiaddr-matcher": "^1.2.1",
|
|
62
62
|
"it-drain": "^3.0.7",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"wherearewe": "^2.0.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@libp2p/interface-compliance-tests": "6.0.1-
|
|
72
|
-
"@libp2p/logger": "5.0.1-
|
|
71
|
+
"@libp2p/interface-compliance-tests": "6.0.1-4fd7eb2e1",
|
|
72
|
+
"@libp2p/logger": "5.0.1-4fd7eb2e1",
|
|
73
73
|
"aegir": "^44.0.1",
|
|
74
74
|
"delay": "^6.0.0",
|
|
75
75
|
"it-length-prefixed": "^9.0.4",
|