Socket
Socket
Sign inDemoInstall

is-ipfs

Package Overview
Dependencies
Maintainers
5
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-ipfs - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## [6.0.2](https://github.com/ipfs/is-ipfs/compare/v6.0.1...v6.0.2) (2021-08-23)
## [6.0.1](https://github.com/ipfs/is-ipfs/compare/v6.0.0...v6.0.1) (2021-07-07)

@@ -2,0 +6,0 @@

22

dist/index.min.js
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.IsIpfs = factory()}(typeof self !== 'undefined' ? self : this, function () {
var IsIpfs=(()=>{var Mn=Object.defineProperty;var O=(t,e)=>()=>(t&&(e=t(t=0)),e),l=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Se=(t,e)=>{for(var r in e)Mn(t,r,{get:e[r],enumerable:!0})};function Cn(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),o=s.charCodeAt(0);if(e[o]!==255)throw new TypeError(s+" is ambiguous");e[o]=n}var i=t.length,u=t.charAt(0),x=Math.log(i)/Math.log(256),S=Math.log(256)/Math.log(i);function D(c){if(c instanceof Uint8Array||(ArrayBuffer.isView(c)?c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength):Array.isArray(c)&&(c=Uint8Array.from(c))),!(c instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(c.length===0)return"";for(var d=0,$=0,p=0,g=c.length;p!==g&&c[p]===0;)p++,d++;for(var b=(g-p)*S+1>>>0,f=new Uint8Array(b);p!==g;){for(var y=c[p],E=0,w=b-1;(y!==0||E<$)&&w!==-1;w--,E++)y+=256*f[w]>>>0,f[w]=y%i>>>0,y=y/i>>>0;if(y!==0)throw new Error("Non-zero carry");$=E,p++}for(var v=b-$;v!==b&&f[v]===0;)v++;for(var N=u.repeat(d);v<b;++v)N+=t.charAt(f[v]);return N}function k(c){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;var d=0;if(c[d]!==" "){for(var $=0,p=0;c[d]===u;)$++,d++;for(var g=(c.length-d)*x+1>>>0,b=new Uint8Array(g);c[d];){var f=e[c.charCodeAt(d)];if(f===255)return;for(var y=0,E=g-1;(f!==0||y<p)&&E!==-1;E--,y++)f+=i*b[E]>>>0,b[E]=f%256>>>0,f=f/256>>>0;if(f!==0)throw new Error("Non-zero carry");p=y,d++}if(c[d]!==" "){for(var w=g-p;w!==g&&b[w]===0;)w++;for(var v=new Uint8Array($+(g-w)),N=$;w!==g;)v[N++]=b[w++];return v}}}function ie(c){var d=k(c);if(d)return d;throw new Error("Non-base"+i+" character")}return{encode:D,decodeUnsafe:k,decode:ie}}var Bn,Dn,Ut,Tt=O(()=>{Bn=Cn,Dn=Bn,Ut=Dn});var ti,$t,F,Ee=O(()=>{ti=new Uint8Array(0),$t=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},F=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")}});var qt,zt,Ae,Mt,W,Ue,Je=O(()=>{qt=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},zt=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseDecode=n}decode(e){if(typeof e=="string")switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}else throw Error("Can only multibase decode strings")}or(e){let r={[this.prefix]:this,...e.decoders||{[e.prefix]:e}};return new Ae(r)}},Ae=class{constructor(e){this.decoders=e}or(e){let r=e.decoders||{[e.prefix]:e};return new Ae({...this.decoders,...r})}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Mt=class{constructor(e,r,n,s){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=s,this.encoder=new qt(e,r,n),this.decoder=new zt(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},W=({name:t,prefix:e,encode:r,decode:n,alphabet:s})=>Ue({name:t,prefix:e,encode:o=>r(o,s),decode:o=>{for(let i of o)if(s.indexOf(i)<0)throw new Error(`invalid ${t} character`);return n(o,s)}}),Ue=({name:t,prefix:e,encode:r,decode:n})=>new Mt(t,e,r,n)});var Te={};Se(Te,{base58btc:()=>I,base58flickr:()=>In});var Ct,I,In,ce=O(()=>{Tt();Ee();Je();Ct=t=>{let{encode:e,decode:r}=Ut(t);return{encode:e,decode:n=>F(r(n))}},I=Ue({name:"base58btc",prefix:"z",...Ct("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")}),In=Ue({name:"base58flickr",prefix:"Z",...Ct("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ")})});var Qe={};Se(Qe,{base32:()=>G,base32hex:()=>On,base32hexpad:()=>Rn,base32pad:()=>Nn,base32z:()=>Ln});function ae(t,e){t=t.replace(/=/g,"");let r=t.length,n=0,s=0,o=0,i=new Uint8Array(r*5/8|0);for(let u=0;u<r;u++)s=s<<5|e.indexOf(t[u]),n+=5,n>=8&&(i[o++]=s>>>n-8&255,n-=8);return i}function ue(t,e){let r=t.byteLength,n=new Uint8Array(t),s=e.indexOf("=")===e.length-1;s&&(e=e.substring(0,e.length-1));let o=0,i=0,u="";for(let x=0;x<r;x++)for(i=i<<8|n[x],o+=8;o>=5;)u+=e[i>>>o-5&31],o-=5;if(o>0&&(u+=e[i<<5-o&31]),s)for(;u.length%8!=0;)u+="=";return u}var G,Nn,On,Rn,Ln,$e=O(()=>{Je();G=W({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",encode:ue,decode:ae}),Nn=W({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",encode:ue,decode:ae}),On=W({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",encode:ue,decode:ae}),Rn=W({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",encode:ue,decode:ae}),Ln=W({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",encode:ue,decode:ae})});function Bt(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Vn;)e[r++]=t&255|Dt,t/=128;for(;t&jn;)e[r++]=t&255|Dt,t>>>=7;return e[r]=t|0,Bt.bytes=r-n+1,e}function Xe(t,e){var r=0,e=e||0,n=0,s=e,o,i=t.length;do{if(s>=i)throw Xe.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=n<28?(o&It)<<n:(o&It)*Math.pow(2,n),n+=7}while(o>=Wn);return Xe.bytes=s-e,r}var Pn,Dt,kn,jn,Vn,Fn,Wn,It,Gn,Jn,Qn,Xn,Kn,Zn,Yn,Hn,_n,es,ts,rs,he,Nt=O(()=>{Pn=Bt,Dt=128,kn=127,jn=~kn,Vn=Math.pow(2,31);Fn=Xe,Wn=128,It=127;Gn=Math.pow(2,7),Jn=Math.pow(2,14),Qn=Math.pow(2,21),Xn=Math.pow(2,28),Kn=Math.pow(2,35),Zn=Math.pow(2,42),Yn=Math.pow(2,49),Hn=Math.pow(2,56),_n=Math.pow(2,63),es=function(t){return t<Gn?1:t<Jn?2:t<Qn?3:t<Xn?4:t<Kn?5:t<Zn?6:t<Yn?7:t<Hn?8:t<_n?9:10},ts={encode:Pn,decode:Fn,encodingLength:es},rs=ts,he=rs});var de,J,Q,Ke=O(()=>{Nt();de=t=>[he.decode(t),he.decode.bytes],J=(t,e,r=0)=>(he.encode(t,e,r),e),Q=t=>he.encodingLength(t)});var Ze={};Se(Ze,{Digest:()=>X,create:()=>Ye,decode:()=>He,equals:()=>_e});var Ye,He,_e,X,qe=O(()=>{Ee();Ke();Ye=(t,e)=>{let r=e.byteLength,n=Q(t),s=n+Q(r),o=new Uint8Array(s+r);return J(t,o,0),J(r,o,n),o.set(e,s),new X(t,r,e,o)},He=t=>{let e=F(t),[r,n]=de(e),[s,o]=de(e.subarray(n)),i=e.subarray(n+o);if(i.byteLength!==s)throw new Error("Incorrect length");return new X(r,s,i,e)},_e=(t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&$t(t.bytes,e.bytes),X=class{constructor(e,r,n,s){this.code=e,this.size=r,this.digest=n,this.bytes=s}}});var Lt=l((li,Ot)=>{"use strict";var Rt="[a-fA-F\\d:]",L=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${Rt})|(?<=${Rt})(?=\\s|$))`:"",C="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",m="[a-fA-F\\d]{1,4}",ze=`
var IsIpfs=(()=>{var It=Object.defineProperty;var Ws=t=>It(t,"__esModule",{value:!0});var p=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),m=(t,e)=>{Ws(t);for(var r in e)It(t,r,{get:e[r],enumerable:!0})};function Js(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),s=0;s<r.length;s++)r[s]=255;for(var n=0;n<t.length;n++){var o=t.charAt(n),i=o.charCodeAt(0);if(r[i]!==255)throw new TypeError(o+" is ambiguous");r[i]=n}var u=t.length,w=t.charAt(0),B=Math.log(u)/Math.log(256),v=Math.log(256)/Math.log(u);function W(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var x=0,V=0,$=0,M=h.length;$!==M&&h[$]===0;)$++,x++;for(var q=(M-$)*v+1>>>0,E=new Uint8Array(q);$!==M;){for(var j=h[$],N=0,C=q-1;(j!==0||N<V)&&C!==-1;C--,N++)j+=256*E[C]>>>0,E[C]=j%u>>>0,j=j/u>>>0;if(j!==0)throw new Error("Non-zero carry");V=N,$++}for(var D=q-V;D!==q&&E[D]===0;)D++;for(var Te=w.repeat(x);D<q;++D)Te+=t.charAt(E[D]);return Te}function Ce(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var x=0;if(h[x]!==" "){for(var V=0,$=0;h[x]===w;)V++,x++;for(var M=(h.length-x)*B+1>>>0,q=new Uint8Array(M);h[x];){var E=r[h.charCodeAt(x)];if(E===255)return;for(var j=0,N=M-1;(E!==0||j<$)&&N!==-1;N--,j++)E+=u*q[N]>>>0,q[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");$=j,x++}if(h[x]!==" "){for(var C=M-$;C!==M&&q[C]===0;)C++;for(var D=new Uint8Array(V+(M-C)),Te=V;C!==M;)D[Te++]=q[C++];return D}}}function Fs(h){var x=Ce(h);if(x)return x;throw new Error(`Non-${e} character`)}return{encode:W,decodeUnsafe:Ce,decode:Fs}}var Gs,Xs,Dt,Pt=p(()=>{Gs=Js,Xs=Gs,Dt=Xs});var ui,Bt,P,Nt,Rt,R=p(()=>{ui=new Uint8Array(0),Bt=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},P=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Nt=t=>new TextEncoder().encode(t),Rt=t=>new TextDecoder().decode(t)});var Ot,kt,Ue,Vt,Me,L,Qs,Hs,d,z=p(()=>{Pt();R();Ot=class{constructor(e,r,s){this.name=e,this.prefix=r,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},kt=class{constructor(e,r,s){this.name=e,this.prefix=r,this.baseDecode=s}decode(e){if(typeof e=="string")switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}else throw Error("Can only multibase decode strings")}or(e){let r={[this.prefix]:this,...e.decoders||{[e.prefix]:e}};return new Ue(r)}},Ue=class{constructor(e){this.decoders=e}or(e){let r=e.decoders||{[e.prefix]:e};return new Ue({...this.decoders,...r})}decode(e){let r=e[0],s=this.decoders[r];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Vt=class{constructor(e,r,s,n){this.name=e,this.prefix=r,this.baseEncode=s,this.baseDecode=n,this.encoder=new Ot(e,r,s),this.decoder=new kt(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Me=({name:t,prefix:e,encode:r,decode:s})=>new Vt(t,e,r,s),L=({prefix:t,name:e,alphabet:r})=>{let{encode:s,decode:n}=Dt(r,e);return Me({prefix:t,name:e,encode:s,decode:o=>P(n(o))})},Qs=(t,e,r,s)=>{let n={};for(let v=0;v<e.length;++v)n[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;let i=new Uint8Array(o*r/8|0),u=0,w=0,B=0;for(let v=0;v<o;++v){let W=n[t[v]];if(W===void 0)throw new SyntaxError(`Non-${s} character`);w=w<<r|W,u+=r,u>=8&&(u-=8,i[B++]=255&w>>u)}if(u>=r||255&w<<8-u)throw new SyntaxError("Unexpected end of data");return i},Hs=(t,e,r)=>{let s=e[e.length-1]==="=",n=(1<<r)-1,o="",i=0,u=0;for(let w=0;w<t.length;++w)for(u=u<<8|t[w],i+=8;i>r;)i-=r,o+=e[n&u>>i];if(i&&(o+=e[n&u<<r-i]),s)for(;o.length*r&7;)o+="=";return o},d=({name:t,prefix:e,bitsPerChar:r,alphabet:s})=>Me({prefix:e,name:t,encode(n){return Hs(n,s,r)},decode(n){return Qs(n,s,r,t)}})});var J={};m(J,{base58btc:()=>I,base58flickr:()=>Ks});var I,Ks,G=p(()=>{z();I=L({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ks=L({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var ue={};m(ue,{base32:()=>X,base32hex:()=>en,base32hexpad:()=>rn,base32hexpadupper:()=>sn,base32hexupper:()=>tn,base32pad:()=>Ys,base32padupper:()=>_s,base32upper:()=>Zs,base32z:()=>nn});var X,Zs,Ys,_s,en,tn,rn,sn,nn,pe=p(()=>{z();X=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Zs=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ys=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),_s=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),en=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tn=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rn=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sn=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),nn=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});function Wt(t,e,r){e=e||[],r=r||0;for(var s=r;t>=un;)e[r++]=t&255|Ft,t/=128;for(;t&cn;)e[r++]=t&255|Ft,t>>>=7;return e[r]=t|0,Wt.bytes=r-s+1,e}function Xe(t,e){var r=0,e=e||0,s=0,n=e,o,i=t.length;do{if(n>=i)throw Xe.bytes=0,new RangeError("Could not decode varint");o=t[n++],r+=s<28?(o&Jt)<<s:(o&Jt)*Math.pow(2,s),s+=7}while(o>=hn);return Xe.bytes=n-e,r}var on,Ft,an,cn,un,pn,hn,Jt,dn,ln,fn,bn,mn,wn,gn,yn,vn,xn,Sn,En,he,Gt=p(()=>{on=Wt,Ft=128,an=127,cn=~an,un=Math.pow(2,31);pn=Xe,hn=128,Jt=127;dn=Math.pow(2,7),ln=Math.pow(2,14),fn=Math.pow(2,21),bn=Math.pow(2,28),mn=Math.pow(2,35),wn=Math.pow(2,42),gn=Math.pow(2,49),yn=Math.pow(2,56),vn=Math.pow(2,63),xn=function(t){return t<dn?1:t<ln?2:t<fn?3:t<bn?4:t<mn?5:t<wn?6:t<gn?7:t<yn?8:t<vn?9:10},Sn={encode:on,decode:pn,encodingLength:xn},En=Sn,he=En});var de,Q,H,qe=p(()=>{Gt();de=t=>[he.decode(t),he.decode.bytes],Q=(t,e,r=0)=>(he.encode(t,e,r),e),H=t=>he.encodingLength(t)});var fe={};m(fe,{Digest:()=>K,create:()=>le,decode:()=>Qe,equals:()=>He});var le,Qe,He,K,Z=p(()=>{R();qe();le=(t,e)=>{let r=e.byteLength,s=H(t),n=s+H(r),o=new Uint8Array(n+r);return Q(t,o,0),Q(r,o,s),o.set(e,n),new K(t,r,e,o)},Qe=t=>{let e=P(t),[r,s]=de(e),[n,o]=de(e.subarray(s)),i=e.subarray(s+o);if(i.byteLength!==n)throw new Error("Incorrect length");return new K(r,n,i,e)},He=(t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&Bt(t.bytes,e.bytes),K=class{constructor(e,r,s,n){this.code=e,this.size=r,this.digest=s,this.bytes=n}}});var Kt=b((yi,Ht)=>{"use strict";var Qt="[a-fA-F\\d:]",O=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${Qt})|(?<=${Qt})(?=\\s|$))`:"",T="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",l="[a-fA-F\\d]{1,4}",je=`
(?:
(?:${m}:){7}(?:${m}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
(?:${m}:){6}(?:${C}|:${m}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
(?:${m}:){5}(?::${C}|(?::${m}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
(?:${m}:){4}(?:(?::${m}){0,1}:${C}|(?::${m}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
(?:${m}:){3}(?:(?::${m}){0,2}:${C}|(?::${m}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
(?:${m}:){2}(?:(?::${m}){0,3}:${C}|(?::${m}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
(?:${m}:){1}(?:(?::${m}){0,4}:${C}|(?::${m}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
(?::(?:(?::${m}){0,5}:${C}|(?::${m}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
(?:${l}:){7}(?:${l}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
(?:${l}:){6}(?:${T}|:${l}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
(?:${l}:){5}(?::${T}|(?::${l}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
(?:${l}:){4}(?:(?::${l}){0,1}:${T}|(?::${l}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
(?:${l}:){3}(?:(?::${l}){0,2}:${T}|(?::${l}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
(?:${l}:){2}(?:(?::${l}){0,3}:${T}|(?::${l}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
(?:${l}:){1}(?:(?::${l}){0,4}:${T}|(?::${l}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
(?::(?:(?::${l}){0,5}:${T}|(?::${l}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),ns=new RegExp(`(?:^${C}$)|(?:^${ze}$)`),ss=new RegExp(`^${C}$`),os=new RegExp(`^${ze}$`),et=t=>t&&t.exact?ns:new RegExp(`(?:${L(t)}${C}${L(t)})|(?:${L(t)}${ze}${L(t)})`,"g");et.v4=t=>t&&t.exact?ss:new RegExp(`${L(t)}${C}${L(t)}`,"g");et.v6=t=>t&&t.exact?os:new RegExp(`${L(t)}${ze}${L(t)}`,"g");Ot.exports=et});var kt=l((fi,Pt)=>{"use strict";var tt=Lt(),K=t=>tt({exact:!0}).test(t);K.v4=t=>tt.v4({exact:!0}).test(t);K.v6=t=>tt.v6({exact:!0}).test(t);K.version=t=>K(t)?K.v4(t)?4:6:void 0;Pt.exports=K});var Vt=l((pi,jt)=>{"use strict";function is(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),o=s.charCodeAt(0);if(e[o]!==255)throw new TypeError(s+" is ambiguous");e[o]=n}var i=t.length,u=t.charAt(0),x=Math.log(i)/Math.log(256),S=Math.log(256)/Math.log(i);function D(c){if(c instanceof Uint8Array||(ArrayBuffer.isView(c)?c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength):Array.isArray(c)&&(c=Uint8Array.from(c))),!(c instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(c.length===0)return"";for(var d=0,$=0,p=0,g=c.length;p!==g&&c[p]===0;)p++,d++;for(var b=(g-p)*S+1>>>0,f=new Uint8Array(b);p!==g;){for(var y=c[p],E=0,w=b-1;(y!==0||E<$)&&w!==-1;w--,E++)y+=256*f[w]>>>0,f[w]=y%i>>>0,y=y/i>>>0;if(y!==0)throw new Error("Non-zero carry");$=E,p++}for(var v=b-$;v!==b&&f[v]===0;)v++;for(var N=u.repeat(d);v<b;++v)N+=t.charAt(f[v]);return N}function k(c){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;var d=0;if(c[d]!==" "){for(var $=0,p=0;c[d]===u;)$++,d++;for(var g=(c.length-d)*x+1>>>0,b=new Uint8Array(g);c[d];){var f=e[c.charCodeAt(d)];if(f===255)return;for(var y=0,E=g-1;(f!==0||y<p)&&E!==-1;E--,y++)f+=i*b[E]>>>0,b[E]=f%256>>>0,f=f/256>>>0;if(f!==0)throw new Error("Non-zero carry");p=y,d++}if(c[d]!==" "){for(var w=g-p;w!==g&&b[w]===0;)w++;for(var v=new Uint8Array($+(g-w)),N=$;w!==g;)v[N++]=b[w++];return v}}}function ie(c){var d=k(c);if(d)return d;throw new Error("Non-base"+i+" character")}return{encode:D,decodeUnsafe:k,decode:ie}}jt.exports=is});var Me=l((wi,Ft)=>{"use strict";var cs=new TextDecoder,as=t=>cs.decode(t),us=new TextEncoder,hs=t=>us.encode(t);function ds(t,e){let r=new Uint8Array(e),n=0;for(let s of t)r.set(s,n),n+=s.length;return r}Ft.exports={decodeText:as,encodeText:hs,concat:ds}});var Jt=l((gi,Wt)=>{"use strict";var{encodeText:ls}=Me(),Gt=class{constructor(e,r,n,s){this.name=e,this.code=r,this.codeBuf=ls(this.code),this.alphabet=s,this.codec=n(s)}encode(e){return this.codec.encode(e)}decode(e){for(let r of e)if(this.alphabet&&this.alphabet.indexOf(r)<0)throw new Error(`invalid character '${r}' in '${e}'`);return this.codec.decode(e)}};Wt.exports=Gt});var Xt=l((bi,Qt)=>{"use strict";var fs=(t,e,r)=>{let n={};for(let S=0;S<e.length;++S)n[e[S]]=S;let s=t.length;for(;t[s-1]==="=";)--s;let o=new Uint8Array(s*r/8|0),i=0,u=0,x=0;for(let S=0;S<s;++S){let D=n[t[S]];if(D===void 0)throw new SyntaxError("Invalid character "+t[S]);u=u<<r|D,i+=r,i>=8&&(i-=8,o[x++]=255&u>>i)}if(i>=r||255&u<<8-i)throw new SyntaxError("Unexpected end of data");return o},ps=(t,e,r)=>{let n=e[e.length-1]==="=",s=(1<<r)-1,o="",i=0,u=0;for(let x=0;x<t.length;++x)for(u=u<<8|t[x],i+=8;i>r;)i-=r,o+=e[s&u>>i];if(i&&(o+=e[s&u<<r-i]),n)for(;o.length*r&7;)o+="=";return o},ws=t=>e=>({encode(r){return ps(r,e,t)},decode(r){return fs(r,e,t)}});Qt.exports={rfc4648:ws}});var Ht=l((yi,Kt)=>{"use strict";var le=Vt(),gs=Jt(),{rfc4648:A}=Xt(),{decodeText:bs,encodeText:ys}=Me(),ms=()=>({encode:bs,decode:ys}),Zt=[["identity","\0",ms,""],["base2","0",A(1),"01"],["base8","7",A(3),"01234567"],["base10","9",le,"0123456789"],["base16","f",A(4),"0123456789abcdef"],["base16upper","F",A(4),"0123456789ABCDEF"],["base32hex","v",A(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",A(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",A(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",A(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",A(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",A(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",A(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",A(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",A(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",le,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",le,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",le,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",le,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",A(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",A(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",A(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",A(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],Yt=Zt.reduce((t,e)=>(t[e[0]]=new gs(e[0],e[1],e[2],e[3]),t),{}),vs=Zt.reduce((t,e)=>(t[e[1]]=Yt[e[0]],t),{});Kt.exports={names:Yt,codes:vs}});var rt=l((R,_t)=>{"use strict";var Z=Ht(),{encodeText:xs,decodeText:Ce,concat:er}=Me();function Es(t,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:r,codeBuf:n}=j(t);return Ss(r,e),er([n,e],n.length+e.length)}function As(t,e){let r=j(t),n=xs(r.encode(e));return er([r.codeBuf,n],r.codeBuf.length+n.length)}function Us(t){t instanceof Uint8Array&&(t=Ce(t));let e=t[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(t=t.toLowerCase()),j(t[0]).decode(t.substring(1))}function Ts(t){if(t instanceof Uint8Array&&(t=Ce(t)),Object.prototype.toString.call(t)!=="[object String]")return!1;try{return j(t[0]).name}catch(e){return!1}}function Ss(t,e){j(t).decode(Ce(e))}function j(t){if(Object.prototype.hasOwnProperty.call(Z.names,t))return Z.names[t];if(Object.prototype.hasOwnProperty.call(Z.codes,t))return Z.codes[t];throw new Error(`Unsupported encoding: ${t}`)}function $s(t){return t instanceof Uint8Array&&(t=Ce(t)),j(t[0])}R=_t.exports=Es;R.encode=As;R.decode=Us;R.isEncoded=Ts;R.encoding=j;R.encodingFromData=$s;var qs=Object.freeze(Z.names),zs=Object.freeze(Z.codes);R.names=qs;R.codes=zs});var Y=l((mi,tr)=>{"use strict";var{encoding:Ms}=rt(),Cs=new TextDecoder("utf8");function Bs(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}function Ds(t,e="utf8"){return e==="utf8"||e==="utf-8"?Cs.decode(t):e==="ascii"?Bs(t):Ms(e).encode(t)}tr.exports=Ds});var ir=l((vi,rr)=>{"use strict";var nt=kt(),nr=Y(),Is=nt,st=nt.v4,sr=nt.v6,or=function(t,e,r){r=~~r;let n;if(st(t))n=e||new Uint8Array(r+4),t.split(/\./g).map(function(s){n[r++]=parseInt(s,10)&255});else if(sr(t)){let s=t.split(":",8),o;for(o=0;o<s.length;o++){let i=st(s[o]),u;i&&(u=or(s[o]),s[o]=nr(u.slice(0,2),"base16")),u&&++o<8&&s.splice(o,0,nr(u.slice(2,4),"base16"))}if(s[0]==="")for(;s.length<8;)s.unshift("0");else if(s[s.length-1]==="")for(;s.length<8;)s.push("0");else if(s.length<8){for(o=0;o<s.length&&s[o]!=="";o++);let i=[o,"1"];for(o=9-s.length;o>0;o--)i.push("0");s.splice.apply(s,i)}for(n=e||new Uint8Array(r+16),o=0;o<s.length;o++){let i=parseInt(s[o],16);n[r++]=i>>8&255,n[r++]=i&255}}if(!n)throw Error("Invalid ip address: "+t);return n},Ns=function(t,e,r){e=~~e,r=r||t.length-e;let n=[],s,o=new DataView(t.buffer);if(r===4){for(let i=0;i<r;i++)n.push(t[e+i]);s=n.join(".")}else if(r===16){for(let i=0;i<r;i+=2)n.push(o.getUint16(e+i).toString(16));s=n.join(":"),s=s.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3"),s=s.replace(/:{3,4}/,"::")}return s};rr.exports={isIP:Is,isV4:st,isV6:sr,toBytes:or,toString:Ns}});var Be=l((xi,cr)=>{"use strict";function z(t){if(typeof t=="number"){if(z.codes[t])return z.codes[t];throw new Error("no protocol with code: "+t)}else if(typeof t=="string"){if(z.names[t])return z.names[t];throw new Error("no protocol with name: "+t)}throw new Error("invalid protocol id type: "+t)}var M=-1;z.lengthPrefixedVarSize=M;z.V=M;z.table=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,M,"ip6zone"],[53,M,"dns","resolvable"],[54,M,"dns4","resolvable"],[55,M,"dns6","resolvable"],[56,M,"dnsaddr","resolvable"],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,M,"unix",!1,"path"],[421,M,"ipfs"],[421,M,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,M,"garlic64"],[460,0,"quic"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,M,"memory"]];z.names={};z.codes={};z.table.map(t=>{let e=ar.apply(null,t);return z.codes[e.code]=e,z.names[e.name]=e,null});z.object=ar;function ar(t,e,r,n,s){return{code:t,size:e,name:r,resolvable:Boolean(n),path:Boolean(s)}}cr.exports=z});var De={};Se(De,{CID:()=>U});var U,Os,Rs,Ls,fe,Ps,ur,hr,Ie,Ne,Vs,ks,js,Oe=O(()=>{Ke();qe();ce();$e();Ee();U=class{constructor(e,r,n,s){this.code=r,this.version=e,this.multihash=n,this.bytes=s,this.byteOffset=s.byteOffset,this.byteLength=s.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:Ne,byteLength:Ne,code:Ie,version:Ie,multihash:Ie,bytes:Ie,_baseCache:Ne,asCID:Ne})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==fe)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ps)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return U.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Ye(e,r);return U.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&_e(this.multihash,e.multihash)}toString(e){let{bytes:r,version:n,_baseCache:s}=this;switch(n){case 0:return Rs(r,s,e||I.encoder);default:return Ls(r,s,e||G.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return ks(/^0\.0/,js),!!(e&&(e[hr]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof U)return e;if(e!=null&&e.asCID===e){let{version:r,code:n,multihash:s,bytes:o}=e;return new U(r,n,s,o||ur(r,n,s.bytes))}else if(e!=null&&e[hr]===!0){let{version:r,multihash:n,code:s}=e,o=He(n);return U.create(r,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(r!==fe)throw new Error(`Version 0 CID must use dag-pb (code: ${fe}) block encoding`);return new U(e,r,n,n.bytes)}case 1:{let s=ur(e,r,n.bytes);return new U(e,r,n,s)}default:throw new Error("Invalid version")}}static createV0(e){return U.create(0,fe,e)}static createV1(e,r){return U.create(1,e,r)}static decode(e){let[r,n]=U.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=U.inspectBytes(e),n=r.size-r.multihashSize,s=F(e.subarray(n,n+r.multihashSize));if(s.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=s.subarray(r.multihashSize-r.digestSize),i=new X(r.multihashCode,r.digestSize,o,s);return[r.version===0?U.createV0(i):U.createV1(r.codec,i),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[k,ie]=de(e.subarray(r));return r+=ie,k},s=n(),o=fe;if(s===18?(s=0,r=0):s===1&&(o=n()),s!==0&&s!==1)throw new RangeError(`Invalid CID version ${s}`);let i=r,u=n(),x=n(),S=r+x,D=S-i;return{version:s,codec:o,multihashCode:u,digestSize:x,multihashSize:D,size:S}}static parse(e,r){let[n,s]=Os(e,r),o=U.decode(s);return o._baseCache.set(n,e),o}},Os=(t,e)=>{switch(t[0]){case"Q":{let r=e||I;return[I.prefix,r.decode(`${I.prefix}${t}`)]}case I.prefix:{let r=e||I;return[I.prefix,r.decode(t)]}case G.prefix:{let r=e||G;return[G.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Rs=(t,e,r)=>{let{prefix:n}=r;if(n!==I.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let s=e.get(n);if(s==null){let o=r.encode(t).slice(1);return e.set(n,o),o}else return s},Ls=(t,e,r)=>{let{prefix:n}=r,s=e.get(n);if(s==null){let o=r.encode(t);return e.set(n,o),o}else return s},fe=112,Ps=18,ur=(t,e,r)=>{let n=Q(t),s=n+Q(e),o=new Uint8Array(s+r.byteLength);return J(t,o,0),J(e,o,n),o.set(r,s),o},hr=Symbol.for("@ipld/js-cid/CID"),Ie={writable:!1,configurable:!1,enumerable:!0},Ne={writable:!1,enumerable:!1,configurable:!1},Vs="0.0.0-dev",ks=(t,e)=>{if(t.test(Vs))console.warn(e);else throw new Error(e)},js=`CID.isCID(v) is deprecated and will be removed in the next major release.
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),An=new RegExp(`(?:^${T}$)|(?:^${je}$)`),$n=new RegExp(`^${T}$`),Cn=new RegExp(`^${je}$`),Ke=t=>t&&t.exact?An:new RegExp(`(?:${O(t)}${T}${O(t)})|(?:${O(t)}${je}${O(t)})`,"g");Ke.v4=t=>t&&t.exact?$n:new RegExp(`${O(t)}${T}${O(t)}`,"g");Ke.v6=t=>t&&t.exact?Cn:new RegExp(`${O(t)}${je}${O(t)}`,"g");Ht.exports=Ke});var Yt=b((vi,Zt)=>{"use strict";var Ze=Kt(),Y=t=>Ze({exact:!0}).test(t);Y.v4=t=>Ze.v4({exact:!0}).test(t);Y.v6=t=>Ze.v6({exact:!0}).test(t);Y.version=t=>Y(t)?Y.v4(t)?4:6:void 0;Zt.exports=Y});var Ye={};m(Ye,{identity:()=>Tn});var Tn,_t=p(()=>{z();R();Tn=Me({prefix:"\0",name:"identity",encode:t=>Rt(t),decode:t=>Nt(t)})});var _e={};m(_e,{base2:()=>Un});var Un,er=p(()=>{z();Un=d({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var et={};m(et,{base8:()=>Mn});var Mn,tr=p(()=>{z();Mn=d({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var tt={};m(tt,{base10:()=>qn});var qn,rr=p(()=>{z();qn=L({prefix:"9",name:"base10",alphabet:"0123456789"})});var rt={};m(rt,{base16:()=>jn,base16upper:()=>zn});var jn,zn,sr=p(()=>{z();jn=d({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),zn=d({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var st={};m(st,{base36:()=>In,base36upper:()=>Dn});var In,Dn,nr=p(()=>{z();In=L({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Dn=L({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var nt={};m(nt,{base64:()=>Pn,base64pad:()=>Bn,base64url:()=>Nn,base64urlpad:()=>Rn});var Pn,Bn,Nn,Rn,or=p(()=>{z();Pn=d({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Bn=d({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Nn=d({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Rn=d({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var be,ir,ze=p(()=>{Z();be=({name:t,code:e,encode:r})=>new ir(t,e,r),ir=class{constructor(e,r,s){this.name=e,this.code=r,this.encode=s}async digest(e){if(e instanceof Uint8Array){let r=await this.encode(e);return le(this.code,r)}else throw Error("Unknown type, must be binary type")}}});var ot={};m(ot,{sha256:()=>Ln,sha512:()=>On});var cr,Ln,On,ur=p(()=>{ze();cr=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ln=be({name:"sha2-256",code:18,encode:cr("SHA-256")}),On=be({name:"sha2-512",code:19,encode:cr("SHA-512")})});var it={};m(it,{identity:()=>kn});var kn,pr=p(()=>{ze();R();kn=be({name:"identity",code:0,encode:t=>P(t)})});var hr=p(()=>{R()});var dr=p(()=>{});var Pe={};m(Pe,{CID:()=>f});var f,Wn,Jn,Gn,me,Xn,lr,fr,Ie,De,Qn,Hn,Kn,we=p(()=>{qe();Z();G();pe();R();f=class{constructor(e,r,s,n){this.code=r,this.version=e,this.multihash=s,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:De,byteLength:De,code:Ie,version:Ie,multihash:Ie,bytes:Ie,_baseCache:De,asCID:De})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==me)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Xn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return f.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,s=le(e,r);return f.createV1(this.code,s)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&He(this.multihash,e.multihash)}toString(e){let{bytes:r,version:s,_baseCache:n}=this;switch(s){case 0:return Jn(r,n,e||I.encoder);default:return Gn(r,n,e||X.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return Hn(/^0\.0/,Kn),!!(e&&(e[fr]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof f)return e;if(e!=null&&e.asCID===e){let{version:r,code:s,multihash:n,bytes:o}=e;return new f(r,s,n,o||lr(r,s,n.bytes))}else if(e!=null&&e[fr]===!0){let{version:r,multihash:s,code:n}=e,o=Qe(s);return f.create(r,n,o)}else return null}static create(e,r,s){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(r!==me)throw new Error(`Version 0 CID must use dag-pb (code: ${me}) block encoding`);return new f(e,r,s,s.bytes)}case 1:{let n=lr(e,r,s.bytes);return new f(e,r,s,n)}default:throw new Error("Invalid version")}}static createV0(e){return f.create(0,me,e)}static createV1(e,r){return f.create(1,e,r)}static decode(e){let[r,s]=f.decodeFirst(e);if(s.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=f.inspectBytes(e),s=r.size-r.multihashSize,n=P(e.subarray(s,s+r.multihashSize));if(n.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=n.subarray(r.multihashSize-r.digestSize),i=new K(r.multihashCode,r.digestSize,o,n);return[r.version===0?f.createV0(i):f.createV1(r.codec,i),e.subarray(r.size)]}static inspectBytes(e){let r=0,s=()=>{let[W,Ce]=de(e.subarray(r));return r+=Ce,W},n=s(),o=me;if(n===18?(n=0,r=0):n===1&&(o=s()),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let i=r,u=s(),w=s(),B=r+w,v=B-i;return{version:n,codec:o,multihashCode:u,digestSize:w,multihashSize:v,size:B}}static parse(e,r){let[s,n]=Wn(e,r),o=f.decode(n);return o._baseCache.set(s,e),o}},Wn=(t,e)=>{switch(t[0]){case"Q":{let r=e||I;return[I.prefix,r.decode(`${I.prefix}${t}`)]}case I.prefix:{let r=e||I;return[I.prefix,r.decode(t)]}case X.prefix:{let r=e||X;return[X.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Jn=(t,e,r)=>{let{prefix:s}=r;if(s!==I.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let n=e.get(s);if(n==null){let o=r.encode(t).slice(1);return e.set(s,o),o}else return n},Gn=(t,e,r)=>{let{prefix:s}=r,n=e.get(s);if(n==null){let o=r.encode(t);return e.set(s,o),o}else return n},me=112,Xn=18,lr=(t,e,r)=>{let s=H(t),n=s+H(e),o=new Uint8Array(n+r.byteLength);return Q(t,o,0),Q(e,o,s),o.set(r,n),o},fr=Symbol.for("@ipld/js-cid/CID"),Ie={writable:!1,configurable:!1,enumerable:!0},De={writable:!1,enumerable:!1,configurable:!1},Qn="0.0.0-dev",Hn=(t,e)=>{if(t.test(Qn))console.warn(e);else throw new Error(e)},Kn=`CID.isCID(v) is deprecated and will be removed in the next major release.
Following code pattern:

@@ -27,3 +27,3 @@

}
`});var fr=l(($i,dr)=>{dr.exports=ot;var lr=128,Fs=127,Ws=~Fs,Gs=Math.pow(2,31);function ot(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw ot.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var n=r;t>=Gs;)e[r++]=t&255|lr,t/=128;for(;t&Ws;)e[r++]=t&255|lr,t>>>=7;return e[r]=t|0,ot.bytes=r-n+1,e}});var gr=l((qi,pr)=>{pr.exports=it;var Js=128,wr=127;function it(t,e){var r=0,e=e||0,n=0,s=e,o,i=t.length;do{if(s>=i||n>49)throw it.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=n<28?(o&wr)<<n:(o&wr)*Math.pow(2,n),n+=7}while(o>=Js);return it.bytes=s-e,r}});var yr=l((zi,br)=>{var Qs=Math.pow(2,7),Xs=Math.pow(2,14),Ks=Math.pow(2,21),Zs=Math.pow(2,28),Ys=Math.pow(2,35),Hs=Math.pow(2,42),_s=Math.pow(2,49),eo=Math.pow(2,56),to=Math.pow(2,63);br.exports=function(t){return t<Qs?1:t<Xs?2:t<Ks?3:t<Zs?4:t<Ys?5:t<Hs?6:t<_s?7:t<eo?8:t<to?9:10}});var Re=l((Mi,mr)=>{mr.exports={encode:fr(),decode:gr(),encodingLength:yr()}});var xr=l((Ci,vr)=>{"use strict";var{encoding:ro}=rt(),no=new TextEncoder;function so(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function oo(t,e="utf8"){return e==="utf8"||e==="utf-8"?no.encode(t):e==="ascii"?so(t):ro(e).decode(t)}vr.exports=oo});var ct=l((Bi,Sr)=>{"use strict";function io(t,e){e||(e=t.reduce((s,o)=>s+o.length,0));let r=new Uint8Array(e),n=0;for(let s of t)r.set(s,n),n+=s.length;return r}Sr.exports=io});var Mr=l((Di,Er)=>{"use strict";var Le=ir(),Ar=Be(),{CID:co}=(Oe(),De),{base32:Ur}=($e(),Qe),{base58btc:ao}=(ce(),Te),uo=(qe(),Ze),H=Re(),Pe=Y(),Tr=xr(),ke=ct();Er.exports=pe;function pe(t,e){return e instanceof Uint8Array?pe.toString(t,e):pe.toBytes(t,e)}pe.toString=function(e,r){switch(Ar(e).code){case 4:case 41:return ho(r);case 6:case 273:case 33:case 132:return $r(r).toString();case 53:case 54:case 55:case 56:case 400:case 777:return lo(r);case 421:return fo(r);case 444:return qr(r);case 445:return qr(r);default:return Pe(r,"base16")}};pe.toBytes=function(e,r){switch(Ar(e).code){case 4:return zr(r);case 41:return zr(r);case 6:case 273:case 33:case 132:return at(parseInt(r,10));case 53:case 54:case 55:case 56:case 400:case 777:return po(r);case 421:return wo(r);case 444:return go(r);case 445:return bo(r);default:return Tr(r,"base16")}};function zr(t){if(!Le.isIP(t))throw new Error("invalid ip address");return Le.toBytes(t)}function ho(t){let e=Le.toString(t);if(!e||!Le.isIP(e))throw new Error("invalid ip address");return e}function at(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function $r(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function po(t){let e=Tr(t),r=Uint8Array.from(H.encode(e.length));return ke([r,e],r.length+e.length)}function lo(t){let e=H.decode(t);if(t=t.slice(H.decode.bytes),t.length!==e)throw new Error("inconsistent lengths");return Pe(t)}function wo(t){let e;t[0]==="Q"||t[0]==="1"?e=uo.decode(ao.decode(`z${t}`)).bytes:e=co.parse(t).multihash.bytes;let r=Uint8Array.from(H.encode(e.length));return ke([r,e],r.length+e.length)}function fo(t){let e=H.decode(t),r=t.slice(H.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return Pe(r,"base58btc")}function go(t){let e=t.split(":");if(e.length!==2)throw new Error("failed to parse onion addr: "+e+" does not contain a port number");if(e[0].length!==16)throw new Error("failed to parse onion addr: "+e[0]+" not a Tor onion address.");let r=Ur.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let s=at(n);return ke([r,s],r.length+s.length)}function bo(t){let e=t.split(":");if(e.length!==2)throw new Error("failed to parse onion addr: "+e+" does not contain a port number");if(e[0].length!==56)throw new Error("failed to parse onion addr: "+e[0]+" not a Tor onion3 address.");let r=Ur.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let s=at(n);return ke([r,s],r.length+s.length)}function qr(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),n=Pe(e,"base32"),s=$r(r);return n+":"+s}});var Vr=l((Ii,Cr)=>{"use strict";var Br=Mr(),ut=Be(),we=Re(),Dr=ct(),yo=Y();Cr.exports={stringToStringTuples:Ir,stringTuplesToString:Nr,tuplesToStringTuples:Rr,stringTuplesToTuples:Or,bytesToTuples:ht,tuplesToBytes:Lr,bytesToString:mo,stringToBytes:kr,fromString:vo,fromBytes:jr,validateBytes:dt,isValidBytes:xo,cleanPath:je,ParseError:lt,protoFromTuple:ge,sizeForAddr:Pr};function Ir(t){let e=[],r=t.split("/").slice(1);if(r.length===1&&r[0]==="")return[];for(let n=0;n<r.length;n++){let s=r[n],o=ut(s);if(o.size===0){e.push([s]);continue}if(n++,n>=r.length)throw lt("invalid address: "+t);if(o.path){e.push([s,je(r.slice(n).join("/"))]);break}e.push([s,r[n]])}return e}function Nr(t){let e=[];return t.map(r=>{let n=ge(r);return e.push(n.name),r.length>1&&e.push(r[1]),null}),je(e.join("/"))}function Or(t){return t.map(e=>{Array.isArray(e)||(e=[e]);let r=ge(e);return e.length>1?[r.code,Br.toBytes(r.code,e[1])]:[r.code]})}function Rr(t){return t.map(e=>{let r=ge(e);return e[1]?[r.code,Br.toString(r.code,e[1])]:[r.code]})}function Lr(t){return jr(Dr(t.map(e=>{let r=ge(e),n=Uint8Array.from(we.encode(r.code));return e.length>1&&(n=Dr([n,e[1]])),n})))}function Pr(t,e){return t.size>0?t.size/8:t.size===0?0:we.decode(e)+we.decode.bytes}function ht(t){let e=[],r=0;for(;r<t.length;){let n=we.decode(t,r),s=we.decode.bytes,o=ut(n),i=Pr(o,t.slice(r+s));if(i===0){e.push([n]),r+=s;continue}let u=t.slice(r+s,r+s+i);if(r+=i+s,r>t.length)throw lt("Invalid address Uint8Array: "+yo(t,"base16"));e.push([n,u])}return e}function mo(t){let e=ht(t),r=Rr(e);return Nr(r)}function kr(t){t=je(t);let e=Ir(t),r=Or(e);return Lr(r)}function vo(t){return kr(t)}function jr(t){let e=dt(t);if(e)throw e;return Uint8Array.from(t)}function dt(t){try{ht(t)}catch(e){return e}}function xo(t){return dt(t)===void 0}function je(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function lt(t){return new Error("Error parsing address: "+t)}function ge(t){return ut(t[0])}});var Gr=l((Ni,Fr)=>{"use strict";function Wr(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function So(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Wr(t,r)}catch(n){r.message=t.message,r.stack=t.stack;let s=function(){};return s.prototype=Object.create(Object.getPrototypeOf(t)),Wr(new s,r)}}Fr.exports=So});var Qr=l((Oi,Jr)=>{"use strict";function Eo(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}Jr.exports=Eo});var pt=l((Ri,Xr)=>{"use strict";var B=Vr(),_=Be(),Kr=Re(),{CID:Ao}=(Oe(),De),{base58btc:Uo}=(ce(),Te),To=Gr(),$o=Symbol.for("nodejs.util.inspect.custom"),Ve=Y(),qo=Qr(),ft=new Map,Zr=Symbol.for("@multiformats/js-multiaddr/multiaddr"),q=class{constructor(e){if(e==null&&(e=""),Object.defineProperty(this,Zr,{value:!0}),e instanceof Uint8Array)this.bytes=B.fromBytes(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=B.fromString(e)}else if(q.isMultiaddr(e))this.bytes=B.fromBytes(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return B.bytesToString(this.bytes)}toJSON(){return this.toString()}toOptions(){let e={},r=this.toString().split("/");return e.family=r[1]==="ip4"?4:6,e.host=r[2],e.transport=r[3],e.port=parseInt(r[4]),e}protos(){return this.protoCodes().map(e=>Object.assign({},_(e)))}protoCodes(){let e=[],r=this.bytes,n=0;for(;n<r.length;){let s=Kr.decode(r,n),o=Kr.decode.bytes,i=_(s);n+=B.sizeForAddr(i,r.slice(n+o))+o,e.push(s)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return B.bytesToTuples(this.bytes)}stringTuples(){let e=B.bytesToTuples(this.bytes);return B.tuplesToStringTuples(e)}encapsulate(e){return e=new q(e),new q(this.toString()+e.toString())}decapsulate(e){let r=e.toString(),n=this.toString(),s=n.lastIndexOf(r);if(s<0)throw new Error("Address "+this+" does not contain subaddress: "+e);return new q(n.slice(0,s))}decapsulateCode(e){let r=this.tuples();for(let n=r.length-1;n>=0;n--)if(r[n][0]===e)return new q(B.tuplesToBytes(r.slice(0,n)));return this}getPeerId(){try{let r=this.stringTuples().filter(n=>n[0]===_.names.ipfs.code).pop();if(r&&r[1]){let n=r[1];return n[0]==="Q"||n[0]==="1"?Ve(Uo.decode(`z${n}`),"base58btc"):Ve(Ao.parse(n).multihash.bytes,"base58btc")}return null}catch(e){return null}}getPath(){let e=null;try{e=this.stringTuples().filter(r=>!!_(r[0]).path)[0][1],e||(e=null)}catch(r){e=null}return e}equals(e){return qo(this.bytes,e.bytes)}async resolve(){let e=this.protos().find(s=>s.resolvable);if(!e)return[this];let r=ft.get(e.name);if(!r)throw To(new Error(`no available resolver for ${e.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await r(this)).map(s=>new q(s))}nodeAddress(){let e=this.protoCodes(),r=this.protoNames(),n=this.toString().split("/").slice(1);if(n.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".');if(e[0]!==4&&e[0]!==41&&e[0]!==54&&e[0]!==55)throw new Error(`no protocol with name: "'${r[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`);if(n[2]!=="tcp"&&n[2]!=="udp")throw new Error(`no protocol with name: "'${r[1]}'". Must have a valid transport protocol: "{tcp, udp}".`);return{family:e[0]===41||e[0]===55?6:4,address:n[1],port:parseInt(n[3])}}isThinWaistAddress(e){let r=(e||this).protos();return!(r.length!==2||r[0].code!==4&&r[0].code!==41||r[1].code!==6&&r[1].code!==273)}static fromNodeAddress(e,r){if(!e)throw new Error("requires node address object");if(!r)throw new Error("requires transport protocol");let n;switch(e.family){case 4:n="ip4";break;case 6:n="ip6";break;default:throw Error(`Invalid addr family. Got '${e.family}' instead of 4 or 6`)}return new q("/"+[n,e.address,r,e.port].join("/"))}static isName(e){return q.isMultiaddr(e)?e.protos().some(r=>r.resolvable):!1}static isMultiaddr(e){return e instanceof q||Boolean(e&&e[Zr])}[$o](){return"<Multiaddr "+Ve(this.bytes,"base16")+" - "+B.bytesToString(this.bytes)+">"}inspect(){return"<Multiaddr "+Ve(this.bytes,"base16")+" - "+B.bytesToString(this.bytes)+">"}};q.protocols=_;q.resolvers=ft;function zo(t){return new q(t)}Xr.exports={Multiaddr:q,multiaddr:zo,protocols:_,resolvers:ft}});var an=l((Li,Yr)=>{"use strict";var{Multiaddr:wt}=pt(),Hr=a("dns4"),_r=a("dns6"),en=a("dnsaddr"),V=T(a("dns"),en,Hr,_r),be=T(a("ip4"),a("ip6")),ee=T(h(be,a("tcp")),h(V,a("tcp"))),gt=h(be,a("udp")),tn=h(gt,a("utp")),rn=h(gt,a("quic")),te=T(h(ee,a("ws")),h(V,a("ws"))),re=T(h(ee,a("wss")),h(V,a("wss"))),Fe=T(h(ee,a("http")),h(be,a("http")),h(V,a("http"))),We=T(h(ee,a("https")),h(be,a("https")),h(V,a("https"))),bt=T(h(te,a("p2p-webrtc-star"),a("p2p")),h(re,a("p2p-webrtc-star"),a("p2p")),h(te,a("p2p-webrtc-star")),h(re,a("p2p-webrtc-star"))),Mo=T(h(te,a("p2p-websocket-star"),a("p2p")),h(re,a("p2p-websocket-star"),a("p2p")),h(te,a("p2p-websocket-star")),h(re,a("p2p-websocket-star"))),yt=T(h(Fe,a("p2p-webrtc-direct"),a("p2p")),h(We,a("p2p-webrtc-direct"),a("p2p")),h(Fe,a("p2p-webrtc-direct")),h(We,a("p2p-webrtc-direct"))),ne=T(te,re,Fe,We,bt,yt,ee,tn,rn,V),Co=T(h(ne,a("p2p-stardust"),a("p2p")),h(ne,a("p2p-stardust"))),P=T(h(ne,a("p2p")),bt,yt,a("p2p")),nn=T(h(P,a("p2p-circuit"),P),h(P,a("p2p-circuit")),h(a("p2p-circuit"),P),h(ne,a("p2p-circuit")),h(a("p2p-circuit"),ne),a("p2p-circuit")),sn=()=>T(h(nn,sn),nn),se=sn(),on=T(h(se,P,se),h(P,se),h(se,P),se,P);Yr.exports={DNS:V,DNS4:Hr,DNS6:_r,DNSADDR:en,IP:be,TCP:ee,UDP:gt,QUIC:rn,UTP:tn,HTTP:Fe,HTTPS:We,WebSockets:te,WebSocketsSecure:re,WebSocketStar:Mo,WebRTCStar:bt,WebRTCDirect:yt,Reliable:ne,Stardust:Co,Circuit:se,P2P:on,IPFS:on};function cn(t){function e(r){if(!wt.isMultiaddr(r))try{r=new wt(r)}catch(s){return!1}let n=t(r.protoNames());return n===null?!1:n===!0||n===!1?n:n.length===0}return e}function h(...t){function e(r){if(r.length<t.length)return null;let n=r;return t.some(s=>(n=typeof s=="function"?s().partialMatch(r):s.partialMatch(r),Array.isArray(n)&&(r=n),n===null)),n}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:cn(e),partialMatch:e}}function T(...t){function e(n){let s=null;return t.some(o=>{let i=typeof o=="function"?o().partialMatch(n):o.partialMatch(n);return i?(s=i,!0):!1}),s}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:cn(e),partialMatch:e}}function a(t){let e=t;function r(s){let o;if(typeof s=="string"||s instanceof Uint8Array)try{o=new wt(s)}catch(u){return!1}else o=s;let i=o.protoNames();return i.length===1&&i[0]===e}function n(s){return s.length===0?null:s[0]===e?s.slice(1):null}return{toString:function(){return e},matches:r,partialMatch:n}}});var mt=l((Pi,un)=>{"use strict";var Bo=typeof navigator!="undefined"&&navigator.product==="ReactNative";function Do(){return Bo?"http://localhost":self.location.protocol+"//"+self.location.host}var ye=self.URL,hn=Do(),dn=class{constructor(e="",r=hn){this.super=new ye(e,r),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}get hash(){return this.super.hash}get host(){return this.super.host}get hostname(){return this.super.hostname}get href(){return this.super.href}get origin(){return this.super.origin}get password(){return this.super.password}get pathname(){return this.super.pathname}get port(){return this.super.port}get protocol(){return this.super.protocol}get search(){return this.super.search}get searchParams(){return this.super.searchParams}get username(){return this.super.username}set hash(e){this.super.hash=e}set host(e){this.super.host=e}set hostname(e){this.super.hostname=e}set href(e){this.super.href=e}set password(e){this.super.password=e}set pathname(e){this.super.pathname=e}set port(e){this.super.port=e}set protocol(e){this.super.protocol=e}set search(e){this.super.search=e}set username(e){this.super.username=e}static createObjectURL(e){return ye.createObjectURL(e)}static revokeObjectURL(e){ye.revokeObjectURL(e)}toJSON(){return this.super.toJSON()}toString(){return this.super.toString()}format(){return this.toString()}};function Io(t){if(typeof t=="string")return new ye(t).toString();if(!(t instanceof ye)){let e=t.username&&t.password?`${t.username}:${t.password}@`:"",r=t.auth?t.auth+"@":"",n=t.port?":"+t.port:"",s=t.protocol?t.protocol+"//":"",o=t.host||"",i=t.hostname||"",u=t.search||(t.query?"?"+t.query:""),x=t.hash||"",S=t.pathname||"",D=t.path||S+u;return`${s}${e||r}${o||i+n}${D}${x}`}}un.exports={URLWithLegacySupport:dn,URLSearchParams:self.URLSearchParams,defaultBase:hn,format:Io}});var pn=l((ki,ln)=>{"use strict";var{URLWithLegacySupport:fn,format:No}=mt();ln.exports=(t,e={},r={},n)=>{let s=e.protocol?e.protocol.replace(":",""):"http";s=(r[s]||n||s)+":";let o;try{o=new fn(t)}catch(u){o={}}let i=Object.assign({},e,{protocol:s||o.protocol,host:e.host||o.host});return new fn(t,No(i)).toString()}});var gn=l((ji,wn)=>{"use strict";var{URLWithLegacySupport:Oo,format:Ro,URLSearchParams:Lo,defaultBase:Po}=mt(),ko=pn();wn.exports={URL:Oo,URLSearchParams:Lo,format:Ro,relative:ko,defaultBase:Po}});var Yo=l((Vi,bn)=>{"use strict";var{base58btc:jo}=(ce(),Te),{base32:Vo}=($e(),Qe),Fo=(qe(),Ze),{Multiaddr:yn}=pt(),Wo=an(),{CID:vt}=(Oe(),De),{URL:Go}=gn(),Jo=Y(),xt=/^https?:\/\/[^/]+\/(ip[fn]s)\/([^/?#]+)/,oe=/^\/(ip[fn]s)\/([^/?#]+)/,mn=1,vn=2,me=/^https?:\/\/([^/]+)\.(ip[fn]s)\.[^/?]+/,xn=1,Sn=2,Qo=/^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)+([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$/;function Xo(t){let e=St(t);try{Fo.decode(jo.decode("z"+e))}catch{return!1}return!0}function Ko(t){try{Vo.decode(t)}catch{return!1}return!0}function ve(t){try{return typeof t=="string"?Boolean(vt.parse(t)):t instanceof Uint8Array?Boolean(vt.decode(t)):Boolean(vt.asCID(t))}catch(e){return!1}}function En(t){if(!t)return!1;if(yn.isMultiaddr(t))return!0;try{return new yn(t),!0}catch(e){return!1}}function Zo(t){return En(t)&&Wo.P2P.matches(t)}function xe(t,e,r=mn,n=vn){let s=St(t);if(!s)return!1;let o=s.match(e);if(!o||o[r]!=="ipfs")return!1;let i=o[n];return i&&e===me&&(i=i.toLowerCase()),ve(i)}function Ge(t,e,r=mn,n=vn){let s=St(t);if(!s)return!1;let o=s.match(e);if(!o||o[r]!=="ipns")return!1;let i=o[n];if(i&&e===me){if(i=i.toLowerCase(),ve(i))return!0;try{!i.includes(".")&&i.includes("-")&&(i=i.replace(/--/g,"@").replace(/-/g,".").replace(/@/g,"-"));let{hostname:u}=new Go(`http://${i}`);return Qo.test(u)}catch(u){return!1}}return!0}function An(t){return typeof t=="string"}function St(t){return t instanceof Uint8Array?Jo(t,"base58btc"):An(t)?t:!1}var Et=t=>xe(t,me,Sn,xn),At=t=>Ge(t,me,Sn,xn),Un=t=>Et(t)||At(t),Tn=t=>xe(t,xt)||Et(t),$n=t=>Ge(t,xt)||At(t),qn=t=>Tn(t)||$n(t)||Un(t),zn=t=>xe(t,oe)||Ge(t,oe);bn.exports={multihash:Xo,multiaddr:En,peerMultiaddr:Zo,cid:ve,base32cid:t=>Ko(t)&&ve(t),ipfsSubdomain:Et,ipnsSubdomain:At,subdomain:Un,subdomainGatewayPattern:me,ipfsUrl:Tn,ipnsUrl:$n,url:qn,pathGatewayPattern:xt,ipfsPath:t=>xe(t,oe),ipnsPath:t=>Ge(t,oe),path:zn,pathPattern:oe,urlOrPath:t=>qn(t)||zn(t),cidPath:t=>An(t)&&!ve(t)&&xe(`/ipfs/${t}`,oe)}});return Yo();})();
`});var br=p(()=>{we();qe();R();ze();Z()});var at,Vi,mr=p(()=>{_t();er();tr();rr();sr();pe();nr();G();or();ur();pr();hr();dr();br();at={...Ye,..._e,...et,...tt,...rt,...ue,...st,...J,...nt},Vi={...ot,...it}});function wr(t,e,r,s){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:s}}}var gr,ct,Zn,Be,ut=p(()=>{mr();gr=wr("utf8","u",t=>{let e=new TextDecoder("utf8");return"u"+e.decode(t)},t=>new TextEncoder().encode(t.substring(1))),ct=wr("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Zn={utf8:gr,"utf-8":gr,hex:at.base16,latin1:ct,ascii:ct,binary:ct,...at},Be=Zn});var _={};m(_,{toString:()=>Yn});function Yn(t,e="utf8"){let r=Be[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return r.encoder.encode(t).substring(1)}var ee=p(()=>{ut()});var Er=b((Xi,Sr)=>{"use strict";var pt=Yt(),{toString:yr}=(ee(),_),_n=pt,ht=pt.v4,vr=pt.v6,xr=function(t,e,r){r=~~r;let s;if(ht(t))s=e||new Uint8Array(r+4),t.split(/\./g).map(function(n){s[r++]=parseInt(n,10)&255});else if(vr(t)){let n=t.split(":",8),o;for(o=0;o<n.length;o++){let i=ht(n[o]),u;i&&(u=xr(n[o]),n[o]=yr(u.slice(0,2),"base16")),u&&++o<8&&n.splice(o,0,yr(u.slice(2,4),"base16"))}if(n[0]==="")for(;n.length<8;)n.unshift("0");else if(n[n.length-1]==="")for(;n.length<8;)n.push("0");else if(n.length<8){for(o=0;o<n.length&&n[o]!=="";o++);let i=[o,"1"];for(o=9-n.length;o>0;o--)i.push("0");n.splice.apply(n,i)}for(s=e||new Uint8Array(r+16),o=0;o<n.length;o++){let i=parseInt(n[o],16);s[r++]=i>>8&255,s[r++]=i&255}}if(!s)throw Error("Invalid ip address: "+t);return s},eo=function(t,e,r){e=~~e,r=r||t.length-e;let s=[],n,o=new DataView(t.buffer);if(r===4){for(let i=0;i<r;i++)s.push(t[e+i]);n=s.join(".")}else if(r===16){for(let i=0;i<r;i+=2)s.push(o.getUint16(e+i).toString(16));n=s.join(":"),n=n.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3"),n=n.replace(/:{3,4}/,"::")}return n};Sr.exports={isIP:_n,isV4:ht,isV6:vr,toBytes:xr,toString:eo}});var Ne=b((Qi,$r)=>{"use strict";function S(t){if(typeof t=="number"){if(S.codes[t])return S.codes[t];throw new Error("no protocol with code: "+t)}else if(typeof t=="string"){if(S.names[t])return S.names[t];throw new Error("no protocol with name: "+t)}throw new Error("invalid protocol id type: "+t)}var A=-1;S.lengthPrefixedVarSize=A;S.V=A;S.table=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,A,"ip6zone"],[53,A,"dns","resolvable"],[54,A,"dns4","resolvable"],[55,A,"dns6","resolvable"],[56,A,"dnsaddr","resolvable"],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,A,"unix",!1,"path"],[421,A,"ipfs"],[421,A,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,A,"garlic64"],[460,0,"quic"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,A,"memory"]];S.names={};S.codes={};S.table.map(t=>{let e=Ar.apply(null,t);return S.codes[e.code]=e,S.names[e.name]=e,null});S.object=Ar;function Ar(t,e,r,s,n){return{code:t,size:e,name:r,resolvable:Boolean(s),path:Boolean(n)}}$r.exports=S});var Ur=b((Hi,Tr)=>{Tr.exports=dt;var Cr=128,to=127,ro=~to,so=Math.pow(2,31);function dt(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw dt.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var s=r;t>=so;)e[r++]=t&255|Cr,t/=128;for(;t&ro;)e[r++]=t&255|Cr,t>>>=7;return e[r]=t|0,dt.bytes=r-s+1,e}});var jr=b((Ki,qr)=>{qr.exports=lt;var no=128,Mr=127;function lt(t,e){var r=0,e=e||0,s=0,n=e,o,i=t.length;do{if(n>=i||s>49)throw lt.bytes=0,new RangeError("Could not decode varint");o=t[n++],r+=s<28?(o&Mr)<<s:(o&Mr)*Math.pow(2,s),s+=7}while(o>=no);return lt.bytes=n-e,r}});var Ir=b((Zi,zr)=>{var oo=Math.pow(2,7),io=Math.pow(2,14),ao=Math.pow(2,21),co=Math.pow(2,28),uo=Math.pow(2,35),po=Math.pow(2,42),ho=Math.pow(2,49),lo=Math.pow(2,56),fo=Math.pow(2,63);zr.exports=function(t){return t<oo?1:t<io?2:t<ao?3:t<co?4:t<uo?5:t<po?6:t<ho?7:t<lo?8:t<fo?9:10}});var Re=b((Yi,Dr)=>{Dr.exports={encode:Ur(),decode:jr(),encodingLength:Ir()}});var Pr={};m(Pr,{fromString:()=>bo});function bo(t,e="utf8"){let r=Be[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return r.decoder.decode(`${r.prefix}${t}`)}var Br=p(()=>{ut()});var ft={};m(ft,{concat:()=>mo});function mo(t,e){e||(e=t.reduce((n,o)=>n+o.length,0));let r=new Uint8Array(e),s=0;for(let n of t)r.set(n,s),s+=n.length;return r}var bt=p(()=>{});var Wr=b((ea,Fr)=>{"use strict";var Le=Er(),Nr=Ne(),{CID:wo}=(we(),Pe),{base32:Rr}=(pe(),ue),{base58btc:go}=(G(),J),yo=(Z(),fe),te=Re(),{toString:Oe}=(ee(),_),{fromString:Lr}=(Br(),Pr),{concat:ke}=(bt(),ft);Fr.exports=ge;function ge(t,e){return e instanceof Uint8Array?ge.toString(t,e):ge.toBytes(t,e)}ge.toString=function(e,r){switch(Nr(e).code){case 4:case 41:return vo(r);case 6:case 273:case 33:case 132:return kr(r).toString();case 53:case 54:case 55:case 56:case 400:case 777:return So(r);case 421:return Ao(r);case 444:return Vr(r);case 445:return Vr(r);default:return Oe(r,"base16")}};ge.toBytes=function(e,r){switch(Nr(e).code){case 4:return Or(r);case 41:return Or(r);case 6:case 273:case 33:case 132:return mt(parseInt(r,10));case 53:case 54:case 55:case 56:case 400:case 777:return xo(r);case 421:return Eo(r);case 444:return $o(r);case 445:return Co(r);default:return Lr(r,"base16")}};function Or(t){if(!Le.isIP(t))throw new Error("invalid ip address");return Le.toBytes(t)}function vo(t){let e=Le.toString(t);if(!e||!Le.isIP(e))throw new Error("invalid ip address");return e}function mt(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function kr(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function xo(t){let e=Lr(t),r=Uint8Array.from(te.encode(e.length));return ke([r,e],r.length+e.length)}function So(t){let e=te.decode(t);if(t=t.slice(te.decode.bytes),t.length!==e)throw new Error("inconsistent lengths");return Oe(t)}function Eo(t){let e;t[0]==="Q"||t[0]==="1"?e=yo.decode(go.decode(`z${t}`)).bytes:e=wo.parse(t).multihash.bytes;let r=Uint8Array.from(te.encode(e.length));return ke([r,e],r.length+e.length)}function Ao(t){let e=te.decode(t),r=t.slice(te.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return Oe(r,"base58btc")}function $o(t){let e=t.split(":");if(e.length!==2)throw new Error("failed to parse onion addr: "+e+" does not contain a port number");if(e[0].length!==16)throw new Error("failed to parse onion addr: "+e[0]+" not a Tor onion address.");let r=Rr.decode("b"+e[0]),s=parseInt(e[1],10);if(s<1||s>65536)throw new Error("Port number is not in range(1, 65536)");let n=mt(s);return ke([r,n],r.length+n.length)}function Co(t){let e=t.split(":");if(e.length!==2)throw new Error("failed to parse onion addr: "+e+" does not contain a port number");if(e[0].length!==56)throw new Error("failed to parse onion addr: "+e[0]+" not a Tor onion3 address.");let r=Rr.decode("b"+e[0]),s=parseInt(e[1],10);if(s<1||s>65536)throw new Error("Port number is not in range(1, 65536)");let n=mt(s);return ke([r,n],r.length+n.length)}function Vr(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),s=Oe(e,"base32"),n=kr(r);return s+":"+n}});var rs=b((ta,ts)=>{"use strict";var Jr=Wr(),wt=Ne(),ye=Re(),{concat:Gr}=(bt(),ft),{toString:To}=(ee(),_);ts.exports={stringToStringTuples:Xr,stringTuplesToString:Qr,tuplesToStringTuples:Kr,stringTuplesToTuples:Hr,bytesToTuples:gt,tuplesToBytes:Zr,bytesToString:Uo,stringToBytes:_r,fromString:Mo,fromBytes:es,validateBytes:yt,isValidBytes:qo,cleanPath:Ve,ParseError:vt,protoFromTuple:ve,sizeForAddr:Yr};function Xr(t){let e=[],r=t.split("/").slice(1);if(r.length===1&&r[0]==="")return[];for(let s=0;s<r.length;s++){let n=r[s],o=wt(n);if(o.size===0){e.push([n]);continue}if(s++,s>=r.length)throw vt("invalid address: "+t);if(o.path){e.push([n,Ve(r.slice(s).join("/"))]);break}e.push([n,r[s]])}return e}function Qr(t){let e=[];return t.map(r=>{let s=ve(r);return e.push(s.name),r.length>1&&e.push(r[1]),null}),Ve(e.join("/"))}function Hr(t){return t.map(e=>{Array.isArray(e)||(e=[e]);let r=ve(e);return e.length>1?[r.code,Jr.toBytes(r.code,e[1])]:[r.code]})}function Kr(t){return t.map(e=>{let r=ve(e);return e[1]?[r.code,Jr.toString(r.code,e[1])]:[r.code]})}function Zr(t){return es(Gr(t.map(e=>{let r=ve(e),s=Uint8Array.from(ye.encode(r.code));return e.length>1&&(s=Gr([s,e[1]])),s})))}function Yr(t,e){return t.size>0?t.size/8:t.size===0?0:ye.decode(e)+ye.decode.bytes}function gt(t){let e=[],r=0;for(;r<t.length;){let s=ye.decode(t,r),n=ye.decode.bytes,o=wt(s),i=Yr(o,t.slice(r+n));if(i===0){e.push([s]),r+=n;continue}let u=t.slice(r+n,r+n+i);if(r+=i+n,r>t.length)throw vt("Invalid address Uint8Array: "+To(t,"base16"));e.push([s,u])}return e}function Uo(t){let e=gt(t),r=Kr(e);return Qr(r)}function _r(t){t=Ve(t);let e=Xr(t),r=Hr(e);return Zr(r)}function Mo(t){return _r(t)}function es(t){let e=yt(t);if(e)throw e;return Uint8Array.from(t)}function yt(t){try{gt(t)}catch(e){return e}}function qo(t){return yt(t)===void 0}function Ve(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function vt(t){return new Error("Error parsing address: "+t)}function ve(t){return wt(t[0])}});var os=b((ra,ns)=>{"use strict";function ss(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function jo(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return ss(t,r)}catch(s){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),ss(new n,r)}}ns.exports=jo});var is={};m(is,{equals:()=>zo});function zo(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}var as=p(()=>{});var St=b((sa,ps)=>{"use strict";var U=rs(),re=Ne(),cs=Re(),{CID:Io}=(we(),Pe),{base58btc:Do}=(G(),J),Po=os(),Bo=Symbol.for("nodejs.util.inspect.custom"),{toString:Fe}=(ee(),_),{equals:No}=(as(),is),xt=new Map,us=Symbol.for("@multiformats/js-multiaddr/multiaddr"),y=class{constructor(e){if(e==null&&(e=""),Object.defineProperty(this,us,{value:!0}),e instanceof Uint8Array)this.bytes=U.fromBytes(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=U.fromString(e)}else if(y.isMultiaddr(e))this.bytes=U.fromBytes(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return U.bytesToString(this.bytes)}toJSON(){return this.toString()}toOptions(){let e={},r=this.toString().split("/");return e.family=r[1]==="ip4"?4:6,e.host=r[2],e.transport=r[3],e.port=parseInt(r[4]),e}protos(){return this.protoCodes().map(e=>Object.assign({},re(e)))}protoCodes(){let e=[],r=this.bytes,s=0;for(;s<r.length;){let n=cs.decode(r,s),o=cs.decode.bytes,i=re(n);s+=U.sizeForAddr(i,r.slice(s+o))+o,e.push(n)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return U.bytesToTuples(this.bytes)}stringTuples(){let e=U.bytesToTuples(this.bytes);return U.tuplesToStringTuples(e)}encapsulate(e){return e=new y(e),new y(this.toString()+e.toString())}decapsulate(e){let r=e.toString(),s=this.toString(),n=s.lastIndexOf(r);if(n<0)throw new Error("Address "+this+" does not contain subaddress: "+e);return new y(s.slice(0,n))}decapsulateCode(e){let r=this.tuples();for(let s=r.length-1;s>=0;s--)if(r[s][0]===e)return new y(U.tuplesToBytes(r.slice(0,s)));return this}getPeerId(){try{let r=this.stringTuples().filter(s=>s[0]===re.names.ipfs.code).pop();if(r&&r[1]){let s=r[1];return s[0]==="Q"||s[0]==="1"?Fe(Do.decode(`z${s}`),"base58btc"):Fe(Io.parse(s).multihash.bytes,"base58btc")}return null}catch(e){return null}}getPath(){let e=null;try{e=this.stringTuples().filter(r=>!!re(r[0]).path)[0][1],e||(e=null)}catch(r){e=null}return e}equals(e){return No(this.bytes,e.bytes)}async resolve(){let e=this.protos().find(n=>n.resolvable);if(!e)return[this];let r=xt.get(e.name);if(!r)throw Po(new Error(`no available resolver for ${e.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await r(this)).map(n=>new y(n))}nodeAddress(){let e=this.protoCodes(),r=this.protoNames(),s=this.toString().split("/").slice(1);if(s.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".');if(e[0]!==4&&e[0]!==41&&e[0]!==54&&e[0]!==55)throw new Error(`no protocol with name: "'${r[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`);if(s[2]!=="tcp"&&s[2]!=="udp")throw new Error(`no protocol with name: "'${r[1]}'". Must have a valid transport protocol: "{tcp, udp}".`);return{family:e[0]===41||e[0]===55?6:4,address:s[1],port:parseInt(s[3])}}isThinWaistAddress(e){let r=(e||this).protos();return!(r.length!==2||r[0].code!==4&&r[0].code!==41||r[1].code!==6&&r[1].code!==273)}static fromNodeAddress(e,r){if(!e)throw new Error("requires node address object");if(!r)throw new Error("requires transport protocol");let s;switch(e.family){case 4:s="ip4";break;case 6:s="ip6";break;default:throw Error(`Invalid addr family. Got '${e.family}' instead of 4 or 6`)}return new y("/"+[s,e.address,r,e.port].join("/"))}static isName(e){return y.isMultiaddr(e)?e.protos().some(r=>r.resolvable):!1}static isMultiaddr(e){return e instanceof y||Boolean(e&&e[us])}[Bo](){return"<Multiaddr "+Fe(this.bytes,"base16")+" - "+U.bytesToString(this.bytes)+">"}inspect(){return"<Multiaddr "+Fe(this.bytes,"base16")+" - "+U.bytesToString(this.bytes)+">"}};y.protocols=re;y.resolvers=xt;function Ro(t){return new y(t)}ps.exports={Multiaddr:y,multiaddr:Ro,protocols:re,resolvers:xt}});var xs=b((na,vs)=>{"use strict";var{Multiaddr:Et}=St(),hs=a("dns4"),ds=a("dns6"),ls=a("dnsaddr"),F=g(a("dns"),ls,hs,ds),xe=g(a("ip4"),a("ip6")),se=g(c(xe,a("tcp")),c(F,a("tcp"))),At=c(xe,a("udp")),fs=c(At,a("utp")),bs=c(At,a("quic")),ne=g(c(se,a("ws")),c(F,a("ws"))),oe=g(c(se,a("wss")),c(F,a("wss"))),We=g(c(se,a("http")),c(xe,a("http")),c(F,a("http"))),Je=g(c(se,a("https")),c(xe,a("https")),c(F,a("https"))),$t=g(c(ne,a("p2p-webrtc-star"),a("p2p")),c(oe,a("p2p-webrtc-star"),a("p2p")),c(ne,a("p2p-webrtc-star")),c(oe,a("p2p-webrtc-star"))),Lo=g(c(ne,a("p2p-websocket-star"),a("p2p")),c(oe,a("p2p-websocket-star"),a("p2p")),c(ne,a("p2p-websocket-star")),c(oe,a("p2p-websocket-star"))),Ct=g(c(We,a("p2p-webrtc-direct"),a("p2p")),c(Je,a("p2p-webrtc-direct"),a("p2p")),c(We,a("p2p-webrtc-direct")),c(Je,a("p2p-webrtc-direct"))),ie=g(ne,oe,We,Je,$t,Ct,se,fs,bs,F),Oo=g(c(ie,a("p2p-stardust"),a("p2p")),c(ie,a("p2p-stardust"))),k=g(c(ie,a("p2p")),$t,Ct,a("p2p")),ms=g(c(k,a("p2p-circuit"),k),c(k,a("p2p-circuit")),c(a("p2p-circuit"),k),c(ie,a("p2p-circuit")),c(a("p2p-circuit"),ie),a("p2p-circuit")),ws=()=>g(c(ms,ws),ms),ae=ws(),gs=g(c(ae,k,ae),c(k,ae),c(ae,k),ae,k);vs.exports={DNS:F,DNS4:hs,DNS6:ds,DNSADDR:ls,IP:xe,TCP:se,UDP:At,QUIC:bs,UTP:fs,HTTP:We,HTTPS:Je,WebSockets:ne,WebSocketsSecure:oe,WebSocketStar:Lo,WebRTCStar:$t,WebRTCDirect:Ct,Reliable:ie,Stardust:Oo,Circuit:ae,P2P:gs,IPFS:gs};function ys(t){function e(r){if(!Et.isMultiaddr(r))try{r=new Et(r)}catch(n){return!1}let s=t(r.protoNames());return s===null?!1:s===!0||s===!1?s:s.length===0}return e}function c(...t){function e(r){if(r.length<t.length)return null;let s=r;return t.some(n=>(s=typeof n=="function"?n().partialMatch(r):n.partialMatch(r),Array.isArray(s)&&(r=s),s===null)),s}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:ys(e),partialMatch:e}}function g(...t){function e(s){let n=null;return t.some(o=>{let i=typeof o=="function"?o().partialMatch(s):o.partialMatch(s);return i?(n=i,!0):!1}),n}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:ys(e),partialMatch:e}}function a(t){let e=t;function r(n){let o;if(typeof n=="string"||n instanceof Uint8Array)try{o=new Et(n)}catch(u){return!1}else o=n;let i=o.protoNames();return i.length===1&&i[0]===e}function s(n){return n.length===0?null:n[0]===e?n.slice(1):null}return{toString:function(){return e},matches:r,partialMatch:s}}});var Tt=b((oa,As)=>{"use strict";var ko=typeof navigator!="undefined"&&navigator.product==="ReactNative";function Vo(){return ko?"http://localhost":self.location.protocol+"//"+self.location.host}var Se=self.URL,Ss=Vo(),Es=class{constructor(e="",r=Ss){this.super=new Se(e,r),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}get hash(){return this.super.hash}get host(){return this.super.host}get hostname(){return this.super.hostname}get href(){return this.super.href}get origin(){return this.super.origin}get password(){return this.super.password}get pathname(){return this.super.pathname}get port(){return this.super.port}get protocol(){return this.super.protocol}get search(){return this.super.search}get searchParams(){return this.super.searchParams}get username(){return this.super.username}set hash(e){this.super.hash=e}set host(e){this.super.host=e}set hostname(e){this.super.hostname=e}set href(e){this.super.href=e}set password(e){this.super.password=e}set pathname(e){this.super.pathname=e}set port(e){this.super.port=e}set protocol(e){this.super.protocol=e}set search(e){this.super.search=e}set username(e){this.super.username=e}static createObjectURL(e){return Se.createObjectURL(e)}static revokeObjectURL(e){Se.revokeObjectURL(e)}toJSON(){return this.super.toJSON()}toString(){return this.super.toString()}format(){return this.toString()}};function Fo(t){if(typeof t=="string")return new Se(t).toString();if(!(t instanceof Se)){let e=t.username&&t.password?`${t.username}:${t.password}@`:"",r=t.auth?t.auth+"@":"",s=t.port?":"+t.port:"",n=t.protocol?t.protocol+"//":"",o=t.host||"",i=t.hostname||"",u=t.search||(t.query?"?"+t.query:""),w=t.hash||"",B=t.pathname||"",v=t.path||B+u;return`${n}${e||r}${o||i+s}${v}${w}`}}As.exports={URLWithLegacySupport:Es,URLSearchParams:self.URLSearchParams,defaultBase:Ss,format:Fo}});var Ts=b((ia,Cs)=>{"use strict";var{URLWithLegacySupport:$s,format:Wo}=Tt();Cs.exports=(t,e={},r={},s)=>{let n=e.protocol?e.protocol.replace(":",""):"http";n=(r[n]||s||n)+":";let o;try{o=new $s(t)}catch(u){o={}}let i=Object.assign({},e,{protocol:n||o.protocol,host:e.host||o.host});return new $s(t,Wo(i)).toString()}});var Ms=b((aa,Us)=>{"use strict";var{URLWithLegacySupport:Jo,format:Go,URLSearchParams:Xo,defaultBase:Qo}=Tt(),Ho=Ts();Us.exports={URL:Jo,URLSearchParams:Xo,format:Go,relative:Ho,defaultBase:Qo}});var ii=b((ca,Vs)=>{"use strict";var{base58btc:Ko}=(G(),J),{base32:Zo}=(pe(),ue),Yo=(Z(),fe),{Multiaddr:qs}=St(),_o=xs(),{CID:Ut}=(we(),Pe),{URL:ei}=Ms(),{toString:ti}=(ee(),_),Mt=/^https?:\/\/[^/]+\/(ip[fn]s)\/([^/?#]+)/,ce=/^\/(ip[fn]s)\/([^/?#]+)/,js=1,zs=2,Ee=/^https?:\/\/([^/]+)\.(ip[fn]s)\.[^/?]+/,Is=1,Ds=2,ri=/^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)+([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$/;function si(t){let e=qt(t);try{Yo.decode(Ko.decode("z"+e))}catch{return!1}return!0}function ni(t){try{Zo.decode(t)}catch{return!1}return!0}function Ae(t){try{return typeof t=="string"?Boolean(Ut.parse(t)):t instanceof Uint8Array?Boolean(Ut.decode(t)):Boolean(Ut.asCID(t))}catch(e){return!1}}function Ps(t){if(!t)return!1;if(qs.isMultiaddr(t))return!0;try{return new qs(t),!0}catch(e){return!1}}function oi(t){return Ps(t)&&_o.P2P.matches(t)}function $e(t,e,r=js,s=zs){let n=qt(t);if(!n)return!1;let o=n.match(e);if(!o||o[r]!=="ipfs")return!1;let i=o[s];return i&&e===Ee&&(i=i.toLowerCase()),Ae(i)}function Ge(t,e,r=js,s=zs){let n=qt(t);if(!n)return!1;let o=n.match(e);if(!o||o[r]!=="ipns")return!1;let i=o[s];if(i&&e===Ee){if(i=i.toLowerCase(),Ae(i))return!0;try{!i.includes(".")&&i.includes("-")&&(i=i.replace(/--/g,"@").replace(/-/g,".").replace(/@/g,"-"));let{hostname:u}=new ei(`http://${i}`);return ri.test(u)}catch(u){return!1}}return!0}function Bs(t){return typeof t=="string"}function qt(t){return t instanceof Uint8Array?ti(t,"base58btc"):Bs(t)?t:!1}var jt=t=>$e(t,Ee,Ds,Is),zt=t=>Ge(t,Ee,Ds,Is),Ns=t=>jt(t)||zt(t),Rs=t=>$e(t,Mt)||jt(t),Ls=t=>Ge(t,Mt)||zt(t),Os=t=>Rs(t)||Ls(t)||Ns(t),ks=t=>$e(t,ce)||Ge(t,ce);Vs.exports={multihash:si,multiaddr:Ps,peerMultiaddr:oi,cid:Ae,base32cid:t=>ni(t)&&Ae(t),ipfsSubdomain:jt,ipnsSubdomain:zt,subdomain:Ns,subdomainGatewayPattern:Ee,ipfsUrl:Rs,ipnsUrl:Ls,url:Os,pathGatewayPattern:Mt,ipfsPath:t=>$e(t,ce),ipnsPath:t=>Ge(t,ce),path:ks,pathPattern:ce,urlOrPath:t=>Os(t)||ks(t),cidPath:t=>Bs(t)&&!Ae(t)&&$e(`/ipfs/${t}`,ce)}});return ii();})();
return IsIpfs}));
{
"name": "is-ipfs",
"version": "6.0.1",
"version": "6.0.2",
"description": "A set of utilities to help identify IPFS resources on the web",

@@ -38,3 +38,3 @@ "keywords": [

"prepublishOnly": "aegir build",
"lint": "aegir lint && aegir lint-package-json",
"lint": "aegir ts -p check && aegir lint-package-json && aegir lint",
"release": "aegir release",

@@ -49,7 +49,8 @@ "release-minor": "aegir release --type minor",

"multiformats": "^9.0.0",
"uint8arrays": "^2.1.3"
"uint8arrays": "^3.0.0"
},
"devDependencies": {
"aegir": "^33.1.0",
"pre-commit": "^1.2.2"
"aegir": "^35.0.2",
"pre-commit": "^1.2.2",
"util": "^0.12.4"
},

@@ -71,5 +72,5 @@ "engines": {

"nginnever <ginneversource@gmail.com>",
"Henrique Dias <hacdias@gmail.com>",
"Hugo Dias <mail@hugodias.me>"
"Hugo Dias <mail@hugodias.me>",
"Henrique Dias <hacdias@gmail.com>"
]
}

@@ -10,3 +10,3 @@ 'use strict'

const { URL } = require('iso-url')
const uint8ArrayToString = require('uint8arrays/to-string')
const { toString: uint8ArrayToString } = require('uint8arrays/to-string')

@@ -13,0 +13,0 @@ const pathGatewayPattern = /^https?:\/\/[^/]+\/(ip[fn]s)\/([^/?#]+)/

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc