ipfs-unixfs-importer 10.0.2 → 11.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -13
- package/dist/index.min.js +2 -23
- package/dist/src/chunker/fixed-size.d.ts.map +1 -1
- package/dist/src/chunker/rabin.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/persist.d.ts +1 -1
- package/dist/src/utils/persist.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/chunker/fixed-size.js +10 -11
- package/src/chunker/rabin.js +3 -4
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# ipfs-unixfs-importer <!-- omit in toc -->
|
|
2
2
|
|
|
3
|
-
[](https://discord.gg/ipfs)
|
|
3
|
+
[](https://ipfs.tech)
|
|
4
|
+
[](https://discuss.ipfs.tech)
|
|
6
5
|
[](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
|
|
7
6
|
[](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml)
|
|
8
7
|
|
|
@@ -167,14 +166,6 @@ Several aspects of the importer are overridable by specifying functions as part
|
|
|
167
166
|
- This function should read `{ cid, path, unixfs, node }` entries from `source` and place them in a directory structure
|
|
168
167
|
- It should yield an object with the properties `{ cid, path, unixfs, size }` where `cid` is a `CID`, `path` is a string, `unixfs` is a UnixFS entry and `size` is a `Number`.
|
|
169
168
|
|
|
170
|
-
[blockstore]: https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore#readme
|
|
171
|
-
|
|
172
|
-
[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs
|
|
173
|
-
|
|
174
|
-
[IPLD]: https://github.com/ipld/js-ipld
|
|
175
|
-
|
|
176
|
-
[CID]: https://github.com/multiformats/js-cid
|
|
177
|
-
|
|
178
169
|
## Contribute
|
|
179
170
|
|
|
180
171
|
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
|
|
@@ -192,8 +183,20 @@ Licensed under either of
|
|
|
192
183
|
|
|
193
184
|
## Contribute
|
|
194
185
|
|
|
195
|
-
|
|
186
|
+
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-unixfs/issues).
|
|
196
187
|
|
|
197
|
-
|
|
188
|
+
Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
|
|
189
|
+
|
|
190
|
+
Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
|
|
191
|
+
|
|
192
|
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
|
|
198
193
|
|
|
199
194
|
[](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
|
|
195
|
+
|
|
196
|
+
[blockstore]: https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore#readme
|
|
197
|
+
|
|
198
|
+
[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs
|
|
199
|
+
|
|
200
|
+
[IPLD]: https://github.com/ipld/js-ipld
|
|
201
|
+
|
|
202
|
+
[CID]: https://github.com/multiformats/js-cid
|
package/dist/index.min.js
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
var IpfsUnixfsImporter=(()=>{var rs=Object.create;var ne=Object.defineProperty;var ns=Object.getOwnPropertyDescriptor;var is=Object.getOwnPropertyNames;var os=Object.getPrototypeOf,ss=Object.prototype.hasOwnProperty;var I=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),V=(r,t)=>{for(var e in t)ne(r,e,{get:t[e],enumerable:!0})},Mr=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of is(t))!ss.call(r,i)&&i!==e&&ne(r,i,{get:()=>t[i],enumerable:!(n=ns(t,i))||n.enumerable});return r};var M=(r,t,e)=>(e=r!=null?rs(os(r)):{},Mr(t||!r||!r.__esModule?ne(e,"default",{value:r,enumerable:!0}):e,r)),as=r=>Mr(ne({},"__esModule",{value:!0}),r);var ie=I((xu,jr)=>{"use strict";async function*us(r,t=1){let e=[];t<1&&(t=1);for await(let n of r)for(e.push(n);e.length>=t;)yield e.slice(0,t),e=e.slice(t);for(;e.length;)yield e.slice(0,t),e=e.slice(t)}jr.exports=us});var Se=I((Au,Vr)=>{"use strict";var cs=ie();async function*fs(r,t=1){for await(let e of cs(r,t)){let n=e.map(i=>i().then(o=>({ok:!0,value:o}),o=>({ok:!1,err:o})));for(let i=0;i<n.length;i++){let o=await n[i];if(o.ok)yield o.value;else throw o.err}}}Vr.exports=fs});var $r=I((Bu,Hr)=>{"use strict";Hr.exports=r=>{if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}});var Jr=I((Yr,Kr)=>{"use strict";var oe=$r(),{hasOwnProperty:qr}=Object.prototype,{propertyIsEnumerable:hs}=Object,xt=(r,t,e)=>Object.defineProperty(r,t,{value:e,writable:!0,enumerable:!0,configurable:!0}),ls=Yr,Gr={concatArrays:!1,ignoreUndefined:!1},se=r=>{let t=[];for(let e in r)qr.call(r,e)&&t.push(e);if(Object.getOwnPropertySymbols){let e=Object.getOwnPropertySymbols(r);for(let n of e)hs.call(r,n)&&t.push(n)}return t};function At(r){return Array.isArray(r)?ps(r):oe(r)?ds(r):r}function ps(r){let t=r.slice(0,0);return se(r).forEach(e=>{xt(t,e,At(r[e]))}),t}function ds(r){let t=Object.getPrototypeOf(r)===null?Object.create(null):{};return se(r).forEach(e=>{xt(t,e,At(r[e]))}),t}var Wr=(r,t,e,n)=>(e.forEach(i=>{typeof t[i]>"u"&&n.ignoreUndefined||(i in r&&r[i]!==Object.getPrototypeOf(r)?xt(r,i,Ce(r[i],t[i],n)):xt(r,i,At(t[i])))}),r),ys=(r,t,e)=>{let n=r.slice(0,0),i=0;return[r,t].forEach(o=>{let s=[];for(let u=0;u<o.length;u++)!qr.call(o,u)||(s.push(String(u)),o===r?xt(n,i++,o[u]):xt(n,i++,At(o[u])));n=Wr(n,o,se(o).filter(u=>!s.includes(u)),e)}),n};function Ce(r,t,e){return e.concatArrays&&Array.isArray(r)&&Array.isArray(t)?ys(r,t,e):!oe(t)||!oe(r)?At(t):Wr(r,t,se(t),e)}Kr.exports=function(...r){let t=Ce(At(Gr),this!==ls&&this||{},Gr),e={_:{}};for(let n of r)if(n!==void 0){if(!oe(n))throw new TypeError("`"+n+"` is not an Option Object");e=Ce(e,{_:n},t)}return e._}});var ln=I((Gt,fe)=>{(function(r,t){"use strict";var e={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function n(c){if(!Array.isArray(c)&&!ArrayBuffer.isView(c))return!1;for(var p=0;p<c.length;p++)if(!Number.isInteger(c[p])||c[p]<0||c[p]>255)return!1;return!0}function i(c,p){return(c&65535)*p+(((c>>>16)*p&65535)<<16)}function o(c,p){return c<<p|c>>>32-p}function s(c){return c^=c>>>16,c=i(c,2246822507),c^=c>>>13,c=i(c,3266489909),c^=c>>>16,c}function u(c,p){c=[c[0]>>>16,c[0]&65535,c[1]>>>16,c[1]&65535],p=[p[0]>>>16,p[0]&65535,p[1]>>>16,p[1]&65535];var g=[0,0,0,0];return g[3]+=c[3]+p[3],g[2]+=g[3]>>>16,g[3]&=65535,g[2]+=c[2]+p[2],g[1]+=g[2]>>>16,g[2]&=65535,g[1]+=c[1]+p[1],g[0]+=g[1]>>>16,g[1]&=65535,g[0]+=c[0]+p[0],g[0]&=65535,[g[0]<<16|g[1],g[2]<<16|g[3]]}function a(c,p){c=[c[0]>>>16,c[0]&65535,c[1]>>>16,c[1]&65535],p=[p[0]>>>16,p[0]&65535,p[1]>>>16,p[1]&65535];var g=[0,0,0,0];return g[3]+=c[3]*p[3],g[2]+=g[3]>>>16,g[3]&=65535,g[2]+=c[2]*p[3],g[1]+=g[2]>>>16,g[2]&=65535,g[2]+=c[3]*p[2],g[1]+=g[2]>>>16,g[2]&=65535,g[1]+=c[1]*p[3],g[0]+=g[1]>>>16,g[1]&=65535,g[1]+=c[2]*p[2],g[0]+=g[1]>>>16,g[1]&=65535,g[1]+=c[3]*p[1],g[0]+=g[1]>>>16,g[1]&=65535,g[0]+=c[0]*p[3]+c[1]*p[2]+c[2]*p[1]+c[3]*p[0],g[0]&=65535,[g[0]<<16|g[1],g[2]<<16|g[3]]}function h(c,p){return p%=64,p===32?[c[1],c[0]]:p<32?[c[0]<<p|c[1]>>>32-p,c[1]<<p|c[0]>>>32-p]:(p-=32,[c[1]<<p|c[0]>>>32-p,c[0]<<p|c[1]>>>32-p])}function f(c,p){return p%=64,p===0?c:p<32?[c[0]<<p|c[1]>>>32-p,c[1]<<p]:[c[1]<<p-32,0]}function d(c,p){return[c[0]^p[0],c[1]^p[1]]}function A(c){return c=d(c,[0,c[0]>>>1]),c=a(c,[4283543511,3981806797]),c=d(c,[0,c[0]>>>1]),c=a(c,[3301882366,444984403]),c=d(c,[0,c[0]>>>1]),c}e.x86.hash32=function(c,p){if(e.inputValidation&&!n(c))return t;p=p||0;for(var g=c.length%4,k=c.length-g,m=p,D=0,b=3432918353,_=461845907,F=0;F<k;F=F+4)D=c[F]|c[F+1]<<8|c[F+2]<<16|c[F+3]<<24,D=i(D,b),D=o(D,15),D=i(D,_),m^=D,m=o(m,13),m=i(m,5)+3864292196;switch(D=0,g){case 3:D^=c[F+2]<<16;case 2:D^=c[F+1]<<8;case 1:D^=c[F],D=i(D,b),D=o(D,15),D=i(D,_),m^=D}return m^=c.length,m=s(m),m>>>0},e.x86.hash128=function(c,p){if(e.inputValidation&&!n(c))return t;p=p||0;for(var g=c.length%16,k=c.length-g,m=p,D=p,b=p,_=p,F=0,w=0,y=0,E=0,S=597399067,N=2869860233,v=951274213,W=2716044179,C=0;C<k;C=C+16)F=c[C]|c[C+1]<<8|c[C+2]<<16|c[C+3]<<24,w=c[C+4]|c[C+5]<<8|c[C+6]<<16|c[C+7]<<24,y=c[C+8]|c[C+9]<<8|c[C+10]<<16|c[C+11]<<24,E=c[C+12]|c[C+13]<<8|c[C+14]<<16|c[C+15]<<24,F=i(F,S),F=o(F,15),F=i(F,N),m^=F,m=o(m,19),m+=D,m=i(m,5)+1444728091,w=i(w,N),w=o(w,16),w=i(w,v),D^=w,D=o(D,17),D+=b,D=i(D,5)+197830471,y=i(y,v),y=o(y,17),y=i(y,W),b^=y,b=o(b,15),b+=_,b=i(b,5)+2530024501,E=i(E,W),E=o(E,18),E=i(E,S),_^=E,_=o(_,13),_+=m,_=i(_,5)+850148119;switch(F=0,w=0,y=0,E=0,g){case 15:E^=c[C+14]<<16;case 14:E^=c[C+13]<<8;case 13:E^=c[C+12],E=i(E,W),E=o(E,18),E=i(E,S),_^=E;case 12:y^=c[C+11]<<24;case 11:y^=c[C+10]<<16;case 10:y^=c[C+9]<<8;case 9:y^=c[C+8],y=i(y,v),y=o(y,17),y=i(y,W),b^=y;case 8:w^=c[C+7]<<24;case 7:w^=c[C+6]<<16;case 6:w^=c[C+5]<<8;case 5:w^=c[C+4],w=i(w,N),w=o(w,16),w=i(w,v),D^=w;case 4:F^=c[C+3]<<24;case 3:F^=c[C+2]<<16;case 2:F^=c[C+1]<<8;case 1:F^=c[C],F=i(F,S),F=o(F,15),F=i(F,N),m^=F}return m^=c.length,D^=c.length,b^=c.length,_^=c.length,m+=D,m+=b,m+=_,D+=m,b+=m,_+=m,m=s(m),D=s(D),b=s(b),_=s(_),m+=D,m+=b,m+=_,D+=m,b+=m,_+=m,("00000000"+(m>>>0).toString(16)).slice(-8)+("00000000"+(D>>>0).toString(16)).slice(-8)+("00000000"+(b>>>0).toString(16)).slice(-8)+("00000000"+(_>>>0).toString(16)).slice(-8)},e.x64.hash128=function(c,p){if(e.inputValidation&&!n(c))return t;p=p||0;for(var g=c.length%16,k=c.length-g,m=[0,p],D=[0,p],b=[0,0],_=[0,0],F=[2277735313,289559509],w=[1291169091,658871167],y=0;y<k;y=y+16)b=[c[y+4]|c[y+5]<<8|c[y+6]<<16|c[y+7]<<24,c[y]|c[y+1]<<8|c[y+2]<<16|c[y+3]<<24],_=[c[y+12]|c[y+13]<<8|c[y+14]<<16|c[y+15]<<24,c[y+8]|c[y+9]<<8|c[y+10]<<16|c[y+11]<<24],b=a(b,F),b=h(b,31),b=a(b,w),m=d(m,b),m=h(m,27),m=u(m,D),m=u(a(m,[0,5]),[0,1390208809]),_=a(_,w),_=h(_,33),_=a(_,F),D=d(D,_),D=h(D,31),D=u(D,m),D=u(a(D,[0,5]),[0,944331445]);switch(b=[0,0],_=[0,0],g){case 15:_=d(_,f([0,c[y+14]],48));case 14:_=d(_,f([0,c[y+13]],40));case 13:_=d(_,f([0,c[y+12]],32));case 12:_=d(_,f([0,c[y+11]],24));case 11:_=d(_,f([0,c[y+10]],16));case 10:_=d(_,f([0,c[y+9]],8));case 9:_=d(_,[0,c[y+8]]),_=a(_,w),_=h(_,33),_=a(_,F),D=d(D,_);case 8:b=d(b,f([0,c[y+7]],56));case 7:b=d(b,f([0,c[y+6]],48));case 6:b=d(b,f([0,c[y+5]],40));case 5:b=d(b,f([0,c[y+4]],32));case 4:b=d(b,f([0,c[y+3]],24));case 3:b=d(b,f([0,c[y+2]],16));case 2:b=d(b,f([0,c[y+1]],8));case 1:b=d(b,[0,c[y]]),b=a(b,F),b=h(b,31),b=a(b,w),m=d(m,b)}return m=d(m,[0,c.length]),D=d(D,[0,c.length]),m=u(m,D),D=u(D,m),m=A(m),D=A(D),m=u(m,D),D=u(D,m),("00000000"+(m[0]>>>0).toString(16)).slice(-8)+("00000000"+(m[1]>>>0).toString(16)).slice(-8)+("00000000"+(D[0]>>>0).toString(16)).slice(-8)+("00000000"+(D[1]>>>0).toString(16)).slice(-8)},typeof Gt<"u"?(typeof fe<"u"&&fe.exports&&(Gt=fe.exports=e),Gt.murmurHash3=e):typeof define=="function"&&define.amd?define([],function(){return e}):(e._murmurHash3=r.murmurHash3,e.noConflict=function(){return r.murmurHash3=e._murmurHash3,e._murmurHash3=t,e.noConflict=t,e},r.murmurHash3=e)})(Gt)});var dn=I((Hu,pn)=>{pn.exports=ln()});var Lt=I((Xu,Dn)=>{"use strict";function gn(r,t){for(let e in t)Object.defineProperty(r,e,{value:t[e],enumerable:!0,configurable:!0});return r}function u1(r,t,e){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");e||(e={}),typeof t=="object"&&(e=t,t=""),t&&(e.code=t);try{return gn(r,e)}catch{e.message=r.message,e.stack=r.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(r)),gn(new i,e)}}Dn.exports=u1});var bn=I((Qu,wn)=>{"use strict";wn.exports=c1;function c1(r,t){for(var e=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)e[n++]=arguments[i++];return new Promise(function(u,a){e[n]=function(f){if(o)if(o=!1,f)a(f);else{for(var d=new Array(arguments.length-1),A=0;A<d.length;)d[A++]=arguments[A];u.apply(null,d)}};try{r.apply(t||null,e)}catch(h){o&&(o=!1,a(h))}})}});var An=I(xn=>{"use strict";var he=xn;he.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&t.charAt(e)==="=";)++n;return Math.ceil(t.length*3)/4-n};var Nt=new Array(64),En=new Array(123);for(Q=0;Q<64;)En[Nt[Q]=Q<26?Q+65:Q<52?Q+71:Q<62?Q-4:Q-59|43]=Q++;var Q;he.encode=function(t,e,n){for(var i=null,o=[],s=0,u=0,a;e<n;){var h=t[e++];switch(u){case 0:o[s++]=Nt[h>>2],a=(h&3)<<4,u=1;break;case 1:o[s++]=Nt[a|h>>4],a=(h&15)<<2,u=2;break;case 2:o[s++]=Nt[a|h>>6],o[s++]=Nt[h&63],u=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return u&&(o[s++]=Nt[a],o[s++]=61,u===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var _n="invalid encoding";he.decode=function(t,e,n){for(var i=n,o=0,s,u=0;u<t.length;){var a=t.charCodeAt(u++);if(a===61&&o>1)break;if((a=En[a])===void 0)throw Error(_n);switch(o){case 0:s=a,o=1;break;case 1:e[n++]=s<<2|(a&48)>>4,s=a,o=2;break;case 2:e[n++]=(s&15)<<4|(a&60)>>2,s=a,o=3;break;case 3:e[n++]=(s&3)<<6|a,o=0;break}}if(o===1)throw Error(_n);return n-i};he.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var Fn=I((e0,Bn)=>{"use strict";Bn.exports=le;function le(){this._listeners={}}le.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this};le.prototype.off=function(t,e){if(t===void 0)this._listeners={};else if(e===void 0)this._listeners[t]=[];else for(var n=this._listeners[t],i=0;i<n.length;)n[i].fn===e?n.splice(i,1):++i;return this};le.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<e.length;)e[i].fn.apply(e[i++].ctx,n)}return this}});var Nn=I((r0,Ln)=>{"use strict";Ln.exports=Sn(Sn);function Sn(r){return typeof Float32Array<"u"?function(){var t=new Float32Array([-0]),e=new Uint8Array(t.buffer),n=e[3]===128;function i(a,h,f){t[0]=a,h[f]=e[0],h[f+1]=e[1],h[f+2]=e[2],h[f+3]=e[3]}function o(a,h,f){t[0]=a,h[f]=e[3],h[f+1]=e[2],h[f+2]=e[1],h[f+3]=e[0]}r.writeFloatLE=n?i:o,r.writeFloatBE=n?o:i;function s(a,h){return e[0]=a[h],e[1]=a[h+1],e[2]=a[h+2],e[3]=a[h+3],t[0]}function u(a,h){return e[3]=a[h],e[2]=a[h+1],e[1]=a[h+2],e[0]=a[h+3],t[0]}r.readFloatLE=n?s:u,r.readFloatBE=n?u:s}():function(){function t(n,i,o,s){var u=i<0?1:0;if(u&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((u<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((u<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var a=Math.floor(Math.log(i)/Math.LN2),h=Math.round(i*Math.pow(2,-a)*8388608)&8388607;n((u<<31|a+127<<23|h)>>>0,o,s)}}r.writeFloatLE=t.bind(null,Cn),r.writeFloatBE=t.bind(null,In);function e(n,i,o){var s=n(i,o),u=(s>>31)*2+1,a=s>>>23&255,h=s&8388607;return a===255?h?NaN:u*(1/0):a===0?u*1401298464324817e-60*h:u*Math.pow(2,a-150)*(h+8388608)}r.readFloatLE=e.bind(null,Tn),r.readFloatBE=e.bind(null,kn)}(),typeof Float64Array<"u"?function(){var t=new Float64Array([-0]),e=new Uint8Array(t.buffer),n=e[7]===128;function i(a,h,f){t[0]=a,h[f]=e[0],h[f+1]=e[1],h[f+2]=e[2],h[f+3]=e[3],h[f+4]=e[4],h[f+5]=e[5],h[f+6]=e[6],h[f+7]=e[7]}function o(a,h,f){t[0]=a,h[f]=e[7],h[f+1]=e[6],h[f+2]=e[5],h[f+3]=e[4],h[f+4]=e[3],h[f+5]=e[2],h[f+6]=e[1],h[f+7]=e[0]}r.writeDoubleLE=n?i:o,r.writeDoubleBE=n?o:i;function s(a,h){return e[0]=a[h],e[1]=a[h+1],e[2]=a[h+2],e[3]=a[h+3],e[4]=a[h+4],e[5]=a[h+5],e[6]=a[h+6],e[7]=a[h+7],t[0]}function u(a,h){return e[7]=a[h],e[6]=a[h+1],e[5]=a[h+2],e[4]=a[h+3],e[3]=a[h+4],e[2]=a[h+5],e[1]=a[h+6],e[0]=a[h+7],t[0]}r.readDoubleLE=n?s:u,r.readDoubleBE=n?u:s}():function(){function t(n,i,o,s,u,a){var h=s<0?1:0;if(h&&(s=-s),s===0)n(0,u,a+i),n(1/s>0?0:2147483648,u,a+o);else if(isNaN(s))n(0,u,a+i),n(2146959360,u,a+o);else if(s>17976931348623157e292)n(0,u,a+i),n((h<<31|2146435072)>>>0,u,a+o);else{var f;if(s<22250738585072014e-324)f=s/5e-324,n(f>>>0,u,a+i),n((h<<31|f/4294967296)>>>0,u,a+o);else{var d=Math.floor(Math.log(s)/Math.LN2);d===1024&&(d=1023),f=s*Math.pow(2,-d),n(f*4503599627370496>>>0,u,a+i),n((h<<31|d+1023<<20|f*1048576&1048575)>>>0,u,a+o)}}}r.writeDoubleLE=t.bind(null,Cn,0,4),r.writeDoubleBE=t.bind(null,In,4,0);function e(n,i,o,s,u){var a=n(s,u+i),h=n(s,u+o),f=(h>>31)*2+1,d=h>>>20&2047,A=4294967296*(h&1048575)+a;return d===2047?A?NaN:f*(1/0):d===0?f*5e-324*A:f*Math.pow(2,d-1075)*(A+4503599627370496)}r.readDoubleLE=e.bind(null,Tn,0,4),r.readDoubleBE=e.bind(null,kn,4,0)}(),r}function Cn(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}function In(r,t,e){t[e]=r>>>24,t[e+1]=r>>>16&255,t[e+2]=r>>>8&255,t[e+3]=r&255}function Tn(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24)>>>0}function kn(r,t){return(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3])>>>0}});var Un=I((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var zn=I(On=>{"use strict";var Ve=On;Ve.length=function(t){for(var e=0,n=0,i=0;i<t.length;++i)n=t.charCodeAt(i),n<128?e+=1:n<2048?e+=2:(n&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320?(++i,e+=4):e+=3;return e};Ve.read=function(t,e,n){var i=n-e;if(i<1)return"";for(var o=null,s=[],u=0,a;e<n;)a=t[e++],a<128?s[u++]=a:a>191&&a<224?s[u++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[u++]=55296+(a>>10),s[u++]=56320+(a&1023)):s[u++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,u>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),u=0);return o?(u&&o.push(String.fromCharCode.apply(String,s.slice(0,u))),o.join("")):String.fromCharCode.apply(String,s.slice(0,u))};Ve.write=function(t,e,n){for(var i=n,o,s,u=0;u<t.length;++u)o=t.charCodeAt(u),o<128?e[n++]=o:o<2048?(e[n++]=o>>6|192,e[n++]=o&63|128):(o&64512)===55296&&((s=t.charCodeAt(u+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++u,e[n++]=o>>18|240,e[n++]=o>>12&63|128,e[n++]=o>>6&63|128,e[n++]=o&63|128):(e[n++]=o>>12|224,e[n++]=o>>6&63|128,e[n++]=o&63|128);return n-i}});var Pn=I((i0,vn)=>{"use strict";vn.exports=f1;function f1(r,t,e){var n=e||8192,i=n>>>1,o=null,s=n;return function(a){if(a<1||a>i)return r(a);s+a>n&&(o=r(n),s=0);var h=t.call(o,s,s+=a);return s&7&&(s=(s|7)+1),h}}});var Mn=I((o0,Rn)=>{"use strict";Rn.exports=P;var qt=pt();function P(r,t){this.lo=r>>>0,this.hi=t>>>0}var wt=P.zero=new P(0,0);wt.toNumber=function(){return 0};wt.zzEncode=wt.zzDecode=function(){return this};wt.length=function(){return 1};var h1=P.zeroHash="\0\0\0\0\0\0\0\0";P.fromNumber=function(t){if(t===0)return wt;var e=t<0;e&&(t=-t);var n=t>>>0,i=(t-n)/4294967296>>>0;return e&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new P(n,i)};P.from=function(t){if(typeof t=="number")return P.fromNumber(t);if(qt.isString(t))if(qt.Long)t=qt.Long.fromString(t);else return P.fromNumber(parseInt(t,10));return t.low||t.high?new P(t.low>>>0,t.high>>>0):wt};P.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+n*4294967296)}return this.lo+this.hi*4294967296};P.prototype.toLong=function(t){return qt.Long?new qt.Long(this.lo|0,this.hi|0,Boolean(t)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(t)}};var lt=String.prototype.charCodeAt;P.fromHash=function(t){return t===h1?wt:new P((lt.call(t,0)|lt.call(t,1)<<8|lt.call(t,2)<<16|lt.call(t,3)<<24)>>>0,(lt.call(t,4)|lt.call(t,5)<<8|lt.call(t,6)<<16|lt.call(t,7)<<24)>>>0)};P.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};P.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};P.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};P.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?e===0?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}});var pt=I(He=>{"use strict";var x=He;x.asPromise=bn();x.base64=An();x.EventEmitter=Fn();x.float=Nn();x.inquire=Un();x.utf8=zn();x.pool=Pn();x.LongBits=Mn();x.isNode=Boolean(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);x.global=x.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||He;x.emptyArray=Object.freeze?Object.freeze([]):[];x.emptyObject=Object.freeze?Object.freeze({}):{};x.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};x.isString=function(t){return typeof t=="string"||t instanceof String};x.isObject=function(t){return t&&typeof t=="object"};x.isset=x.isSet=function(t,e){var n=t[e];return n!=null&&t.hasOwnProperty(e)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};x.Buffer=function(){try{var r=x.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();x._Buffer_from=null;x._Buffer_allocUnsafe=null;x.newBuffer=function(t){return typeof t=="number"?x.Buffer?x._Buffer_allocUnsafe(t):new x.Array(t):x.Buffer?x._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};x.Array=typeof Uint8Array<"u"?Uint8Array:Array;x.Long=x.global.dcodeIO&&x.global.dcodeIO.Long||x.global.Long||x.inquire("long");x.key2Re=/^true|false|0|1$/;x.key32Re=/^-?(?:0|[1-9][0-9]*)$/;x.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;x.longToHash=function(t){return t?x.LongBits.from(t).toHash():x.LongBits.zeroHash};x.longFromHash=function(t,e){var n=x.LongBits.fromHash(t);return x.Long?x.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))};function jn(r,t,e){for(var n=Object.keys(t),i=0;i<n.length;++i)(r[n[i]]===void 0||!e)&&(r[n[i]]=t[n[i]]);return r}x.merge=jn;x.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)};function Vn(r){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&jn(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}x.newError=Vn;x.ProtocolError=Vn("ProtocolError");x.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(e[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};x.oneOfSetter=function(t){return function(e){for(var n=0;n<t.length;++n)t[n]!==e&&delete this[t[n]]}};x.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};x._configure=function(){var r=x.Buffer;if(!r){x._Buffer_from=x._Buffer_allocUnsafe=null;return}x._Buffer_from=r.from!==Uint8Array.from&&r.from||function(e,n){return new r(e,n)},x._Buffer_allocUnsafe=r.allocUnsafe||function(e){return new r(e)}}});var Je=I((a0,qn)=>{"use strict";qn.exports=T;var K=pt(),$e,pe=K.LongBits,Hn=K.base64,$n=K.utf8;function Wt(r,t,e){this.fn=r,this.len=t,this.next=void 0,this.val=e}function qe(){}function l1(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function T(){this.len=0,this.head=new Wt(qe,0,0),this.tail=this.head,this.states=null}var Gn=function(){return K.Buffer?function(){return(T.create=function(){return new $e})()}:function(){return new T}};T.create=Gn();T.alloc=function(t){return new K.Array(t)};K.Array!==Array&&(T.alloc=K.pool(T.alloc,K.Array.prototype.subarray));T.prototype._push=function(t,e,n){return this.tail=this.tail.next=new Wt(t,e,n),this.len+=e,this};function We(r,t,e){t[e]=r&255}function p1(r,t,e){for(;r>127;)t[e++]=r&127|128,r>>>=7;t[e]=r}function Ye(r,t){this.len=r,this.next=void 0,this.val=t}Ye.prototype=Object.create(Wt.prototype);Ye.prototype.fn=p1;T.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new Ye((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};T.prototype.int32=function(t){return t<0?this._push(Ke,10,pe.fromNumber(t)):this.uint32(t)};T.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function Ke(r,t,e){for(;r.hi;)t[e++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)t[e++]=r.lo&127|128,r.lo=r.lo>>>7;t[e++]=r.lo}T.prototype.uint64=function(t){var e=pe.from(t);return this._push(Ke,e.length(),e)};T.prototype.int64=T.prototype.uint64;T.prototype.sint64=function(t){var e=pe.from(t).zzEncode();return this._push(Ke,e.length(),e)};T.prototype.bool=function(t){return this._push(We,1,t?1:0)};function Ge(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}T.prototype.fixed32=function(t){return this._push(Ge,4,t>>>0)};T.prototype.sfixed32=T.prototype.fixed32;T.prototype.fixed64=function(t){var e=pe.from(t);return this._push(Ge,4,e.lo)._push(Ge,4,e.hi)};T.prototype.sfixed64=T.prototype.fixed64;T.prototype.float=function(t){return this._push(K.float.writeFloatLE,4,t)};T.prototype.double=function(t){return this._push(K.float.writeDoubleLE,8,t)};var d1=K.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var i=0;i<t.length;++i)e[n+i]=t[i]};T.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(We,1,0);if(K.isString(t)){var n=T.alloc(e=Hn.length(t));Hn.decode(t,n,0),t=n}return this.uint32(e)._push(d1,e,t)};T.prototype.string=function(t){var e=$n.length(t);return e?this.uint32(e)._push($n.write,e,t):this._push(We,1,0)};T.prototype.fork=function(){return this.states=new l1(this),this.head=this.tail=new Wt(qe,0,0),this.len=0,this};T.prototype.reset=function(){return this.states?(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(qe,0,0),this.len=0),this};T.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this};T.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e};T._configure=function(r){$e=r,T.create=Gn(),$e._configure()}});var Kn=I((u0,Yn)=>{"use strict";Yn.exports=it;var Wn=Je();(it.prototype=Object.create(Wn.prototype)).constructor=it;var dt=pt();function it(){Wn.call(this)}it._configure=function(){it.alloc=dt._Buffer_allocUnsafe,it.writeBytesBuffer=dt.Buffer&&dt.Buffer.prototype instanceof Uint8Array&&dt.Buffer.prototype.set.name==="set"?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var i=0;i<t.length;)e[n++]=t[i++]}};it.prototype.bytes=function(t){dt.isString(t)&&(t=dt._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(it.writeBytesBuffer,e,t),this};function y1(r,t,e){r.length<40?dt.utf8.write(r,t,e):t.utf8Write?t.utf8Write(r,e):t.write(r,e)}it.prototype.string=function(t){var e=dt.Buffer.byteLength(t);return this.uint32(e),e&&this._push(y1,e,t),this};it._configure()});var Qe=I((c0,ti)=>{"use strict";ti.exports=z;var ot=pt(),Xe,Xn=ot.LongBits,m1=ot.utf8;function tt(r,t){return RangeError("index out of range: "+r.pos+" + "+(t||1)+" > "+r.len)}function z(r){this.buf=r,this.pos=0,this.len=r.length}var Jn=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new z(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new z(t);throw Error("illegal buffer")},Qn=function(){return ot.Buffer?function(e){return(z.create=function(i){return ot.Buffer.isBuffer(i)?new Xe(i):Jn(i)})(e)}:Jn};z.create=Qn();z.prototype._slice=ot.Array.prototype.subarray||ot.Array.prototype.slice;z.prototype.uint32=function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,tt(this,10);return t}}();z.prototype.int32=function(){return this.uint32()|0};z.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function Ze(){var r=new Xn(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw tt(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,r}if(this.len-this.pos>4){for(;t<5;++t)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;t<5;++t){if(this.pos>=this.len)throw tt(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}z.prototype.bool=function(){return this.uint32()!==0};function de(r,t){return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0}z.prototype.fixed32=function(){if(this.pos+4>this.len)throw tt(this,4);return de(this.buf,this.pos+=4)};z.prototype.sfixed32=function(){if(this.pos+4>this.len)throw tt(this,4);return de(this.buf,this.pos+=4)|0};function Zn(){if(this.pos+8>this.len)throw tt(this,8);return new Xn(de(this.buf,this.pos+=4),de(this.buf,this.pos+=4))}z.prototype.float=function(){if(this.pos+4>this.len)throw tt(this,4);var t=ot.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};z.prototype.double=function(){if(this.pos+8>this.len)throw tt(this,4);var t=ot.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};z.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw tt(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,n):e===n?new this.buf.constructor(0):this._slice.call(this.buf,e,n)};z.prototype.string=function(){var t=this.bytes();return m1.read(t,0,t.length)};z.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw tt(this,t);this.pos+=t}else do if(this.pos>=this.len)throw tt(this);while(this.buf[this.pos++]&128);return this};z.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};z._configure=function(r){Xe=r,z.create=Qn(),Xe._configure();var t=ot.Long?"toLong":"toNumber";ot.merge(z.prototype,{int64:function(){return Ze.call(this)[t](!1)},uint64:function(){return Ze.call(this)[t](!0)},sint64:function(){return Ze.call(this).zzDecode()[t](!1)},fixed64:function(){return Zn.call(this)[t](!0)},sfixed64:function(){return Zn.call(this)[t](!1)}})}});var ii=I((f0,ni)=>{"use strict";ni.exports=bt;var ri=Qe();(bt.prototype=Object.create(ri.prototype)).constructor=bt;var ei=pt();function bt(r){ri.call(this,r)}bt._configure=function(){ei.Buffer&&(bt.prototype._slice=ei.Buffer.prototype.slice)};bt.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};bt._configure()});var si=I((h0,oi)=>{"use strict";oi.exports=Yt;var tr=pt();(Yt.prototype=Object.create(tr.EventEmitter.prototype)).constructor=Yt;function Yt(r,t,e){if(typeof r!="function")throw TypeError("rpcImpl must be a function");tr.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(e)}Yt.prototype.rpcCall=function r(t,e,n,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return tr.asPromise(r,s,t,e,n,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(t,e[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(a,h){if(a)return s.emit("error",a,t),o(a);if(h===null){s.end(!0);return}if(!(h instanceof n))try{h=n[s.responseDelimited?"decodeDelimited":"decode"](h)}catch(f){return s.emit("error",f,t),o(f)}return s.emit("data",h,t),o(null,h)})}catch(u){s.emit("error",u,t),setTimeout(function(){o(u)},0);return}};Yt.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var ui=I(ai=>{"use strict";var g1=ai;g1.Service=si()});var fi=I((p0,ci)=>{"use strict";ci.exports={}});var pi=I(li=>{"use strict";var G=li;G.build="minimal";G.Writer=Je();G.BufferWriter=Kn();G.Reader=Qe();G.BufferReader=ii();G.util=pt();G.rpc=ui();G.roots=fi();G.configure=hi;function hi(){G.util._configure(),G.Writer._configure(G.BufferWriter),G.Reader._configure(G.BufferReader)}hi()});var yi=I((y0,di)=>{"use strict";di.exports=pi()});var Ni=I((O0,Li)=>{"use strict";var P1=async r=>{let t=[];for await(let e of r)t.push(e);return t};Li.exports=P1});var Wi=I(we=>{"use strict";we.byteLength=Y1;we.toByteArray=J1;we.fromByteArray=Q1;var st=[],X=[],W1=typeof Uint8Array<"u"?Uint8Array:Array,ar="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(_t=0,Gi=ar.length;_t<Gi;++_t)st[_t]=ar[_t],X[ar.charCodeAt(_t)]=_t;var _t,Gi;X["-".charCodeAt(0)]=62;X["_".charCodeAt(0)]=63;function qi(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function Y1(r){var t=qi(r),e=t[0],n=t[1];return(e+n)*3/4-n}function K1(r,t,e){return(t+e)*3/4-e}function J1(r){var t,e=qi(r),n=e[0],i=e[1],o=new W1(K1(r,n,i)),s=0,u=i>0?n-4:n,a;for(a=0;a<u;a+=4)t=X[r.charCodeAt(a)]<<18|X[r.charCodeAt(a+1)]<<12|X[r.charCodeAt(a+2)]<<6|X[r.charCodeAt(a+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=X[r.charCodeAt(a)]<<2|X[r.charCodeAt(a+1)]>>4,o[s++]=t&255),i===1&&(t=X[r.charCodeAt(a)]<<10|X[r.charCodeAt(a+1)]<<4|X[r.charCodeAt(a+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function Z1(r){return st[r>>18&63]+st[r>>12&63]+st[r>>6&63]+st[r&63]}function X1(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(Z1(n));return i.join("")}function Q1(r){for(var t,e=r.length,n=e%3,i=[],o=16383,s=0,u=e-n;s<u;s+=o)i.push(X1(r,s,s+o>u?u:s+o));return n===1?(t=r[e-1],i.push(st[t>>2]+st[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],i.push(st[t>>10]+st[t>>4&63]+st[t<<2&63]+"=")),i.join("")}});var Yi=I(ur=>{ur.read=function(r,t,e,n,i){var o,s,u=i*8-n-1,a=(1<<u)-1,h=a>>1,f=-7,d=e?i-1:0,A=e?-1:1,c=r[t+d];for(d+=A,o=c&(1<<-f)-1,c>>=-f,f+=u;f>0;o=o*256+r[t+d],d+=A,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[t+d],d+=A,f-=8);if(o===0)o=1-h;else{if(o===a)return s?NaN:(c?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-h}return(c?-1:1)*s*Math.pow(2,o-n)};ur.write=function(r,t,e,n,i,o){var s,u,a,h=o*8-i-1,f=(1<<h)-1,d=f>>1,A=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=n?0:o-1,p=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-s))<1&&(s--,a*=2),s+d>=1?t+=A/a:t+=A*Math.pow(2,1-d),t*a>=2&&(s++,a/=2),s+d>=f?(u=0,s=f):s+d>=1?(u=(t*a-1)*Math.pow(2,i),s=s+d):(u=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;r[e+c]=u&255,c+=p,u/=256,i-=8);for(s=s<<i|u,h+=i;h>0;r[e+c]=s&255,c+=p,s/=256,h-=8);r[e+c-p]|=g*128}});var ho=I(Rt=>{"use strict";var cr=Wi(),vt=Yi(),Ki=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Rt.Buffer=l;Rt.SlowBuffer=oa;Rt.INSPECT_MAX_BYTES=50;var be=2147483647;Rt.kMaxLength=be;l.TYPED_ARRAY_SUPPORT=ta();!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ta(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(!!l.isBuffer(this))return this.buffer}});Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(!!l.isBuffer(this))return this.byteOffset}});function ft(r){if(r>be)throw new RangeError('The value "'+r+'" is invalid for option "size"');let t=new Uint8Array(r);return Object.setPrototypeOf(t,l.prototype),t}function l(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return pr(r)}return Qi(r,t,e)}l.poolSize=8192;function Qi(r,t,e){if(typeof r=="string")return ra(r,t);if(ArrayBuffer.isView(r))return na(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(at(r,ArrayBuffer)||r&&at(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(at(r,SharedArrayBuffer)||r&&at(r.buffer,SharedArrayBuffer)))return hr(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return l.from(n,t,e);let i=ia(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return l.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}l.from=function(r,t,e){return Qi(r,t,e)};Object.setPrototypeOf(l.prototype,Uint8Array.prototype);Object.setPrototypeOf(l,Uint8Array);function to(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function ea(r,t,e){return to(r),r<=0?ft(r):t!==void 0?typeof e=="string"?ft(r).fill(t,e):ft(r).fill(t):ft(r)}l.alloc=function(r,t,e){return ea(r,t,e)};function pr(r){return to(r),ft(r<0?0:dr(r)|0)}l.allocUnsafe=function(r){return pr(r)};l.allocUnsafeSlow=function(r){return pr(r)};function ra(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=eo(r,t)|0,n=ft(e),i=n.write(r,t);return i!==e&&(n=n.slice(0,i)),n}function fr(r){let t=r.length<0?0:dr(r.length)|0,e=ft(t);for(let n=0;n<t;n+=1)e[n]=r[n]&255;return e}function na(r){if(at(r,Uint8Array)){let t=new Uint8Array(r);return hr(t.buffer,t.byteOffset,t.byteLength)}return fr(r)}function hr(r,t,e){if(t<0||r.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&e===void 0?n=new Uint8Array(r):e===void 0?n=new Uint8Array(r,t):n=new Uint8Array(r,t,e),Object.setPrototypeOf(n,l.prototype),n}function ia(r){if(l.isBuffer(r)){let t=dr(r.length)|0,e=ft(t);return e.length===0||r.copy(e,0,0,t),e}if(r.length!==void 0)return typeof r.length!="number"||mr(r.length)?ft(0):fr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return fr(r.data)}function dr(r){if(r>=be)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+be.toString(16)+" bytes");return r|0}function oa(r){return+r!=r&&(r=0),l.alloc(+r)}l.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==l.prototype};l.compare=function(t,e){if(at(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),at(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,i=e.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return l.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;let i=l.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){let s=t[n];if(at(s,Uint8Array))o+s.length>i.length?(l.isBuffer(s)||(s=l.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(l.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function eo(r,t){if(l.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||at(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return lr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return fo(r).length;default:if(i)return n?-1:lr(r).length;t=(""+t).toLowerCase(),i=!0}}l.byteLength=eo;function sa(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return ma(this,t,e);case"utf8":case"utf-8":return no(this,t,e);case"ascii":return da(this,t,e);case"latin1":case"binary":return ya(this,t,e);case"base64":return la(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ga(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}l.prototype._isBuffer=!0;function Et(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}l.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)Et(this,e,e+1);return this};l.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)Et(this,e,e+3),Et(this,e+1,e+2);return this};l.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)Et(this,e,e+7),Et(this,e+1,e+6),Et(this,e+2,e+5),Et(this,e+3,e+4);return this};l.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?no(this,0,t):sa.apply(this,arguments)};l.prototype.toLocaleString=l.prototype.toString;l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:l.compare(this,t)===0};l.prototype.inspect=function(){let t="",e=Rt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"};Ki&&(l.prototype[Ki]=l.prototype.inspect);l.prototype.compare=function(t,e,n,i,o){if(at(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let s=o-i,u=n-e,a=Math.min(s,u),h=this.slice(i,o),f=t.slice(e,n);for(let d=0;d<a;++d)if(h[d]!==f[d]){s=h[d],u=f[d];break}return s<u?-1:u<s?1:0};function ro(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,mr(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=l.from(t,n)),l.isBuffer(t))return t.length===0?-1:Ji(r,t,e,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Ji(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Ji(r,t,e,n,i){let o=1,s=r.length,u=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,s/=2,u/=2,e/=2}function a(f,d){return o===1?f[d]:f.readUInt16BE(d*o)}let h;if(i){let f=-1;for(h=e;h<s;h++)if(a(r,h)===a(t,f===-1?0:h-f)){if(f===-1&&(f=h),h-f+1===u)return f*o}else f!==-1&&(h-=h-f),f=-1}else for(e+u>s&&(e=s-u),h=e;h>=0;h--){let f=!0;for(let d=0;d<u;d++)if(a(r,h+d)!==a(t,d)){f=!1;break}if(f)return h}return-1}l.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};l.prototype.indexOf=function(t,e,n){return ro(this,t,e,n,!0)};l.prototype.lastIndexOf=function(t,e,n){return ro(this,t,e,n,!1)};function aa(r,t,e,n){e=Number(e)||0;let i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let u=parseInt(t.substr(s*2,2),16);if(mr(u))return s;r[e+s]=u}return s}function ua(r,t,e,n){return _e(lr(t,r.length-e),r,e,n)}function ca(r,t,e,n){return _e(_a(t),r,e,n)}function fa(r,t,e,n){return _e(fo(t),r,e,n)}function ha(r,t,e,n){return _e(Ea(t,r.length-e),r,e,n)}l.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return aa(this,t,e,n);case"utf8":case"utf-8":return ua(this,t,e,n);case"ascii":case"latin1":case"binary":return ca(this,t,e,n);case"base64":return fa(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ha(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function la(r,t,e){return t===0&&e===r.length?cr.fromByteArray(r):cr.fromByteArray(r.slice(t,e))}function no(r,t,e){e=Math.min(r.length,e);let n=[],i=t;for(;i<e;){let o=r[i],s=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=e){let a,h,f,d;switch(u){case 1:o<128&&(s=o);break;case 2:a=r[i+1],(a&192)===128&&(d=(o&31)<<6|a&63,d>127&&(s=d));break;case 3:a=r[i+1],h=r[i+2],(a&192)===128&&(h&192)===128&&(d=(o&15)<<12|(a&63)<<6|h&63,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:a=r[i+1],h=r[i+2],f=r[i+3],(a&192)===128&&(h&192)===128&&(f&192)===128&&(d=(o&15)<<18|(a&63)<<12|(h&63)<<6|f&63,d>65535&&d<1114112&&(s=d))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=u}return pa(n)}var Zi=4096;function pa(r){let t=r.length;if(t<=Zi)return String.fromCharCode.apply(String,r);let e="",n=0;for(;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Zi));return e}function da(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function ya(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function ma(r,t,e){let n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);let i="";for(let o=t;o<e;++o)i+=xa[r[o]];return i}function ga(r,t,e){let n=r.slice(t,e),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}l.prototype.slice=function(t,e){let n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,l.prototype),i};function R(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let i=this[t],o=1,s=0;for(;++s<e&&(o*=256);)i+=this[t+s]*o;return i};l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let i=this[t+--e],o=1;for(;e>0&&(o*=256);)i+=this[t+--e]*o;return i};l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t=t>>>0,e||R(t,1,this.length),this[t]};l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||R(t,2,this.length),this[t]|this[t+1]<<8};l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||R(t,2,this.length),this[t]<<8|this[t+1]};l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};l.prototype.readBigUInt64LE=mt(function(t){t=t>>>0,Pt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Zt(t,this.length-8);let i=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});l.prototype.readBigUInt64BE=mt(function(t){t=t>>>0,Pt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Zt(t,this.length-8);let i=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});l.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let i=this[t],o=1,s=0;for(;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};l.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let i=e,o=1,s=this[t+--i];for(;i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};l.prototype.readInt8=function(t,e){return t=t>>>0,e||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};l.prototype.readInt16LE=function(t,e){t=t>>>0,e||R(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};l.prototype.readInt16BE=function(t,e){t=t>>>0,e||R(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};l.prototype.readInt32LE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};l.prototype.readInt32BE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};l.prototype.readBigInt64LE=mt(function(t){t=t>>>0,Pt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Zt(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});l.prototype.readBigInt64BE=mt(function(t){t=t>>>0,Pt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Zt(t,this.length-8);let i=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});l.prototype.readFloatLE=function(t,e){return t=t>>>0,e||R(t,4,this.length),vt.read(this,t,!0,23,4)};l.prototype.readFloatBE=function(t,e){return t=t>>>0,e||R(t,4,this.length),vt.read(this,t,!1,23,4)};l.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||R(t,8,this.length),vt.read(this,t,!0,52,8)};l.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||R(t,8,this.length),vt.read(this,t,!1,52,8)};function q(r,t,e,n,i,o){if(!l.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;q(this,t,e,n,u,0)}let o=1,s=0;for(this[e]=t&255;++s<n&&(o*=256);)this[e+s]=t/o&255;return e+n};l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;q(this,t,e,n,u,0)}let o=n-1,s=1;for(this[e+o]=t&255;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+n};l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,1,255,0),this[e]=t&255,e+1};l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function io(r,t,e,n,i){co(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=s,s=s>>8,r[e++]=s,s=s>>8,r[e++]=s,s=s>>8,r[e++]=s,e}function oo(r,t,e,n,i){co(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e+7]=o,o=o>>8,r[e+6]=o,o=o>>8,r[e+5]=o,o=o>>8,r[e+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=s,s=s>>8,r[e+2]=s,s=s>>8,r[e+1]=s,s=s>>8,r[e]=s,e+8}l.prototype.writeBigUInt64LE=mt(function(t,e=0){return io(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});l.prototype.writeBigUInt64BE=mt(function(t,e=0){return oo(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let a=Math.pow(2,8*n-1);q(this,t,e,n,a-1,-a)}let o=0,s=1,u=0;for(this[e]=t&255;++o<n&&(s*=256);)t<0&&u===0&&this[e+o-1]!==0&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+n};l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let a=Math.pow(2,8*n-1);q(this,t,e,n,a-1,-a)}let o=n-1,s=1,u=0;for(this[e+o]=t&255;--o>=0&&(s*=256);)t<0&&u===0&&this[e+o+1]!==0&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+n};l.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};l.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};l.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};l.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};l.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||q(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};l.prototype.writeBigInt64LE=mt(function(t,e=0){return io(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});l.prototype.writeBigInt64BE=mt(function(t,e=0){return oo(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function so(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ao(r,t,e,n,i){return t=+t,e=e>>>0,i||so(r,t,e,4,34028234663852886e22,-34028234663852886e22),vt.write(r,t,e,n,23,4),e+4}l.prototype.writeFloatLE=function(t,e,n){return ao(this,t,e,!0,n)};l.prototype.writeFloatBE=function(t,e,n){return ao(this,t,e,!1,n)};function uo(r,t,e,n,i){return t=+t,e=e>>>0,i||so(r,t,e,8,17976931348623157e292,-17976931348623157e292),vt.write(r,t,e,n,52,8),e+8}l.prototype.writeDoubleLE=function(t,e,n){return uo(this,t,e,!0,n)};l.prototype.writeDoubleBE=function(t,e,n){return uo(this,t,e,!1,n)};l.prototype.copy=function(t,e,n,i){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);let o=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),e),o};l.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let s=t.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{let s=l.isBuffer(t)?t:l.from(t,i),u=s.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=s[o%u]}return this};var zt={};function yr(r,t,e){zt[r]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}yr("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);yr("ERR_INVALID_ARG_TYPE",function(r,t){return`The "${r}" argument must be of type number. Received type ${typeof t}`},TypeError);yr("ERR_OUT_OF_RANGE",function(r,t,e){let n=`The value of "${r}" is out of range.`,i=e;return Number.isInteger(e)&&Math.abs(e)>2**32?i=Xi(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=Xi(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Xi(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function Da(r,t,e){Pt(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&Zt(t,r.length-(e+1))}function co(r,t,e,n,i,o){if(r>e||r<t){let s=typeof t=="bigint"?"n":"",u;throw o>3?t===0||t===BigInt(0)?u=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:u=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:u=`>= ${t}${s} and <= ${e}${s}`,new zt.ERR_OUT_OF_RANGE("value",u,r)}Da(n,i,o)}function Pt(r,t){if(typeof r!="number")throw new zt.ERR_INVALID_ARG_TYPE(t,"number",r)}function Zt(r,t,e){throw Math.floor(r)!==r?(Pt(r,e),new zt.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new zt.ERR_BUFFER_OUT_OF_BOUNDS:new zt.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}var wa=/[^+/0-9A-Za-z-_]/g;function ba(r){if(r=r.split("=")[0],r=r.trim().replace(wa,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function lr(r,t){t=t||1/0;let e,n=r.length,i=null,o=[];for(let s=0;s<n;++s){if(e=r.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function _a(r){let t=[];for(let e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function Ea(r,t){let e,n,i,o=[];for(let s=0;s<r.length&&!((t-=2)<0);++s)e=r.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function fo(r){return cr.toByteArray(ba(r))}function _e(r,t,e,n){let i;for(i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function at(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function mr(r){return r!==r}var xa=function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let i=0;i<16;++i)t[n+i]=r[e]+r[i]}return t}();function mt(r){return typeof BigInt>"u"?Aa:r}function Aa(){throw new Error("BigInt not supported")}});var gr=I((tc,po)=>{"use strict";var{Buffer:rt}=ho(),lo=Symbol.for("BufferList");function U(r){if(!(this instanceof U))return new U(r);U._init.call(this,r)}U._init=function(t){Object.defineProperty(this,lo,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)};U.prototype._new=function(t){return new U(t)};U.prototype._offset=function(t){if(t===0)return[0,0];let e=0;for(let n=0;n<this._bufs.length;n++){let i=e+this._bufs[n].length;if(t<i||n===this._bufs.length-1)return[n,t-e];e=i}};U.prototype._reverseOffset=function(r){let t=r[0],e=r[1];for(let n=0;n<t;n++)e+=this._bufs[n].length;return e};U.prototype.get=function(t){if(t>this.length||t<0)return;let e=this._offset(t);return this._bufs[e[0]][e[1]]};U.prototype.slice=function(t,e){return typeof t=="number"&&t<0&&(t+=this.length),typeof e=="number"&&e<0&&(e+=this.length),this.copy(null,0,t,e)};U.prototype.copy=function(t,e,n,i){if((typeof n!="number"||n<0)&&(n=0),(typeof i!="number"||i>this.length)&&(i=this.length),n>=this.length||i<=0)return t||rt.alloc(0);let o=!!t,s=this._offset(n),u=i-n,a=u,h=o&&e||0,f=s[1];if(n===0&&i===this.length){if(!o)return this._bufs.length===1?this._bufs[0]:rt.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(t,h),h+=this._bufs[d].length;return t}if(a<=this._bufs[s[0]].length-f)return o?this._bufs[s[0]].copy(t,e,f,f+a):this._bufs[s[0]].slice(f,f+a);o||(t=rt.allocUnsafe(u));for(let d=s[0];d<this._bufs.length;d++){let A=this._bufs[d].length-f;if(a>A)this._bufs[d].copy(t,h,f),h+=A;else{this._bufs[d].copy(t,h,f,f+a),h+=A;break}a-=A,f&&(f=0)}return t.length>h?t.slice(0,h):t};U.prototype.shallowSlice=function(t,e){if(t=t||0,e=typeof e!="number"?this.length:e,t<0&&(t+=this.length),e<0&&(e+=this.length),t===e)return this._new();let n=this._offset(t),i=this._offset(e),o=this._bufs.slice(n[0],i[0]+1);return i[1]===0?o.pop():o[o.length-1]=o[o.length-1].slice(0,i[1]),n[1]!==0&&(o[0]=o[0].slice(n[1])),this._new(o)};U.prototype.toString=function(t,e,n){return this.slice(e,n).toString(t)};U.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this};U.prototype.duplicate=function(){let t=this._new();for(let e=0;e<this._bufs.length;e++)t.append(this._bufs[e]);return t};U.prototype.append=function(t){if(t==null)return this;if(t.buffer)this._appendBuffer(rt.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let e=0;e<t.length;e++)this.append(t[e]);else if(this._isBufferList(t))for(let e=0;e<t._bufs.length;e++)this.append(t._bufs[e]);else typeof t=="number"&&(t=t.toString()),this._appendBuffer(rt.from(t));return this};U.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length};U.prototype.indexOf=function(r,t,e){if(e===void 0&&typeof t=="string"&&(e=t,t=void 0),typeof r=="function"||Array.isArray(r))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof r=="number"?r=rt.from([r]):typeof r=="string"?r=rt.from(r,e):this._isBufferList(r)?r=r.slice():Array.isArray(r.buffer)?r=rt.from(r.buffer,r.byteOffset,r.byteLength):rt.isBuffer(r)||(r=rt.from(r)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),r.length===0)return t>this.length?this.length:t;let n=this._offset(t),i=n[0],o=n[1];for(;i<this._bufs.length;i++){let s=this._bufs[i];for(;o<s.length;)if(s.length-o>=r.length){let a=s.indexOf(r,o);if(a!==-1)return this._reverseOffset([i,a]);o=s.length-r.length+1}else{let a=this._reverseOffset([i,o]);if(this._match(a,r))return a;o++}o=0}return-1};U.prototype._match=function(r,t){if(this.length-r<t.length)return!1;for(let e=0;e<t.length;e++)if(this.get(r+e)!==t[e])return!1;return!0};(function(){let r={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in r)(function(e){r[e]===null?U.prototype[e]=function(n,i){return this.slice(n,n+i)[e](0,i)}:U.prototype[e]=function(n=0){return this.slice(n,n+r[e])[e](0)}})(t)})();U.prototype._isBufferList=function(t){return t instanceof U||U.isBufferList(t)};U.isBufferList=function(t){return t!=null&&t[lo]};po.exports=U});var mo=I((ec,yo)=>{var Dr=class{constructor(t,e=12,n=8*1024,i=32*1024,o=64,s){this.bits=e,this.min=n,this.max=i,this.asModule=t,this.rabin=new t.Rabin(e,n,i,o,s),this.polynomial=s}fingerprint(t){let{__retain:e,__release:n,__allocArray:i,__getInt32Array:o,Int32Array_ID:s,Uint8Array_ID:u}=this.asModule,a=new Int32Array(Math.ceil(t.length/this.min)),h=e(i(s,a)),f=e(i(u,t)),d=this.rabin.fingerprint(f,h),A=o(d);n(f),n(h);let c=A.indexOf(0);return c>=0?A.subarray(0,c):A}};yo.exports=Dr});var Eo=I(te=>{"use strict";var Ba=typeof BigUint64Array<"u",Xt=Symbol(),Qt=1024;function go(r,t){let e=new Uint32Array(r),n=new Uint16Array(r);var i=e[t+-4>>>2]>>>1,o=t>>>1;if(i<=Qt)return String.fromCharCode.apply(String,n.subarray(o,o+i));let s=[];do{let u=n[o+Qt-1],a=u>=55296&&u<56320?Qt-1:Qt;s.push(String.fromCharCode.apply(String,n.subarray(o,o+=a))),i-=a}while(i>Qt);return s.join("")+String.fromCharCode.apply(String,n.subarray(o,o+i))}function wr(r){let t={};function e(i,o){return i?go(i.buffer,o):"<yet unknown>"}let n=r.env=r.env||{};return n.abort=n.abort||function(o,s,u,a){let h=t.memory||n.memory;throw Error("abort: "+e(h,o)+" at "+e(h,s)+":"+u+":"+a)},n.trace=n.trace||function(o,s){let u=t.memory||n.memory;console.log("trace: "+e(u,o)+(s?" ":"")+Array.prototype.slice.call(arguments,2,2+s).join(", "))},r.Math=r.Math||Math,r.Date=r.Date||Date,t}function br(r,t){let e=t.exports,n=e.memory,i=e.table,o=e.__alloc,s=e.__retain,u=e.__rtti_base||-1;function a(w){let y=new Uint32Array(n.buffer),E=y[u>>>2];if((w>>>=0)>=E)throw Error("invalid id: "+w);return y[(u+4>>>2)+w*2]}function h(w){let y=new Uint32Array(n.buffer),E=y[u>>>2];if((w>>>=0)>=E)throw Error("invalid id: "+w);return y[(u+4>>>2)+w*2+1]}function f(w){return 31-Math.clz32(w>>>5&31)}function d(w){return 31-Math.clz32(w>>>14&31)}function A(w){let y=w.length,E=o(y<<1,1),S=new Uint16Array(n.buffer);for(var N=0,v=E>>>1;N<y;++N)S[v+N]=w.charCodeAt(N);return E}r.__allocString=A;function c(w){let y=n.buffer;if(new Uint32Array(y)[w+-8>>>2]!==1)throw Error("not a string: "+w);return go(y,w)}r.__getString=c;function p(w,y,E){let S=n.buffer;if(E)switch(w){case 2:return new Float32Array(S);case 3:return new Float64Array(S)}else switch(w){case 0:return new(y?Int8Array:Uint8Array)(S);case 1:return new(y?Int16Array:Uint16Array)(S);case 2:return new(y?Int32Array:Uint32Array)(S);case 3:return new(y?BigInt64Array:BigUint64Array)(S)}throw Error("unsupported align: "+w)}function g(w,y){let E=a(w);if(!(E&3))throw Error("not an array: "+w+" @ "+E);let S=f(E),N=y.length,v=o(N<<S,0),W=o(E&2?16:12,w),C=new Uint32Array(n.buffer);C[W+0>>>2]=s(v),C[W+4>>>2]=v,C[W+8>>>2]=N<<S,E&2&&(C[W+12>>>2]=N);let Rr=p(S,E&1024,E&2048);if(E&8192)for(let re=0;re<N;++re)Rr[(v>>>S)+re]=s(y[re]);else Rr.set(y,v>>>S);return W}r.__allocArray=g;function k(w){let y=new Uint32Array(n.buffer),E=y[w+-8>>>2],S=a(E);if(!(S&1))throw Error("not an array: "+E);let N=f(S);var v=y[w+4>>>2];let W=S&2?y[w+12>>>2]:y[v+-4>>>2]>>>N;return p(N,S&1024,S&2048).subarray(v>>>=N,v+W)}r.__getArrayView=k;function m(w){let y=k(w),E=y.length,S=new Array(E);for(let N=0;N<E;N++)S[N]=y[N];return S}r.__getArray=m;function D(w){let y=n.buffer,E=new Uint32Array(y)[w+-4>>>2];return y.slice(w,w+E)}r.__getArrayBuffer=D;function b(w,y,E){return new w(_(w,y,E))}function _(w,y,E){let S=n.buffer,N=new Uint32Array(S),v=N[E+4>>>2];return new w(S,v,N[v+-4>>>2]>>>y)}r.__getInt8Array=b.bind(null,Int8Array,0),r.__getInt8ArrayView=_.bind(null,Int8Array,0),r.__getUint8Array=b.bind(null,Uint8Array,0),r.__getUint8ArrayView=_.bind(null,Uint8Array,0),r.__getUint8ClampedArray=b.bind(null,Uint8ClampedArray,0),r.__getUint8ClampedArrayView=_.bind(null,Uint8ClampedArray,0),r.__getInt16Array=b.bind(null,Int16Array,1),r.__getInt16ArrayView=_.bind(null,Int16Array,1),r.__getUint16Array=b.bind(null,Uint16Array,1),r.__getUint16ArrayView=_.bind(null,Uint16Array,1),r.__getInt32Array=b.bind(null,Int32Array,2),r.__getInt32ArrayView=_.bind(null,Int32Array,2),r.__getUint32Array=b.bind(null,Uint32Array,2),r.__getUint32ArrayView=_.bind(null,Uint32Array,2),Ba&&(r.__getInt64Array=b.bind(null,BigInt64Array,3),r.__getInt64ArrayView=_.bind(null,BigInt64Array,3),r.__getUint64Array=b.bind(null,BigUint64Array,3),r.__getUint64ArrayView=_.bind(null,BigUint64Array,3)),r.__getFloat32Array=b.bind(null,Float32Array,2),r.__getFloat32ArrayView=_.bind(null,Float32Array,2),r.__getFloat64Array=b.bind(null,Float64Array,3),r.__getFloat64ArrayView=_.bind(null,Float64Array,3);function F(w,y){let E=new Uint32Array(n.buffer);var S=E[w+-8>>>2];if(S<=E[u>>>2])do if(S==y)return!0;while(S=h(S));return!1}return r.__instanceof=F,r.memory=r.memory||n,r.table=r.table||i,_o(e,r)}function Do(r){return typeof Response<"u"&&r instanceof Response}async function wo(r,t){return Do(r=await r)?bo(r,t):br(wr(t||(t={})),await WebAssembly.instantiate(r instanceof WebAssembly.Module?r:await WebAssembly.compile(r),t))}te.instantiate=wo;function Fa(r,t){return br(wr(t||(t={})),new WebAssembly.Instance(r instanceof WebAssembly.Module?r:new WebAssembly.Module(r),t))}te.instantiateSync=Fa;async function bo(r,t){return WebAssembly.instantiateStreaming?br(wr(t||(t={})),(await WebAssembly.instantiateStreaming(r,t)).instance):wo(Do(r=await r)?r.arrayBuffer():r,t)}te.instantiateStreaming=bo;function _o(r,t){var e=t?Object.create(t):{},n=r.__argumentsLength?function(i){r.__argumentsLength.value=i}:r.__setArgumentsLength||r.__setargc||function(){};for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let o=r[i],s=i.split("."),u=e;for(;s.length>1;){let f=s.shift();Object.prototype.hasOwnProperty.call(u,f)||(u[f]={}),u=u[f]}let a=s[0],h=a.indexOf("#");if(h>=0){let f=a.substring(0,h),d=u[f];if(typeof d>"u"||!d.prototype){let A=function(...c){return A.wrap(A.prototype.constructor(0,...c))};A.prototype={valueOf:function(){return this[Xt]}},A.wrap=function(c){return Object.create(A.prototype,{[Xt]:{value:c,writable:!1}})},d&&Object.getOwnPropertyNames(d).forEach(c=>Object.defineProperty(A,c,Object.getOwnPropertyDescriptor(d,c))),u[f]=A}if(a=a.substring(h+1),u=u[f].prototype,/^(get|set):/.test(a)){if(!Object.prototype.hasOwnProperty.call(u,a=a.substring(4))){let A=r[i.replace("set:","get:")],c=r[i.replace("get:","set:")];Object.defineProperty(u,a,{get:function(){return A(this[Xt])},set:function(p){c(this[Xt],p)},enumerable:!0})}}else a==="constructor"?(u[a]=(...A)=>(n(A.length),o(...A))).original=o:(u[a]=function(...A){return n(A.length),o(this[Xt],...A)}).original=o}else/^(get|set):/.test(a)?Object.prototype.hasOwnProperty.call(u,a=a.substring(4))||Object.defineProperty(u,a,{get:r[i.replace("set:","get:")],set:r[i.replace("get:","set:")],enumerable:!0}):typeof o=="function"&&o!==n?(u[a]=(...f)=>(n(f.length),o(...f))).original=o:u[a]=o}return e}te.demangle=_o});var Ao=I((nc,xo)=>{var{instantiate:Sa}=Eo();_r.supported=typeof WebAssembly<"u";function _r(r={}){if(!_r.supported)return null;var t=new Uint8Array([0,97,115,109,1,0,0,0,1,78,14,96,2,127,126,0,96,1,127,1,126,96,2,127,127,0,96,1,127,1,127,96,1,127,0,96,2,127,127,1,127,96,3,127,127,127,1,127,96,0,0,96,3,127,127,127,0,96,0,1,127,96,4,127,127,127,127,0,96,5,127,127,127,127,127,1,127,96,1,126,1,127,96,2,126,126,1,126,2,13,1,3,101,110,118,5,97,98,111,114,116,0,10,3,54,53,2,2,8,9,3,5,2,8,6,5,3,4,2,6,9,12,13,2,5,11,3,2,3,2,3,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,6,7,7,4,4,5,3,1,0,1,6,47,9,127,1,65,0,11,127,1,65,0,11,127,0,65,3,11,127,0,65,4,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,0,65,240,2,11,127,0,65,6,11,7,240,5,41,6,109,101,109,111,114,121,2,0,7,95,95,97,108,108,111,99,0,10,8,95,95,114,101,116,97,105,110,0,11,9,95,95,114,101,108,101,97,115,101,0,12,9,95,95,99,111,108,108,101,99,116,0,51,11,95,95,114,116,116,105,95,98,97,115,101,3,7,13,73,110,116,51,50,65,114,114,97,121,95,73,68,3,2,13,85,105,110,116,56,65,114,114,97,121,95,73,68,3,3,6,100,101,103,114,101,101,0,16,3,109,111,100,0,17,5,82,97,98,105,110,3,8,16,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,0,21,16,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,0,22,21,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,23,21,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,24,14,82,97,98,105,110,35,103,101,116,58,119,112,111,115,0,25,14,82,97,98,105,110,35,115,101,116,58,119,112,111,115,0,26,15,82,97,98,105,110,35,103,101,116,58,99,111,117,110,116,0,27,15,82,97,98,105,110,35,115,101,116,58,99,111,117,110,116,0,28,13,82,97,98,105,110,35,103,101,116,58,112,111,115,0,29,13,82,97,98,105,110,35,115,101,116,58,112,111,115,0,30,15,82,97,98,105,110,35,103,101,116,58,115,116,97,114,116,0,31,15,82,97,98,105,110,35,115,101,116,58,115,116,97,114,116,0,32,16,82,97,98,105,110,35,103,101,116,58,100,105,103,101,115,116,0,33,16,82,97,98,105,110,35,115,101,116,58,100,105,103,101,115,116,0,34,21,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,35,21,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,36,22,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,37,22,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,38,31,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,39,31,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,40,20,82,97,98,105,110,35,103,101,116,58,112,111,108,121,110,111,109,105,97,108,0,41,20,82,97,98,105,110,35,115,101,116,58,112,111,108,121,110,111,109,105,97,108,0,42,17,82,97,98,105,110,35,103,101,116,58,109,105,110,115,105,122,101,0,43,17,82,97,98,105,110,35,115,101,116,58,109,105,110,115,105,122,101,0,44,17,82,97,98,105,110,35,103,101,116,58,109,97,120,115,105,122,101,0,45,17,82,97,98,105,110,35,115,101,116,58,109,97,120,115,105,122,101,0,46,14,82,97,98,105,110,35,103,101,116,58,109,97,115,107,0,47,14,82,97,98,105,110,35,115,101,116,58,109,97,115,107,0,48,17,82,97,98,105,110,35,99,111,110,115,116,114,117,99,116,111,114,0,20,17,82,97,98,105,110,35,102,105,110,103,101,114,112,114,105,110,116,0,49,8,1,50,10,165,31,53,199,1,1,4,127,32,1,40,2,0,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,3,65,4,107,118,65,16,115,33,4,32,3,65,7,107,11,33,3,32,1,40,2,20,33,2,32,1,40,2,16,34,5,4,64,32,5,32,2,54,2,20,11,32,2,4,64,32,2,32,5,54,2,16,11,32,1,32,0,32,4,32,3,65,4,116,106,65,2,116,106,40,2,96,70,4,64,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,2,54,2,96,32,2,69,4,64,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,65,127,115,113,34,1,54,2,4,32,1,69,4,64,32,0,32,0,40,2,0,65,1,32,3,116,65,127,115,113,54,2,0,11,11,11,11,226,2,1,6,127,32,1,40,2,0,33,3,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,34,5,65,1,113,4,64,32,3,65,124,113,65,16,106,32,5,65,124,113,106,34,2,65,240,255,255,255,3,73,4,64,32,0,32,4,16,1,32,1,32,2,32,3,65,3,113,114,34,3,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,33,5,11,11,32,3,65,2,113,4,64,32,1,65,4,107,40,2,0,34,2,40,2,0,34,6,65,124,113,65,16,106,32,3,65,124,113,106,34,7,65,240,255,255,255,3,73,4,64,32,0,32,2,16,1,32,2,32,7,32,6,65,3,113,114,34,3,54,2,0,32,2,33,1,11,11,32,4,32,5,65,2,114,54,2,0,32,4,65,4,107,32,1,54,2,0,32,0,32,3,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,2,65,4,107,118,65,16,115,33,4,32,2,65,7,107,11,34,3,65,4,116,32,4,106,65,2,116,106,40,2,96,33,2,32,1,65,0,54,2,16,32,1,32,2,54,2,20,32,2,4,64,32,2,32,1,54,2,16,11,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,1,54,2,96,32,0,32,0,40,2,0,65,1,32,3,116,114,54,2,0,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,114,54,2,4,11,119,1,1,127,32,2,2,127,32,0,40,2,160,12,34,2,4,64,32,2,32,1,65,16,107,70,4,64,32,2,40,2,0,33,3,32,1,65,16,107,33,1,11,11,32,1,11,107,34,2,65,48,73,4,64,15,11,32,1,32,3,65,2,113,32,2,65,32,107,65,1,114,114,54,2,0,32,1,65,0,54,2,16,32,1,65,0,54,2,20,32,1,32,2,106,65,16,107,34,2,65,2,54,2,0,32,0,32,2,54,2,160,12,32,0,32,1,16,2,11,155,1,1,3,127,35,0,34,0,69,4,64,65,1,63,0,34,0,74,4,127,65,1,32,0,107,64,0,65,0,72,5,65,0,11,4,64,0,11,65,176,3,34,0,65,0,54,2,0,65,208,15,65,0,54,2,0,3,64,32,1,65,23,73,4,64,32,1,65,2,116,65,176,3,106,65,0,54,2,4,65,0,33,2,3,64,32,2,65,16,73,4,64,32,1,65,4,116,32,2,106,65,2,116,65,176,3,106,65,0,54,2,96,32,2,65,1,106,33,2,12,1,11,11,32,1,65,1,106,33,1,12,1,11,11,65,176,3,65,224,15,63,0,65,16,116,16,3,65,176,3,36,0,11,32,0,11,45,0,32,0,65,240,255,255,255,3,79,4,64,65,32,65,224,0,65,201,3,65,29,16,0,0,11,32,0,65,15,106,65,112,113,34,0,65,16,32,0,65,16,75,27,11,169,1,1,1,127,32,0,32,1,65,128,2,73,4,127,32,1,65,4,118,33,1,65,0,5,32,1,65,248,255,255,255,1,73,4,64,32,1,65,1,65,27,32,1,103,107,116,106,65,1,107,33,1,11,32,1,65,31,32,1,103,107,34,2,65,4,107,118,65,16,115,33,1,32,2,65,7,107,11,34,2,65,2,116,106,40,2,4,65,127,32,1,116,113,34,1,4,127,32,0,32,1,104,32,2,65,4,116,106,65,2,116,106,40,2,96,5,32,0,40,2,0,65,127,32,2,65,1,106,116,113,34,1,4,127,32,0,32,0,32,1,104,34,0,65,2,116,106,40,2,4,104,32,0,65,4,116,106,65,2,116,106,40,2,96,5,65,0,11,11,11,111,1,1,127,63,0,34,2,32,1,65,248,255,255,255,1,73,4,127,32,1,65,1,65,27,32,1,103,107,116,65,1,107,106,5,32,1,11,65,16,32,0,40,2,160,12,32,2,65,16,116,65,16,107,71,116,106,65,255,255,3,106,65,128,128,124,113,65,16,118,34,1,32,2,32,1,74,27,64,0,65,0,72,4,64,32,1,64,0,65,0,72,4,64,0,11,11,32,0,32,2,65,16,116,63,0,65,16,116,16,3,11,113,1,2,127,32,1,40,2,0,34,3,65,124,113,32,2,107,34,4,65,32,79,4,64,32,1,32,2,32,3,65,2,113,114,54,2,0,32,2,32,1,65,16,106,106,34,1,32,4,65,16,107,65,1,114,54,2,0,32,0,32,1,16,2,5,32,1,32,3,65,126,113,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,32,1,65,16,106,32,1,40,2,0,65,124,113,106,40,2,0,65,125,113,54,2,0,11,11,91,1,2,127,32,0,32,1,16,5,34,4,16,6,34,3,69,4,64,65,1,36,1,65,0,36,1,32,0,32,4,16,6,34,3,69,4,64,32,0,32,4,16,7,32,0,32,4,16,6,33,3,11,11,32,3,65,0,54,2,4,32,3,32,2,54,2,8,32,3,32,1,54,2,12,32,0,32,3,16,1,32,0,32,3,32,4,16,8,32,3,11,13,0,16,4,32,0,32,1,16,9,65,16,106,11,33,1,1,127,32,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,18,0,32,0,65,172,3,75,4,64,32,0,65,16,107,16,52,11,11,140,3,1,1,127,2,64,32,1,69,13,0,32,0,65,0,58,0,0,32,0,32,1,106,65,1,107,65,0,58,0,0,32,1,65,2,77,13,0,32,0,65,1,106,65,0,58,0,0,32,0,65,2,106,65,0,58,0,0,32,0,32,1,106,34,2,65,2,107,65,0,58,0,0,32,2,65,3,107,65,0,58,0,0,32,1,65,6,77,13,0,32,0,65,3,106,65,0,58,0,0,32,0,32,1,106,65,4,107,65,0,58,0,0,32,1,65,8,77,13,0,32,1,65,0,32,0,107,65,3,113,34,1,107,33,2,32,0,32,1,106,34,0,65,0,54,2,0,32,0,32,2,65,124,113,34,1,106,65,4,107,65,0,54,2,0,32,1,65,8,77,13,0,32,0,65,4,106,65,0,54,2,0,32,0,65,8,106,65,0,54,2,0,32,0,32,1,106,34,2,65,12,107,65,0,54,2,0,32,2,65,8,107,65,0,54,2,0,32,1,65,24,77,13,0,32,0,65,12,106,65,0,54,2,0,32,0,65,16,106,65,0,54,2,0,32,0,65,20,106,65,0,54,2,0,32,0,65,24,106,65,0,54,2,0,32,0,32,1,106,34,2,65,28,107,65,0,54,2,0,32,2,65,24,107,65,0,54,2,0,32,2,65,20,107,65,0,54,2,0,32,2,65,16,107,65,0,54,2,0,32,0,32,0,65,4,113,65,24,106,34,2,106,33,0,32,1,32,2,107,33,1,3,64,32,1,65,32,79,4,64,32,0,66,0,55,3,0,32,0,65,8,106,66,0,55,3,0,32,0,65,16,106,66,0,55,3,0,32,0,65,24,106,66,0,55,3,0,32,1,65,32,107,33,1,32,0,65,32,106,33,0,12,1,11,11,11,11,178,1,1,3,127,32,1,65,240,255,255,255,3,32,2,118,75,4,64,65,144,1,65,192,1,65,23,65,56,16,0,0,11,32,1,32,2,116,34,3,65,0,16,10,34,2,32,3,16,13,32,0,69,4,64,65,12,65,2,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,2,34,1,32,0,40,2,0,34,4,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,32,4,16,12,11,32,0,32,1,54,2,0,32,0,32,2,54,2,4,32,0,32,3,54,2,8,32,0,11,46,1,2,127,65,12,65,5,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,65,128,2,65,3,16,14,11,9,0,65,63,32,0,121,167,107,11,49,1,2,127,65,63,32,1,121,167,107,33,2,3,64,65,63,32,0,121,167,107,32,2,107,34,3,65,0,78,4,64,32,0,32,1,32,3,172,134,133,33,0,12,1,11,11,32,0,11,40,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,163,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,65,0,58,0,0,11,38,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,152,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,45,0,0,11,254,5,2,1,127,4,126,32,0,69,4,64,65,232,0,65,6,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,24,32,0,66,0,55,3,32,32,0,66,0,55,3,40,32,0,66,0,55,3,48,32,0,66,0,55,3,56,32,0,66,0,55,3,64,32,0,66,0,55,3,72,32,0,66,0,55,3,80,32,0,66,0,55,3,88,32,0,66,0,55,3,96,32,0,32,2,173,55,3,80,32,0,32,3,173,55,3,88,65,12,65,4,16,10,34,2,65,172,3,75,4,64,32,2,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,32,4,65,0,16,14,33,2,32,0,40,2,0,16,12,32,0,32,2,54,2,0,32,0,32,4,54,2,4,32,0,66,1,32,1,173,134,66,1,125,55,3,96,32,0,66,243,130,183,218,216,230,232,30,55,3,72,35,4,69,4,64,65,0,33,2,3,64,32,2,65,128,2,72,4,64,32,2,65,255,1,113,173,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,65,0,33,4,3,64,32,4,32,0,40,2,4,65,1,107,72,4,64,32,6,66,8,134,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,32,4,65,1,106,33,4,12,1,11,11,35,6,40,2,4,32,2,65,3,116,106,32,6,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,63,32,0,41,3,72,121,167,107,172,33,7,65,0,33,2,3,64,32,2,65,128,2,72,4,64,35,5,33,1,32,2,172,32,7,134,34,8,33,6,65,63,32,0,41,3,72,34,9,121,167,107,33,3,3,64,65,63,32,6,121,167,107,32,3,107,34,4,65,0,78,4,64,32,6,32,9,32,4,172,134,133,33,6,12,1,11,11,32,1,40,2,4,32,2,65,3,116,106,32,6,32,8,132,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,1,36,4,11,32,0,66,0,55,3,24,32,0,66,0,55,3,32,65,0,33,2,3,64,32,2,32,0,40,2,4,72,4,64,32,0,40,2,0,32,2,16,18,32,2,65,1,106,33,2,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,6,66,45,136,167,65,3,116,106,41,3,0,32,6,66,8,134,66,1,132,133,55,3,40,32,0,11,38,1,1,127,32,0,40,2,0,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,55,1,2,127,32,1,32,0,40,2,0,34,2,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,16,12,11,32,0,32,1,54,2,0,11,7,0,32,0,40,2,4,11,9,0,32,0,32,1,54,2,4,11,7,0,32,0,40,2,8,11,9,0,32,0,32,1,54,2,8,11,7,0,32,0,41,3,16,11,9,0,32,0,32,1,55,3,16,11,7,0,32,0,41,3,24,11,9,0,32,0,32,1,55,3,24,11,7,0,32,0,41,3,32,11,9,0,32,0,32,1,55,3,32,11,7,0,32,0,41,3,40,11,9,0,32,0,32,1,55,3,40,11,7,0,32,0,41,3,48,11,9,0,32,0,32,1,55,3,48,11,7,0,32,0,41,3,56,11,9,0,32,0,32,1,55,3,56,11,7,0,32,0,41,3,64,11,9,0,32,0,32,1,55,3,64,11,7,0,32,0,41,3,72,11,9,0,32,0,32,1,55,3,72,11,7,0,32,0,41,3,80,11,9,0,32,0,32,1,55,3,80,11,7,0,32,0,41,3,88,11,9,0,32,0,32,1,55,3,88,11,7,0,32,0,41,3,96,11,9,0,32,0,32,1,55,3,96,11,172,4,2,5,127,1,126,32,2,65,172,3,75,4,64,32,2,65,16,107,34,4,32,4,40,2,4,65,1,106,54,2,4,11,32,2,33,4,65,0,33,2,32,1,40,2,8,33,5,32,1,40,2,4,33,6,3,64,2,127,65,0,33,3,3,64,32,3,32,5,72,4,64,32,3,32,6,106,45,0,0,33,1,32,0,40,2,0,32,0,40,2,8,16,19,33,7,32,0,40,2,8,32,0,40,2,0,40,2,4,106,32,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,7,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,1,173,32,8,66,8,134,132,133,55,3,40,32,0,32,0,41,3,16,66,1,124,55,3,16,32,0,32,0,41,3,24,66,1,124,55,3,24,32,0,41,3,16,32,0,41,3,80,90,4,127,32,0,41,3,40,32,0,41,3,96,131,80,5,65,0,11,4,127,65,1,5,32,0,41,3,16,32,0,41,3,88,90,11,4,64,32,0,32,0,41,3,32,55,3,48,32,0,32,0,41,3,16,55,3,56,32,0,32,0,41,3,40,55,3,64,65,0,33,1,3,64,32,1,32,0,40,2,4,72,4,64,32,0,40,2,0,32,1,16,18,32,1,65,1,106,33,1,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,8,66,8,134,66,1,132,133,55,3,40,32,3,65,1,106,12,3,11,32,3,65,1,106,33,3,12,1,11,11,65,127,11,34,1,65,0,78,4,64,32,5,32,1,107,33,5,32,1,32,6,106,33,6,32,2,34,1,65,1,106,33,2,32,4,40,2,4,32,1,65,2,116,106,32,0,41,3,56,62,2,0,12,1,11,11,32,4,11,10,0,16,15,36,5,16,15,36,6,11,3,0,1,11,73,1,2,127,32,0,40,2,4,34,1,65,255,255,255,255,0,113,34,2,65,1,70,4,64,32,0,65,16,106,16,53,32,0,32,0,40,2,0,65,1,114,54,2,0,35,0,32,0,16,2,5,32,0,32,2,65,1,107,32,1,65,128,128,128,128,127,113,114,54,2,4,11,11,58,0,2,64,2,64,2,64,32,0,65,8,107,40,2,0,14,7,0,0,1,1,1,1,1,2,11,15,11,32,0,40,2,0,34,0,4,64,32,0,65,172,3,79,4,64,32,0,65,16,107,16,52,11,11,15,11,0,11,11,137,3,7,0,65,16,11,55,40,0,0,0,1,0,0,0,1,0,0,0,40,0,0,0,97,0,108,0,108,0,111,0,99,0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,111,0,111,0,32,0,108,0,97,0,114,0,103,0,101,0,65,208,0,11,45,30,0,0,0,1,0,0,0,1,0,0,0,30,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,47,0,116,0,108,0,115,0,102,0,46,0,116,0,115,0,65,128,1,11,43,28,0,0,0,1,0,0,0,1,0,0,0,28,0,0,0,73,0,110,0,118,0,97,0,108,0,105,0,100,0,32,0,108,0,101,0,110,0,103,0,116,0,104,0,65,176,1,11,53,38,0,0,0,1,0,0,0,1,0,0,0,38,0,0,0,126,0,108,0,105,0,98,0,47,0,97,0,114,0,114,0,97,0,121,0,98,0,117,0,102,0,102,0,101,0,114,0,46,0,116,0,115,0,65,240,1,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,73,0,110,0,100,0,101,0,120,0,32,0,111,0,117,0,116,0,32,0,111,0,102,0,32,0,114,0,97,0,110,0,103,0,101,0,65,176,2,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,126,0,108,0,105,0,98,0,47,0,116,0,121,0,112,0,101,0,100,0,97,0,114,0,114,0,97,0,121,0,46,0,116,0,115,0,65,240,2,11,53,7,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,145,4,0,0,2,0,0,0,49,0,0,0,2,0,0,0,17,1,0,0,2,0,0,0,16,0,34,16,115,111,117,114,99,101,77,97,112,112,105,110,103,85,82,76,16,46,47,114,97,98,105,110,46,119,97,115,109,46,109,97,112]);return Sa(new Response(new Blob([t],{type:"application/wasm"})),r)}xo.exports=_r});var So=I((ic,Fo)=>{var Bo=mo(),Ca=Ao(),Ia=async(r,t,e,n,i)=>{let o=await Ca();return new Bo(o,r,t,e,n,i)};Fo.exports={Rabin:Bo,create:Ia}});var Vo=I((Hc,jo)=>{"use strict";jo.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(t,e){let n=this._internalPositionFor(t,!1);if(e===void 0)n!==-1&&(this._unsetInternalPos(n),this._unsetBit(t),this._changedLength=!0,this._changedData=!0);else{let i=!1;n===-1?(n=this._data.length,this._setBit(t),this._changedData=!0):i=!0,this._setInternalPos(n,t,e,i),this._changedLength=!0}}unset(t){this.set(t,void 0)}get(t){this._sortData();let e=this._internalPositionFor(t,!0);if(e!==-1)return this._data[e][1]}push(t){return this.set(this.length,t),this.length}get length(){if(this._sortData(),this._changedLength){let t=this._data[this._data.length-1];this._length=t?t[0]+1:0,this._changedLength=!1}return this._length}forEach(t){let e=0;for(;e<this.length;)t(this.get(e),e,this),e++}map(t){let e=0,n=new Array(this.length);for(;e<this.length;)n[e]=t(this.get(e),e,this),e++;return n}reduce(t,e){let n=0,i=e;for(;n<this.length;){let o=this.get(n);i=t(i,o,n),n++}return i}find(t){let e=0,n,i;for(;e<this.length&&!n;)i=this.get(e),n=t(i),e++;return n?i:void 0}_internalPositionFor(t,e){let n=this._bytePosFor(t,e);if(n>=this._bitArrays.length)return-1;let i=this._bitArrays[n],o=t-n*7;if(!((i&1<<o)>0))return-1;let u=this._bitArrays.slice(0,n).reduce(su,0),a=~(4294967295<<o+1),h=Mo(i&a);return u+h-1}_bytePosFor(t,e){let n=Math.floor(t/7),i=n+1;for(;!e&&this._bitArrays.length<i;)this._bitArrays.push(0);return n}_setBit(t){let e=this._bytePosFor(t,!1);this._bitArrays[e]|=1<<t-e*7}_unsetBit(t){let e=this._bytePosFor(t,!1);this._bitArrays[e]&=~(1<<t-e*7)}_setInternalPos(t,e,n,i){let o=this._data,s=[e,n];if(i)this._sortData(),o[t]=s;else{if(o.length)if(o[o.length-1][0]>=e)o.push(s);else if(o[0][0]<=e)o.unshift(s);else{let u=Math.round(o.length/2);this._data=o.slice(0,u).concat(s).concat(o.slice(u))}else this._data.push(s);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(t){this._data.splice(t,1)}_sortData(){this._changedData&&this._data.sort(au),this._changedData=!1}bitField(){let t=[],e=8,n=0,i=0,o,s=this._bitArrays.slice();for(;s.length||n;){n===0&&(o=s.shift(),n=7);let a=Math.min(n,e),h=~(255<<a);i|=(o&h)<<8-e,o=o>>>a,n-=a,e-=a,(!e||!n&&!s.length)&&(t.push(i),i=0,e=8)}for(var u=t.length-1;u>0&&t[u]===0;u--)t.pop();return t}compactArray(){return this._sortData(),this._data.map(uu)}};function su(r,t){return r+Mo(t)}function Mo(r){let t=r;return t=t-(t>>1&1431655765),t=(t&858993459)+(t>>2&858993459),(t+(t>>4)&252645135)*16843009>>24}function au(r,t){return r[0]-t[0]}function uu(r){return r[1]}});var _u={};V(_u,{importer:()=>bu});var es=M(Se(),1);var Zr=M(Jr(),1),Xr=Zr.default;var Ue={};V(Ue,{sha256:()=>It,sha512:()=>vs});var Mt={};V(Mt,{coerce:()=>Y,empty:()=>Qr,equals:()=>Ie,fromHex:()=>gs,fromString:()=>Te,isBinary:()=>Ds,toHex:()=>ms,toString:()=>ke});var Qr=new Uint8Array(0),ms=r=>r.reduce((t,e)=>t+e.toString(16).padStart(2,"0"),""),gs=r=>{let t=r.match(/../g);return t?new Uint8Array(t.map(e=>parseInt(e,16))):Qr},Ie=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},Y=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")},Ds=r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),Te=r=>new TextEncoder().encode(r),ke=r=>new TextDecoder().decode(r);var ws=rn,tn=128,bs=127,_s=~bs,Es=Math.pow(2,31);function rn(r,t,e){t=t||[],e=e||0;for(var n=e;r>=Es;)t[e++]=r&255|tn,r/=128;for(;r&_s;)t[e++]=r&255|tn,r>>>=7;return t[e]=r|0,rn.bytes=e-n+1,t}var xs=Le,As=128,en=127;function Le(r,n){var e=0,n=n||0,i=0,o=n,s,u=r.length;do{if(o>=u)throw Le.bytes=0,new RangeError("Could not decode varint");s=r[o++],e+=i<28?(s&en)<<i:(s&en)*Math.pow(2,i),i+=7}while(s>=As);return Le.bytes=o-n,e}var Bs=Math.pow(2,7),Fs=Math.pow(2,14),Ss=Math.pow(2,21),Cs=Math.pow(2,28),Is=Math.pow(2,35),Ts=Math.pow(2,42),ks=Math.pow(2,49),Ls=Math.pow(2,56),Ns=Math.pow(2,63),Us=function(r){return r<Bs?1:r<Fs?2:r<Ss?3:r<Cs?4:r<Is?5:r<Ts?6:r<ks?7:r<Ls?8:r<Ns?9:10},Os={encode:ws,decode:xs,encodingLength:Us},zs=Os,jt=zs;var Vt=r=>[jt.decode(r),jt.decode.bytes],Bt=(r,t,e=0)=>(jt.encode(r,t,e),t),Ft=r=>jt.encodingLength(r);var Dt=(r,t)=>{let e=t.byteLength,n=Ft(r),i=n+Ft(e),o=new Uint8Array(i+e);return Bt(r,o,0),Bt(e,o,n),o.set(t,i),new St(r,e,t,o)},nn=r=>{let t=Y(r),[e,n]=Vt(t),[i,o]=Vt(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new St(e,i,s,t)},on=(r,t)=>r===t?!0:r.code===t.code&&r.size===t.size&&Ie(r.bytes,t.bytes),St=class{constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};var Ct=({name:r,code:t,encode:e})=>new Ne(r,t,e),Ne=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?Dt(this.code,e):e.then(n=>Dt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var an=r=>async t=>new Uint8Array(await crypto.subtle.digest(r,t)),It=Ct({name:"sha2-256",code:18,encode:an("SHA-256")}),vs=Ct({name:"sha2-512",code:19,encode:an("SHA-512")});var Re={};V(Re,{base58btc:()=>nt,base58flickr:()=>Hs});function Ps(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=i}var u=r.length,a=r.charAt(0),h=Math.log(u)/Math.log(256),f=Math.log(256)/Math.log(u);function d(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var g=0,k=0,m=0,D=p.length;m!==D&&p[m]===0;)m++,g++;for(var b=(D-m)*f+1>>>0,_=new Uint8Array(b);m!==D;){for(var F=p[m],w=0,y=b-1;(F!==0||w<k)&&y!==-1;y--,w++)F+=256*_[y]>>>0,_[y]=F%u>>>0,F=F/u>>>0;if(F!==0)throw new Error("Non-zero carry");k=w,m++}for(var E=b-k;E!==b&&_[E]===0;)E++;for(var S=a.repeat(g);E<b;++E)S+=r.charAt(_[E]);return S}function A(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;var g=0;if(p[g]!==" "){for(var k=0,m=0;p[g]===a;)k++,g++;for(var D=(p.length-g)*h+1>>>0,b=new Uint8Array(D);p[g];){var _=e[p.charCodeAt(g)];if(_===255)return;for(var F=0,w=D-1;(_!==0||F<m)&&w!==-1;w--,F++)_+=u*b[w]>>>0,b[w]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");m=F,g++}if(p[g]!==" "){for(var y=D-m;y!==D&&b[y]===0;)y++;for(var E=new Uint8Array(k+(D-y)),S=k;y!==D;)E[S++]=b[y++];return E}}}function c(p){var g=A(p);if(g)return g;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:A,decode:c}}var Rs=Ps,Ms=Rs,un=Ms;var Oe=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},ze=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return cn(this,t)}},ve=class{constructor(t){this.decoders=t}or(t){return cn(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},cn=(r,t)=>new ve({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Pe=class{constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new Oe(t,e,n),this.decoder=new ze(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Tt=({name:r,prefix:t,encode:e,decode:n})=>new Pe(r,t,e,n),ht=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:i}=un(e,t);return Tt({prefix:r,name:t,encode:n,decode:o=>Y(i(o))})},js=(r,t,e,n)=>{let i={};for(let f=0;f<t.length;++f)i[t[f]]=f;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*e/8|0),u=0,a=0,h=0;for(let f=0;f<o;++f){let d=i[r[f]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<e|d,u+=e,u>=8&&(u-=8,s[h++]=255&a>>u)}if(u>=e||255&a<<8-u)throw new SyntaxError("Unexpected end of data");return s},Vs=(r,t,e)=>{let n=t[t.length-1]==="=",i=(1<<e)-1,o="",s=0,u=0;for(let a=0;a<r.length;++a)for(u=u<<8|r[a],s+=8;s>e;)s-=e,o+=t[i&u>>s];if(s&&(o+=t[i&u<<e-s]),n)for(;o.length*e&7;)o+="=";return o},O=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>Tt({prefix:t,name:r,encode(i){return Vs(i,n,e)},decode(i){return js(i,n,e,r)}});var nt=ht({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Hs=ht({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Me={};V(Me,{base32:()=>kt,base32hex:()=>Ws,base32hexpad:()=>Ks,base32hexpadupper:()=>Js,base32hexupper:()=>Ys,base32pad:()=>Gs,base32padupper:()=>qs,base32upper:()=>$s,base32z:()=>Zs});var kt=O({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$s=O({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gs=O({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qs=O({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ws=O({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ys=O({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ks=O({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Js=O({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zs=O({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var L=class{constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:ce,byteLength:ce,code:ue,version:ue,multihash:ue,bytes:ue,_baseCache:ce,asCID:ce})}toV0(){switch(this.version){case 0:return this;default:{let{code:t,multihash:e}=this;if(t!==$t)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==e1)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return L.createV0(e)}}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=Dt(t,e);return L.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(t){return t&&this.code===t.code&&this.version===t.version&&on(this.multihash,t.multihash)}toString(t){let{bytes:e,version:n,_baseCache:i}=this;switch(n){case 0:return Qs(e,i,t||nt.encoder);default:return t1(e,i,t||kt.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(t){return n1(/^0\.0/,i1),!!(t&&(t[hn]||t.asCID===t))}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(t){if(t instanceof L)return t;if(t!=null&&t.asCID===t){let{version:e,code:n,multihash:i,bytes:o}=t;return new L(e,n,i,o||fn(e,n,i.bytes))}else if(t!=null&&t[hn]===!0){let{version:e,multihash:n,code:i}=t,o=nn(n);return L.create(e,i,o)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");switch(t){case 0:{if(e!==$t)throw new Error(`Version 0 CID must use dag-pb (code: ${$t}) block encoding`);return new L(t,e,n,n.bytes)}case 1:{let i=fn(t,e,n.bytes);return new L(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return L.create(0,$t,t)}static createV1(t,e){return L.create(1,t,e)}static decode(t){let[e,n]=L.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=L.inspectBytes(t),n=e.size-e.multihashSize,i=Y(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let o=i.subarray(e.multihashSize-e.digestSize),s=new St(e.multihashCode,e.digestSize,o,i);return[e.version===0?L.createV0(s):L.createV1(e.codec,s),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[d,A]=Vt(t.subarray(e));return e+=A,d},i=n(),o=$t;if(i===18?(i=0,e=0):i===1&&(o=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=e,u=n(),a=n(),h=e+a,f=h-s;return{version:i,codec:o,multihashCode:u,digestSize:a,multihashSize:f,size:h}}static parse(t,e){let[n,i]=Xs(t,e),o=L.decode(i);return o._baseCache.set(n,t),o}},Xs=(r,t)=>{switch(r[0]){case"Q":{let e=t||nt;return[nt.prefix,e.decode(`${nt.prefix}${r}`)]}case nt.prefix:{let e=t||nt;return[nt.prefix,e.decode(r)]}case kt.prefix:{let e=t||kt;return[kt.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},Qs=(r,t,e)=>{let{prefix:n}=e;if(n!==nt.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let o=e.encode(r).slice(1);return t.set(n,o),o}else return i},t1=(r,t,e)=>{let{prefix:n}=e,i=t.get(n);if(i==null){let o=e.encode(r);return t.set(n,o),o}else return i},$t=112,e1=18,fn=(r,t,e)=>{let n=Ft(r),i=n+Ft(t),o=new Uint8Array(i+e.byteLength);return Bt(r,o,0),Bt(t,o,n),o.set(e,i),o},hn=Symbol.for("@ipld/js-cid/CID"),ue={writable:!1,configurable:!1,enumerable:!0},ce={writable:!1,enumerable:!1,configurable:!1},r1="0.0.0-dev",n1=(r,t)=>{if(r.test(r1))console.warn(t);else throw new Error(t)},i1=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
3
|
-
Following code pattern:
|
|
4
|
-
|
|
5
|
-
if (CID.isCID(value)) {
|
|
6
|
-
doSomethingWithCID(value)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
Is replaced with:
|
|
10
|
-
|
|
11
|
-
const cid = CID.asCID(value)
|
|
12
|
-
if (cid) {
|
|
13
|
-
// Make sure to use cid instead of value
|
|
14
|
-
doSomethingWithCID(cid)
|
|
15
|
-
}
|
|
16
|
-
`;var je=M(dn(),1);function o1(r){let t=new Array(4);for(let e=0;e<4;e++)t[e]=r&255,r=r>>8;return new Uint8Array(t)}var qu=Ct({name:"murmur3-32",code:35,encode:r=>o1(je.default.x86.hash32(r))}),yn=Ct({name:"murmur3-128",code:34,encode:r=>Mt.fromHex(je.default.x64.hash128(r))});async function s1(r){return(await yn.encode(r)).slice(0,8).reverse()}var a1={chunker:"fixed",strategy:"balanced",rawLeaves:!1,onlyHash:!1,reduceSingleLeafToSelf:!0,hasher:It,leafType:"file",cidVersion:0,progress:()=>()=>{},shardSplitThreshold:1e3,fileImportConcurrency:50,blockWriteConcurrency:10,minChunkSize:262144,maxChunkSize:262144,avgChunkSize:262144,window:16,polynomial:0x3df305dfb2a804,maxChildrenPerNode:174,layerRepeat:4,wrapWithDirectory:!1,recursive:!1,hidden:!1,timeout:void 0,hamtHashFn:s1,hamtHashCode:34,hamtBucketBits:8},mn=(r={})=>Xr.bind({ignoreUndefined:!0})(a1,r);var ye=M(Lt(),1);var ut=M(yi(),1),Ut=ut.default.Reader,er=ut.default.Writer,B=ut.default.util,j=ut.default.roots["ipfs-unixfs"]||(ut.default.roots["ipfs-unixfs"]={}),mi=j.Data=(()=>{function r(t){if(this.blocksizes=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)t[e[n]]!=null&&(this[e[n]]=t[e[n]])}return r.prototype.Type=0,r.prototype.Data=B.newBuffer([]),r.prototype.filesize=B.Long?B.Long.fromBits(0,0,!0):0,r.prototype.blocksizes=B.emptyArray,r.prototype.hashType=B.Long?B.Long.fromBits(0,0,!0):0,r.prototype.fanout=B.Long?B.Long.fromBits(0,0,!0):0,r.prototype.mode=0,r.prototype.mtime=null,r.encode=function(e,n){if(n||(n=er.create()),n.uint32(8).int32(e.Type),e.Data!=null&&Object.hasOwnProperty.call(e,"Data")&&n.uint32(18).bytes(e.Data),e.filesize!=null&&Object.hasOwnProperty.call(e,"filesize")&&n.uint32(24).uint64(e.filesize),e.blocksizes!=null&&e.blocksizes.length)for(var i=0;i<e.blocksizes.length;++i)n.uint32(32).uint64(e.blocksizes[i]);return e.hashType!=null&&Object.hasOwnProperty.call(e,"hashType")&&n.uint32(40).uint64(e.hashType),e.fanout!=null&&Object.hasOwnProperty.call(e,"fanout")&&n.uint32(48).uint64(e.fanout),e.mode!=null&&Object.hasOwnProperty.call(e,"mode")&&n.uint32(56).uint32(e.mode),e.mtime!=null&&Object.hasOwnProperty.call(e,"mtime")&&j.UnixTime.encode(e.mtime,n.uint32(66).fork()).ldelim(),n},r.decode=function(e,n){e instanceof Ut||(e=Ut.create(e));for(var i=n===void 0?e.len:e.pos+n,o=new j.Data;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.Type=e.int32();break;case 2:o.Data=e.bytes();break;case 3:o.filesize=e.uint64();break;case 4:if(o.blocksizes&&o.blocksizes.length||(o.blocksizes=[]),(s&7)===2)for(var u=e.uint32()+e.pos;e.pos<u;)o.blocksizes.push(e.uint64());else o.blocksizes.push(e.uint64());break;case 5:o.hashType=e.uint64();break;case 6:o.fanout=e.uint64();break;case 7:o.mode=e.uint32();break;case 8:o.mtime=j.UnixTime.decode(e,e.uint32());break;default:e.skipType(s&7);break}}if(!o.hasOwnProperty("Type"))throw B.ProtocolError("missing required 'Type'",{instance:o});return o},r.fromObject=function(e){if(e instanceof j.Data)return e;var n=new j.Data;switch(e.Type){case"Raw":case 0:n.Type=0;break;case"Directory":case 1:n.Type=1;break;case"File":case 2:n.Type=2;break;case"Metadata":case 3:n.Type=3;break;case"Symlink":case 4:n.Type=4;break;case"HAMTShard":case 5:n.Type=5;break}if(e.Data!=null&&(typeof e.Data=="string"?B.base64.decode(e.Data,n.Data=B.newBuffer(B.base64.length(e.Data)),0):e.Data.length&&(n.Data=e.Data)),e.filesize!=null&&(B.Long?(n.filesize=B.Long.fromValue(e.filesize)).unsigned=!0:typeof e.filesize=="string"?n.filesize=parseInt(e.filesize,10):typeof e.filesize=="number"?n.filesize=e.filesize:typeof e.filesize=="object"&&(n.filesize=new B.LongBits(e.filesize.low>>>0,e.filesize.high>>>0).toNumber(!0))),e.blocksizes){if(!Array.isArray(e.blocksizes))throw TypeError(".Data.blocksizes: array expected");n.blocksizes=[];for(var i=0;i<e.blocksizes.length;++i)B.Long?(n.blocksizes[i]=B.Long.fromValue(e.blocksizes[i])).unsigned=!0:typeof e.blocksizes[i]=="string"?n.blocksizes[i]=parseInt(e.blocksizes[i],10):typeof e.blocksizes[i]=="number"?n.blocksizes[i]=e.blocksizes[i]:typeof e.blocksizes[i]=="object"&&(n.blocksizes[i]=new B.LongBits(e.blocksizes[i].low>>>0,e.blocksizes[i].high>>>0).toNumber(!0))}if(e.hashType!=null&&(B.Long?(n.hashType=B.Long.fromValue(e.hashType)).unsigned=!0:typeof e.hashType=="string"?n.hashType=parseInt(e.hashType,10):typeof e.hashType=="number"?n.hashType=e.hashType:typeof e.hashType=="object"&&(n.hashType=new B.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0))),e.fanout!=null&&(B.Long?(n.fanout=B.Long.fromValue(e.fanout)).unsigned=!0:typeof e.fanout=="string"?n.fanout=parseInt(e.fanout,10):typeof e.fanout=="number"?n.fanout=e.fanout:typeof e.fanout=="object"&&(n.fanout=new B.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0))),e.mode!=null&&(n.mode=e.mode>>>0),e.mtime!=null){if(typeof e.mtime!="object")throw TypeError(".Data.mtime: object expected");n.mtime=j.UnixTime.fromObject(e.mtime)}return n},r.toObject=function(e,n){n||(n={});var i={};if((n.arrays||n.defaults)&&(i.blocksizes=[]),n.defaults){if(i.Type=n.enums===String?"Raw":0,n.bytes===String?i.Data="":(i.Data=[],n.bytes!==Array&&(i.Data=B.newBuffer(i.Data))),B.Long){var o=new B.Long(0,0,!0);i.filesize=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.filesize=n.longs===String?"0":0;if(B.Long){var o=new B.Long(0,0,!0);i.hashType=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.hashType=n.longs===String?"0":0;if(B.Long){var o=new B.Long(0,0,!0);i.fanout=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.fanout=n.longs===String?"0":0;i.mode=0,i.mtime=null}if(e.Type!=null&&e.hasOwnProperty("Type")&&(i.Type=n.enums===String?j.Data.DataType[e.Type]:e.Type),e.Data!=null&&e.hasOwnProperty("Data")&&(i.Data=n.bytes===String?B.base64.encode(e.Data,0,e.Data.length):n.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),e.filesize!=null&&e.hasOwnProperty("filesize")&&(typeof e.filesize=="number"?i.filesize=n.longs===String?String(e.filesize):e.filesize:i.filesize=n.longs===String?B.Long.prototype.toString.call(e.filesize):n.longs===Number?new B.LongBits(e.filesize.low>>>0,e.filesize.high>>>0).toNumber(!0):e.filesize),e.blocksizes&&e.blocksizes.length){i.blocksizes=[];for(var s=0;s<e.blocksizes.length;++s)typeof e.blocksizes[s]=="number"?i.blocksizes[s]=n.longs===String?String(e.blocksizes[s]):e.blocksizes[s]:i.blocksizes[s]=n.longs===String?B.Long.prototype.toString.call(e.blocksizes[s]):n.longs===Number?new B.LongBits(e.blocksizes[s].low>>>0,e.blocksizes[s].high>>>0).toNumber(!0):e.blocksizes[s]}return e.hashType!=null&&e.hasOwnProperty("hashType")&&(typeof e.hashType=="number"?i.hashType=n.longs===String?String(e.hashType):e.hashType:i.hashType=n.longs===String?B.Long.prototype.toString.call(e.hashType):n.longs===Number?new B.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0):e.hashType),e.fanout!=null&&e.hasOwnProperty("fanout")&&(typeof e.fanout=="number"?i.fanout=n.longs===String?String(e.fanout):e.fanout:i.fanout=n.longs===String?B.Long.prototype.toString.call(e.fanout):n.longs===Number?new B.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0):e.fanout),e.mode!=null&&e.hasOwnProperty("mode")&&(i.mode=e.mode),e.mtime!=null&&e.hasOwnProperty("mtime")&&(i.mtime=j.UnixTime.toObject(e.mtime,n)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,ut.default.util.toJSONOptions)},r.DataType=function(){let t={},e=Object.create(t);return e[t[0]="Raw"]=0,e[t[1]="Directory"]=1,e[t[2]="File"]=2,e[t[3]="Metadata"]=3,e[t[4]="Symlink"]=4,e[t[5]="HAMTShard"]=5,e}(),r})(),m0=j.UnixTime=(()=>{function r(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)t[e[n]]!=null&&(this[e[n]]=t[e[n]])}return r.prototype.Seconds=B.Long?B.Long.fromBits(0,0,!1):0,r.prototype.FractionalNanoseconds=0,r.encode=function(e,n){return n||(n=er.create()),n.uint32(8).int64(e.Seconds),e.FractionalNanoseconds!=null&&Object.hasOwnProperty.call(e,"FractionalNanoseconds")&&n.uint32(21).fixed32(e.FractionalNanoseconds),n},r.decode=function(e,n){e instanceof Ut||(e=Ut.create(e));for(var i=n===void 0?e.len:e.pos+n,o=new j.UnixTime;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.Seconds=e.int64();break;case 2:o.FractionalNanoseconds=e.fixed32();break;default:e.skipType(s&7);break}}if(!o.hasOwnProperty("Seconds"))throw B.ProtocolError("missing required 'Seconds'",{instance:o});return o},r.fromObject=function(e){if(e instanceof j.UnixTime)return e;var n=new j.UnixTime;return e.Seconds!=null&&(B.Long?(n.Seconds=B.Long.fromValue(e.Seconds)).unsigned=!1:typeof e.Seconds=="string"?n.Seconds=parseInt(e.Seconds,10):typeof e.Seconds=="number"?n.Seconds=e.Seconds:typeof e.Seconds=="object"&&(n.Seconds=new B.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber())),e.FractionalNanoseconds!=null&&(n.FractionalNanoseconds=e.FractionalNanoseconds>>>0),n},r.toObject=function(e,n){n||(n={});var i={};if(n.defaults){if(B.Long){var o=new B.Long(0,0,!1);i.Seconds=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.Seconds=n.longs===String?"0":0;i.FractionalNanoseconds=0}return e.Seconds!=null&&e.hasOwnProperty("Seconds")&&(typeof e.Seconds=="number"?i.Seconds=n.longs===String?String(e.Seconds):e.Seconds:i.Seconds=n.longs===String?B.Long.prototype.toString.call(e.Seconds):n.longs===Number?new B.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber():e.Seconds),e.FractionalNanoseconds!=null&&e.hasOwnProperty("FractionalNanoseconds")&&(i.FractionalNanoseconds=e.FractionalNanoseconds),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,ut.default.util.toJSONOptions)},r})(),g0=j.Metadata=(()=>{function r(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)t[e[n]]!=null&&(this[e[n]]=t[e[n]])}return r.prototype.MimeType="",r.encode=function(e,n){return n||(n=er.create()),e.MimeType!=null&&Object.hasOwnProperty.call(e,"MimeType")&&n.uint32(10).string(e.MimeType),n},r.decode=function(e,n){e instanceof Ut||(e=Ut.create(e));for(var i=n===void 0?e.len:e.pos+n,o=new j.Metadata;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.MimeType=e.string();break;default:e.skipType(s&7);break}}return o},r.fromObject=function(e){if(e instanceof j.Metadata)return e;var n=new j.Metadata;return e.MimeType!=null&&(n.MimeType=String(e.MimeType)),n},r.toObject=function(e,n){n||(n={});var i={};return n.defaults&&(i.MimeType=""),e.MimeType!=null&&e.hasOwnProperty("MimeType")&&(i.MimeType=e.MimeType),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,ut.default.util.toJSONOptions)},r})();var ct=mi,gi=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],w1=["directory","hamt-sharded-directory"],Di=parseInt("0644",8),wi=parseInt("0755",8);function rr(r){if(r!=null)return typeof r=="number"?r&4095:(r=r.toString(),r.substring(0,1)==="0"?parseInt(r,8)&4095:parseInt(r,10)&4095)}function bi(r){if(r==null)return;let t;if(r.secs!=null&&(t={secs:r.secs,nsecs:r.nsecs}),r.Seconds!=null&&(t={secs:r.Seconds,nsecs:r.FractionalNanoseconds}),Array.isArray(r)&&(t={secs:r[0],nsecs:r[1]}),r instanceof Date){let e=r.getTime(),n=Math.floor(e/1e3);t={secs:n,nsecs:(e-n*1e3)*1e3}}if(!!Object.prototype.hasOwnProperty.call(t,"secs")){if(t!=null&&t.nsecs!=null&&(t.nsecs<0||t.nsecs>999999999))throw(0,ye.default)(new Error("mtime-nsecs must be within the range [0,999999999]"),"ERR_INVALID_MTIME_NSECS");return t}}var H=class{static unmarshal(t){let e=ct.decode(t),n=ct.toObject(e,{defaults:!1,arrays:!0,longs:Number,objects:!1}),i=new H({type:gi[n.Type],data:n.Data,blockSizes:n.blocksizes,mode:n.mode,mtime:n.mtime?{secs:n.mtime.Seconds,nsecs:n.mtime.FractionalNanoseconds}:void 0});return i._originalMode=n.mode||0,i}constructor(t={type:"file"}){let{type:e,data:n,blockSizes:i,hashType:o,fanout:s,mtime:u,mode:a}=t;if(e&&!gi.includes(e))throw(0,ye.default)(new Error("Type: "+e+" is not valid"),"ERR_INVALID_TYPE");this.type=e||"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i||[],this._originalMode=0,this.mode=rr(a),u&&(this.mtime=bi(u),this.mtime&&!this.mtime.nsecs&&(this.mtime.nsecs=0))}set mode(t){this._mode=this.isDirectory()?wi:Di;let e=rr(t);e!==void 0&&(this._mode=e)}get mode(){return this._mode}isDirectory(){return Boolean(this.type&&w1.includes(this.type))}addBlockSize(t){this.blockSizes.push(t)}removeBlockSize(t){this.blockSizes.splice(t,1)}fileSize(){if(this.isDirectory())return 0;let t=0;return this.blockSizes.forEach(e=>{t+=e}),this.data&&(t+=this.data.length),t}marshal(){let t;switch(this.type){case"raw":t=ct.DataType.Raw;break;case"directory":t=ct.DataType.Directory;break;case"file":t=ct.DataType.File;break;case"metadata":t=ct.DataType.Metadata;break;case"symlink":t=ct.DataType.Symlink;break;case"hamt-sharded-directory":t=ct.DataType.HAMTShard;break;default:throw(0,ye.default)(new Error("Type: "+t+" is not valid"),"ERR_INVALID_TYPE")}let e=this.data;(!this.data||!this.data.length)&&(e=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(rr(this.mode)||0),n===Di&&!this.isDirectory()&&(n=void 0),n===wi&&this.isDirectory()&&(n=void 0));let i;if(this.mtime!=null){let s=bi(this.mtime);s&&(i={Seconds:s.secs,FractionalNanoseconds:s.nsecs},i.FractionalNanoseconds===0&&delete i.FractionalNanoseconds)}let o={Type:t,Data:e,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i};return ct.encode(o).finish()}};var yt={};V(yt,{code:()=>k1,createLink:()=>Ti,createNode:()=>Ii,decode:()=>L1,encode:()=>Z,name:()=>T1,prepare:()=>J,validate:()=>or});var b1=new TextDecoder;function nr(r,t){let e=0;for(let n=0;;n+=7){if(n>=64)throw new Error("protobuf: varint overflow");if(t>=r.length)throw new Error("protobuf: unexpected end of data");let i=r[t++];if(e+=n<28?(i&127)<<n:(i&127)*2**n,i<128)break}return[e,t]}function me(r,t){let e;[e,t]=nr(r,t);let n=t+e;if(e<0||n<0)throw new Error("protobuf: invalid length");if(n>r.length)throw new Error("protobuf: unexpected end of data");return[r.subarray(t,n),n]}function _i(r,t){let e;return[e,t]=nr(r,t),[e&7,e>>3,t]}function _1(r){let t={},e=r.length,n=0;for(;n<e;){let i,o;if([i,o,n]=_i(r,n),o===1){if(t.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Hash`);if(t.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[t.Hash,n]=me(r,n)}else if(o===2){if(t.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Name`);if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let s;[s,n]=me(r,n),t.Name=b1.decode(s)}else if(o===3){if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(i!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Tsize`);[t.Tsize,n]=nr(r,n)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${o}`)}if(n>e)throw new Error("protobuf: (PBLink) unexpected end of data");return t}function Ei(r){let t=r.length,e=0,n,i=!1,o;for(;e<t;){let u,a;if([u,a,e]=_i(r,e),u!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${u}`);if(a===1){if(o)throw new Error("protobuf: (PBNode) duplicate Data section");[o,e]=me(r,e),n&&(i=!0)}else if(a===2){if(i)throw new Error("protobuf: (PBNode) duplicate Links section");n||(n=[]);let h;[h,e]=me(r,e),n.push(_1(h))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${a}`)}if(e>t)throw new Error("protobuf: (PBNode) unexpected end of data");let s={};return o&&(s.Data=o),s.Links=n||[],s}var Ai=new TextEncoder,xi=2**32,E1=2**31;function x1(r,t){let e=t.length;if(typeof r.Tsize=="number"){if(r.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(r.Tsize))throw new Error("Tsize too large for encoding");e=Kt(t,e,r.Tsize)-1,t[e]=24}if(typeof r.Name=="string"){let n=Ai.encode(r.Name);e-=n.length,t.set(n,e),e=Kt(t,e,n.length)-1,t[e]=18}return r.Hash&&(e-=r.Hash.length,t.set(r.Hash,e),e=Kt(t,e,r.Hash.length)-1,t[e]=10),t.length-e}function Bi(r){let t=B1(r),e=new Uint8Array(t),n=t;if(r.Data&&(n-=r.Data.length,e.set(r.Data,n),n=Kt(e,n,r.Data.length)-1,e[n]=10),r.Links)for(let i=r.Links.length-1;i>=0;i--){let o=x1(r.Links[i],e.subarray(0,n));n-=o,n=Kt(e,n,o)-1,e[n]=18}return e}function A1(r){let t=0;if(r.Hash){let e=r.Hash.length;t+=1+e+Ot(e)}if(typeof r.Name=="string"){let e=Ai.encode(r.Name).length;t+=1+e+Ot(e)}return typeof r.Tsize=="number"&&(t+=1+Ot(r.Tsize)),t}function B1(r){let t=0;if(r.Data){let e=r.Data.length;t+=1+e+Ot(e)}if(r.Links)for(let e of r.Links){let n=A1(e);t+=1+n+Ot(n)}return t}function Kt(r,t,e){t-=Ot(e);let n=t;for(;e>=E1;)r[t++]=e&127|128,e/=128;for(;e>=128;)r[t++]=e&127|128,e>>>=7;return r[t]=e,n}function Ot(r){return r%2===0&&r++,Math.floor((F1(r)+6)/7)}function F1(r){let t=0;return r>=xi&&(r=Math.floor(r/xi),t=32),r>=1<<16&&(r>>>=16,t+=16),r>=1<<8&&(r>>>=8,t+=8),t+S1[r]}var S1=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8];var C1=["Data","Links"],I1=["Hash","Name","Tsize"],ir=new TextEncoder;function Si(r,t){if(r===t)return 0;let e=r.Name?ir.encode(r.Name):[],n=t.Name?ir.encode(t.Name):[],i=e.length,o=n.length;for(let s=0,u=Math.min(i,o);s<u;++s)if(e[s]!==n[s]){i=e[s],o=n[s];break}return i<o?-1:o<i?1:0}function Fi(r,t){return!Object.keys(r).some(e=>!t.includes(e))}function Ci(r){if(typeof r.asCID=="object"){let e=L.asCID(r);if(!e)throw new TypeError("Invalid DAG-PB form");return{Hash:e}}if(typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let t={};if(r.Hash){let e=L.asCID(r.Hash);try{e||(typeof r.Hash=="string"?e=L.parse(r.Hash):r.Hash instanceof Uint8Array&&(e=L.decode(r.Hash)))}catch(n){throw new TypeError(`Invalid DAG-PB form: ${n.message}`)}e&&(t.Hash=e)}if(!t.Hash)throw new TypeError("Invalid DAG-PB form");return typeof r.Name=="string"&&(t.Name=r.Name),typeof r.Tsize=="number"&&(t.Tsize=r.Tsize),t}function J(r){if((r instanceof Uint8Array||typeof r=="string")&&(r={Data:r}),typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let t={};if(r.Data!==void 0)if(typeof r.Data=="string")t.Data=ir.encode(r.Data);else if(r.Data instanceof Uint8Array)t.Data=r.Data;else throw new TypeError("Invalid DAG-PB form");if(r.Links!==void 0)if(Array.isArray(r.Links))t.Links=r.Links.map(Ci),t.Links.sort(Si);else throw new TypeError("Invalid DAG-PB form");else t.Links=[];return t}function or(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");if(!Fi(r,C1))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(r.Data!==void 0&&!(r.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be a Uint8Array)");if(!Array.isArray(r.Links))throw new TypeError("Invalid DAG-PB form (Links must be an array)");for(let t=0;t<r.Links.length;t++){let e=r.Links[t];if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("Invalid DAG-PB form (bad link object)");if(!Fi(e,I1))throw new TypeError("Invalid DAG-PB form (extraneous properties on link object)");if(!e.Hash)throw new TypeError("Invalid DAG-PB form (link must have a Hash)");if(e.Hash.asCID!==e.Hash)throw new TypeError("Invalid DAG-PB form (link Hash must be a CID)");if(e.Name!==void 0&&typeof e.Name!="string")throw new TypeError("Invalid DAG-PB form (link Name must be a string)");if(e.Tsize!==void 0&&(typeof e.Tsize!="number"||e.Tsize%1!==0))throw new TypeError("Invalid DAG-PB form (link Tsize must be an integer)");if(t>0&&Si(e,r.Links[t-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function Ii(r,t=[]){return J({Data:r,Links:t})}function Ti(r,t,e){return Ci({Hash:e,Name:r,Tsize:t})}var T1="dag-pb",k1=112;function Z(r){or(r);let t={};return r.Links&&(t.Links=r.Links.map(e=>{let n={};return e.Hash&&(n.Hash=e.Hash.bytes),e.Name!==void 0&&(n.Name=e.Name),e.Tsize!==void 0&&(n.Tsize=e.Tsize),n})),r.Data&&(t.Data=r.Data),Bi(t)}function L1(r){let t=Ei(r),e={};return t.Data&&(e.Data=t.Data),t.Links&&(e.Links=t.Links.map(n=>{let i={};try{i.Hash=L.decode(n.Hash)}catch{}if(!i.Hash)throw new Error("Invalid Hash field found in link, expected CID");return n.Name!==void 0&&(i.Name=n.Name),n.Tsize!==void 0&&(i.Tsize=n.Tsize),i})),e}var N1=async(r,t,e)=>{e.codec||(e.codec=yt),e.hasher||(e.hasher=It),e.cidVersion===void 0&&(e.cidVersion=1),e.codec===yt&&e.hasher!==It&&(e.cidVersion=1);let n=await e.hasher.digest(r),i=L.create(e.cidVersion,e.codec.code,n);return e.onlyHash||await t.put(i,r,{signal:e.signal}),i},et=N1;var U1=async(r,t,e)=>{let n=new H({type:"directory",mtime:r.mtime,mode:r.mode}),i=Z(J({Data:n.marshal()})),o=await et(i,t,e),s=r.path;return{cid:o,path:s,unixfs:n,size:i.length}},ki=U1;var Vi=M(Lt(),1);var Hi=M(Se(),1);var Jt={};V(Jt,{code:()=>ge,decode:()=>v1,encode:()=>z1,name:()=>O1});var O1="raw",ge=85,z1=r=>Y(r),v1=r=>Y(r);var Ui=M(Ni(),1);async function R1(r,t){return t(await(0,Ui.default)(r))}var Oi=R1;var zi=M(ie(),1);function M1(r,t,e){return vi(r,t,e)}async function vi(r,t,e){let n=[];for await(let i of(0,zi.default)(r,e.maxChildrenPerNode))n.push(await t(i));return n.length>1?vi(n,t,e):n[0]}var Pi=M1;var Ri=M(ie(),1);async function j1(r,t,e){let n=new sr(e.layerRepeat),i=0,o=1,s=n;for await(let u of(0,Ri.default)(r,e.maxChildrenPerNode))s.isFull()&&(s!==n&&n.addChild(await s.reduce(t)),i&&i%e.layerRepeat===0&&o++,s=new De(o,e.layerRepeat,i),i++),s.append(u);return s&&s!==n&&n.addChild(await s.reduce(t)),n.reduce(t)}var Mi=j1,De=class{constructor(t,e,n=0){this.maxDepth=t,this.layerRepeat=e,this.currentDepth=1,this.iteration=n,this.root=this.node=this.parent={children:[],depth:this.currentDepth,maxDepth:t,maxChildren:(this.maxDepth-this.currentDepth)*this.layerRepeat}}isFull(){if(!this.root.data)return!1;if(this.currentDepth<this.maxDepth&&this.node.maxChildren)return this._addNextNodeToParent(this.node),!1;let t=this._findParent(this.node,this.currentDepth);return t?(this._addNextNodeToParent(t),!1):!0}_addNextNodeToParent(t){this.parent=t;let e={children:[],depth:t.depth+1,parent:t,maxDepth:this.maxDepth,maxChildren:Math.floor(t.children.length/this.layerRepeat)*this.layerRepeat};t.children.push(e),this.currentDepth=e.depth,this.node=e}append(t){this.node.data=t}reduce(t){return this._reduce(this.root,t)}async _reduce(t,e){let n=[];return t.children.length&&(n=await Promise.all(t.children.filter(i=>i.data).map(i=>this._reduce(i,e)))),e((t.data||[]).concat(n))}_findParent(t,e){let n=t.parent;if(!(!n||n.depth===0))return n.children.length===n.maxChildren||!n.maxChildren?this._findParent(n,e):n}},sr=class extends De{constructor(t){super(0,t),this.root.depth=0,this.currentDepth=1}addChild(t){this.root.children.push(t)}reduce(t){return t((this.root.data||[]).concat(this.root.children))}};async function*V1(r,t,e){for await(let n of r.content)yield async()=>{e.progress(n.length,r.path);let i,o={codec:yt,cidVersion:e.cidVersion,hasher:e.hasher,onlyHash:e.onlyHash};return e.rawLeaves?(o.codec=Jt,o.cidVersion=1):(i=new H({type:e.leafType,data:n}),n=Z({Data:i.marshal(),Links:[]})),{cid:await et(n,t,o),unixfs:i,size:n.length}}}var ji=V1;var H1={flat:Oi,balanced:Pi,trickle:Mi};async function*$1(r,t,e){let n=-1,i,o;typeof e.bufferImporter=="function"?o=e.bufferImporter:o=ji;for await(let s of(0,Hi.default)(o(r,t,e),e.blockWriteConcurrency)){if(n++,n===0){i=s;continue}else n===1&&i&&(yield i,i=null);yield s}i&&(i.single=!0,yield i)}var G1=(r,t,e)=>{async function n(i){if(i.length===1&&i[0].single&&e.reduceSingleLeafToSelf){let f=i[0];if(r.mtime!==void 0||r.mode!==void 0){let d=await t.get(f.cid);f.unixfs=new H({type:"file",mtime:r.mtime,mode:r.mode,data:d}),d=Z(J({Data:f.unixfs.marshal()})),f.cid=await et(d,t,{...e,codec:yt,hasher:e.hasher,cidVersion:e.cidVersion}),f.size=d.length}return{cid:f.cid,path:r.path,unixfs:f.unixfs,size:f.size}}let o=new H({type:"file",mtime:r.mtime,mode:r.mode}),s=i.filter(f=>f.cid.code===ge&&f.size||f.unixfs&&!f.unixfs.data&&f.unixfs.fileSize()?!0:Boolean(f.unixfs&&f.unixfs.data&&f.unixfs.data.length)).map(f=>f.cid.code===ge?(o.addBlockSize(f.size),{Name:"",Tsize:f.size,Hash:f.cid}):(!f.unixfs||!f.unixfs.data?o.addBlockSize(f.unixfs&&f.unixfs.fileSize()||0):o.addBlockSize(f.unixfs.data.length),{Name:"",Tsize:f.size,Hash:f.cid})),u={Data:o.marshal(),Links:s},a=Z(J(u));return{cid:await et(a,t,e),path:r.path,unixfs:o,size:a.length+u.Links.reduce((f,d)=>f+d.Tsize,0)}}return n};function q1(r,t,e){let n=H1[e.strategy];if(!n)throw(0,Vi.default)(new Error(`Unknown importer build strategy name: ${e.strategy}`),"ERR_BAD_STRATEGY");return n($1(r,t,e),G1(r,t,e),e)}var $i=q1;var Or=M(Lt(),1);var Co=M(gr(),1),Io=M(So(),1),Er=M(Lt(),1);async function*Ta(r,t){let e,n,i;if(t.minChunkSize&&t.maxChunkSize&&t.avgChunkSize)i=t.avgChunkSize,e=t.minChunkSize,n=t.maxChunkSize;else if(t.avgChunkSize)i=t.avgChunkSize,e=i/3,n=i+i/2;else throw(0,Er.default)(new Error("please specify an average chunk size"),"ERR_INVALID_AVG_CHUNK_SIZE");if(e<16)throw(0,Er.default)(new Error("rabin min must be greater than 16"),"ERR_INVALID_MIN_CHUNK_SIZE");n<e&&(n=e),i<e&&(i=e);let o=Math.floor(Math.log2(i));for await(let s of ka(r,{min:e,max:n,bits:o,window:t.window,polynomial:t.polynomial}))yield s}var To=Ta;async function*ka(r,t){let e=await(0,Io.create)(t.bits,t.min,t.max,t.window),n=new Co.default;for await(let i of r){n.append(i);let o=e.fingerprint(i);for(let s=0;s<o.length;s++){let u=o[s],a=n.slice(0,u);n.consume(u),yield a}}n.length&&(yield n.slice(0))}var Ee=M(gr(),1);async function*La(r,t){let e=new Ee.default,n=0,i=!1,o=t.maxChunkSize;for await(let s of r)for(e.append(s),n+=s.length;n>=o;)if(yield e.slice(0,o),i=!0,o===e.length)e=new Ee.default,n=0;else{let u=new Ee.default;u.append(e.shallowSlice(o)),e=u,n-=o}(!i||n)&&(yield e.slice(0,n))}var ko=La;var Ur=M(Lt(),1);var xr={};V(xr,{identity:()=>Na});var Na=Tt({prefix:"\0",name:"identity",encode:r=>ke(r),decode:r=>Te(r)});var Ar={};V(Ar,{base2:()=>Ua});var Ua=O({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Br={};V(Br,{base8:()=>Oa});var Oa=O({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Fr={};V(Fr,{base10:()=>za});var za=ht({prefix:"9",name:"base10",alphabet:"0123456789"});var Sr={};V(Sr,{base16:()=>va,base16upper:()=>Pa});var va=O({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pa=O({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Cr={};V(Cr,{base36:()=>Ra,base36upper:()=>Ma});var Ra=ht({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ma=ht({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ir={};V(Ir,{base64:()=>ja,base64pad:()=>Va,base64url:()=>Ha,base64urlpad:()=>$a});var ja=O({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Va=O({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ha=O({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),$a=O({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Tr={};V(Tr,{base256emoji:()=>Ka});var Lo=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}"),Ga=Lo.reduce((r,t,e)=>(r[e]=t,r),[]),qa=Lo.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function Wa(r){return r.reduce((t,e)=>(t+=Ga[e],t),"")}function Ya(r){let t=[];for(let e of r){let n=qa[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var Ka=Tt({prefix:"\u{1F680}",name:"base256emoji",encode:Wa,decode:Ya});var kr={};V(kr,{identity:()=>Xa});var No=0,Ja="identity",Uo=Y,Za=r=>Dt(No,Uo(r)),Xa={code:No,name:Ja,encode:Uo,digest:Za};var gc=new TextEncoder,Dc=new TextDecoder;var Lr={...xr,...Ar,...Br,...Fr,...Sr,...Me,...Cr,...Re,...Ir,...Tr},bc={...Ue,...kr};function xe(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function zo(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Oo=zo("utf8","u",r=>{let t=new TextDecoder("utf8");return"u"+t.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Nr=zo("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=xe(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),tu={utf8:Oo,"utf-8":Oo,hex:Lr.base16,latin1:Nr,ascii:Nr,binary:Nr,...Lr},vo=tu;function Ae(r,t="utf8"){let e=vo[t];if(!e)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r,"utf8"):e.decoder.decode(`${e.prefix}${r}`)}async function*eu(r){for await(let t of r){if(t.length===void 0)throw(0,Ur.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof t=="string"||t instanceof String)yield Ae(t.toString());else if(Array.isArray(t))yield Uint8Array.from(t);else if(t instanceof Uint8Array)yield t;else throw(0,Ur.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}}var Po=eu;function ru(r){return Symbol.iterator in r}function nu(r){return Symbol.asyncIterator in r}function iu(r){try{if(r instanceof Uint8Array)return async function*(){yield r}();if(ru(r))return async function*(){yield*r}();if(nu(r))return r}catch{throw(0,Or.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,Or.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}async function*ou(r,t,e){for await(let n of r)if(n.path&&(n.path.substring(0,2)==="./"&&(e.wrapWithDirectory=!0),n.path=n.path.split("/").filter(i=>i&&i!==".").join("/")),n.content){let i;typeof e.chunker=="function"?i=e.chunker:e.chunker==="rabin"?i=To:i=ko;let o;typeof e.chunkValidator=="function"?o=e.chunkValidator:o=Po;let s={path:n.path,mtime:n.mtime,mode:n.mode,content:i(o(iu(n.content),e),e)};yield()=>$i(s,t,e)}else if(n.path){let i={path:n.path,mtime:n.mtime,mode:n.mode};yield()=>ki(i,t,e)}else throw new Error("Import candidate must have content or path or both")}var Ro=ou;var zr=class{constructor(t,e){this.options=e||{},this.root=t.root,this.dir=t.dir,this.path=t.path,this.dirty=t.dirty,this.flat=t.flat,this.parent=t.parent,this.parentKey=t.parentKey,this.unixfs=t.unixfs,this.mode=t.mode,this.mtime=t.mtime,this.cid=void 0,this.size=void 0}async put(t,e){}get(t){return Promise.resolve(this)}async*eachChildSeries(){}async*flush(t){}},gt=zr;var vr=class extends gt{constructor(t,e){super(t,e),this._children={}}async put(t,e){this.cid=void 0,this.size=void 0,this._children[t]=e}get(t){return Promise.resolve(this._children[t])}childCount(){return Object.keys(this._children).length}directChildrenCount(){return this.childCount()}onlyChild(){return this._children[Object.keys(this._children)[0]]}async*eachChildSeries(){let t=Object.keys(this._children);for(let e=0;e<t.length;e++){let n=t[e];yield{key:n,child:this._children[n]}}}async*flush(t){let e=Object.keys(this._children),n=[];for(let h=0;h<e.length;h++){let f=this._children[e[h]];if(f instanceof gt)for await(let d of f.flush(t))f=d,yield f;f.size!=null&&f.cid&&n.push({Name:e[h],Tsize:f.size,Hash:f.cid})}let i=new H({type:"directory",mtime:this.mtime,mode:this.mode}),o={Data:i.marshal(),Links:n},s=Z(J(o)),u=await et(s,t,this.options),a=s.length+o.Links.reduce((h,f)=>h+(f.Tsize==null?0:f.Tsize),0);this.cid=u,this.size=a,yield{cid:u,unixfs:i,path:this.path,size:a}}},ee=vr;var Ho=M(Vo(),1);var $=class{constructor(t,e,n=0){this._options=t,this._popCount=0,this._parent=e,this._posAtParent=n,this._children=new Ho.default,this.key=null}async put(t,e){let n=await this._findNewBucketAndPos(t);await n.bucket._putAt(n,t,e)}async get(t){let e=await this._findChild(t);if(e!=null)return e.value}async del(t){let e=await this._findPlace(t),n=e.bucket._at(e.pos);n!=null&&n.key===t&&e.bucket._delAt(e.pos)}leafCount(){return this._children.compactArray().reduce((e,n)=>n instanceof $?e+n.leafCount():e+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){let t=this._children.compactArray();for(let e of t)e instanceof $?yield*e.eachLeafSeries():yield e}serialize(t,e){let n=[];return e(this._children.reduce((i,o,s)=>(o!=null&&(o instanceof $?i.push(o.serialize(t,e)):i.push(t(o,s))),i),n))}async asyncTransform(t,e){return await $o(this,t,e)}toJSON(){return this.serialize(fu,hu)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(t){let e=await this._findPlace(t),n=e.bucket._at(e.pos);if(!(n instanceof $)&&n!=null&&n.key===t)return n}async _findPlace(t){let e=this._options.hash(typeof t=="string"?Ae(t):t),n=await e.take(this._options.bits),i=this._children.get(n);return i instanceof $?await i._findPlace(e):{bucket:this,pos:n,hash:e,existingChild:i}}async _findNewBucketAndPos(t){let e=await this._findPlace(t);if(e.existingChild!=null&&e.existingChild.key!==t){let n=new $(this._options,e.bucket,e.pos);e.bucket._putObjectAt(e.pos,n);let i=await n._findPlace(e.existingChild.hash);return i.bucket._putAt(i,e.existingChild.key,e.existingChild.value),await n._findNewBucketAndPos(e.hash)}return e}_putAt(t,e,n){this._putObjectAt(t.pos,{key:e,value:n,hash:t.hash})}_putObjectAt(t,e){this._children.get(t)==null&&this._popCount++,this._children.set(t,e)}_delAt(t){if(t===-1)throw new Error("Invalid position");this._children.get(t)!=null&&this._popCount--,this._children.unset(t),this._level()}_level(){if(this._parent!=null&&this._popCount<=1)if(this._popCount===1){let t=this._children.find(cu);if(t!=null&&!(t instanceof $)){let e=t.hash;e.untake(this._options.bits);let n={pos:this._posAtParent,hash:e,bucket:this._parent};this._parent._putAt(n,t.key,t.value)}}else this._parent._delAt(this._posAtParent)}_at(t){return this._children.get(t)}};function cu(r){return Boolean(r)}function fu(r,t){return r.key}function hu(r){return r}async function $o(r,t,e){let n=[];for(let i of r._children.compactArray())if(i instanceof $)await $o(i,t,e);else{let o=await t(i);n.push({bitField:r._children.bitField(),children:o})}return await e(n)}var lu=[255,254,252,248,240,224,192,128],pu=[1,3,7,15,31,63,127,255],Be=class{constructor(t){this._value=t,this._currentBytePos=t.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(t){let e=t,n=0;for(;e>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,e),u=du(i,o-s,s);n=(n<<s)+u,e-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return n}untake(t){for(this._currentBitPos+=t;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function du(r,t,e){let n=yu(t,e);return(r&n)>>>t}function yu(r,t){return lu[r]&pu[Math.min(t+r-1,7)]}function Go(r,t){t||(t=r.reduce((i,o)=>i+o.length,0));let e=xe(t),n=0;for(let i of r)e.set(i,n),n+=i.length;return e}function qo(r){function t(e){return e instanceof Fe?e:new Fe(e,r)}return t}var Fe=class{constructor(t,e){if(!(t instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=t,this._hashFn=e,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(t){let e=t;for(;this._availableBits<e;)await this._produceMoreBits();let n=0;for(;e>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),e),s=i.take(o);n=(n<<o)+s,e-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return n}untake(t){let e=t;for(;e>0;){let n=this._buffers[this._currentBufferIndex],i=Math.min(n.totalBits()-n.availableBits(),e);n.untake(i),e-=i,this._availableBits+=i,this._currentBufferIndex>0&&n.totalBits()===n.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let t=this._depth>0?Go([this._value,Uint8Array.from([this._depth])]):this._value,e=await this._hashFn(t),n=new Be(e);this._buffers.push(n),this._availableBits+=n.availableBits()}};function Wo(r){if(r==null||r.hashFn==null)throw new Error("please define an options.hashFn");let t={bits:r.bits??8,hash:qo(r.hashFn)};return new $(t)}var Pr=class extends gt{constructor(t,e){super(t,e),this._bucket=Wo({hashFn:e.hamtHashFn,bits:e.hamtBucketBits})}async put(t,e){await this._bucket.put(t,e)}get(t){return this._bucket.get(t)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(let{key:t,value:e}of this._bucket.eachLeafSeries())yield{key:t,child:e}}async*flush(t){for await(let e of Ko(this._bucket,t,this,this.options))yield{...e,path:this.path}}},Yo=Pr;async function*Ko(r,t,e,n){let i=r._children,o=[],s=0;for(let c=0;c<i.length;c++){let p=i.get(c);if(!p)continue;let g=c.toString(16).toUpperCase().padStart(2,"0");if(p instanceof $){let k;for await(let m of await Ko(p,t,null,n))k=m;if(!k)throw new Error("Could not flush sharded directory, no subshard found");o.push({Name:g,Tsize:k.size,Hash:k.cid}),s+=k.size}else if(typeof p.value.flush=="function"){let k=p.value,m;for await(let b of k.flush(t))m=b,yield m;let D=g+p.key;o.push({Name:D,Tsize:m.size,Hash:m.cid}),s+=m.size}else{let k=p.value;if(!k.cid)continue;let m=g+p.key,D=k.size;o.push({Name:m,Tsize:D,Hash:k.cid}),s+=D}}let u=Uint8Array.from(i.bitField().reverse()),a=new H({type:"hamt-sharded-directory",data:u,fanout:r.tableSize(),hashType:n.hamtHashCode,mtime:e&&e.mtime,mode:e&&e.mode}),h={Data:a.marshal(),Links:o},f=Z(J(h)),d=await et(f,t,n),A=f.length+s;yield{cid:d,unixfs:a,size:A}}async function Jo(r,t,e,n){let i=t;t instanceof ee&&t.directChildrenCount()>=e&&(i=await mu(t,n));let o=i.parent;if(o){if(i!==t){if(r&&(r.parent=i),!i.parentKey)throw new Error("No parent key found");await o.put(i.parentKey,i)}return Jo(i,o,e,n)}return i}async function mu(r,t){let e=new Yo({root:r.root,dir:!0,parent:r.parent,parentKey:r.parentKey,path:r.path,dirty:r.dirty,flat:!1,mtime:r.mtime,mode:r.mode},t);for await(let{key:n,child:i}of r.eachChildSeries())await e.put(n,i);return e}var Zo=Jo;var gu=(r="")=>(r.trim().match(/([^\\/]|\\\/)+/g)||[]).filter(Boolean),Xo=gu;async function Du(r,t,e){let n=Xo(r.path||""),i=n.length-1,o=t,s="";for(let u=0;u<n.length;u++){let a=n[u];s+=`${s?"/":""}${a}`;let h=u===i;if(o.dirty=!0,o.cid=void 0,o.size=void 0,h)await o.put(a,r),t=await Zo(null,o,e.shardSplitThreshold,e);else{let f=await o.get(a);(!f||!(f instanceof gt))&&(f=new ee({root:!1,dir:!0,parent:o,parentKey:a,path:s,dirty:!0,flat:!0,mtime:f&&f.unixfs&&f.unixfs.mtime,mode:f&&f.unixfs&&f.unixfs.mode},e)),await o.put(a,f),o=f}}return t}async function*Qo(r,t){if(!(r instanceof gt)){r&&r.unixfs&&r.unixfs.isDirectory()&&(yield r);return}yield*r.flush(t)}async function*wu(r,t,e){let n=new ee({root:!0,dir:!0,path:"",dirty:!0,flat:!0},e);for await(let i of r)!i||(n=await Du(i,n,e),(!i.unixfs||!i.unixfs.isDirectory())&&(yield i));if(e.wrapWithDirectory)yield*Qo(n,t);else for await(let i of n.eachChildSeries())!i||(yield*Qo(i.child,t))}var ts=wu;async function*bu(r,t,e={}){let n=mn(e),i;typeof e.dagBuilder=="function"?i=e.dagBuilder:i=Ro;let o;typeof e.treeBuilder=="function"?o=e.treeBuilder:o=ts;let s;Symbol.asyncIterator in r||Symbol.iterator in r?s=r:s=[r];for await(let u of o((0,es.default)(i(s,t,n),n.fileImportConcurrency),t,n))yield{cid:u.cid,path:u.path,unixfs:u.unixfs,size:u.size}}return as(_u);})();
|
|
17
|
-
/*!
|
|
18
|
-
* The buffer module from node.js, for the browser.
|
|
19
|
-
*
|
|
20
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
21
|
-
* @license MIT
|
|
22
|
-
*/
|
|
23
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1
|
+
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.IpfsUnixfsImporter = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
+
"use strict";var IpfsUnixfsImporter=(()=>{var Zi=Object.create;var Wt=Object.defineProperty;var Xi=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var to=Object.getPrototypeOf,eo=Object.prototype.hasOwnProperty;var F=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),U=(r,e)=>{for(var t in e)Wt(r,t,{get:e[t],enumerable:!0})},dr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Qi(e))!eo.call(r,i)&&i!==t&&Wt(r,i,{get:()=>e[i],enumerable:!(n=Xi(e,i))||n.enumerable});return r};var Z=(r,e,t)=>(t=r!=null?Zi(to(r)):{},dr(e||!r||!r.__esModule?Wt(t,"default",{value:r,enumerable:!0}):t,r)),ro=r=>dr(Wt({},"__esModule",{value:!0}),r);var yr=F((R1,pr)=>{"use strict";pr.exports=r=>{if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}});var Ar=F((wr,_r)=>{"use strict";var $t=yr(),{hasOwnProperty:mr}=Object.prototype,{propertyIsEnumerable:no}=Object,gt=(r,e,t)=>Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0}),io=wr,gr={concatArrays:!1,ignoreUndefined:!1},Kt=r=>{let e=[];for(let t in r)mr.call(r,t)&&e.push(t);if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(r);for(let n of t)no.call(r,n)&&e.push(n)}return e};function mt(r){return Array.isArray(r)?oo(r):$t(r)?so(r):r}function oo(r){let e=r.slice(0,0);return Kt(r).forEach(t=>{gt(e,t,mt(r[t]))}),e}function so(r){let e=Object.getPrototypeOf(r)===null?Object.create(null):{};return Kt(r).forEach(t=>{gt(e,t,mt(r[t]))}),e}var br=(r,e,t,n)=>(t.forEach(i=>{typeof e[i]>"u"&&n.ignoreUndefined||(i in r&&r[i]!==Object.getPrototypeOf(r)?gt(r,i,ce(r[i],e[i],n)):gt(r,i,mt(e[i])))}),r),ao=(r,e,t)=>{let n=r.slice(0,0),i=0;return[r,e].forEach(o=>{let s=[];for(let c=0;c<o.length;c++)!mr.call(o,c)||(s.push(String(c)),o===r?gt(n,i++,o[c]):gt(n,i++,mt(o[c])));n=br(n,o,Kt(o).filter(c=>!s.includes(c)),t)}),n};function ce(r,e,t){return t.concatArrays&&Array.isArray(r)&&Array.isArray(e)?ao(r,e,t):!$t(e)||!$t(r)?mt(e):br(r,e,Kt(e),t)}_r.exports=function(...r){let e=ce(mt(gr),this!==io&&this||{},gr),t={_:{}};for(let n of r)if(n!==void 0){if(!$t(n))throw new TypeError("`"+n+"` is not an Option Object");t=ce(t,{_:n},e)}return t._}});var Cr=F((It,Zt)=>{(function(r,e){"use strict";var t={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function n(a){if(!Array.isArray(a)&&!ArrayBuffer.isView(a))return!1;for(var h=0;h<a.length;h++)if(!Number.isInteger(a[h])||a[h]<0||a[h]>255)return!1;return!0}function i(a,h){return(a&65535)*h+(((a>>>16)*h&65535)<<16)}function o(a,h){return a<<h|a>>>32-h}function s(a){return a^=a>>>16,a=i(a,2246822507),a^=a>>>13,a=i(a,3266489909),a^=a>>>16,a}function c(a,h){a=[a[0]>>>16,a[0]&65535,a[1]>>>16,a[1]&65535],h=[h[0]>>>16,h[0]&65535,h[1]>>>16,h[1]&65535];var y=[0,0,0,0];return y[3]+=a[3]+h[3],y[2]+=y[3]>>>16,y[3]&=65535,y[2]+=a[2]+h[2],y[1]+=y[2]>>>16,y[2]&=65535,y[1]+=a[1]+h[1],y[0]+=y[1]>>>16,y[1]&=65535,y[0]+=a[0]+h[0],y[0]&=65535,[y[0]<<16|y[1],y[2]<<16|y[3]]}function f(a,h){a=[a[0]>>>16,a[0]&65535,a[1]>>>16,a[1]&65535],h=[h[0]>>>16,h[0]&65535,h[1]>>>16,h[1]&65535];var y=[0,0,0,0];return y[3]+=a[3]*h[3],y[2]+=y[3]>>>16,y[3]&=65535,y[2]+=a[2]*h[3],y[1]+=y[2]>>>16,y[2]&=65535,y[2]+=a[3]*h[2],y[1]+=y[2]>>>16,y[2]&=65535,y[1]+=a[1]*h[3],y[0]+=y[1]>>>16,y[1]&=65535,y[1]+=a[2]*h[2],y[0]+=y[1]>>>16,y[1]&=65535,y[1]+=a[3]*h[1],y[0]+=y[1]>>>16,y[1]&=65535,y[0]+=a[0]*h[3]+a[1]*h[2]+a[2]*h[1]+a[3]*h[0],y[0]&=65535,[y[0]<<16|y[1],y[2]<<16|y[3]]}function l(a,h){return h%=64,h===32?[a[1],a[0]]:h<32?[a[0]<<h|a[1]>>>32-h,a[1]<<h|a[0]>>>32-h]:(h-=32,[a[1]<<h|a[0]>>>32-h,a[0]<<h|a[1]>>>32-h])}function u(a,h){return h%=64,h===0?a:h<32?[a[0]<<h|a[1]>>>32-h,a[1]<<h]:[a[1]<<h-32,0]}function _(a,h){return[a[0]^h[0],a[1]^h[1]]}function v(a){return a=_(a,[0,a[0]>>>1]),a=f(a,[4283543511,3981806797]),a=_(a,[0,a[0]>>>1]),a=f(a,[3301882366,444984403]),a=_(a,[0,a[0]>>>1]),a}t.x86.hash32=function(a,h){if(t.inputValidation&&!n(a))return e;h=h||0;for(var y=a.length%4,L=a.length-y,p=h,g=0,b=3432918353,w=461845907,E=0;E<L;E=E+4)g=a[E]|a[E+1]<<8|a[E+2]<<16|a[E+3]<<24,g=i(g,b),g=o(g,15),g=i(g,w),p^=g,p=o(p,13),p=i(p,5)+3864292196;switch(g=0,y){case 3:g^=a[E+2]<<16;case 2:g^=a[E+1]<<8;case 1:g^=a[E],g=i(g,b),g=o(g,15),g=i(g,w),p^=g}return p^=a.length,p=s(p),p>>>0},t.x86.hash128=function(a,h){if(t.inputValidation&&!n(a))return e;h=h||0;for(var y=a.length%16,L=a.length-y,p=h,g=h,b=h,w=h,E=0,m=0,d=0,A=0,T=597399067,O=2869860233,I=951274213,H=2716044179,B=0;B<L;B=B+16)E=a[B]|a[B+1]<<8|a[B+2]<<16|a[B+3]<<24,m=a[B+4]|a[B+5]<<8|a[B+6]<<16|a[B+7]<<24,d=a[B+8]|a[B+9]<<8|a[B+10]<<16|a[B+11]<<24,A=a[B+12]|a[B+13]<<8|a[B+14]<<16|a[B+15]<<24,E=i(E,T),E=o(E,15),E=i(E,O),p^=E,p=o(p,19),p+=g,p=i(p,5)+1444728091,m=i(m,O),m=o(m,16),m=i(m,I),g^=m,g=o(g,17),g+=b,g=i(g,5)+197830471,d=i(d,I),d=o(d,17),d=i(d,H),b^=d,b=o(b,15),b+=w,b=i(b,5)+2530024501,A=i(A,H),A=o(A,18),A=i(A,T),w^=A,w=o(w,13),w+=p,w=i(w,5)+850148119;switch(E=0,m=0,d=0,A=0,y){case 15:A^=a[B+14]<<16;case 14:A^=a[B+13]<<8;case 13:A^=a[B+12],A=i(A,H),A=o(A,18),A=i(A,T),w^=A;case 12:d^=a[B+11]<<24;case 11:d^=a[B+10]<<16;case 10:d^=a[B+9]<<8;case 9:d^=a[B+8],d=i(d,I),d=o(d,17),d=i(d,H),b^=d;case 8:m^=a[B+7]<<24;case 7:m^=a[B+6]<<16;case 6:m^=a[B+5]<<8;case 5:m^=a[B+4],m=i(m,O),m=o(m,16),m=i(m,I),g^=m;case 4:E^=a[B+3]<<24;case 3:E^=a[B+2]<<16;case 2:E^=a[B+1]<<8;case 1:E^=a[B],E=i(E,T),E=o(E,15),E=i(E,O),p^=E}return p^=a.length,g^=a.length,b^=a.length,w^=a.length,p+=g,p+=b,p+=w,g+=p,b+=p,w+=p,p=s(p),g=s(g),b=s(b),w=s(w),p+=g,p+=b,p+=w,g+=p,b+=p,w+=p,("00000000"+(p>>>0).toString(16)).slice(-8)+("00000000"+(g>>>0).toString(16)).slice(-8)+("00000000"+(b>>>0).toString(16)).slice(-8)+("00000000"+(w>>>0).toString(16)).slice(-8)},t.x64.hash128=function(a,h){if(t.inputValidation&&!n(a))return e;h=h||0;for(var y=a.length%16,L=a.length-y,p=[0,h],g=[0,h],b=[0,0],w=[0,0],E=[2277735313,289559509],m=[1291169091,658871167],d=0;d<L;d=d+16)b=[a[d+4]|a[d+5]<<8|a[d+6]<<16|a[d+7]<<24,a[d]|a[d+1]<<8|a[d+2]<<16|a[d+3]<<24],w=[a[d+12]|a[d+13]<<8|a[d+14]<<16|a[d+15]<<24,a[d+8]|a[d+9]<<8|a[d+10]<<16|a[d+11]<<24],b=f(b,E),b=l(b,31),b=f(b,m),p=_(p,b),p=l(p,27),p=c(p,g),p=c(f(p,[0,5]),[0,1390208809]),w=f(w,m),w=l(w,33),w=f(w,E),g=_(g,w),g=l(g,31),g=c(g,p),g=c(f(g,[0,5]),[0,944331445]);switch(b=[0,0],w=[0,0],y){case 15:w=_(w,u([0,a[d+14]],48));case 14:w=_(w,u([0,a[d+13]],40));case 13:w=_(w,u([0,a[d+12]],32));case 12:w=_(w,u([0,a[d+11]],24));case 11:w=_(w,u([0,a[d+10]],16));case 10:w=_(w,u([0,a[d+9]],8));case 9:w=_(w,[0,a[d+8]]),w=f(w,m),w=l(w,33),w=f(w,E),g=_(g,w);case 8:b=_(b,u([0,a[d+7]],56));case 7:b=_(b,u([0,a[d+6]],48));case 6:b=_(b,u([0,a[d+5]],40));case 5:b=_(b,u([0,a[d+4]],32));case 4:b=_(b,u([0,a[d+3]],24));case 3:b=_(b,u([0,a[d+2]],16));case 2:b=_(b,u([0,a[d+1]],8));case 1:b=_(b,[0,a[d]]),b=f(b,E),b=l(b,31),b=f(b,m),p=_(p,b)}return p=_(p,[0,a.length]),g=_(g,[0,a.length]),p=c(p,g),g=c(g,p),p=v(p),g=v(g),p=c(p,g),g=c(g,p),("00000000"+(p[0]>>>0).toString(16)).slice(-8)+("00000000"+(p[1]>>>0).toString(16)).slice(-8)+("00000000"+(g[0]>>>0).toString(16)).slice(-8)+("00000000"+(g[1]>>>0).toString(16)).slice(-8)},typeof It<"u"?(typeof Zt<"u"&&Zt.exports&&(It=Zt.exports=t),It.murmurHash3=t):typeof define=="function"&&define.amd?define([],function(){return t}):(t._murmurHash3=r.murmurHash3,t.noConflict=function(){return r.murmurHash3=t._murmurHash3,t._murmurHash3=e,t.noConflict=e,t},r.murmurHash3=t)})(It)});var Ur=F((oa,Pr)=>{Pr.exports=Cr()});var Tt=F((pa,Hr)=>{"use strict";function jr(r,e){for(let t in e)Object.defineProperty(r,t,{value:e[t],enumerable:!0,configurable:!0});return r}function ts(r,e,t){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=""),e&&(t.code=e);try{return jr(r,t)}catch{t.message=r.message,t.stack=r.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(r)),jr(new i,t)}}Hr.exports=ts});var qr=F((ya,Mr)=>{"use strict";Mr.exports=es;function es(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(c,f){t[n]=function(u){if(o)if(o=!1,u)f(u);else{for(var _=new Array(arguments.length-1),v=0;v<_.length;)_[v++]=arguments[v];c.apply(null,_)}};try{r.apply(e||null,t)}catch(l){o&&(o=!1,f(l))}})}});var $r=F(Wr=>{"use strict";var Xt=Wr;Xt.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)==="=";)++n;return Math.ceil(e.length*3)/4-n};var vt=new Array(64),Yr=new Array(123);for($=0;$<64;)Yr[vt[$]=$<26?$+65:$<52?$+71:$<62?$-4:$-59|43]=$++;var $;Xt.encode=function(e,t,n){for(var i=null,o=[],s=0,c=0,f;t<n;){var l=e[t++];switch(c){case 0:o[s++]=vt[l>>2],f=(l&3)<<4,c=1;break;case 1:o[s++]=vt[f|l>>4],f=(l&15)<<2,c=2;break;case 2:o[s++]=vt[f|l>>6],o[s++]=vt[l&63],c=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return c&&(o[s++]=vt[f],o[s++]=61,c===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var Gr="invalid encoding";Xt.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var f=e.charCodeAt(c++);if(f===61&&o>1)break;if((f=Yr[f])===void 0)throw Error(Gr);switch(o){case 0:s=f,o=1;break;case 1:t[n++]=s<<2|(f&48)>>4,s=f,o=2;break;case 2:t[n++]=(s&15)<<4|(f&60)>>2,s=f,o=3;break;case 3:t[n++]=(s&3)<<6|f,o=0;break}}if(o===1)throw Error(Gr);return n-i};Xt.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var Jr=F((ma,Kr)=>{"use strict";Kr.exports=Qt;function Qt(){this._listeners={}}Qt.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};Qt.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};Qt.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var nn=F((ba,rn)=>{"use strict";rn.exports=Zr(Zr);function Zr(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(f,l,u){e[0]=f,l[u]=t[0],l[u+1]=t[1],l[u+2]=t[2],l[u+3]=t[3]}function o(f,l,u){e[0]=f,l[u]=t[3],l[u+1]=t[2],l[u+2]=t[1],l[u+3]=t[0]}r.writeFloatLE=n?i:o,r.writeFloatBE=n?o:i;function s(f,l){return t[0]=f[l],t[1]=f[l+1],t[2]=f[l+2],t[3]=f[l+3],e[0]}function c(f,l){return t[3]=f[l],t[2]=f[l+1],t[1]=f[l+2],t[0]=f[l+3],e[0]}r.readFloatLE=n?s:c,r.readFloatBE=n?c:s}():function(){function e(n,i,o,s){var c=i<0?1:0;if(c&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((c<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((c<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var f=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-f)*8388608)&8388607;n((c<<31|f+127<<23|l)>>>0,o,s)}}r.writeFloatLE=e.bind(null,Xr),r.writeFloatBE=e.bind(null,Qr);function t(n,i,o){var s=n(i,o),c=(s>>31)*2+1,f=s>>>23&255,l=s&8388607;return f===255?l?NaN:c*(1/0):f===0?c*1401298464324817e-60*l:c*Math.pow(2,f-150)*(l+8388608)}r.readFloatLE=t.bind(null,tn),r.readFloatBE=t.bind(null,en)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(f,l,u){e[0]=f,l[u]=t[0],l[u+1]=t[1],l[u+2]=t[2],l[u+3]=t[3],l[u+4]=t[4],l[u+5]=t[5],l[u+6]=t[6],l[u+7]=t[7]}function o(f,l,u){e[0]=f,l[u]=t[7],l[u+1]=t[6],l[u+2]=t[5],l[u+3]=t[4],l[u+4]=t[3],l[u+5]=t[2],l[u+6]=t[1],l[u+7]=t[0]}r.writeDoubleLE=n?i:o,r.writeDoubleBE=n?o:i;function s(f,l){return t[0]=f[l],t[1]=f[l+1],t[2]=f[l+2],t[3]=f[l+3],t[4]=f[l+4],t[5]=f[l+5],t[6]=f[l+6],t[7]=f[l+7],e[0]}function c(f,l){return t[7]=f[l],t[6]=f[l+1],t[5]=f[l+2],t[4]=f[l+3],t[3]=f[l+4],t[2]=f[l+5],t[1]=f[l+6],t[0]=f[l+7],e[0]}r.readDoubleLE=n?s:c,r.readDoubleBE=n?c:s}():function(){function e(n,i,o,s,c,f){var l=s<0?1:0;if(l&&(s=-s),s===0)n(0,c,f+i),n(1/s>0?0:2147483648,c,f+o);else if(isNaN(s))n(0,c,f+i),n(2146959360,c,f+o);else if(s>17976931348623157e292)n(0,c,f+i),n((l<<31|2146435072)>>>0,c,f+o);else{var u;if(s<22250738585072014e-324)u=s/5e-324,n(u>>>0,c,f+i),n((l<<31|u/4294967296)>>>0,c,f+o);else{var _=Math.floor(Math.log(s)/Math.LN2);_===1024&&(_=1023),u=s*Math.pow(2,-_),n(u*4503599627370496>>>0,c,f+i),n((l<<31|_+1023<<20|u*1048576&1048575)>>>0,c,f+o)}}}r.writeDoubleLE=e.bind(null,Xr,0,4),r.writeDoubleBE=e.bind(null,Qr,4,0);function t(n,i,o,s,c){var f=n(s,c+i),l=n(s,c+o),u=(l>>31)*2+1,_=l>>>20&2047,v=4294967296*(l&1048575)+f;return _===2047?v?NaN:u*(1/0):_===0?u*5e-324*v:u*Math.pow(2,_-1075)*(v+4503599627370496)}r.readDoubleLE=t.bind(null,tn,0,4),r.readDoubleBE=t.bind(null,en,4,0)}(),r}function Xr(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 Qr(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function tn(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function en(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var on=F((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var an=F(sn=>{"use strict";var Ee=sn;Ee.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};Ee.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var o=null,s=[],c=0,f;t<n;)f=e[t++],f<128?s[c++]=f:f>191&&f<224?s[c++]=(f&31)<<6|e[t++]&63:f>239&&f<365?(f=((f&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,s[c++]=55296+(f>>10),s[c++]=56320+(f&1023)):s[c++]=(f&15)<<12|(e[t++]&63)<<6|e[t++]&63,c>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),c=0);return o?(c&&o.push(String.fromCharCode.apply(String,s.slice(0,c))),o.join("")):String.fromCharCode.apply(String,s.slice(0,c))};Ee.write=function(e,t,n){for(var i=n,o,s,c=0;c<e.length;++c)o=e.charCodeAt(c),o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=o&63|128):(o&64512)===55296&&((s=e.charCodeAt(c+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++c,t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=o&63|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=o&63|128);return n-i}});var cn=F((_a,fn)=>{"use strict";fn.exports=rs;function rs(r,e,t){var n=t||8192,i=n>>>1,o=null,s=n;return function(f){if(f<1||f>i)return r(f);s+f>n&&(o=r(n),s=0);var l=e.call(o,s,s+=f);return s&7&&(s=(s|7)+1),l}}});var ln=F((Aa,un)=>{"use strict";un.exports=C;var Ct=st();function C(r,e){this.lo=r>>>0,this.hi=e>>>0}var ht=C.zero=new C(0,0);ht.toNumber=function(){return 0};ht.zzEncode=ht.zzDecode=function(){return this};ht.length=function(){return 1};var ns=C.zeroHash="\0\0\0\0\0\0\0\0";C.fromNumber=function(e){if(e===0)return ht;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new C(n,i)};C.from=function(e){if(typeof e=="number")return C.fromNumber(e);if(Ct.isString(e))if(Ct.Long)e=Ct.Long.fromString(e);else return C.fromNumber(parseInt(e,10));return e.low||e.high?new C(e.low>>>0,e.high>>>0):ht};C.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296};C.prototype.toLong=function(e){return Ct.Long?new Ct.Long(this.lo|0,this.hi|0,Boolean(e)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(e)}};var ot=String.prototype.charCodeAt;C.fromHash=function(e){return e===ns?ht:new C((ot.call(e,0)|ot.call(e,1)<<8|ot.call(e,2)<<16|ot.call(e,3)<<24)>>>0,(ot.call(e,4)|ot.call(e,5)<<8|ot.call(e,6)<<16|ot.call(e,7)<<24)>>>0)};C.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};C.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};C.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};C.prototype.length=function(){var 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}});var st=F(Te=>{"use strict";var x=Te;x.asPromise=qr();x.base64=$r();x.EventEmitter=Jr();x.float=nn();x.inquire=on();x.utf8=an();x.pool=cn();x.LongBits=ln();x.isNode=Boolean(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);x.global=x.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||Te;x.emptyArray=Object.freeze?Object.freeze([]):[];x.emptyObject=Object.freeze?Object.freeze({}):{};x.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};x.isString=function(e){return typeof e=="string"||e instanceof String};x.isObject=function(e){return e&&typeof e=="object"};x.isset=x.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};x.Buffer=function(){try{var r=x.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();x._Buffer_from=null;x._Buffer_allocUnsafe=null;x.newBuffer=function(e){return typeof e=="number"?x.Buffer?x._Buffer_allocUnsafe(e):new x.Array(e):x.Buffer?x._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};x.Array=typeof Uint8Array<"u"?Uint8Array:Array;x.Long=x.global.dcodeIO&&x.global.dcodeIO.Long||x.global.Long||x.inquire("long");x.key2Re=/^true|false|0|1$/;x.key32Re=/^-?(?:0|[1-9][0-9]*)$/;x.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;x.longToHash=function(e){return e?x.LongBits.from(e).toHash():x.LongBits.zeroHash};x.longFromHash=function(e,t){var n=x.LongBits.fromHash(e);return x.Long?x.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))};function hn(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}x.merge=hn;x.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function dn(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&hn(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}x.newError=dn;x.ProtocolError=dn("ProtocolError");x.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(t[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};x.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};x.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};x._configure=function(){var r=x.Buffer;if(!r){x._Buffer_from=x._Buffer_allocUnsafe=null;return}x._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},x._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var Oe=F((Sa,mn)=>{"use strict";mn.exports=D;var q=st(),ve,te=q.LongBits,pn=q.base64,yn=q.utf8;function Pt(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function De(){}function is(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function D(){this.len=0,this.head=new Pt(De,0,0),this.tail=this.head,this.states=null}var gn=function(){return q.Buffer?function(){return(D.create=function(){return new ve})()}:function(){return new D}};D.create=gn();D.alloc=function(e){return new q.Array(e)};q.Array!==Array&&(D.alloc=q.pool(D.alloc,q.Array.prototype.subarray));D.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Pt(e,t,n),this.len+=t,this};function ke(r,e,t){e[t]=r&255}function os(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function Le(r,e){this.len=r,this.next=void 0,this.val=e}Le.prototype=Object.create(Pt.prototype);Le.prototype.fn=os;D.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Le((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};D.prototype.int32=function(e){return e<0?this._push(Fe,10,te.fromNumber(e)):this.uint32(e)};D.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function Fe(r,e,t){for(;r.hi;)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}D.prototype.uint64=function(e){var t=te.from(e);return this._push(Fe,t.length(),t)};D.prototype.int64=D.prototype.uint64;D.prototype.sint64=function(e){var t=te.from(e).zzEncode();return this._push(Fe,t.length(),t)};D.prototype.bool=function(e){return this._push(ke,1,e?1:0)};function Be(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}D.prototype.fixed32=function(e){return this._push(Be,4,e>>>0)};D.prototype.sfixed32=D.prototype.fixed32;D.prototype.fixed64=function(e){var t=te.from(e);return this._push(Be,4,t.lo)._push(Be,4,t.hi)};D.prototype.sfixed64=D.prototype.fixed64;D.prototype.float=function(e){return this._push(q.float.writeFloatLE,4,e)};D.prototype.double=function(e){return this._push(q.float.writeDoubleLE,8,e)};var ss=q.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};D.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(ke,1,0);if(q.isString(e)){var n=D.alloc(t=pn.length(e));pn.decode(e,n,0),e=n}return this.uint32(t)._push(ss,t,e)};D.prototype.string=function(e){var t=yn.length(e);return t?this.uint32(t)._push(yn.write,t,e):this._push(ke,1,0)};D.prototype.fork=function(){return this.states=new is(this),this.head=this.tail=new Pt(De,0,0),this.len=0,this};D.prototype.reset=function(){return this.states?(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 Pt(De,0,0),this.len=0),this};D.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this};D.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t};D._configure=function(r){ve=r,D.create=gn(),ve._configure()}});var _n=F((Ea,wn)=>{"use strict";wn.exports=Q;var bn=Oe();(Q.prototype=Object.create(bn.prototype)).constructor=Q;var at=st();function Q(){bn.call(this)}Q._configure=function(){Q.alloc=at._Buffer_allocUnsafe,Q.writeBytesBuffer=at.Buffer&&at.Buffer.prototype instanceof Uint8Array&&at.Buffer.prototype.set.name==="set"?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i<e.length;)t[n++]=e[i++]}};Q.prototype.bytes=function(e){at.isString(e)&&(e=at._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Q.writeBytesBuffer,t,e),this};function as(r,e,t){r.length<40?at.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Q.prototype.string=function(e){var t=at.Buffer.byteLength(e);return this.uint32(t),t&&this._push(as,t,e),this};Q._configure()});var Ie=F((Ta,Tn)=>{"use strict";Tn.exports=N;var tt=st(),Ne,Sn=tt.LongBits,fs=tt.utf8;function K(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function N(r){this.buf=r,this.pos=0,this.len=r.length}var An=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new N(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new N(e);throw Error("illegal buffer")},En=function(){return tt.Buffer?function(t){return(N.create=function(i){return tt.Buffer.isBuffer(i)?new Ne(i):An(i)})(t)}:An};N.create=En();N.prototype._slice=tt.Array.prototype.subarray||tt.Array.prototype.slice;N.prototype.uint32=function(){var e=4294967295;return function(){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,K(this,10);return e}}();N.prototype.int32=function(){return this.uint32()|0};N.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function ze(){var r=new Sn(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw K(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw K(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}N.prototype.bool=function(){return this.uint32()!==0};function ee(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}N.prototype.fixed32=function(){if(this.pos+4>this.len)throw K(this,4);return ee(this.buf,this.pos+=4)};N.prototype.sfixed32=function(){if(this.pos+4>this.len)throw K(this,4);return ee(this.buf,this.pos+=4)|0};function xn(){if(this.pos+8>this.len)throw K(this,8);return new Sn(ee(this.buf,this.pos+=4),ee(this.buf,this.pos+=4))}N.prototype.float=function(){if(this.pos+4>this.len)throw K(this,4);var e=tt.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};N.prototype.double=function(){if(this.pos+8>this.len)throw K(this,4);var e=tt.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};N.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw K(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)};N.prototype.string=function(){var e=this.bytes();return fs.read(e,0,e.length)};N.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw K(this,e);this.pos+=e}else do if(this.pos>=this.len)throw K(this);while(this.buf[this.pos++]&128);return this};N.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};N._configure=function(r){Ne=r,N.create=En(),Ne._configure();var e=tt.Long?"toLong":"toNumber";tt.merge(N.prototype,{int64:function(){return ze.call(this)[e](!1)},uint64:function(){return ze.call(this)[e](!0)},sint64:function(){return ze.call(this).zzDecode()[e](!1)},fixed64:function(){return xn.call(this)[e](!0)},sfixed64:function(){return xn.call(this)[e](!1)}})}});var kn=F((va,Dn)=>{"use strict";Dn.exports=dt;var Bn=Ie();(dt.prototype=Object.create(Bn.prototype)).constructor=dt;var vn=st();function dt(r){Bn.call(this,r)}dt._configure=function(){vn.Buffer&&(dt.prototype._slice=vn.Buffer.prototype.slice)};dt.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};dt._configure()});var Fn=F((Ba,Ln)=>{"use strict";Ln.exports=Ut;var Ce=st();(Ut.prototype=Object.create(Ce.EventEmitter.prototype)).constructor=Ut;function Ut(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");Ce.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(t)}Ut.prototype.rpcCall=function r(e,t,n,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return Ce.asPromise(r,s,e,t,n,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(e,t[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(f,l){if(f)return s.emit("error",f,e),o(f);if(l===null){s.end(!0);return}if(!(l instanceof n))try{l=n[s.responseDelimited?"decodeDelimited":"decode"](l)}catch(u){return s.emit("error",u,e),o(u)}return s.emit("data",l,e),o(null,l)})}catch(c){s.emit("error",c,e),setTimeout(function(){o(c)},0);return}};Ut.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var zn=F(On=>{"use strict";var cs=On;cs.Service=Fn()});var In=F((ka,Nn)=>{"use strict";Nn.exports={}});var Un=F(Pn=>{"use strict";var j=Pn;j.build="minimal";j.Writer=Oe();j.BufferWriter=_n();j.Reader=Ie();j.BufferReader=kn();j.util=st();j.rpc=zn();j.roots=In();j.configure=Cn;function Cn(){j.util._configure(),j.Writer._configure(j.BufferWriter),j.Reader._configure(j.BufferReader)}Cn()});var Vn=F((Fa,Rn)=>{"use strict";Rn.exports=Un()});var pi=F((B0,di)=>{var Ge=class{constructor(e,t=12,n=8*1024,i=32*1024,o=64,s){this.bits=t,this.min=n,this.max=i,this.asModule=e,this.rabin=new e.Rabin(t,n,i,o,s),this.polynomial=s}fingerprint(e){let{__retain:t,__release:n,__allocArray:i,__getInt32Array:o,Int32Array_ID:s,Uint8Array_ID:c}=this.asModule,f=new Int32Array(Math.ceil(e.length/this.min)),l=t(i(s,f)),u=t(i(c,e)),_=this.rabin.fingerprint(u,l),v=o(_);n(u),n(l);let a=v.indexOf(0);return a>=0?v.subarray(0,a):v}};di.exports=Ge});var _i=F(qt=>{"use strict";var Us=typeof BigUint64Array<"u",Ht=Symbol(),Mt=1024;function yi(r,e){let t=new Uint32Array(r),n=new Uint16Array(r);var i=t[e+-4>>>2]>>>1,o=e>>>1;if(i<=Mt)return String.fromCharCode.apply(String,n.subarray(o,o+i));let s=[];do{let c=n[o+Mt-1],f=c>=55296&&c<56320?Mt-1:Mt;s.push(String.fromCharCode.apply(String,n.subarray(o,o+=f))),i-=f}while(i>Mt);return s.join("")+String.fromCharCode.apply(String,n.subarray(o,o+i))}function Ye(r){let e={};function t(i,o){return i?yi(i.buffer,o):"<yet unknown>"}let n=r.env=r.env||{};return n.abort=n.abort||function(o,s,c,f){let l=e.memory||n.memory;throw Error("abort: "+t(l,o)+" at "+t(l,s)+":"+c+":"+f)},n.trace=n.trace||function(o,s){let c=e.memory||n.memory;console.log("trace: "+t(c,o)+(s?" ":"")+Array.prototype.slice.call(arguments,2,2+s).join(", "))},r.Math=r.Math||Math,r.Date=r.Date||Date,e}function We(r,e){let t=e.exports,n=t.memory,i=t.table,o=t.__alloc,s=t.__retain,c=t.__rtti_base||-1;function f(m){let d=new Uint32Array(n.buffer),A=d[c>>>2];if((m>>>=0)>=A)throw Error("invalid id: "+m);return d[(c+4>>>2)+m*2]}function l(m){let d=new Uint32Array(n.buffer),A=d[c>>>2];if((m>>>=0)>=A)throw Error("invalid id: "+m);return d[(c+4>>>2)+m*2+1]}function u(m){return 31-Math.clz32(m>>>5&31)}function _(m){return 31-Math.clz32(m>>>14&31)}function v(m){let d=m.length,A=o(d<<1,1),T=new Uint16Array(n.buffer);for(var O=0,I=A>>>1;O<d;++O)T[I+O]=m.charCodeAt(O);return A}r.__allocString=v;function a(m){let d=n.buffer;if(new Uint32Array(d)[m+-8>>>2]!==1)throw Error("not a string: "+m);return yi(d,m)}r.__getString=a;function h(m,d,A){let T=n.buffer;if(A)switch(m){case 2:return new Float32Array(T);case 3:return new Float64Array(T)}else switch(m){case 0:return new(d?Int8Array:Uint8Array)(T);case 1:return new(d?Int16Array:Uint16Array)(T);case 2:return new(d?Int32Array:Uint32Array)(T);case 3:return new(d?BigInt64Array:BigUint64Array)(T)}throw Error("unsupported align: "+m)}function y(m,d){let A=f(m);if(!(A&3))throw Error("not an array: "+m+" @ "+A);let T=u(A),O=d.length,I=o(O<<T,0),H=o(A&2?16:12,m),B=new Uint32Array(n.buffer);B[H+0>>>2]=s(I),B[H+4>>>2]=I,B[H+8>>>2]=O<<T,A&2&&(B[H+12>>>2]=O);let hr=h(T,A&1024,A&2048);if(A&8192)for(let Yt=0;Yt<O;++Yt)hr[(I>>>T)+Yt]=s(d[Yt]);else hr.set(d,I>>>T);return H}r.__allocArray=y;function L(m){let d=new Uint32Array(n.buffer),A=d[m+-8>>>2],T=f(A);if(!(T&1))throw Error("not an array: "+A);let O=u(T);var I=d[m+4>>>2];let H=T&2?d[m+12>>>2]:d[I+-4>>>2]>>>O;return h(O,T&1024,T&2048).subarray(I>>>=O,I+H)}r.__getArrayView=L;function p(m){let d=L(m),A=d.length,T=new Array(A);for(let O=0;O<A;O++)T[O]=d[O];return T}r.__getArray=p;function g(m){let d=n.buffer,A=new Uint32Array(d)[m+-4>>>2];return d.slice(m,m+A)}r.__getArrayBuffer=g;function b(m,d,A){return new m(w(m,d,A))}function w(m,d,A){let T=n.buffer,O=new Uint32Array(T),I=O[A+4>>>2];return new m(T,I,O[I+-4>>>2]>>>d)}r.__getInt8Array=b.bind(null,Int8Array,0),r.__getInt8ArrayView=w.bind(null,Int8Array,0),r.__getUint8Array=b.bind(null,Uint8Array,0),r.__getUint8ArrayView=w.bind(null,Uint8Array,0),r.__getUint8ClampedArray=b.bind(null,Uint8ClampedArray,0),r.__getUint8ClampedArrayView=w.bind(null,Uint8ClampedArray,0),r.__getInt16Array=b.bind(null,Int16Array,1),r.__getInt16ArrayView=w.bind(null,Int16Array,1),r.__getUint16Array=b.bind(null,Uint16Array,1),r.__getUint16ArrayView=w.bind(null,Uint16Array,1),r.__getInt32Array=b.bind(null,Int32Array,2),r.__getInt32ArrayView=w.bind(null,Int32Array,2),r.__getUint32Array=b.bind(null,Uint32Array,2),r.__getUint32ArrayView=w.bind(null,Uint32Array,2),Us&&(r.__getInt64Array=b.bind(null,BigInt64Array,3),r.__getInt64ArrayView=w.bind(null,BigInt64Array,3),r.__getUint64Array=b.bind(null,BigUint64Array,3),r.__getUint64ArrayView=w.bind(null,BigUint64Array,3)),r.__getFloat32Array=b.bind(null,Float32Array,2),r.__getFloat32ArrayView=w.bind(null,Float32Array,2),r.__getFloat64Array=b.bind(null,Float64Array,3),r.__getFloat64ArrayView=w.bind(null,Float64Array,3);function E(m,d){let A=new Uint32Array(n.buffer);var T=A[m+-8>>>2];if(T<=A[c>>>2])do if(T==d)return!0;while(T=l(T));return!1}return r.__instanceof=E,r.memory=r.memory||n,r.table=r.table||i,wi(t,r)}function gi(r){return typeof Response<"u"&&r instanceof Response}async function mi(r,e){return gi(r=await r)?bi(r,e):We(Ye(e||(e={})),await WebAssembly.instantiate(r instanceof WebAssembly.Module?r:await WebAssembly.compile(r),e))}qt.instantiate=mi;function Rs(r,e){return We(Ye(e||(e={})),new WebAssembly.Instance(r instanceof WebAssembly.Module?r:new WebAssembly.Module(r),e))}qt.instantiateSync=Rs;async function bi(r,e){return WebAssembly.instantiateStreaming?We(Ye(e||(e={})),(await WebAssembly.instantiateStreaming(r,e)).instance):mi(gi(r=await r)?r.arrayBuffer():r,e)}qt.instantiateStreaming=bi;function wi(r,e){var t=e?Object.create(e):{},n=r.__argumentsLength?function(i){r.__argumentsLength.value=i}:r.__setArgumentsLength||r.__setargc||function(){};for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let o=r[i],s=i.split("."),c=t;for(;s.length>1;){let u=s.shift();Object.prototype.hasOwnProperty.call(c,u)||(c[u]={}),c=c[u]}let f=s[0],l=f.indexOf("#");if(l>=0){let u=f.substring(0,l),_=c[u];if(typeof _>"u"||!_.prototype){let v=function(...a){return v.wrap(v.prototype.constructor(0,...a))};v.prototype={valueOf:function(){return this[Ht]}},v.wrap=function(a){return Object.create(v.prototype,{[Ht]:{value:a,writable:!1}})},_&&Object.getOwnPropertyNames(_).forEach(a=>Object.defineProperty(v,a,Object.getOwnPropertyDescriptor(_,a))),c[u]=v}if(f=f.substring(l+1),c=c[u].prototype,/^(get|set):/.test(f)){if(!Object.prototype.hasOwnProperty.call(c,f=f.substring(4))){let v=r[i.replace("set:","get:")],a=r[i.replace("get:","set:")];Object.defineProperty(c,f,{get:function(){return v(this[Ht])},set:function(h){a(this[Ht],h)},enumerable:!0})}}else f==="constructor"?(c[f]=(...v)=>(n(v.length),o(...v))).original=o:(c[f]=function(...v){return n(v.length),o(this[Ht],...v)}).original=o}else/^(get|set):/.test(f)?Object.prototype.hasOwnProperty.call(c,f=f.substring(4))||Object.defineProperty(c,f,{get:r[i.replace("set:","get:")],set:r[i.replace("get:","set:")],enumerable:!0}):typeof o=="function"&&o!==n?(c[f]=(...u)=>(n(u.length),o(...u))).original=o:c[f]=o}return t}qt.demangle=wi});var xi=F((k0,Ai)=>{var{instantiate:Vs}=_i();$e.supported=typeof WebAssembly<"u";function $e(r={}){if(!$e.supported)return null;var e=new Uint8Array([0,97,115,109,1,0,0,0,1,78,14,96,2,127,126,0,96,1,127,1,126,96,2,127,127,0,96,1,127,1,127,96,1,127,0,96,2,127,127,1,127,96,3,127,127,127,1,127,96,0,0,96,3,127,127,127,0,96,0,1,127,96,4,127,127,127,127,0,96,5,127,127,127,127,127,1,127,96,1,126,1,127,96,2,126,126,1,126,2,13,1,3,101,110,118,5,97,98,111,114,116,0,10,3,54,53,2,2,8,9,3,5,2,8,6,5,3,4,2,6,9,12,13,2,5,11,3,2,3,2,3,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,6,7,7,4,4,5,3,1,0,1,6,47,9,127,1,65,0,11,127,1,65,0,11,127,0,65,3,11,127,0,65,4,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,0,65,240,2,11,127,0,65,6,11,7,240,5,41,6,109,101,109,111,114,121,2,0,7,95,95,97,108,108,111,99,0,10,8,95,95,114,101,116,97,105,110,0,11,9,95,95,114,101,108,101,97,115,101,0,12,9,95,95,99,111,108,108,101,99,116,0,51,11,95,95,114,116,116,105,95,98,97,115,101,3,7,13,73,110,116,51,50,65,114,114,97,121,95,73,68,3,2,13,85,105,110,116,56,65,114,114,97,121,95,73,68,3,3,6,100,101,103,114,101,101,0,16,3,109,111,100,0,17,5,82,97,98,105,110,3,8,16,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,0,21,16,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,0,22,21,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,23,21,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,24,14,82,97,98,105,110,35,103,101,116,58,119,112,111,115,0,25,14,82,97,98,105,110,35,115,101,116,58,119,112,111,115,0,26,15,82,97,98,105,110,35,103,101,116,58,99,111,117,110,116,0,27,15,82,97,98,105,110,35,115,101,116,58,99,111,117,110,116,0,28,13,82,97,98,105,110,35,103,101,116,58,112,111,115,0,29,13,82,97,98,105,110,35,115,101,116,58,112,111,115,0,30,15,82,97,98,105,110,35,103,101,116,58,115,116,97,114,116,0,31,15,82,97,98,105,110,35,115,101,116,58,115,116,97,114,116,0,32,16,82,97,98,105,110,35,103,101,116,58,100,105,103,101,115,116,0,33,16,82,97,98,105,110,35,115,101,116,58,100,105,103,101,115,116,0,34,21,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,35,21,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,36,22,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,37,22,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,38,31,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,39,31,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,40,20,82,97,98,105,110,35,103,101,116,58,112,111,108,121,110,111,109,105,97,108,0,41,20,82,97,98,105,110,35,115,101,116,58,112,111,108,121,110,111,109,105,97,108,0,42,17,82,97,98,105,110,35,103,101,116,58,109,105,110,115,105,122,101,0,43,17,82,97,98,105,110,35,115,101,116,58,109,105,110,115,105,122,101,0,44,17,82,97,98,105,110,35,103,101,116,58,109,97,120,115,105,122,101,0,45,17,82,97,98,105,110,35,115,101,116,58,109,97,120,115,105,122,101,0,46,14,82,97,98,105,110,35,103,101,116,58,109,97,115,107,0,47,14,82,97,98,105,110,35,115,101,116,58,109,97,115,107,0,48,17,82,97,98,105,110,35,99,111,110,115,116,114,117,99,116,111,114,0,20,17,82,97,98,105,110,35,102,105,110,103,101,114,112,114,105,110,116,0,49,8,1,50,10,165,31,53,199,1,1,4,127,32,1,40,2,0,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,3,65,4,107,118,65,16,115,33,4,32,3,65,7,107,11,33,3,32,1,40,2,20,33,2,32,1,40,2,16,34,5,4,64,32,5,32,2,54,2,20,11,32,2,4,64,32,2,32,5,54,2,16,11,32,1,32,0,32,4,32,3,65,4,116,106,65,2,116,106,40,2,96,70,4,64,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,2,54,2,96,32,2,69,4,64,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,65,127,115,113,34,1,54,2,4,32,1,69,4,64,32,0,32,0,40,2,0,65,1,32,3,116,65,127,115,113,54,2,0,11,11,11,11,226,2,1,6,127,32,1,40,2,0,33,3,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,34,5,65,1,113,4,64,32,3,65,124,113,65,16,106,32,5,65,124,113,106,34,2,65,240,255,255,255,3,73,4,64,32,0,32,4,16,1,32,1,32,2,32,3,65,3,113,114,34,3,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,33,5,11,11,32,3,65,2,113,4,64,32,1,65,4,107,40,2,0,34,2,40,2,0,34,6,65,124,113,65,16,106,32,3,65,124,113,106,34,7,65,240,255,255,255,3,73,4,64,32,0,32,2,16,1,32,2,32,7,32,6,65,3,113,114,34,3,54,2,0,32,2,33,1,11,11,32,4,32,5,65,2,114,54,2,0,32,4,65,4,107,32,1,54,2,0,32,0,32,3,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,2,65,4,107,118,65,16,115,33,4,32,2,65,7,107,11,34,3,65,4,116,32,4,106,65,2,116,106,40,2,96,33,2,32,1,65,0,54,2,16,32,1,32,2,54,2,20,32,2,4,64,32,2,32,1,54,2,16,11,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,1,54,2,96,32,0,32,0,40,2,0,65,1,32,3,116,114,54,2,0,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,114,54,2,4,11,119,1,1,127,32,2,2,127,32,0,40,2,160,12,34,2,4,64,32,2,32,1,65,16,107,70,4,64,32,2,40,2,0,33,3,32,1,65,16,107,33,1,11,11,32,1,11,107,34,2,65,48,73,4,64,15,11,32,1,32,3,65,2,113,32,2,65,32,107,65,1,114,114,54,2,0,32,1,65,0,54,2,16,32,1,65,0,54,2,20,32,1,32,2,106,65,16,107,34,2,65,2,54,2,0,32,0,32,2,54,2,160,12,32,0,32,1,16,2,11,155,1,1,3,127,35,0,34,0,69,4,64,65,1,63,0,34,0,74,4,127,65,1,32,0,107,64,0,65,0,72,5,65,0,11,4,64,0,11,65,176,3,34,0,65,0,54,2,0,65,208,15,65,0,54,2,0,3,64,32,1,65,23,73,4,64,32,1,65,2,116,65,176,3,106,65,0,54,2,4,65,0,33,2,3,64,32,2,65,16,73,4,64,32,1,65,4,116,32,2,106,65,2,116,65,176,3,106,65,0,54,2,96,32,2,65,1,106,33,2,12,1,11,11,32,1,65,1,106,33,1,12,1,11,11,65,176,3,65,224,15,63,0,65,16,116,16,3,65,176,3,36,0,11,32,0,11,45,0,32,0,65,240,255,255,255,3,79,4,64,65,32,65,224,0,65,201,3,65,29,16,0,0,11,32,0,65,15,106,65,112,113,34,0,65,16,32,0,65,16,75,27,11,169,1,1,1,127,32,0,32,1,65,128,2,73,4,127,32,1,65,4,118,33,1,65,0,5,32,1,65,248,255,255,255,1,73,4,64,32,1,65,1,65,27,32,1,103,107,116,106,65,1,107,33,1,11,32,1,65,31,32,1,103,107,34,2,65,4,107,118,65,16,115,33,1,32,2,65,7,107,11,34,2,65,2,116,106,40,2,4,65,127,32,1,116,113,34,1,4,127,32,0,32,1,104,32,2,65,4,116,106,65,2,116,106,40,2,96,5,32,0,40,2,0,65,127,32,2,65,1,106,116,113,34,1,4,127,32,0,32,0,32,1,104,34,0,65,2,116,106,40,2,4,104,32,0,65,4,116,106,65,2,116,106,40,2,96,5,65,0,11,11,11,111,1,1,127,63,0,34,2,32,1,65,248,255,255,255,1,73,4,127,32,1,65,1,65,27,32,1,103,107,116,65,1,107,106,5,32,1,11,65,16,32,0,40,2,160,12,32,2,65,16,116,65,16,107,71,116,106,65,255,255,3,106,65,128,128,124,113,65,16,118,34,1,32,2,32,1,74,27,64,0,65,0,72,4,64,32,1,64,0,65,0,72,4,64,0,11,11,32,0,32,2,65,16,116,63,0,65,16,116,16,3,11,113,1,2,127,32,1,40,2,0,34,3,65,124,113,32,2,107,34,4,65,32,79,4,64,32,1,32,2,32,3,65,2,113,114,54,2,0,32,2,32,1,65,16,106,106,34,1,32,4,65,16,107,65,1,114,54,2,0,32,0,32,1,16,2,5,32,1,32,3,65,126,113,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,32,1,65,16,106,32,1,40,2,0,65,124,113,106,40,2,0,65,125,113,54,2,0,11,11,91,1,2,127,32,0,32,1,16,5,34,4,16,6,34,3,69,4,64,65,1,36,1,65,0,36,1,32,0,32,4,16,6,34,3,69,4,64,32,0,32,4,16,7,32,0,32,4,16,6,33,3,11,11,32,3,65,0,54,2,4,32,3,32,2,54,2,8,32,3,32,1,54,2,12,32,0,32,3,16,1,32,0,32,3,32,4,16,8,32,3,11,13,0,16,4,32,0,32,1,16,9,65,16,106,11,33,1,1,127,32,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,18,0,32,0,65,172,3,75,4,64,32,0,65,16,107,16,52,11,11,140,3,1,1,127,2,64,32,1,69,13,0,32,0,65,0,58,0,0,32,0,32,1,106,65,1,107,65,0,58,0,0,32,1,65,2,77,13,0,32,0,65,1,106,65,0,58,0,0,32,0,65,2,106,65,0,58,0,0,32,0,32,1,106,34,2,65,2,107,65,0,58,0,0,32,2,65,3,107,65,0,58,0,0,32,1,65,6,77,13,0,32,0,65,3,106,65,0,58,0,0,32,0,32,1,106,65,4,107,65,0,58,0,0,32,1,65,8,77,13,0,32,1,65,0,32,0,107,65,3,113,34,1,107,33,2,32,0,32,1,106,34,0,65,0,54,2,0,32,0,32,2,65,124,113,34,1,106,65,4,107,65,0,54,2,0,32,1,65,8,77,13,0,32,0,65,4,106,65,0,54,2,0,32,0,65,8,106,65,0,54,2,0,32,0,32,1,106,34,2,65,12,107,65,0,54,2,0,32,2,65,8,107,65,0,54,2,0,32,1,65,24,77,13,0,32,0,65,12,106,65,0,54,2,0,32,0,65,16,106,65,0,54,2,0,32,0,65,20,106,65,0,54,2,0,32,0,65,24,106,65,0,54,2,0,32,0,32,1,106,34,2,65,28,107,65,0,54,2,0,32,2,65,24,107,65,0,54,2,0,32,2,65,20,107,65,0,54,2,0,32,2,65,16,107,65,0,54,2,0,32,0,32,0,65,4,113,65,24,106,34,2,106,33,0,32,1,32,2,107,33,1,3,64,32,1,65,32,79,4,64,32,0,66,0,55,3,0,32,0,65,8,106,66,0,55,3,0,32,0,65,16,106,66,0,55,3,0,32,0,65,24,106,66,0,55,3,0,32,1,65,32,107,33,1,32,0,65,32,106,33,0,12,1,11,11,11,11,178,1,1,3,127,32,1,65,240,255,255,255,3,32,2,118,75,4,64,65,144,1,65,192,1,65,23,65,56,16,0,0,11,32,1,32,2,116,34,3,65,0,16,10,34,2,32,3,16,13,32,0,69,4,64,65,12,65,2,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,2,34,1,32,0,40,2,0,34,4,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,32,4,16,12,11,32,0,32,1,54,2,0,32,0,32,2,54,2,4,32,0,32,3,54,2,8,32,0,11,46,1,2,127,65,12,65,5,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,65,128,2,65,3,16,14,11,9,0,65,63,32,0,121,167,107,11,49,1,2,127,65,63,32,1,121,167,107,33,2,3,64,65,63,32,0,121,167,107,32,2,107,34,3,65,0,78,4,64,32,0,32,1,32,3,172,134,133,33,0,12,1,11,11,32,0,11,40,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,163,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,65,0,58,0,0,11,38,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,152,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,45,0,0,11,254,5,2,1,127,4,126,32,0,69,4,64,65,232,0,65,6,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,24,32,0,66,0,55,3,32,32,0,66,0,55,3,40,32,0,66,0,55,3,48,32,0,66,0,55,3,56,32,0,66,0,55,3,64,32,0,66,0,55,3,72,32,0,66,0,55,3,80,32,0,66,0,55,3,88,32,0,66,0,55,3,96,32,0,32,2,173,55,3,80,32,0,32,3,173,55,3,88,65,12,65,4,16,10,34,2,65,172,3,75,4,64,32,2,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,32,4,65,0,16,14,33,2,32,0,40,2,0,16,12,32,0,32,2,54,2,0,32,0,32,4,54,2,4,32,0,66,1,32,1,173,134,66,1,125,55,3,96,32,0,66,243,130,183,218,216,230,232,30,55,3,72,35,4,69,4,64,65,0,33,2,3,64,32,2,65,128,2,72,4,64,32,2,65,255,1,113,173,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,65,0,33,4,3,64,32,4,32,0,40,2,4,65,1,107,72,4,64,32,6,66,8,134,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,32,4,65,1,106,33,4,12,1,11,11,35,6,40,2,4,32,2,65,3,116,106,32,6,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,63,32,0,41,3,72,121,167,107,172,33,7,65,0,33,2,3,64,32,2,65,128,2,72,4,64,35,5,33,1,32,2,172,32,7,134,34,8,33,6,65,63,32,0,41,3,72,34,9,121,167,107,33,3,3,64,65,63,32,6,121,167,107,32,3,107,34,4,65,0,78,4,64,32,6,32,9,32,4,172,134,133,33,6,12,1,11,11,32,1,40,2,4,32,2,65,3,116,106,32,6,32,8,132,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,1,36,4,11,32,0,66,0,55,3,24,32,0,66,0,55,3,32,65,0,33,2,3,64,32,2,32,0,40,2,4,72,4,64,32,0,40,2,0,32,2,16,18,32,2,65,1,106,33,2,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,6,66,45,136,167,65,3,116,106,41,3,0,32,6,66,8,134,66,1,132,133,55,3,40,32,0,11,38,1,1,127,32,0,40,2,0,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,55,1,2,127,32,1,32,0,40,2,0,34,2,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,16,12,11,32,0,32,1,54,2,0,11,7,0,32,0,40,2,4,11,9,0,32,0,32,1,54,2,4,11,7,0,32,0,40,2,8,11,9,0,32,0,32,1,54,2,8,11,7,0,32,0,41,3,16,11,9,0,32,0,32,1,55,3,16,11,7,0,32,0,41,3,24,11,9,0,32,0,32,1,55,3,24,11,7,0,32,0,41,3,32,11,9,0,32,0,32,1,55,3,32,11,7,0,32,0,41,3,40,11,9,0,32,0,32,1,55,3,40,11,7,0,32,0,41,3,48,11,9,0,32,0,32,1,55,3,48,11,7,0,32,0,41,3,56,11,9,0,32,0,32,1,55,3,56,11,7,0,32,0,41,3,64,11,9,0,32,0,32,1,55,3,64,11,7,0,32,0,41,3,72,11,9,0,32,0,32,1,55,3,72,11,7,0,32,0,41,3,80,11,9,0,32,0,32,1,55,3,80,11,7,0,32,0,41,3,88,11,9,0,32,0,32,1,55,3,88,11,7,0,32,0,41,3,96,11,9,0,32,0,32,1,55,3,96,11,172,4,2,5,127,1,126,32,2,65,172,3,75,4,64,32,2,65,16,107,34,4,32,4,40,2,4,65,1,106,54,2,4,11,32,2,33,4,65,0,33,2,32,1,40,2,8,33,5,32,1,40,2,4,33,6,3,64,2,127,65,0,33,3,3,64,32,3,32,5,72,4,64,32,3,32,6,106,45,0,0,33,1,32,0,40,2,0,32,0,40,2,8,16,19,33,7,32,0,40,2,8,32,0,40,2,0,40,2,4,106,32,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,7,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,1,173,32,8,66,8,134,132,133,55,3,40,32,0,32,0,41,3,16,66,1,124,55,3,16,32,0,32,0,41,3,24,66,1,124,55,3,24,32,0,41,3,16,32,0,41,3,80,90,4,127,32,0,41,3,40,32,0,41,3,96,131,80,5,65,0,11,4,127,65,1,5,32,0,41,3,16,32,0,41,3,88,90,11,4,64,32,0,32,0,41,3,32,55,3,48,32,0,32,0,41,3,16,55,3,56,32,0,32,0,41,3,40,55,3,64,65,0,33,1,3,64,32,1,32,0,40,2,4,72,4,64,32,0,40,2,0,32,1,16,18,32,1,65,1,106,33,1,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,8,66,8,134,66,1,132,133,55,3,40,32,3,65,1,106,12,3,11,32,3,65,1,106,33,3,12,1,11,11,65,127,11,34,1,65,0,78,4,64,32,5,32,1,107,33,5,32,1,32,6,106,33,6,32,2,34,1,65,1,106,33,2,32,4,40,2,4,32,1,65,2,116,106,32,0,41,3,56,62,2,0,12,1,11,11,32,4,11,10,0,16,15,36,5,16,15,36,6,11,3,0,1,11,73,1,2,127,32,0,40,2,4,34,1,65,255,255,255,255,0,113,34,2,65,1,70,4,64,32,0,65,16,106,16,53,32,0,32,0,40,2,0,65,1,114,54,2,0,35,0,32,0,16,2,5,32,0,32,2,65,1,107,32,1,65,128,128,128,128,127,113,114,54,2,4,11,11,58,0,2,64,2,64,2,64,32,0,65,8,107,40,2,0,14,7,0,0,1,1,1,1,1,2,11,15,11,32,0,40,2,0,34,0,4,64,32,0,65,172,3,79,4,64,32,0,65,16,107,16,52,11,11,15,11,0,11,11,137,3,7,0,65,16,11,55,40,0,0,0,1,0,0,0,1,0,0,0,40,0,0,0,97,0,108,0,108,0,111,0,99,0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,111,0,111,0,32,0,108,0,97,0,114,0,103,0,101,0,65,208,0,11,45,30,0,0,0,1,0,0,0,1,0,0,0,30,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,47,0,116,0,108,0,115,0,102,0,46,0,116,0,115,0,65,128,1,11,43,28,0,0,0,1,0,0,0,1,0,0,0,28,0,0,0,73,0,110,0,118,0,97,0,108,0,105,0,100,0,32,0,108,0,101,0,110,0,103,0,116,0,104,0,65,176,1,11,53,38,0,0,0,1,0,0,0,1,0,0,0,38,0,0,0,126,0,108,0,105,0,98,0,47,0,97,0,114,0,114,0,97,0,121,0,98,0,117,0,102,0,102,0,101,0,114,0,46,0,116,0,115,0,65,240,1,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,73,0,110,0,100,0,101,0,120,0,32,0,111,0,117,0,116,0,32,0,111,0,102,0,32,0,114,0,97,0,110,0,103,0,101,0,65,176,2,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,126,0,108,0,105,0,98,0,47,0,116,0,121,0,112,0,101,0,100,0,97,0,114,0,114,0,97,0,121,0,46,0,116,0,115,0,65,240,2,11,53,7,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,145,4,0,0,2,0,0,0,49,0,0,0,2,0,0,0,17,1,0,0,2,0,0,0,16,0,34,16,115,111,117,114,99,101,77,97,112,112,105,110,103,85,82,76,16,46,47,114,97,98,105,110,46,119,97,115,109,46,109,97,112]);return Vs(new Response(new Blob([e],{type:"application/wasm"})),r)}Ai.exports=$e});var Ti=F((L0,Ei)=>{var Si=pi(),js=xi(),Hs=async(r,e,t,n,i)=>{let o=await js();return new Si(o,r,e,t,n,i)};Ei.exports={Rabin:Si,create:Hs}});var Ri=F((bf,Ui)=>{"use strict";Ui.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(e,t){let n=this._internalPositionFor(e,!1);if(t===void 0)n!==-1&&(this._unsetInternalPos(n),this._unsetBit(e),this._changedLength=!0,this._changedData=!0);else{let i=!1;n===-1?(n=this._data.length,this._setBit(e),this._changedData=!0):i=!0,this._setInternalPos(n,e,t,i),this._changedLength=!0}}unset(e){this.set(e,void 0)}get(e){this._sortData();let t=this._internalPositionFor(e,!0);if(t!==-1)return this._data[t][1]}push(e){return this.set(this.length,e),this.length}get length(){if(this._sortData(),this._changedLength){let e=this._data[this._data.length-1];this._length=e?e[0]+1:0,this._changedLength=!1}return this._length}forEach(e){let t=0;for(;t<this.length;)e(this.get(t),t,this),t++}map(e){let t=0,n=new Array(this.length);for(;t<this.length;)n[t]=e(this.get(t),t,this),t++;return n}reduce(e,t){let n=0,i=t;for(;n<this.length;){let o=this.get(n);i=e(i,o,n),n++}return i}find(e){let t=0,n,i;for(;t<this.length&&!n;)i=this.get(t),n=e(i),t++;return n?i:void 0}_internalPositionFor(e,t){let n=this._bytePosFor(e,t);if(n>=this._bitArrays.length)return-1;let i=this._bitArrays[n],o=e-n*7;if(!((i&1<<o)>0))return-1;let c=this._bitArrays.slice(0,n).reduce(w1,0),f=~(4294967295<<o+1),l=Pi(i&f);return c+l-1}_bytePosFor(e,t){let n=Math.floor(e/7),i=n+1;for(;!t&&this._bitArrays.length<i;)this._bitArrays.push(0);return n}_setBit(e){let t=this._bytePosFor(e,!1);this._bitArrays[t]|=1<<e-t*7}_unsetBit(e){let t=this._bytePosFor(e,!1);this._bitArrays[t]&=~(1<<e-t*7)}_setInternalPos(e,t,n,i){let o=this._data,s=[t,n];if(i)this._sortData(),o[e]=s;else{if(o.length)if(o[o.length-1][0]>=t)o.push(s);else if(o[0][0]<=t)o.unshift(s);else{let c=Math.round(o.length/2);this._data=o.slice(0,c).concat(s).concat(o.slice(c))}else this._data.push(s);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(e){this._data.splice(e,1)}_sortData(){this._changedData&&this._data.sort(_1),this._changedData=!1}bitField(){let e=[],t=8,n=0,i=0,o,s=this._bitArrays.slice();for(;s.length||n;){n===0&&(o=s.shift(),n=7);let f=Math.min(n,t),l=~(255<<f);i|=(o&l)<<8-t,o=o>>>f,n-=f,t-=f,(!t||!n&&!s.length)&&(e.push(i),i=0,t=8)}for(var c=e.length-1;c>0&&e[c]===0;c--)e.pop();return e}compactArray(){return this._sortData(),this._data.map(A1)}};function w1(r,e){return r+Pi(e)}function Pi(r){let e=r;return e=e-(e>>1&1431655765),e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}function _1(r,e){return r[0]-e[0]}function A1(r){return r[1]}});var N1={};U(N1,{importer:()=>z1});async function*ut(r,e=1){let t=[];e<1&&(e=1);for await(let n of r)for(t.push(n);t.length>=e;)yield t.slice(0,e),t=t.slice(e);for(;t.length>0;)yield t.slice(0,e),t=t.slice(e)}async function*kt(r,e=1){for await(let t of ut(r,e)){let n=t.map(async i=>await i().then(o=>({ok:!0,value:o}),o=>({ok:!1,err:o})));for(let i=0;i<n.length;i++){let o=await n[i];if(o.ok)yield o.value;else throw o.err}}}var xr=Z(Ar(),1),Sr=xr.default;var ye={};U(ye,{sha256:()=>xt,sha512:()=>Lo});var Lt={};U(Lt,{coerce:()=>M,empty:()=>Er,equals:()=>ue,fromHex:()=>co,fromString:()=>le,isBinary:()=>uo,toHex:()=>fo,toString:()=>he});var Er=new Uint8Array(0),fo=r=>r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),co=r=>{let e=r.match(/../g);return e?new Uint8Array(e.map(t=>parseInt(t,16))):Er},ue=(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},M=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")},uo=r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),le=r=>new TextEncoder().encode(r),he=r=>new TextDecoder().decode(r);var lo=Br,Tr=128,ho=127,po=~ho,yo=Math.pow(2,31);function Br(r,e,t){e=e||[],t=t||0;for(var n=t;r>=yo;)e[t++]=r&255|Tr,r/=128;for(;r&po;)e[t++]=r&255|Tr,r>>>=7;return e[t]=r|0,Br.bytes=t-n+1,e}var go=de,mo=128,vr=127;function de(r,n){var t=0,n=n||0,i=0,o=n,s,c=r.length;do{if(o>=c)throw de.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&vr)<<i:(s&vr)*Math.pow(2,i),i+=7}while(s>=mo);return de.bytes=o-n,t}var bo=Math.pow(2,7),wo=Math.pow(2,14),_o=Math.pow(2,21),Ao=Math.pow(2,28),xo=Math.pow(2,35),So=Math.pow(2,42),Eo=Math.pow(2,49),To=Math.pow(2,56),vo=Math.pow(2,63),Bo=function(r){return r<bo?1:r<wo?2:r<_o?3:r<Ao?4:r<xo?5:r<So?6:r<Eo?7:r<To?8:r<vo?9:10},Do={encode:lo,decode:go,encodingLength:Bo},ko=Do,Ft=ko;var Ot=(r,e=0)=>[Ft.decode(r,e),Ft.decode.bytes],bt=(r,e,t=0)=>(Ft.encode(r,e,t),e),wt=r=>Ft.encodingLength(r);var lt=(r,e)=>{let t=e.byteLength,n=wt(r),i=n+wt(t),o=new Uint8Array(i+t);return bt(r,o,0),bt(t,o,n),o.set(e,i),new _t(r,t,e,o)},Dr=r=>{let e=M(r),[t,n]=Ot(e),[i,o]=Ot(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new _t(t,i,s,e)},kr=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&ue(r.bytes,t.bytes)}},_t=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var At=({name:r,code:e,encode:t})=>new pe(r,e,t),pe=class{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?lt(this.code,t):t.then(n=>lt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Fr=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),xt=At({name:"sha2-256",code:18,encode:Fr("SHA-256")}),Lo=At({name:"sha2-512",code:19,encode:Fr("SHA-512")});var _e={};U(_e,{base58btc:()=>X,base58flickr:()=>Co});function Fo(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 i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var c=r.length,f=r.charAt(0),l=Math.log(c)/Math.log(256),u=Math.log(256)/Math.log(c);function _(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 y=0,L=0,p=0,g=h.length;p!==g&&h[p]===0;)p++,y++;for(var b=(g-p)*u+1>>>0,w=new Uint8Array(b);p!==g;){for(var E=h[p],m=0,d=b-1;(E!==0||m<L)&&d!==-1;d--,m++)E+=256*w[d]>>>0,w[d]=E%c>>>0,E=E/c>>>0;if(E!==0)throw new Error("Non-zero carry");L=m,p++}for(var A=b-L;A!==b&&w[A]===0;)A++;for(var T=f.repeat(y);A<b;++A)T+=r.charAt(w[A]);return T}function v(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var y=0;if(h[y]!==" "){for(var L=0,p=0;h[y]===f;)L++,y++;for(var g=(h.length-y)*l+1>>>0,b=new Uint8Array(g);h[y];){var w=t[h.charCodeAt(y)];if(w===255)return;for(var E=0,m=g-1;(w!==0||E<p)&&m!==-1;m--,E++)w+=c*b[m]>>>0,b[m]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");p=E,y++}if(h[y]!==" "){for(var d=g-p;d!==g&&b[d]===0;)d++;for(var A=new Uint8Array(L+(g-d)),T=L;d!==g;)A[T++]=b[d++];return A}}}function a(h){var y=v(h);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:v,decode:a}}var Oo=Fo,zo=Oo,Or=zo;var ge=class{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")}},me=class{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 zr(this,e)}},be=class{constructor(e){this.decoders=e}or(e){return zr(this,e)}decode(e){let t=e[0],n=this.decoders[t];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`)}},zr=(r,e)=>new be({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),we=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new ge(e,t,n),this.decoder=new me(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},St=({name:r,prefix:e,encode:t,decode:n})=>new we(r,e,t,n),it=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Or(t,e);return St({prefix:r,name:e,encode:n,decode:o=>M(i(o))})},No=(r,e,t,n)=>{let i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),c=0,f=0,l=0;for(let u=0;u<o;++u){let _=i[r[u]];if(_===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|_,c+=t,c>=8&&(c-=8,s[l++]=255&f>>c)}if(c>=t||255&f<<8-c)throw new SyntaxError("Unexpected end of data");return s},Io=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,c=0;for(let f=0;f<r.length;++f)for(c=c<<8|r[f],s+=8;s>t;)s-=t,o+=e[i&c>>s];if(s&&(o+=e[i&c<<t-s]),n)for(;o.length*t&7;)o+="=";return o},z=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>St({prefix:e,name:r,encode(i){return Io(i,n,t)},decode(i){return No(i,n,t,r)}});var X=it({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Co=it({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ae={};U(Ae,{base32:()=>Et,base32hex:()=>Vo,base32hexpad:()=>Ho,base32hexpadupper:()=>Mo,base32hexupper:()=>jo,base32pad:()=>Uo,base32padupper:()=>Ro,base32upper:()=>Po,base32z:()=>qo});var Et=z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Po=z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Uo=z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ro=z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Vo=z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),jo=z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ho=z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Mo=z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),qo=z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Go=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return Wo(t,xe(r),e||X.encoder);default:return $o(t,xe(r),e||Et.encoder)}},Nr=new WeakMap,xe=r=>{let e=Nr.get(r);if(e==null){let t=new Map;return Nr.set(r,t),t}return e},k=class{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==Nt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Ko)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return k.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=lt(e,t);return k.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 k.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&kr(e.multihash,n.multihash)}toString(e){return Go(this,e)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}link(){return this}get[Symbol.toStringTag](){return"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 k)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new k(n,i,o,s||Ir(n,i,o.bytes))}else if(t[Jo]===!0){let{version:n,multihash:i,code:o}=t,s=Dr(i);return k.create(n,o,s)}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!==Nt)throw new Error(`Version 0 CID must use dag-pb (code: ${Nt}) block encoding`);return new k(e,t,n,n.bytes)}case 1:{let i=Ir(e,t,n.bytes);return new k(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return k.create(0,Nt,e)}static createV1(e,t){return k.create(1,e,t)}static decode(e){let[t,n]=k.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=k.inspectBytes(e),n=t.size-t.multihashSize,i=M(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new _t(t.multihashCode,t.digestSize,o,i);return[t.version===0?k.createV0(s):k.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[_,v]=Ot(e.subarray(t));return t+=v,_},i=n(),o=Nt;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,c=n(),f=n(),l=t+f,u=l-s;return{version:i,codec:o,multihashCode:c,digestSize:f,multihashSize:u,size:l}}static parse(e,t){let[n,i]=Yo(e,t),o=k.decode(i);return xe(o).set(n,e),o}},Yo=(r,e)=>{switch(r[0]){case"Q":{let t=e||X;return[X.prefix,t.decode(`${X.prefix}${r}`)]}case X.prefix:{let t=e||X;return[X.prefix,t.decode(r)]}case Et.prefix:{let t=e||Et;return[Et.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},Wo=(r,e,t)=>{let{prefix:n}=t;if(n!==X.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i},$o=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i},Nt=112,Ko=18,Ir=(r,e,t)=>{let n=wt(r),i=n+wt(e),o=new Uint8Array(i+t.byteLength);return bt(r,o,0),bt(e,o,n),o.set(t,i),o},Jo=Symbol.for("@ipld/js-cid/CID");var Se=Z(Ur(),1);function Zo(r){let e=new Array(4);for(let t=0;t<4;t++)e[t]=r&255,r=r>>8;return new Uint8Array(e)}var fa=At({name:"murmur3-32",code:35,encode:r=>Zo(Se.default.x86.hash32(r))}),Rr=At({name:"murmur3-128",code:34,encode:r=>Lt.fromHex(Se.default.x64.hash128(r))});async function Xo(r){return(await Rr.encode(r)).slice(0,8).reverse()}var Qo={chunker:"fixed",strategy:"balanced",rawLeaves:!1,onlyHash:!1,reduceSingleLeafToSelf:!0,hasher:xt,leafType:"file",cidVersion:0,progress:()=>()=>{},shardSplitThreshold:1e3,fileImportConcurrency:50,blockWriteConcurrency:10,minChunkSize:262144,maxChunkSize:262144,avgChunkSize:262144,window:16,polynomial:0x3df305dfb2a804,maxChildrenPerNode:174,layerRepeat:4,wrapWithDirectory:!1,recursive:!1,hidden:!1,timeout:void 0,hamtHashFn:Xo,hamtHashCode:34,hamtBucketBits:8},Vr=(r={})=>Sr.bind({ignoreUndefined:!0})(Qo,r);var re=Z(Tt(),1);var et=Z(Vn(),1),Bt=et.default.Reader,Pe=et.default.Writer,S=et.default.util,P=et.default.roots["ipfs-unixfs"]||(et.default.roots["ipfs-unixfs"]={}),jn=P.Data=(()=>{function r(e){if(this.blocksizes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return r.prototype.Type=0,r.prototype.Data=S.newBuffer([]),r.prototype.filesize=S.Long?S.Long.fromBits(0,0,!0):0,r.prototype.blocksizes=S.emptyArray,r.prototype.hashType=S.Long?S.Long.fromBits(0,0,!0):0,r.prototype.fanout=S.Long?S.Long.fromBits(0,0,!0):0,r.prototype.mode=0,r.prototype.mtime=null,r.encode=function(t,n){if(n||(n=Pe.create()),n.uint32(8).int32(t.Type),t.Data!=null&&Object.hasOwnProperty.call(t,"Data")&&n.uint32(18).bytes(t.Data),t.filesize!=null&&Object.hasOwnProperty.call(t,"filesize")&&n.uint32(24).uint64(t.filesize),t.blocksizes!=null&&t.blocksizes.length)for(var i=0;i<t.blocksizes.length;++i)n.uint32(32).uint64(t.blocksizes[i]);return t.hashType!=null&&Object.hasOwnProperty.call(t,"hashType")&&n.uint32(40).uint64(t.hashType),t.fanout!=null&&Object.hasOwnProperty.call(t,"fanout")&&n.uint32(48).uint64(t.fanout),t.mode!=null&&Object.hasOwnProperty.call(t,"mode")&&n.uint32(56).uint32(t.mode),t.mtime!=null&&Object.hasOwnProperty.call(t,"mtime")&&P.UnixTime.encode(t.mtime,n.uint32(66).fork()).ldelim(),n},r.decode=function(t,n){t instanceof Bt||(t=Bt.create(t));for(var i=n===void 0?t.len:t.pos+n,o=new P.Data;t.pos<i;){var s=t.uint32();switch(s>>>3){case 1:o.Type=t.int32();break;case 2:o.Data=t.bytes();break;case 3:o.filesize=t.uint64();break;case 4:if(o.blocksizes&&o.blocksizes.length||(o.blocksizes=[]),(s&7)===2)for(var c=t.uint32()+t.pos;t.pos<c;)o.blocksizes.push(t.uint64());else o.blocksizes.push(t.uint64());break;case 5:o.hashType=t.uint64();break;case 6:o.fanout=t.uint64();break;case 7:o.mode=t.uint32();break;case 8:o.mtime=P.UnixTime.decode(t,t.uint32());break;default:t.skipType(s&7);break}}if(!o.hasOwnProperty("Type"))throw S.ProtocolError("missing required 'Type'",{instance:o});return o},r.fromObject=function(t){if(t instanceof P.Data)return t;var n=new P.Data;switch(t.Type){case"Raw":case 0:n.Type=0;break;case"Directory":case 1:n.Type=1;break;case"File":case 2:n.Type=2;break;case"Metadata":case 3:n.Type=3;break;case"Symlink":case 4:n.Type=4;break;case"HAMTShard":case 5:n.Type=5;break}if(t.Data!=null&&(typeof t.Data=="string"?S.base64.decode(t.Data,n.Data=S.newBuffer(S.base64.length(t.Data)),0):t.Data.length&&(n.Data=t.Data)),t.filesize!=null&&(S.Long?(n.filesize=S.Long.fromValue(t.filesize)).unsigned=!0:typeof t.filesize=="string"?n.filesize=parseInt(t.filesize,10):typeof t.filesize=="number"?n.filesize=t.filesize:typeof t.filesize=="object"&&(n.filesize=new S.LongBits(t.filesize.low>>>0,t.filesize.high>>>0).toNumber(!0))),t.blocksizes){if(!Array.isArray(t.blocksizes))throw TypeError(".Data.blocksizes: array expected");n.blocksizes=[];for(var i=0;i<t.blocksizes.length;++i)S.Long?(n.blocksizes[i]=S.Long.fromValue(t.blocksizes[i])).unsigned=!0:typeof t.blocksizes[i]=="string"?n.blocksizes[i]=parseInt(t.blocksizes[i],10):typeof t.blocksizes[i]=="number"?n.blocksizes[i]=t.blocksizes[i]:typeof t.blocksizes[i]=="object"&&(n.blocksizes[i]=new S.LongBits(t.blocksizes[i].low>>>0,t.blocksizes[i].high>>>0).toNumber(!0))}if(t.hashType!=null&&(S.Long?(n.hashType=S.Long.fromValue(t.hashType)).unsigned=!0:typeof t.hashType=="string"?n.hashType=parseInt(t.hashType,10):typeof t.hashType=="number"?n.hashType=t.hashType:typeof t.hashType=="object"&&(n.hashType=new S.LongBits(t.hashType.low>>>0,t.hashType.high>>>0).toNumber(!0))),t.fanout!=null&&(S.Long?(n.fanout=S.Long.fromValue(t.fanout)).unsigned=!0:typeof t.fanout=="string"?n.fanout=parseInt(t.fanout,10):typeof t.fanout=="number"?n.fanout=t.fanout:typeof t.fanout=="object"&&(n.fanout=new S.LongBits(t.fanout.low>>>0,t.fanout.high>>>0).toNumber(!0))),t.mode!=null&&(n.mode=t.mode>>>0),t.mtime!=null){if(typeof t.mtime!="object")throw TypeError(".Data.mtime: object expected");n.mtime=P.UnixTime.fromObject(t.mtime)}return n},r.toObject=function(t,n){n||(n={});var i={};if((n.arrays||n.defaults)&&(i.blocksizes=[]),n.defaults){if(i.Type=n.enums===String?"Raw":0,n.bytes===String?i.Data="":(i.Data=[],n.bytes!==Array&&(i.Data=S.newBuffer(i.Data))),S.Long){var o=new S.Long(0,0,!0);i.filesize=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.filesize=n.longs===String?"0":0;if(S.Long){var o=new S.Long(0,0,!0);i.hashType=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.hashType=n.longs===String?"0":0;if(S.Long){var o=new S.Long(0,0,!0);i.fanout=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.fanout=n.longs===String?"0":0;i.mode=0,i.mtime=null}if(t.Type!=null&&t.hasOwnProperty("Type")&&(i.Type=n.enums===String?P.Data.DataType[t.Type]:t.Type),t.Data!=null&&t.hasOwnProperty("Data")&&(i.Data=n.bytes===String?S.base64.encode(t.Data,0,t.Data.length):n.bytes===Array?Array.prototype.slice.call(t.Data):t.Data),t.filesize!=null&&t.hasOwnProperty("filesize")&&(typeof t.filesize=="number"?i.filesize=n.longs===String?String(t.filesize):t.filesize:i.filesize=n.longs===String?S.Long.prototype.toString.call(t.filesize):n.longs===Number?new S.LongBits(t.filesize.low>>>0,t.filesize.high>>>0).toNumber(!0):t.filesize),t.blocksizes&&t.blocksizes.length){i.blocksizes=[];for(var s=0;s<t.blocksizes.length;++s)typeof t.blocksizes[s]=="number"?i.blocksizes[s]=n.longs===String?String(t.blocksizes[s]):t.blocksizes[s]:i.blocksizes[s]=n.longs===String?S.Long.prototype.toString.call(t.blocksizes[s]):n.longs===Number?new S.LongBits(t.blocksizes[s].low>>>0,t.blocksizes[s].high>>>0).toNumber(!0):t.blocksizes[s]}return t.hashType!=null&&t.hasOwnProperty("hashType")&&(typeof t.hashType=="number"?i.hashType=n.longs===String?String(t.hashType):t.hashType:i.hashType=n.longs===String?S.Long.prototype.toString.call(t.hashType):n.longs===Number?new S.LongBits(t.hashType.low>>>0,t.hashType.high>>>0).toNumber(!0):t.hashType),t.fanout!=null&&t.hasOwnProperty("fanout")&&(typeof t.fanout=="number"?i.fanout=n.longs===String?String(t.fanout):t.fanout:i.fanout=n.longs===String?S.Long.prototype.toString.call(t.fanout):n.longs===Number?new S.LongBits(t.fanout.low>>>0,t.fanout.high>>>0).toNumber(!0):t.fanout),t.mode!=null&&t.hasOwnProperty("mode")&&(i.mode=t.mode),t.mtime!=null&&t.hasOwnProperty("mtime")&&(i.mtime=P.UnixTime.toObject(t.mtime,n)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,et.default.util.toJSONOptions)},r.DataType=function(){let e={},t=Object.create(e);return t[e[0]="Raw"]=0,t[e[1]="Directory"]=1,t[e[2]="File"]=2,t[e[3]="Metadata"]=3,t[e[4]="Symlink"]=4,t[e[5]="HAMTShard"]=5,t}(),r})(),Oa=P.UnixTime=(()=>{function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return r.prototype.Seconds=S.Long?S.Long.fromBits(0,0,!1):0,r.prototype.FractionalNanoseconds=0,r.encode=function(t,n){return n||(n=Pe.create()),n.uint32(8).int64(t.Seconds),t.FractionalNanoseconds!=null&&Object.hasOwnProperty.call(t,"FractionalNanoseconds")&&n.uint32(21).fixed32(t.FractionalNanoseconds),n},r.decode=function(t,n){t instanceof Bt||(t=Bt.create(t));for(var i=n===void 0?t.len:t.pos+n,o=new P.UnixTime;t.pos<i;){var s=t.uint32();switch(s>>>3){case 1:o.Seconds=t.int64();break;case 2:o.FractionalNanoseconds=t.fixed32();break;default:t.skipType(s&7);break}}if(!o.hasOwnProperty("Seconds"))throw S.ProtocolError("missing required 'Seconds'",{instance:o});return o},r.fromObject=function(t){if(t instanceof P.UnixTime)return t;var n=new P.UnixTime;return t.Seconds!=null&&(S.Long?(n.Seconds=S.Long.fromValue(t.Seconds)).unsigned=!1:typeof t.Seconds=="string"?n.Seconds=parseInt(t.Seconds,10):typeof t.Seconds=="number"?n.Seconds=t.Seconds:typeof t.Seconds=="object"&&(n.Seconds=new S.LongBits(t.Seconds.low>>>0,t.Seconds.high>>>0).toNumber())),t.FractionalNanoseconds!=null&&(n.FractionalNanoseconds=t.FractionalNanoseconds>>>0),n},r.toObject=function(t,n){n||(n={});var i={};if(n.defaults){if(S.Long){var o=new S.Long(0,0,!1);i.Seconds=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else i.Seconds=n.longs===String?"0":0;i.FractionalNanoseconds=0}return t.Seconds!=null&&t.hasOwnProperty("Seconds")&&(typeof t.Seconds=="number"?i.Seconds=n.longs===String?String(t.Seconds):t.Seconds:i.Seconds=n.longs===String?S.Long.prototype.toString.call(t.Seconds):n.longs===Number?new S.LongBits(t.Seconds.low>>>0,t.Seconds.high>>>0).toNumber():t.Seconds),t.FractionalNanoseconds!=null&&t.hasOwnProperty("FractionalNanoseconds")&&(i.FractionalNanoseconds=t.FractionalNanoseconds),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,et.default.util.toJSONOptions)},r})(),za=P.Metadata=(()=>{function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return r.prototype.MimeType="",r.encode=function(t,n){return n||(n=Pe.create()),t.MimeType!=null&&Object.hasOwnProperty.call(t,"MimeType")&&n.uint32(10).string(t.MimeType),n},r.decode=function(t,n){t instanceof Bt||(t=Bt.create(t));for(var i=n===void 0?t.len:t.pos+n,o=new P.Metadata;t.pos<i;){var s=t.uint32();switch(s>>>3){case 1:o.MimeType=t.string();break;default:t.skipType(s&7);break}}return o},r.fromObject=function(t){if(t instanceof P.Metadata)return t;var n=new P.Metadata;return t.MimeType!=null&&(n.MimeType=String(t.MimeType)),n},r.toObject=function(t,n){n||(n={});var i={};return n.defaults&&(i.MimeType=""),t.MimeType!=null&&t.hasOwnProperty("MimeType")&&(i.MimeType=t.MimeType),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,et.default.util.toJSONOptions)},r})();var rt=jn,Hn=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],ls=["directory","hamt-sharded-directory"],Mn=parseInt("0644",8),qn=parseInt("0755",8);function Ue(r){if(r!=null)return typeof r=="number"?r&4095:(r=r.toString(),r.substring(0,1)==="0"?parseInt(r,8)&4095:parseInt(r,10)&4095)}function Gn(r){if(r==null)return;let e;if(r.secs!=null&&(e={secs:r.secs,nsecs:r.nsecs}),r.Seconds!=null&&(e={secs:r.Seconds,nsecs:r.FractionalNanoseconds}),Array.isArray(r)&&(e={secs:r[0],nsecs:r[1]}),r instanceof Date){let t=r.getTime(),n=Math.floor(t/1e3);e={secs:n,nsecs:(t-n*1e3)*1e3}}if(!!Object.prototype.hasOwnProperty.call(e,"secs")){if(e!=null&&e.nsecs!=null&&(e.nsecs<0||e.nsecs>999999999))throw(0,re.default)(new Error("mtime-nsecs must be within the range [0,999999999]"),"ERR_INVALID_MTIME_NSECS");return e}}var R=class{static unmarshal(e){let t=rt.decode(e),n=rt.toObject(t,{defaults:!1,arrays:!0,longs:Number,objects:!1}),i=new R({type:Hn[n.Type],data:n.Data,blockSizes:n.blocksizes,mode:n.mode,mtime:n.mtime?{secs:n.mtime.Seconds,nsecs:n.mtime.FractionalNanoseconds}:void 0});return i._originalMode=n.mode||0,i}constructor(e={type:"file"}){let{type:t,data:n,blockSizes:i,hashType:o,fanout:s,mtime:c,mode:f}=e;if(t&&!Hn.includes(t))throw(0,re.default)(new Error("Type: "+t+" is not valid"),"ERR_INVALID_TYPE");this.type=t||"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i||[],this._originalMode=0,this.mode=Ue(f),c&&(this.mtime=Gn(c),this.mtime&&!this.mtime.nsecs&&(this.mtime.nsecs=0))}set mode(e){this._mode=this.isDirectory()?qn:Mn;let t=Ue(e);t!==void 0&&(this._mode=t)}get mode(){return this._mode}isDirectory(){return Boolean(this.type&&ls.includes(this.type))}addBlockSize(e){this.blockSizes.push(e)}removeBlockSize(e){this.blockSizes.splice(e,1)}fileSize(){if(this.isDirectory())return 0;let e=0;return this.blockSizes.forEach(t=>{e+=t}),this.data&&(e+=this.data.length),e}marshal(){let e;switch(this.type){case"raw":e=rt.DataType.Raw;break;case"directory":e=rt.DataType.Directory;break;case"file":e=rt.DataType.File;break;case"metadata":e=rt.DataType.Metadata;break;case"symlink":e=rt.DataType.Symlink;break;case"hamt-sharded-directory":e=rt.DataType.HAMTShard;break;default:throw(0,re.default)(new Error("Type: "+e+" is not valid"),"ERR_INVALID_TYPE")}let t=this.data;(!this.data||!this.data.length)&&(t=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(Ue(this.mode)||0),n===Mn&&!this.isDirectory()&&(n=void 0),n===qn&&this.isDirectory()&&(n=void 0));let i;if(this.mtime!=null){let s=Gn(this.mtime);s&&(i={Seconds:s.secs,FractionalNanoseconds:s.nsecs},i.FractionalNanoseconds===0&&delete i.FractionalNanoseconds)}let o={Type:e,Data:t,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i};return rt.encode(o).finish()}};var ft={};U(ft,{code:()=>Ss,createLink:()=>ei,createNode:()=>ti,decode:()=>Es,encode:()=>Y,name:()=>xs,prepare:()=>G,validate:()=>je});var hs=new TextDecoder;function Re(r,e){let t=0;for(let n=0;;n+=7){if(n>=64)throw new Error("protobuf: varint overflow");if(e>=r.length)throw new Error("protobuf: unexpected end of data");let i=r[e++];if(t+=n<28?(i&127)<<n:(i&127)*2**n,i<128)break}return[t,e]}function ne(r,e){let t;[t,e]=Re(r,e);let n=e+t;if(t<0||n<0)throw new Error("protobuf: invalid length");if(n>r.length)throw new Error("protobuf: unexpected end of data");return[r.subarray(e,n),n]}function Yn(r,e){let t;return[t,e]=Re(r,e),[t&7,t>>3,e]}function ds(r){let e={},t=r.length,n=0;for(;n<t;){let i,o;if([i,o,n]=Yn(r,n),o===1){if(e.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Hash`);if(e.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[e.Hash,n]=ne(r,n)}else if(o===2){if(e.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Name`);if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let s;[s,n]=ne(r,n),e.Name=hs.decode(s)}else if(o===3){if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(i!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Tsize`);[e.Tsize,n]=Re(r,n)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${o}`)}if(n>t)throw new Error("protobuf: (PBLink) unexpected end of data");return e}function Wn(r){let e=r.length,t=0,n,i=!1,o;for(;t<e;){let c,f;if([c,f,t]=Yn(r,t),c!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${c}`);if(f===1){if(o)throw new Error("protobuf: (PBNode) duplicate Data section");[o,t]=ne(r,t),n&&(i=!0)}else if(f===2){if(i)throw new Error("protobuf: (PBNode) duplicate Links section");n||(n=[]);let l;[l,t]=ne(r,t),n.push(ds(l))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${f}`)}if(t>e)throw new Error("protobuf: (PBNode) unexpected end of data");let s={};return o&&(s.Data=o),s.Links=n||[],s}var Kn=new TextEncoder,$n=2**32,ps=2**31;function ys(r,e){let t=e.length;if(typeof r.Tsize=="number"){if(r.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(r.Tsize))throw new Error("Tsize too large for encoding");t=Rt(e,t,r.Tsize)-1,e[t]=24}if(typeof r.Name=="string"){let n=Kn.encode(r.Name);t-=n.length,e.set(n,t),t=Rt(e,t,n.length)-1,e[t]=18}return r.Hash&&(t-=r.Hash.length,e.set(r.Hash,t),t=Rt(e,t,r.Hash.length)-1,e[t]=10),e.length-t}function Jn(r){let e=ms(r),t=new Uint8Array(e),n=e;if(r.Data&&(n-=r.Data.length,t.set(r.Data,n),n=Rt(t,n,r.Data.length)-1,t[n]=10),r.Links)for(let i=r.Links.length-1;i>=0;i--){let o=ys(r.Links[i],t.subarray(0,n));n-=o,n=Rt(t,n,o)-1,t[n]=18}return t}function gs(r){let e=0;if(r.Hash){let t=r.Hash.length;e+=1+t+Dt(t)}if(typeof r.Name=="string"){let t=Kn.encode(r.Name).length;e+=1+t+Dt(t)}return typeof r.Tsize=="number"&&(e+=1+Dt(r.Tsize)),e}function ms(r){let e=0;if(r.Data){let t=r.Data.length;e+=1+t+Dt(t)}if(r.Links)for(let t of r.Links){let n=gs(t);e+=1+n+Dt(n)}return e}function Rt(r,e,t){e-=Dt(t);let n=e;for(;t>=ps;)r[e++]=t&127|128,t/=128;for(;t>=128;)r[e++]=t&127|128,t>>>=7;return r[e]=t,n}function Dt(r){return r%2===0&&r++,Math.floor((bs(r)+6)/7)}function bs(r){let e=0;return r>=$n&&(r=Math.floor(r/$n),e=32),r>=1<<16&&(r>>>=16,e+=16),r>=1<<8&&(r>>>=8,e+=8),e+ws[r]}var ws=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8];var _s=["Data","Links"],As=["Hash","Name","Tsize"],Ve=new TextEncoder;function Xn(r,e){if(r===e)return 0;let t=r.Name?Ve.encode(r.Name):[],n=e.Name?Ve.encode(e.Name):[],i=t.length,o=n.length;for(let s=0,c=Math.min(i,o);s<c;++s)if(t[s]!==n[s]){i=t[s],o=n[s];break}return i<o?-1:o<i?1:0}function Zn(r,e){return!Object.keys(r).some(t=>!e.includes(t))}function Qn(r){if(typeof r.asCID=="object"){let t=k.asCID(r);if(!t)throw new TypeError("Invalid DAG-PB form");return{Hash:t}}if(typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let e={};if(r.Hash){let t=k.asCID(r.Hash);try{t||(typeof r.Hash=="string"?t=k.parse(r.Hash):r.Hash instanceof Uint8Array&&(t=k.decode(r.Hash)))}catch(n){throw new TypeError(`Invalid DAG-PB form: ${n.message}`)}t&&(e.Hash=t)}if(!e.Hash)throw new TypeError("Invalid DAG-PB form");return typeof r.Name=="string"&&(e.Name=r.Name),typeof r.Tsize=="number"&&(e.Tsize=r.Tsize),e}function G(r){if((r instanceof Uint8Array||typeof r=="string")&&(r={Data:r}),typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let e={};if(r.Data!==void 0)if(typeof r.Data=="string")e.Data=Ve.encode(r.Data);else if(r.Data instanceof Uint8Array)e.Data=r.Data;else throw new TypeError("Invalid DAG-PB form");if(r.Links!==void 0)if(Array.isArray(r.Links))e.Links=r.Links.map(Qn),e.Links.sort(Xn);else throw new TypeError("Invalid DAG-PB form");else e.Links=[];return e}function je(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");if(!Zn(r,_s))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(r.Data!==void 0&&!(r.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be a Uint8Array)");if(!Array.isArray(r.Links))throw new TypeError("Invalid DAG-PB form (Links must be an array)");for(let e=0;e<r.Links.length;e++){let t=r.Links[e];if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError("Invalid DAG-PB form (bad link object)");if(!Zn(t,As))throw new TypeError("Invalid DAG-PB form (extraneous properties on link object)");if(!t.Hash)throw new TypeError("Invalid DAG-PB form (link must have a Hash)");if(t.Hash.asCID!==t.Hash)throw new TypeError("Invalid DAG-PB form (link Hash must be a CID)");if(t.Name!==void 0&&typeof t.Name!="string")throw new TypeError("Invalid DAG-PB form (link Name must be a string)");if(t.Tsize!==void 0&&(typeof t.Tsize!="number"||t.Tsize%1!==0))throw new TypeError("Invalid DAG-PB form (link Tsize must be an integer)");if(e>0&&Xn(t,r.Links[e-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function ti(r,e=[]){return G({Data:r,Links:e})}function ei(r,e,t){return Qn({Hash:t,Name:r,Tsize:e})}var xs="dag-pb",Ss=112;function Y(r){je(r);let e={};return r.Links&&(e.Links=r.Links.map(t=>{let n={};return t.Hash&&(n.Hash=t.Hash.bytes),t.Name!==void 0&&(n.Name=t.Name),t.Tsize!==void 0&&(n.Tsize=t.Tsize),n})),r.Data&&(e.Data=r.Data),Jn(e)}function Es(r){let e=Wn(r),t={};return e.Data&&(t.Data=e.Data),e.Links&&(t.Links=e.Links.map(n=>{let i={};try{i.Hash=k.decode(n.Hash)}catch{}if(!i.Hash)throw new Error("Invalid Hash field found in link, expected CID");return n.Name!==void 0&&(i.Name=n.Name),n.Tsize!==void 0&&(i.Tsize=n.Tsize),i})),t}var Ts=async(r,e,t)=>{t.codec||(t.codec=ft),t.hasher||(t.hasher=xt),t.cidVersion===void 0&&(t.cidVersion=1),t.codec===ft&&t.hasher!==xt&&(t.cidVersion=1);let n=await t.hasher.digest(r),i=k.create(t.cidVersion,t.codec.code,n);return t.onlyHash||await e.put(i,r,{signal:t.signal}),i},J=Ts;var vs=async(r,e,t)=>{let n=new R({type:"directory",mtime:r.mtime,mode:r.mode}),i=Y(G({Data:n.marshal()})),o=await J(i,e,t),s=r.path;return{cid:o,path:s,unixfs:n,size:i.length}},ri=vs;var fi=Z(Tt(),1);var Vt={};U(Vt,{code:()=>ie,decode:()=>ks,encode:()=>Ds,name:()=>Bs});var Bs="raw",ie=85,Ds=r=>M(r),ks=r=>M(r);async function He(r){let e=[];for await(let t of r)e.push(t);return e}async function Ls(r,e){return e(await He(r))}var ni=Ls;function Fs(r,e,t){return ii(r,e,t)}async function ii(r,e,t){let n=[];for await(let i of ut(r,t.maxChildrenPerNode))n.push(await e(i));return n.length>1?ii(n,e,t):n[0]}var oi=Fs;async function Os(r,e,t){let n=new Me(t.layerRepeat),i=0,o=1,s=n;for await(let c of ut(r,t.maxChildrenPerNode))s.isFull()&&(s!==n&&n.addChild(await s.reduce(e)),i&&i%t.layerRepeat===0&&o++,s=new oe(o,t.layerRepeat,i),i++),s.append(c);return s&&s!==n&&n.addChild(await s.reduce(e)),n.reduce(e)}var si=Os,oe=class{constructor(e,t,n=0){this.maxDepth=e,this.layerRepeat=t,this.currentDepth=1,this.iteration=n,this.root=this.node=this.parent={children:[],depth:this.currentDepth,maxDepth:e,maxChildren:(this.maxDepth-this.currentDepth)*this.layerRepeat}}isFull(){if(!this.root.data)return!1;if(this.currentDepth<this.maxDepth&&this.node.maxChildren)return this._addNextNodeToParent(this.node),!1;let e=this._findParent(this.node,this.currentDepth);return e?(this._addNextNodeToParent(e),!1):!0}_addNextNodeToParent(e){this.parent=e;let t={children:[],depth:e.depth+1,parent:e,maxDepth:this.maxDepth,maxChildren:Math.floor(e.children.length/this.layerRepeat)*this.layerRepeat};e.children.push(t),this.currentDepth=t.depth,this.node=t}append(e){this.node.data=e}reduce(e){return this._reduce(this.root,e)}async _reduce(e,t){let n=[];return e.children.length&&(n=await Promise.all(e.children.filter(i=>i.data).map(i=>this._reduce(i,t)))),t((e.data||[]).concat(n))}_findParent(e,t){let n=e.parent;if(!(!n||n.depth===0))return n.children.length===n.maxChildren||!n.maxChildren?this._findParent(n,t):n}},Me=class extends oe{constructor(e){super(0,e),this.root.depth=0,this.currentDepth=1}addChild(e){this.root.children.push(e)}reduce(e){return e((this.root.data||[]).concat(this.root.children))}};async function*zs(r,e,t){for await(let n of r.content)yield async()=>{t.progress(n.length,r.path);let i,o={codec:ft,cidVersion:t.cidVersion,hasher:t.hasher,onlyHash:t.onlyHash};return t.rawLeaves?(o.codec=Vt,o.cidVersion=1):(i=new R({type:t.leafType,data:n}),n=Y({Data:i.marshal(),Links:[]})),{cid:await J(n,e,o),unixfs:i,size:n.length}}}var ai=zs;var Ns={flat:ni,balanced:oi,trickle:si};async function*Is(r,e,t){let n=-1,i,o;typeof t.bufferImporter=="function"?o=t.bufferImporter:o=ai;for await(let s of kt(o(r,e,t),t.blockWriteConcurrency)){if(n++,n===0){i=s;continue}else n===1&&i&&(yield i,i=null);yield s}i&&(i.single=!0,yield i)}var Cs=(r,e,t)=>{async function n(i){if(i.length===1&&i[0].single&&t.reduceSingleLeafToSelf){let u=i[0];if(r.mtime!==void 0||r.mode!==void 0){let _=await e.get(u.cid);u.unixfs=new R({type:"file",mtime:r.mtime,mode:r.mode,data:_}),_=Y(G({Data:u.unixfs.marshal()})),u.cid=await J(_,e,{...t,codec:ft,hasher:t.hasher,cidVersion:t.cidVersion}),u.size=_.length}return{cid:u.cid,path:r.path,unixfs:u.unixfs,size:u.size}}let o=new R({type:"file",mtime:r.mtime,mode:r.mode}),s=i.filter(u=>u.cid.code===ie&&u.size||u.unixfs&&!u.unixfs.data&&u.unixfs.fileSize()?!0:Boolean(u.unixfs&&u.unixfs.data&&u.unixfs.data.length)).map(u=>u.cid.code===ie?(o.addBlockSize(u.size),{Name:"",Tsize:u.size,Hash:u.cid}):(!u.unixfs||!u.unixfs.data?o.addBlockSize(u.unixfs&&u.unixfs.fileSize()||0):o.addBlockSize(u.unixfs.data.length),{Name:"",Tsize:u.size,Hash:u.cid})),c={Data:o.marshal(),Links:s},f=Y(G(c));return{cid:await J(f,e,t),path:r.path,unixfs:o,size:f.length+c.Links.reduce((u,_)=>u+_.Tsize,0)}}return n};function Ps(r,e,t){let n=Ns[t.strategy];if(!n)throw(0,fi.default)(new Error(`Unknown importer build strategy name: ${t.strategy}`),"ERR_BAD_STRATEGY");return n(Is(r,e,t),Cs(r,e,t),t)}var ci=Ps;var fr=Z(Tt(),1);function pt(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function nt(r=0){return globalThis.Buffer?.alloc!=null?pt(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function yt(r=0){return globalThis.Buffer?.allocUnsafe!=null?pt(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function jt(r,e){e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=yt(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return pt(t)}function ui(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}var hi=Symbol.for("@achingbrain/uint8arraylist");function li(r,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let n of r){let i=t+n.byteLength;if(e<i)return{buf:n,index:e-t};t=i}throw new RangeError("index is out of bounds")}function qe(r){return Boolean(r?.[hi])}var W=class{constructor(...e){Object.defineProperty(this,hi,{value:!0}),this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(qe(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(qe(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=li(this.bufs,e);return t.buf[t.index]}set(e,t){let n=li(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(t+n,e[n]);else if(qe(e))for(let n=0;n<e.length;n++)this.set(t+n,e.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0))for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}slice(e,t){let{bufs:n,length:i}=this._subList(e,t);return jt(n,i)}subarray(e,t){let{bufs:n,length:i}=this._subList(e,t);return n.length===1?n[0]:jt(n,i)}sublist(e,t){let{bufs:n,length:i}=this._subList(e,t),o=new W;return o.length=i,o.bufs=n,o}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let o=0;o<this.bufs.length;o++){let s=this.bufs[o],c=i,f=c+s.byteLength;if(i=f,e>=f)continue;let l=e>=c&&e<f,u=t>c&&t<=f;if(l&&u){if(e===c&&t===f){n.push(s);break}let _=e-c;n.push(s.subarray(_,_+(t-e)));break}if(l){if(e===0){n.push(s);continue}n.push(s.subarray(e-c));continue}if(u){if(t===f){n.push(s);break}n.push(s.subarray(0,t-c));break}n.push(s)}return{bufs:n,length:t-e}}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=yt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let i=nt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,t,n),this.write(i,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let i=nt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,t,n),this.write(i,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let i=nt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,t,n),this.write(i,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=yt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let i=nt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,t,n),this.write(i,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let i=nt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,t,n),this.write(i,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let i=nt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,t,n),this.write(i,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let i=nt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,t,n),this.write(i,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let i=nt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,t,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof W)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!ui(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let n=new W;return n.bufs=e,t==null&&(t=e.reduce((i,o)=>i+o.byteLength,0)),n.length=t,n}};var vi=Z(Ti(),1),Ke=Z(Tt(),1);async function*Ms(r,e){let t,n,i;if(e.minChunkSize&&e.maxChunkSize&&e.avgChunkSize)i=e.avgChunkSize,t=e.minChunkSize,n=e.maxChunkSize;else if(e.avgChunkSize)i=e.avgChunkSize,t=i/3,n=i+i/2;else throw(0,Ke.default)(new Error("please specify an average chunk size"),"ERR_INVALID_AVG_CHUNK_SIZE");if(t<16)throw(0,Ke.default)(new Error("rabin min must be greater than 16"),"ERR_INVALID_MIN_CHUNK_SIZE");n<t&&(n=t),i<t&&(i=t);let o=Math.floor(Math.log2(i));for await(let s of qs(r,{min:t,max:n,bits:o,window:e.window,polynomial:e.polynomial}))yield s}var Bi=Ms;async function*qs(r,e){let t=await(0,vi.create)(e.bits,e.min,e.max,e.window),n=new W;for await(let i of r){n.append(i);let o=t.fingerprint(i);for(let s=0;s<o.length;s++){let c=o[s],f=n.slice(0,c);n.consume(c),yield f}}n.length&&(yield n.subarray(0))}async function*Gs(r,e){let t=new W,n=0,i=!1,o=e.maxChunkSize;for await(let s of r)for(t.append(s),n+=s.length;n>=o;)if(yield t.slice(0,o),i=!0,o===t.length)t=new W,n=0;else{let c=new W;c.append(t.sublist(o)),t=c,n-=o}(!i||n)&&(yield t.subarray(0,n))}var Di=Gs;var ar=Z(Tt(),1);var Je={};U(Je,{identity:()=>Ys});var Ys=St({prefix:"\0",name:"identity",encode:r=>he(r),decode:r=>le(r)});var Ze={};U(Ze,{base2:()=>Ws});var Ws=z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Xe={};U(Xe,{base8:()=>$s});var $s=z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Qe={};U(Qe,{base10:()=>Ks});var Ks=it({prefix:"9",name:"base10",alphabet:"0123456789"});var tr={};U(tr,{base16:()=>Js,base16upper:()=>Zs});var Js=z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Zs=z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var er={};U(er,{base36:()=>Xs,base36upper:()=>Qs});var Xs=it({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qs=it({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var rr={};U(rr,{base64:()=>t1,base64pad:()=>e1,base64url:()=>r1,base64urlpad:()=>n1});var t1=z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),e1=z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),r1=z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),n1=z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var nr={};U(nr,{base256emoji:()=>f1});var ki=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}"),i1=ki.reduce((r,e,t)=>(r[t]=e,r),[]),o1=ki.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function s1(r){return r.reduce((e,t)=>(e+=i1[t],e),"")}function a1(r){let e=[];for(let t of r){let n=o1[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var f1=St({prefix:"\u{1F680}",name:"base256emoji",encode:s1,decode:a1});var ir={};U(ir,{identity:()=>l1});var Li=0,c1="identity",Fi=M,u1=r=>lt(Li,Fi(r)),l1={code:Li,name:c1,encode:Fi,digest:u1};var G0=new TextEncoder,Y0=new TextDecoder;var or={...Je,...Ze,...Xe,...Qe,...tr,...Ae,...er,..._e,...rr,...nr},$0={...ye,...ir};function zi(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var Oi=zi("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),sr=zi("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=yt(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),d1={utf8:Oi,"utf-8":Oi,hex:or.base16,latin1:sr,ascii:sr,binary:sr,...or},Ni=d1;function se(r,e="utf8"){let t=Ni[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?pt(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}async function*p1(r){for await(let e of r){if(e.length===void 0)throw(0,ar.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof e=="string"||e instanceof String)yield se(e.toString());else if(Array.isArray(e))yield Uint8Array.from(e);else if(e instanceof Uint8Array)yield e;else throw(0,ar.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}}var Ii=p1;function y1(r){return Symbol.iterator in r}function g1(r){return Symbol.asyncIterator in r}function m1(r){try{if(r instanceof Uint8Array)return async function*(){yield r}();if(y1(r))return async function*(){yield*r}();if(g1(r))return r}catch{throw(0,fr.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,fr.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}async function*b1(r,e,t){for await(let n of r)if(n.path&&(n.path.substring(0,2)==="./"&&(t.wrapWithDirectory=!0),n.path=n.path.split("/").filter(i=>i&&i!==".").join("/")),n.content){let i;typeof t.chunker=="function"?i=t.chunker:t.chunker==="rabin"?i=Bi:i=Di;let o;typeof t.chunkValidator=="function"?o=t.chunkValidator:o=Ii;let s={path:n.path,mtime:n.mtime,mode:n.mode,content:i(o(m1(n.content),t),t)};yield()=>ci(s,e,t)}else if(n.path){let i={path:n.path,mtime:n.mtime,mode:n.mode};yield()=>ri(i,e,t)}else throw new Error("Import candidate must have content or path or both")}var Ci=b1;var cr=class{constructor(e,t){this.options=t||{},this.root=e.root,this.dir=e.dir,this.path=e.path,this.dirty=e.dirty,this.flat=e.flat,this.parent=e.parent,this.parentKey=e.parentKey,this.unixfs=e.unixfs,this.mode=e.mode,this.mtime=e.mtime,this.cid=void 0,this.size=void 0}async put(e,t){}get(e){return Promise.resolve(this)}async*eachChildSeries(){}async*flush(e){}},ct=cr;var ur=class extends ct{constructor(e,t){super(e,t),this._children={}}async put(e,t){this.cid=void 0,this.size=void 0,this._children[e]=t}get(e){return Promise.resolve(this._children[e])}childCount(){return Object.keys(this._children).length}directChildrenCount(){return this.childCount()}onlyChild(){return this._children[Object.keys(this._children)[0]]}async*eachChildSeries(){let e=Object.keys(this._children);for(let t=0;t<e.length;t++){let n=e[t];yield{key:n,child:this._children[n]}}}async*flush(e){let t=Object.keys(this._children),n=[];for(let l=0;l<t.length;l++){let u=this._children[t[l]];if(u instanceof ct)for await(let _ of u.flush(e))u=_,yield u;u.size!=null&&u.cid&&n.push({Name:t[l],Tsize:u.size,Hash:u.cid})}let i=new R({type:"directory",mtime:this.mtime,mode:this.mode}),o={Data:i.marshal(),Links:n},s=Y(G(o)),c=await J(s,e,this.options),f=s.length+o.Links.reduce((l,u)=>l+(u.Tsize==null?0:u.Tsize),0);this.cid=c,this.size=f,yield{cid:c,unixfs:i,path:this.path,size:f}}},Gt=ur;var Vi=Z(Ri(),1);var V=class{constructor(e,t,n=0){this._options=e,this._popCount=0,this._parent=t,this._posAtParent=n,this._children=new Vi.default,this.key=null}async put(e,t){let n=await this._findNewBucketAndPos(e);await n.bucket._putAt(n,e,t)}async get(e){let t=await this._findChild(e);if(t!=null)return t.value}async del(e){let t=await this._findPlace(e),n=t.bucket._at(t.pos);n!=null&&n.key===e&&t.bucket._delAt(t.pos)}leafCount(){return this._children.compactArray().reduce((t,n)=>n instanceof V?t+n.leafCount():t+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){let e=this._children.compactArray();for(let t of e)t instanceof V?yield*t.eachLeafSeries():yield t}serialize(e,t){let n=[];return t(this._children.reduce((i,o,s)=>(o!=null&&(o instanceof V?i.push(o.serialize(e,t)):i.push(e(o,s))),i),n))}async asyncTransform(e,t){return await ji(this,e,t)}toJSON(){return this.serialize(S1,E1)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(e){let t=await this._findPlace(e),n=t.bucket._at(t.pos);if(!(n instanceof V)&&n!=null&&n.key===e)return n}async _findPlace(e){let t=this._options.hash(typeof e=="string"?se(e):e),n=await t.take(this._options.bits),i=this._children.get(n);return i instanceof V?await i._findPlace(t):{bucket:this,pos:n,hash:t,existingChild:i}}async _findNewBucketAndPos(e){let t=await this._findPlace(e);if(t.existingChild!=null&&t.existingChild.key!==e){let n=new V(this._options,t.bucket,t.pos);t.bucket._putObjectAt(t.pos,n);let i=await n._findPlace(t.existingChild.hash);return i.bucket._putAt(i,t.existingChild.key,t.existingChild.value),await n._findNewBucketAndPos(t.hash)}return t}_putAt(e,t,n){this._putObjectAt(e.pos,{key:t,value:n,hash:e.hash})}_putObjectAt(e,t){this._children.get(e)==null&&this._popCount++,this._children.set(e,t)}_delAt(e){if(e===-1)throw new Error("Invalid position");this._children.get(e)!=null&&this._popCount--,this._children.unset(e),this._level()}_level(){if(this._parent!=null&&this._popCount<=1)if(this._popCount===1){let e=this._children.find(x1);if(e!=null&&!(e instanceof V)){let t=e.hash;t.untake(this._options.bits);let n={pos:this._posAtParent,hash:t,bucket:this._parent};this._parent._putAt(n,e.key,e.value)}}else this._parent._delAt(this._posAtParent)}_at(e){return this._children.get(e)}};function x1(r){return Boolean(r)}function S1(r,e){return r.key}function E1(r){return r}async function ji(r,e,t){let n=[];for(let i of r._children.compactArray())if(i instanceof V)await ji(i,e,t);else{let o=await e(i);n.push({bitField:r._children.bitField(),children:o})}return await t(n)}var T1=[255,254,252,248,240,224,192,128],v1=[1,3,7,15,31,63,127,255],ae=class{constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(e){let t=e,n=0;for(;t>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,t),c=B1(i,o-s,s);n=(n<<s)+c,t-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return n}untake(e){for(this._currentBitPos+=e;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function B1(r,e,t){let n=D1(e,t);return(r&n)>>>e}function D1(r,e){return T1[r]&v1[Math.min(e+r-1,7)]}function Hi(r){function e(t){return t instanceof fe?t:new fe(t,r)}return e}var fe=class{constructor(e,t){if(!(e instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=e,this._hashFn=t,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(e){let t=e;for(;this._availableBits<t;)await this._produceMoreBits();let n=0;for(;t>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),t),s=i.take(o);n=(n<<o)+s,t-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return n}untake(e){let t=e;for(;t>0;){let n=this._buffers[this._currentBufferIndex],i=Math.min(n.totalBits()-n.availableBits(),t);n.untake(i),t-=i,this._availableBits+=i,this._currentBufferIndex>0&&n.totalBits()===n.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth>0?jt([this._value,Uint8Array.from([this._depth])]):this._value,t=await this._hashFn(e),n=new ae(t);this._buffers.push(n),this._availableBits+=n.availableBits()}};function Mi(r){if(r==null||r.hashFn==null)throw new Error("please define an options.hashFn");let e={bits:r.bits??8,hash:Hi(r.hashFn)};return new V(e)}var lr=class extends ct{constructor(e,t){super(e,t),this._bucket=Mi({hashFn:t.hamtHashFn,bits:t.hamtBucketBits})}async put(e,t){await this._bucket.put(e,t)}get(e){return this._bucket.get(e)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(let{key:e,value:t}of this._bucket.eachLeafSeries())yield{key:e,child:t}}async*flush(e){for await(let t of Gi(this._bucket,e,this,this.options))yield{...t,path:this.path}}},qi=lr;async function*Gi(r,e,t,n){let i=r._children,o=[],s=0;for(let a=0;a<i.length;a++){let h=i.get(a);if(!h)continue;let y=a.toString(16).toUpperCase().padStart(2,"0");if(h instanceof V){let L;for await(let p of await Gi(h,e,null,n))L=p;if(!L)throw new Error("Could not flush sharded directory, no subshard found");o.push({Name:y,Tsize:L.size,Hash:L.cid}),s+=L.size}else if(typeof h.value.flush=="function"){let L=h.value,p;for await(let b of L.flush(e))p=b,yield p;let g=y+h.key;o.push({Name:g,Tsize:p.size,Hash:p.cid}),s+=p.size}else{let L=h.value;if(!L.cid)continue;let p=y+h.key,g=L.size;o.push({Name:p,Tsize:g,Hash:L.cid}),s+=g}}let c=Uint8Array.from(i.bitField().reverse()),f=new R({type:"hamt-sharded-directory",data:c,fanout:r.tableSize(),hashType:n.hamtHashCode,mtime:t&&t.mtime,mode:t&&t.mode}),l={Data:f.marshal(),Links:o},u=Y(G(l)),_=await J(u,e,n),v=u.length+s;yield{cid:_,unixfs:f,size:v}}async function Yi(r,e,t,n){let i=e;e instanceof Gt&&e.directChildrenCount()>=t&&(i=await k1(e,n));let o=i.parent;if(o){if(i!==e){if(r&&(r.parent=i),!i.parentKey)throw new Error("No parent key found");await o.put(i.parentKey,i)}return Yi(i,o,t,n)}return i}async function k1(r,e){let t=new qi({root:r.root,dir:!0,parent:r.parent,parentKey:r.parentKey,path:r.path,dirty:r.dirty,flat:!1,mtime:r.mtime,mode:r.mode},e);for await(let{key:n,child:i}of r.eachChildSeries())await t.put(n,i);return t}var Wi=Yi;var L1=(r="")=>(r.trim().match(/([^\\/]|\\\/)+/g)||[]).filter(Boolean),$i=L1;async function F1(r,e,t){let n=$i(r.path||""),i=n.length-1,o=e,s="";for(let c=0;c<n.length;c++){let f=n[c];s+=`${s?"/":""}${f}`;let l=c===i;if(o.dirty=!0,o.cid=void 0,o.size=void 0,l)await o.put(f,r),e=await Wi(null,o,t.shardSplitThreshold,t);else{let u=await o.get(f);(!u||!(u instanceof ct))&&(u=new Gt({root:!1,dir:!0,parent:o,parentKey:f,path:s,dirty:!0,flat:!0,mtime:u&&u.unixfs&&u.unixfs.mtime,mode:u&&u.unixfs&&u.unixfs.mode},t)),await o.put(f,u),o=u}}return e}async function*Ki(r,e){if(!(r instanceof ct)){r&&r.unixfs&&r.unixfs.isDirectory()&&(yield r);return}yield*r.flush(e)}async function*O1(r,e,t){let n=new Gt({root:!0,dir:!0,path:"",dirty:!0,flat:!0},t);for await(let i of r)!i||(n=await F1(i,n,t),(!i.unixfs||!i.unixfs.isDirectory())&&(yield i));if(t.wrapWithDirectory)yield*Ki(n,e);else for await(let i of n.eachChildSeries())!i||(yield*Ki(i.child,e))}var Ji=O1;async function*z1(r,e,t={}){let n=Vr(t),i;typeof t.dagBuilder=="function"?i=t.dagBuilder:i=Ci;let o;typeof t.treeBuilder=="function"?o=t.treeBuilder:o=Ji;let s;Symbol.asyncIterator in r||Symbol.iterator in r?s=r:s=[r];for await(let c of o(kt(i(s,e,n),n.fileImportConcurrency),e,n))yield{cid:c.cid,path:c.path,unixfs:c.unixfs,size:c.size}}return ro(N1);})();
|
|
24
3
|
return IpfsUnixfsImporter}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixed-size.d.ts","sourceRoot":"","sources":["../../../src/chunker/fixed-size.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"fixed-size.d.ts","sourceRoot":"","sources":["../../../src/chunker/fixed-size.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,6IAkCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rabin.d.ts","sourceRoot":"","sources":["../../../src/chunker/rabin.js"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"rabin.d.ts","sourceRoot":"","sources":["../../../src/chunker/rabin.js"],"names":[],"mappings":";;SAOc,MAAM;SACN,MAAM;UACN,MAAM;YACN,MAAM;gBACN,MAAM;;AANpB;;;;;;;GAOG;AAEH;;GAEG;AACH,yIAuCC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UnixFS, Mtime } from 'ipfs-unixfs';
|
|
2
|
-
import type { CID, CIDVersion } from 'multiformats/cid';
|
|
2
|
+
import type { CID, Version as CIDVersion } from 'multiformats/cid';
|
|
3
3
|
import type { MultihashHasher } from 'multiformats/hashes/interface';
|
|
4
4
|
import type { BlockCodec } from 'multiformats/codecs/interface';
|
|
5
5
|
import type { Blockstore } from 'interface-blockstore';
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU,CAAA;IACvE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,oBAAY,WAAW,GAAG,OAAO,GAAG,OAAO,CAAA;AAC3C,MAAM,WAAW,eAAe;IAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE;AAC7E,MAAM,WAAW,UAAU;IAAG,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CAAE;AACxE,MAAM,WAAW,OAAO;IAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;CAAE;AACrH,MAAM,WAAW,UAAU;IAAG,CAAC,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAA;CAAE;AAC5M,MAAM,WAAW,WAAW;IAAG,CAAC,MAAM,EAAE,aAAa,CAAC,sBAAsB,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,YAAY,CAAC,CAAA;CAAE;AAC/J,MAAM,WAAW,cAAc;IAAG,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAA;CAAE;AACxJ,MAAM,WAAW,cAAc;IAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;CAAE;AAC5H,MAAM,WAAW,kBAAkB,CAAC,CAAC;IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAAE;AACvI,MAAM,WAAW,OAAO;IAAG,CAAC,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAAE;AAEhG,MAAM,WAAW,cAAc;IAAG,CAAC,MAAM,EAAE,aAAa,CAAC,sBAAsB,CAAC,GAAG,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAAE;AAEnM,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAA;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACzB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAA;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAA;IACzC,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;IACjB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,eAAe,CAAA;IACzB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,UAAU,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,WAAW,GAAG,OAAO,CAAA;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,sBAAsB,EAAE,CAAA;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,sBAAsB,EAAE,CAAA;IAC/B,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC5B,MAAM,EAAE,eAAe,CAAA;IACvB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB"}
|
|
@@ -4,6 +4,6 @@ export default persist;
|
|
|
4
4
|
* @param {import('interface-blockstore').Blockstore} blockstore
|
|
5
5
|
* @param {import('../types').PersistOptions} options
|
|
6
6
|
*/
|
|
7
|
-
declare function persist(buffer: Uint8Array, blockstore: import('interface-blockstore').Blockstore, options: import('../types').PersistOptions): Promise<CID
|
|
7
|
+
declare function persist(buffer: Uint8Array, blockstore: import('interface-blockstore').Blockstore, options: import('../types').PersistOptions): Promise<CID<unknown, any, number, import("multiformats/cid").Version>>;
|
|
8
8
|
import { CID } from "multiformats/cid";
|
|
9
9
|
//# sourceMappingURL=persist.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../../src/utils/persist.js"],"names":[],"mappings":";AAIA;;;;GAIG;AACH,iCAJW,UAAU,cACV,OAAO,sBAAsB,EAAE,UAAU,WACzC,OAAO,UAAU,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../../src/utils/persist.js"],"names":[],"mappings":";AAIA;;;;GAIG;AACH,iCAJW,UAAU,cACV,OAAO,sBAAsB,EAAE,UAAU,WACzC,OAAO,UAAU,EAAE,cAAc,0EA6B3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ipfs-unixfs-importer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "JavaScript implementation of the UnixFs importer used by IPFS",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/js-ipfs-unixfs/tree/master/packages/ipfs-unixfs-importer#readme",
|
|
@@ -151,27 +151,27 @@
|
|
|
151
151
|
"release": "aegir release"
|
|
152
152
|
},
|
|
153
153
|
"dependencies": {
|
|
154
|
-
"@ipld/dag-pb": "^
|
|
155
|
-
"@multiformats/murmur3": "^
|
|
156
|
-
"bl": "^5.0.0",
|
|
154
|
+
"@ipld/dag-pb": "^3.0.0",
|
|
155
|
+
"@multiformats/murmur3": "^2.0.0",
|
|
157
156
|
"err-code": "^3.0.1",
|
|
158
157
|
"hamt-sharding": "^3.0.0",
|
|
159
158
|
"interface-blockstore": "^3.0.0",
|
|
160
|
-
"ipfs-unixfs": "^
|
|
161
|
-
"it-all": "^
|
|
162
|
-
"it-batch": "^
|
|
163
|
-
"it-first": "^
|
|
164
|
-
"it-parallel-batch": "^
|
|
159
|
+
"ipfs-unixfs": "^8.0.0",
|
|
160
|
+
"it-all": "^2.0.0",
|
|
161
|
+
"it-batch": "^2.0.0",
|
|
162
|
+
"it-first": "^2.0.0",
|
|
163
|
+
"it-parallel-batch": "^2.0.0",
|
|
165
164
|
"merge-options": "^3.0.4",
|
|
166
|
-
"multiformats": "^
|
|
165
|
+
"multiformats": "^10.0.0",
|
|
167
166
|
"rabin-wasm": "^0.1.4",
|
|
168
|
-
"
|
|
167
|
+
"uint8arraylist": "^2.3.3",
|
|
168
|
+
"uint8arrays": "^4.0.2"
|
|
169
169
|
},
|
|
170
170
|
"devDependencies": {
|
|
171
171
|
"aegir": "^37.5.0",
|
|
172
172
|
"assert": "^2.0.0",
|
|
173
173
|
"blockstore-core": "^2.0.1",
|
|
174
|
-
"it-buffer-stream": "^
|
|
174
|
+
"it-buffer-stream": "^3.0.0",
|
|
175
175
|
"wherearewe": "^2.0.1"
|
|
176
176
|
},
|
|
177
177
|
"browser": {
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import BufferList from 'bl/BufferList.js'
|
|
1
|
+
import { Uint8ArrayList } from 'uint8arraylist'
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* @type {import('../types').Chunker}
|
|
6
5
|
*/
|
|
7
6
|
async function * fixedSizeChunker (source, options) {
|
|
8
|
-
let
|
|
7
|
+
let list = new Uint8ArrayList()
|
|
9
8
|
let currentLength = 0
|
|
10
9
|
let emitted = false
|
|
11
10
|
const maxChunkSize = options.maxChunkSize
|
|
12
11
|
|
|
13
12
|
for await (const buffer of source) {
|
|
14
|
-
|
|
13
|
+
list.append(buffer)
|
|
15
14
|
|
|
16
15
|
currentLength += buffer.length
|
|
17
16
|
|
|
18
17
|
while (currentLength >= maxChunkSize) {
|
|
19
|
-
yield
|
|
18
|
+
yield list.slice(0, maxChunkSize)
|
|
20
19
|
emitted = true
|
|
21
20
|
|
|
22
21
|
// throw away consumed bytes
|
|
23
|
-
if (maxChunkSize ===
|
|
24
|
-
|
|
22
|
+
if (maxChunkSize === list.length) {
|
|
23
|
+
list = new Uint8ArrayList()
|
|
25
24
|
currentLength = 0
|
|
26
25
|
} else {
|
|
27
|
-
const newBl = new
|
|
28
|
-
newBl.append(
|
|
29
|
-
|
|
26
|
+
const newBl = new Uint8ArrayList()
|
|
27
|
+
newBl.append(list.sublist(maxChunkSize))
|
|
28
|
+
list = newBl
|
|
30
29
|
|
|
31
30
|
// update our offset
|
|
32
31
|
currentLength -= maxChunkSize
|
|
@@ -36,7 +35,7 @@ async function * fixedSizeChunker (source, options) {
|
|
|
36
35
|
|
|
37
36
|
if (!emitted || currentLength) {
|
|
38
37
|
// return any remaining bytes or an empty buffer
|
|
39
|
-
yield
|
|
38
|
+
yield list.subarray(0, currentLength)
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
|
package/src/chunker/rabin.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import BufferList from 'bl/BufferList.js'
|
|
1
|
+
import { Uint8ArrayList } from 'uint8arraylist'
|
|
3
2
|
// @ts-ignore
|
|
4
3
|
import { create } from 'rabin-wasm'
|
|
5
4
|
import errcode from 'err-code'
|
|
@@ -65,7 +64,7 @@ export default rabinChunker
|
|
|
65
64
|
*/
|
|
66
65
|
async function * rabin (source, options) {
|
|
67
66
|
const r = await create(options.bits, options.min, options.max, options.window)
|
|
68
|
-
const buffers = new
|
|
67
|
+
const buffers = new Uint8ArrayList()
|
|
69
68
|
|
|
70
69
|
for await (const chunk of source) {
|
|
71
70
|
buffers.append(chunk)
|
|
@@ -82,6 +81,6 @@ async function * rabin (source, options) {
|
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
if (buffers.length) {
|
|
85
|
-
yield buffers.
|
|
84
|
+
yield buffers.subarray(0)
|
|
86
85
|
}
|
|
87
86
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UnixFS, Mtime } from 'ipfs-unixfs'
|
|
2
|
-
import type { CID, CIDVersion } from 'multiformats/cid'
|
|
2
|
+
import type { CID, Version as CIDVersion } from 'multiformats/cid'
|
|
3
3
|
import type { MultihashHasher } from 'multiformats/hashes/interface'
|
|
4
4
|
import type { BlockCodec } from 'multiformats/codecs/interface'
|
|
5
5
|
import type { Blockstore } from 'interface-blockstore'
|