ipfs-repo
Version:
IPFS Repo implementation
2 lines • 174 kB
JavaScript
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.IpfsRepo = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var IpfsRepo=(()=>{var el=Object.create;var Gr=Object.defineProperty;var tl=Object.getOwnPropertyDescriptor;var rl=Object.getOwnPropertyNames;var nl=Object.getPrototypeOf,ol=Object.prototype.hasOwnProperty;var C=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Y=(r,e)=>{for(var t in e)Gr(r,t,{get:e[t],enumerable:!0})},ns=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of rl(e))!ol.call(r,o)&&o!==t&&Gr(r,o,{get:()=>e[o],enumerable:!(n=tl(e,o))||n.enumerable});return r};var S=(r,e,t)=>(t=r!=null?el(nl(r)):{},ns(e||!r||!r.__esModule?Gr(t,"default",{value:r,enumerable:!0}):t,r)),il=r=>ns(Gr({},"__esModule",{value:!0}),r);var is=C((Ey,os)=>{var Ct=1e3,Tt=Ct*60,kt=Tt*60,ct=kt*24,al=ct*7,cl=ct*365.25;os.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return ul(r);if(t==="number"&&isFinite(r))return e.long?ll(r):fl(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function ul(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*cl;case"weeks":case"week":case"w":return t*al;case"days":case"day":case"d":return t*ct;case"hours":case"hour":case"hrs":case"hr":case"h":return t*kt;case"minutes":case"minute":case"mins":case"min":case"m":return t*Tt;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ct;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function fl(r){var e=Math.abs(r);return e>=ct?Math.round(r/ct)+"d":e>=kt?Math.round(r/kt)+"h":e>=Tt?Math.round(r/Tt)+"m":e>=Ct?Math.round(r/Ct)+"s":r+"ms"}function ll(r){var e=Math.abs(r);return e>=ct?Jr(r,e,ct,"day"):e>=kt?Jr(r,e,kt,"hour"):e>=Tt?Jr(r,e,Tt,"minute"):e>=Ct?Jr(r,e,Ct,"second"):r+" ms"}function Jr(r,e,t,n){var o=e>=t*1.5;return Math.round(r/t)+" "+n+(o?"s":"")}});var as=C((xy,ss)=>{function dl(r){t.debug=t,t.default=t,t.coerce=c,t.disable=i,t.enable=o,t.enabled=s,t.humanize=is(),t.destroy=u,Object.keys(r).forEach(f=>{t[f]=r[f]}),t.names=[],t.skips=[],t.formatters={};function e(f){let l=0;for(let p=0;p<f.length;p++)l=(l<<5)-l+f.charCodeAt(p),l|=0;return t.colors[Math.abs(l)%t.colors.length]}t.selectColor=e;function t(f){let l,p=null,g,w;function v(...I){if(!v.enabled)return;let B=v,W=Number(new Date),de=W-(l||W);B.diff=de,B.prev=l,B.curr=W,l=W,I[0]=t.coerce(I[0]),typeof I[0]!="string"&&I.unshift("%O");let H=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(pe,re)=>{if(pe==="%%")return"%";H++;let he=t.formatters[re];if(typeof he=="function"){let Ot=I[H];pe=he.call(B,Ot),I.splice(H,1),H--}return pe}),t.formatArgs.call(B,I),(B.log||t.log).apply(B,I)}return v.namespace=f,v.useColors=t.useColors(),v.color=t.selectColor(f),v.extend=n,v.destroy=t.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(g!==t.namespaces&&(g=t.namespaces,w=t.enabled(f)),w),set:I=>{p=I}}),typeof t.init=="function"&&t.init(v),v}function n(f,l){let p=t(this.namespace+(typeof l>"u"?":":l)+f);return p.log=this.log,p}function o(f){t.save(f),t.namespaces=f,t.names=[],t.skips=[];let l,p=(typeof f=="string"?f:"").split(/[\s,]+/),g=p.length;for(l=0;l<g;l++)p[l]&&(f=p[l].replace(/\*/g,".*?"),f[0]==="-"?t.skips.push(new RegExp("^"+f.slice(1)+"$")):t.names.push(new RegExp("^"+f+"$")))}function i(){let f=[...t.names.map(a),...t.skips.map(a).map(l=>"-"+l)].join(",");return t.enable(""),f}function s(f){if(f[f.length-1]==="*")return!0;let l,p;for(l=0,p=t.skips.length;l<p;l++)if(t.skips[l].test(f))return!1;for(l=0,p=t.names.length;l<p;l++)if(t.names[l].test(f))return!0;return!1}function a(f){return f.toString().substring(2,f.toString().length-2).replace(/\.\*\?$/,"*")}function c(f){return f instanceof Error?f.stack||f.message:f}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}ss.exports=dl});var Ce=C((ne,Qr)=>{ne.formatArgs=hl;ne.save=yl;ne.load=ml;ne.useColors=pl;ne.storage=gl();ne.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ne.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function pl(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function hl(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Qr.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(t++,o==="%c"&&(n=t))}),r.splice(n,0,e)}ne.log=console.debug||console.log||(()=>{});function yl(r){try{r?ne.storage.setItem("debug",r):ne.storage.removeItem("debug")}catch{}}function ml(){let r;try{r=ne.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function gl(){try{return localStorage}catch{}}Qr.exports=as()(ne);var{formatters:wl}=Qr.exports;wl.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var De=C((_y,us)=>{"use strict";function cs(r,e){for(let t in e)Object.defineProperty(r,t,{value:e[t],enumerable:!0,configurable:!0});return r}function bl(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 cs(r,t)}catch{t.message=r.message,t.stack=r.stack;let o=function(){};return o.prototype=Object.create(Object.getPrototypeOf(r)),cs(new o,t)}}us.exports=bl});var Ga=C((Lg,Ha)=>{"use strict";Ha.exports=gp;function gp(r,e){for(var t=new Array(arguments.length-1),n=0,o=2,i=!0;o<arguments.length;)t[n++]=arguments[o++];return new Promise(function(a,c){t[n]=function(f){if(i)if(i=!1,f)c(f);else{for(var l=new Array(arguments.length-1),p=0;p<l.length;)l[p++]=arguments[p];a.apply(null,l)}};try{r.apply(e||null,t)}catch(u){i&&(i=!1,c(u))}})}});var Za=C(Ya=>{"use strict";var hn=Ya;hn.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 qt=new Array(64),Qa=new Array(123);for(xe=0;xe<64;)Qa[qt[xe]=xe<26?xe+65:xe<52?xe+71:xe<62?xe-4:xe-59|43]=xe++;var xe;hn.encode=function(e,t,n){for(var o=null,i=[],s=0,a=0,c;t<n;){var u=e[t++];switch(a){case 0:i[s++]=qt[u>>2],c=(u&3)<<4,a=1;break;case 1:i[s++]=qt[c|u>>4],c=(u&15)<<2,a=2;break;case 2:i[s++]=qt[c|u>>6],i[s++]=qt[u&63],a=0;break}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),s=0)}return a&&(i[s++]=qt[c],i[s++]=61,a===1&&(i[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,i.slice(0,s))),o.join("")):String.fromCharCode.apply(String,i.slice(0,s))};var Ja="invalid encoding";hn.decode=function(e,t,n){for(var o=n,i=0,s,a=0;a<e.length;){var c=e.charCodeAt(a++);if(c===61&&i>1)break;if((c=Qa[c])===void 0)throw Error(Ja);switch(i){case 0:s=c,i=1;break;case 1:t[n++]=s<<2|(c&48)>>4,s=c,i=2;break;case 2:t[n++]=(s&15)<<4|(c&60)>>2,s=c,i=3;break;case 3:t[n++]=(s&3)<<6|c,i=0;break}}if(i===1)throw Error(Ja);return n-o};hn.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var ec=C((Mg,Xa)=>{"use strict";Xa.exports=yn;function yn(){this._listeners={}}yn.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};yn.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],o=0;o<n.length;)n[o].fn===t?n.splice(o,1):++o;return this};yn.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],o=1;o<arguments.length;)n.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,n)}return this}});var ac=C((Fg,sc)=>{"use strict";sc.exports=tc(tc);function tc(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function o(c,u,f){e[0]=c,u[f]=t[0],u[f+1]=t[1],u[f+2]=t[2],u[f+3]=t[3]}function i(c,u,f){e[0]=c,u[f]=t[3],u[f+1]=t[2],u[f+2]=t[1],u[f+3]=t[0]}r.writeFloatLE=n?o:i,r.writeFloatBE=n?i:o;function s(c,u){return t[0]=c[u],t[1]=c[u+1],t[2]=c[u+2],t[3]=c[u+3],e[0]}function a(c,u){return t[3]=c[u],t[2]=c[u+1],t[1]=c[u+2],t[0]=c[u+3],e[0]}r.readFloatLE=n?s:a,r.readFloatBE=n?a:s}():function(){function e(n,o,i,s){var a=o<0?1:0;if(a&&(o=-o),o===0)n(1/o>0?0:2147483648,i,s);else if(isNaN(o))n(2143289344,i,s);else if(o>34028234663852886e22)n((a<<31|2139095040)>>>0,i,s);else if(o<11754943508222875e-54)n((a<<31|Math.round(o/1401298464324817e-60))>>>0,i,s);else{var c=Math.floor(Math.log(o)/Math.LN2),u=Math.round(o*Math.pow(2,-c)*8388608)&8388607;n((a<<31|c+127<<23|u)>>>0,i,s)}}r.writeFloatLE=e.bind(null,rc),r.writeFloatBE=e.bind(null,nc);function t(n,o,i){var s=n(o,i),a=(s>>31)*2+1,c=s>>>23&255,u=s&8388607;return c===255?u?NaN:a*(1/0):c===0?a*1401298464324817e-60*u:a*Math.pow(2,c-150)*(u+8388608)}r.readFloatLE=t.bind(null,oc),r.readFloatBE=t.bind(null,ic)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function o(c,u,f){e[0]=c,u[f]=t[0],u[f+1]=t[1],u[f+2]=t[2],u[f+3]=t[3],u[f+4]=t[4],u[f+5]=t[5],u[f+6]=t[6],u[f+7]=t[7]}function i(c,u,f){e[0]=c,u[f]=t[7],u[f+1]=t[6],u[f+2]=t[5],u[f+3]=t[4],u[f+4]=t[3],u[f+5]=t[2],u[f+6]=t[1],u[f+7]=t[0]}r.writeDoubleLE=n?o:i,r.writeDoubleBE=n?i:o;function s(c,u){return t[0]=c[u],t[1]=c[u+1],t[2]=c[u+2],t[3]=c[u+3],t[4]=c[u+4],t[5]=c[u+5],t[6]=c[u+6],t[7]=c[u+7],e[0]}function a(c,u){return t[7]=c[u],t[6]=c[u+1],t[5]=c[u+2],t[4]=c[u+3],t[3]=c[u+4],t[2]=c[u+5],t[1]=c[u+6],t[0]=c[u+7],e[0]}r.readDoubleLE=n?s:a,r.readDoubleBE=n?a:s}():function(){function e(n,o,i,s,a,c){var u=s<0?1:0;if(u&&(s=-s),s===0)n(0,a,c+o),n(1/s>0?0:2147483648,a,c+i);else if(isNaN(s))n(0,a,c+o),n(2146959360,a,c+i);else if(s>17976931348623157e292)n(0,a,c+o),n((u<<31|2146435072)>>>0,a,c+i);else{var f;if(s<22250738585072014e-324)f=s/5e-324,n(f>>>0,a,c+o),n((u<<31|f/4294967296)>>>0,a,c+i);else{var l=Math.floor(Math.log(s)/Math.LN2);l===1024&&(l=1023),f=s*Math.pow(2,-l),n(f*4503599627370496>>>0,a,c+o),n((u<<31|l+1023<<20|f*1048576&1048575)>>>0,a,c+i)}}}r.writeDoubleLE=e.bind(null,rc,0,4),r.writeDoubleBE=e.bind(null,nc,4,0);function t(n,o,i,s,a){var c=n(s,a+o),u=n(s,a+i),f=(u>>31)*2+1,l=u>>>20&2047,p=4294967296*(u&1048575)+c;return l===2047?p?NaN:f*(1/0):l===0?f*5e-324*p:f*Math.pow(2,l-1075)*(p+4503599627370496)}r.readDoubleLE=t.bind(null,oc,0,4),r.readDoubleBE=t.bind(null,ic,4,0)}(),r}function rc(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 nc(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 oc(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function ic(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var cc=C((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 fc=C(uc=>{"use strict";var No=uc;No.length=function(e){for(var t=0,n=0,o=0;o<e.length;++o)n=e.charCodeAt(o),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320?(++o,t+=4):t+=3;return t};No.read=function(e,t,n){var o=n-t;if(o<1)return"";for(var i=null,s=[],a=0,c;t<n;)c=e[t++],c<128?s[a++]=c:c>191&&c<224?s[a++]=(c&31)<<6|e[t++]&63:c>239&&c<365?(c=((c&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,s[a++]=55296+(c>>10),s[a++]=56320+(c&1023)):s[a++]=(c&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};No.write=function(e,t,n){for(var o=n,i,s,a=0;a<e.length;++a)i=e.charCodeAt(a),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++a,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-o}});var dc=C(($g,lc)=>{"use strict";lc.exports=wp;function wp(r,e,t){var n=t||8192,o=n>>>1,i=null,s=n;return function(c){if(c<1||c>o)return r(c);s+c>n&&(i=r(n),s=0);var u=e.call(i,s,s+=c);return s&7&&(s=(s|7)+1),u}}});var hc=C((jg,pc)=>{"use strict";pc.exports=K;var br=Qe();function K(r,e){this.lo=r>>>0,this.hi=e>>>0}var pt=K.zero=new K(0,0);pt.toNumber=function(){return 0};pt.zzEncode=pt.zzDecode=function(){return this};pt.length=function(){return 1};var bp=K.zeroHash="\0\0\0\0\0\0\0\0";K.fromNumber=function(e){if(e===0)return pt;var t=e<0;t&&(e=-e);var n=e>>>0,o=(e-n)/4294967296>>>0;return t&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new K(n,o)};K.from=function(e){if(typeof e=="number")return K.fromNumber(e);if(br.isString(e))if(br.Long)e=br.Long.fromString(e);else return K.fromNumber(parseInt(e,10));return e.low||e.high?new K(e.low>>>0,e.high>>>0):pt};K.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};K.prototype.toLong=function(e){return br.Long?new br.Long(this.lo|0,this.hi|0,Boolean(e)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(e)}};var Je=String.prototype.charCodeAt;K.fromHash=function(e){return e===bp?pt:new K((Je.call(e,0)|Je.call(e,1)<<8|Je.call(e,2)<<16|Je.call(e,3)<<24)>>>0,(Je.call(e,4)|Je.call(e,5)<<8|Je.call(e,6)<<16|Je.call(e,7)<<24)>>>0)};K.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)};K.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};K.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};K.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 Qe=C(Bo=>{"use strict";var b=Bo;b.asPromise=Ga();b.base64=Za();b.EventEmitter=ec();b.float=ac();b.inquire=cc();b.utf8=fc();b.pool=dc();b.LongBits=hc();b.isNode=Boolean(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);b.global=b.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||Bo;b.emptyArray=Object.freeze?Object.freeze([]):[];b.emptyObject=Object.freeze?Object.freeze({}):{};b.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};b.isString=function(e){return typeof e=="string"||e instanceof String};b.isObject=function(e){return e&&typeof e=="object"};b.isset=b.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};b.Buffer=function(){try{var r=b.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();b._Buffer_from=null;b._Buffer_allocUnsafe=null;b.newBuffer=function(e){return typeof e=="number"?b.Buffer?b._Buffer_allocUnsafe(e):new b.Array(e):b.Buffer?b._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};b.Array=typeof Uint8Array<"u"?Uint8Array:Array;b.Long=b.global.dcodeIO&&b.global.dcodeIO.Long||b.global.Long||b.inquire("long");b.key2Re=/^true|false|0|1$/;b.key32Re=/^-?(?:0|[1-9][0-9]*)$/;b.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;b.longToHash=function(e){return e?b.LongBits.from(e).toHash():b.LongBits.zeroHash};b.longFromHash=function(e,t){var n=b.LongBits.fromHash(e);return b.Long?b.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))};function yc(r,e,t){for(var n=Object.keys(e),o=0;o<n.length;++o)(r[n[o]]===void 0||!t)&&(r[n[o]]=e[n[o]]);return r}b.merge=yc;b.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function mc(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&&yc(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}b.newError=mc;b.ProtocolError=mc("ProtocolError");b.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var o=Object.keys(this),i=o.length-1;i>-1;--i)if(t[o[i]]===1&&this[o[i]]!==void 0&&this[o[i]]!==null)return o[i]}};b.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};b.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};b._configure=function(){var r=b.Buffer;if(!r){b._Buffer_from=b._Buffer_allocUnsafe=null;return}b._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},b._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var jo=C((qg,vc)=>{"use strict";vc.exports=A;var ge=Qe(),Lo,mn=ge.LongBits,gc=ge.base64,wc=ge.utf8;function vr(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Mo(){}function vp(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function A(){this.len=0,this.head=new vr(Mo,0,0),this.tail=this.head,this.states=null}var bc=function(){return ge.Buffer?function(){return(A.create=function(){return new Lo})()}:function(){return new A}};A.create=bc();A.alloc=function(e){return new ge.Array(e)};ge.Array!==Array&&(A.alloc=ge.pool(A.alloc,ge.Array.prototype.subarray));A.prototype._push=function(e,t,n){return this.tail=this.tail.next=new vr(e,t,n),this.len+=t,this};function Fo(r,e,t){e[t]=r&255}function Ep(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function Uo(r,e){this.len=r,this.next=void 0,this.val=e}Uo.prototype=Object.create(vr.prototype);Uo.prototype.fn=Ep;A.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Uo((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};A.prototype.int32=function(e){return e<0?this._push($o,10,mn.fromNumber(e)):this.uint32(e)};A.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function $o(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}A.prototype.uint64=function(e){var t=mn.from(e);return this._push($o,t.length(),t)};A.prototype.int64=A.prototype.uint64;A.prototype.sint64=function(e){var t=mn.from(e).zzEncode();return this._push($o,t.length(),t)};A.prototype.bool=function(e){return this._push(Fo,1,e?1:0)};function Do(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}A.prototype.fixed32=function(e){return this._push(Do,4,e>>>0)};A.prototype.sfixed32=A.prototype.fixed32;A.prototype.fixed64=function(e){var t=mn.from(e);return this._push(Do,4,t.lo)._push(Do,4,t.hi)};A.prototype.sfixed64=A.prototype.fixed64;A.prototype.float=function(e){return this._push(ge.float.writeFloatLE,4,e)};A.prototype.double=function(e){return this._push(ge.float.writeDoubleLE,8,e)};var xp=ge.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var o=0;o<e.length;++o)t[n+o]=e[o]};A.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Fo,1,0);if(ge.isString(e)){var n=A.alloc(t=gc.length(e));gc.decode(e,n,0),e=n}return this.uint32(t)._push(xp,t,e)};A.prototype.string=function(e){var t=wc.length(e);return t?this.uint32(t)._push(wc.write,t,e):this._push(Fo,1,0)};A.prototype.fork=function(){return this.states=new vp(this),this.head=this.tail=new vr(Mo,0,0),this.len=0,this};A.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 vr(Mo,0,0),this.len=0),this};A.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};A.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};A._configure=function(r){Lo=r,A.create=bc(),Lo._configure()}});var _c=C((Kg,xc)=>{"use strict";xc.exports=Pe;var Ec=jo();(Pe.prototype=Object.create(Ec.prototype)).constructor=Pe;var Ye=Qe();function Pe(){Ec.call(this)}Pe._configure=function(){Pe.alloc=Ye._Buffer_allocUnsafe,Pe.writeBytesBuffer=Ye.Buffer&&Ye.Buffer.prototype instanceof Uint8Array&&Ye.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 o=0;o<e.length;)t[n++]=e[o++]}};Pe.prototype.bytes=function(e){Ye.isString(e)&&(e=Ye._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Pe.writeBytesBuffer,t,e),this};function _p(r,e,t){r.length<40?Ye.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Pe.prototype.string=function(e){var t=Ye.Buffer.byteLength(e);return this.uint32(t),t&&this._push(_p,t,e),this};Pe._configure()});var Ko=C((Vg,Tc)=>{"use strict";Tc.exports=F;var Re=Qe(),qo,Oc=Re.LongBits,Ap=Re.utf8;function _e(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function F(r){this.buf=r,this.pos=0,this.len=r.length}var Ac=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new F(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new F(e);throw Error("illegal buffer")},Cc=function(){return Re.Buffer?function(t){return(F.create=function(o){return Re.Buffer.isBuffer(o)?new qo(o):Ac(o)})(t)}:Ac};F.create=Cc();F.prototype._slice=Re.Array.prototype.subarray||Re.Array.prototype.slice;F.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,_e(this,10);return e}}();F.prototype.int32=function(){return this.uint32()|0};F.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function zo(){var r=new Oc(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 _e(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 _e(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")}F.prototype.bool=function(){return this.uint32()!==0};function gn(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}F.prototype.fixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return gn(this.buf,this.pos+=4)};F.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return gn(this.buf,this.pos+=4)|0};function Sc(){if(this.pos+8>this.len)throw _e(this,8);return new Oc(gn(this.buf,this.pos+=4),gn(this.buf,this.pos+=4))}F.prototype.float=function(){if(this.pos+4>this.len)throw _e(this,4);var e=Re.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};F.prototype.double=function(){if(this.pos+8>this.len)throw _e(this,4);var e=Re.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};F.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw _e(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)};F.prototype.string=function(){var e=this.bytes();return Ap.read(e,0,e.length)};F.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw _e(this,e);this.pos+=e}else do if(this.pos>=this.len)throw _e(this);while(this.buf[this.pos++]&128);return this};F.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};F._configure=function(r){qo=r,F.create=Cc(),qo._configure();var e=Re.Long?"toLong":"toNumber";Re.merge(F.prototype,{int64:function(){return zo.call(this)[e](!1)},uint64:function(){return zo.call(this)[e](!0)},sint64:function(){return zo.call(this).zzDecode()[e](!1)},fixed64:function(){return Sc.call(this)[e](!0)},sfixed64:function(){return Sc.call(this)[e](!1)}})}});var Rc=C((Wg,Pc)=>{"use strict";Pc.exports=ht;var Ic=Ko();(ht.prototype=Object.create(Ic.prototype)).constructor=ht;var kc=Qe();function ht(r){Ic.call(this,r)}ht._configure=function(){kc.Buffer&&(ht.prototype._slice=kc.Buffer.prototype.slice)};ht.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))};ht._configure()});var Bc=C((Hg,Nc)=>{"use strict";Nc.exports=Er;var Vo=Qe();(Er.prototype=Object.create(Vo.EventEmitter.prototype)).constructor=Er;function Er(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");Vo.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(t)}Er.prototype.rpcCall=function r(e,t,n,o,i){if(!o)throw TypeError("request must be specified");var s=this;if(!i)return Vo.asPromise(r,s,e,t,n,o);if(!s.rpcImpl){setTimeout(function(){i(Error("already ended"))},0);return}try{return s.rpcImpl(e,t[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(c,u){if(c)return s.emit("error",c,e),i(c);if(u===null){s.end(!0);return}if(!(u instanceof n))try{u=n[s.responseDelimited?"decodeDelimited":"decode"](u)}catch(f){return s.emit("error",f,e),i(f)}return s.emit("data",u,e),i(null,u)})}catch(a){s.emit("error",a,e),setTimeout(function(){i(a)},0);return}};Er.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var Dc=C(Lc=>{"use strict";var Sp=Lc;Sp.Service=Bc()});var Fc=C((Jg,Mc)=>{"use strict";Mc.exports={}});var jc=C($c=>{"use strict";var X=$c;X.build="minimal";X.Writer=jo();X.BufferWriter=_c();X.Reader=Ko();X.BufferReader=Rc();X.util=Qe();X.rpc=Dc();X.roots=Fc();X.configure=Uc;function Uc(){X.util._configure(),X.Writer._configure(X.BufferWriter),X.Reader._configure(X.BufferReader)}Uc()});var Ze=C((Yg,zc)=>{"use strict";zc.exports=jc()});var Wc=C((Wo,Vc)=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});bn.BASE=2166136261;function bn(r,e=bn.BASE){let t=r.length;for(let n=0;n<t;n++)e^=r.charCodeAt(n),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}Wo.default=bn;Vc.exports=bn});var Jc=C((ew,Gc)=>{Gc.exports=Ho;var Hc=128,Cp=127,Tp=~Cp,kp=Math.pow(2,31);function Ho(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Ho.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=kp;)e[t++]=r&255|Hc,r/=128;for(;r&Tp;)e[t++]=r&255|Hc,r>>>=7;return e[t]=r|0,Ho.bytes=t-n+1,e}});var Zc=C((tw,Yc)=>{Yc.exports=Go;var Ip=128,Qc=127;function Go(r,n){var t=0,n=n||0,o=0,i=n,s,a=r.length;do{if(i>=a||o>49)throw Go.bytes=0,new RangeError("Could not decode varint");s=r[i++],t+=o<28?(s&Qc)<<o:(s&Qc)*Math.pow(2,o),o+=7}while(s>=Ip);return Go.bytes=i-n,t}});var eu=C((rw,Xc)=>{var Pp=Math.pow(2,7),Rp=Math.pow(2,14),Np=Math.pow(2,21),Bp=Math.pow(2,28),Lp=Math.pow(2,35),Dp=Math.pow(2,42),Mp=Math.pow(2,49),Fp=Math.pow(2,56),Up=Math.pow(2,63);Xc.exports=function(r){return r<Pp?1:r<Rp?2:r<Np?3:r<Bp?4:r<Lp?5:r<Dp?6:r<Mp?7:r<Fp?8:r<Up?9:10}});var xr=C((nw,tu)=>{tu.exports={encode:Jc(),decode:Zc(),encodingLength:eu()}});var Ju=C((zb,Rn)=>{"use strict";Rn.exports=Bh;Rn.exports.format=Hu;Rn.exports.parse=Gu;var Ph=/\B(?=(\d{3})+(?!\d))/g,Rh=/(?:\.0*|(\.[^0]+)0+)$/,rt={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},Nh=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function Bh(r,e){return typeof r=="string"?Gu(r):typeof r=="number"?Hu(r,e):null}function Hu(r,e){if(!Number.isFinite(r))return null;var t=Math.abs(r),n=e&&e.thousandsSeparator||"",o=e&&e.unitSeparator||"",i=e&&e.decimalPlaces!==void 0?e.decimalPlaces:2,s=Boolean(e&&e.fixedDecimals),a=e&&e.unit||"";(!a||!rt[a.toLowerCase()])&&(t>=rt.pb?a="PB":t>=rt.tb?a="TB":t>=rt.gb?a="GB":t>=rt.mb?a="MB":t>=rt.kb?a="KB":a="B");var c=r/rt[a.toLowerCase()],u=c.toFixed(i);return s||(u=u.replace(Rh,"$1")),n&&(u=u.split(".").map(function(f,l){return l===0?f.replace(Ph,n):f}).join(".")),u+o+a}function Gu(r){if(typeof r=="number"&&!isNaN(r))return r;if(typeof r!="string")return null;var e=Nh.exec(r),t,n="b";return e?(t=parseFloat(e[1]),n=e[4].toLowerCase()):(t=parseInt(r,10),n="b"),isNaN(t)?null:Math.floor(rt[n]*t)}});var Yu=C((qb,Qu)=>{"use strict";Qu.exports=r=>{if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}});var nf=C((tf,rf)=>{"use strict";var Nn=Yu(),{hasOwnProperty:Xu}=Object.prototype,{propertyIsEnumerable:Lh}=Object,Zt=(r,e,t)=>Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0}),Dh=tf,Zu={concatArrays:!1,ignoreUndefined:!1},Bn=r=>{let e=[];for(let t in r)Xu.call(r,t)&&e.push(t);if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(r);for(let n of t)Lh.call(r,n)&&e.push(n)}return e};function Xt(r){return Array.isArray(r)?Mh(r):Nn(r)?Fh(r):r}function Mh(r){let e=r.slice(0,0);return Bn(r).forEach(t=>{Zt(e,t,Xt(r[t]))}),e}function Fh(r){let e=Object.getPrototypeOf(r)===null?Object.create(null):{};return Bn(r).forEach(t=>{Zt(e,t,Xt(r[t]))}),e}var ef=(r,e,t,n)=>(t.forEach(o=>{typeof e[o]>"u"&&n.ignoreUndefined||(o in r&&r[o]!==Object.getPrototypeOf(r)?Zt(r,o,Ei(r[o],e[o],n)):Zt(r,o,Xt(e[o])))}),r),Uh=(r,e,t)=>{let n=r.slice(0,0),o=0;return[r,e].forEach(i=>{let s=[];for(let a=0;a<i.length;a++)Xu.call(i,a)&&(s.push(String(a)),i===r?Zt(n,o++,i[a]):Zt(n,o++,Xt(i[a])));n=ef(n,i,Bn(i).filter(a=>!s.includes(a)),t)}),n};function Ei(r,e,t){return t.concatArrays&&Array.isArray(r)&&Array.isArray(e)?Uh(r,e,t):!Nn(e)||!Nn(r)?Xt(e):ef(r,e,Bn(e),t)}rf.exports=function(...r){let e=Ei(Xt(Zu),this!==Dh&&this||{},Zu),t={_:{}};for(let n of r)if(n!==void 0){if(!Nn(n))throw new TypeError("`"+n+"` is not an Option Object");t=Ei(t,{_:n},e)}return t._}});var pf=C((Zb,_i)=>{"use strict";var qh=Object.prototype.hasOwnProperty,Q="~";function Br(){}Object.create&&(Br.prototype=Object.create(null),new Br().__proto__||(Q=!1));function Kh(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function df(r,e,t,n,o){if(typeof t!="function")throw new TypeError("The listener must be a function");var i=new Kh(t,n||r,o),s=Q?Q+e:e;return r._events[s]?r._events[s].fn?r._events[s]=[r._events[s],i]:r._events[s].push(i):(r._events[s]=i,r._eventsCount++),r}function Mn(r,e){--r._eventsCount===0?r._events=new Br:delete r._events[e]}function J(){this._events=new Br,this._eventsCount=0}J.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)qh.call(t,n)&&e.push(Q?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};J.prototype.listeners=function(e){var t=Q?Q+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,s=new Array(i);o<i;o++)s[o]=n[o].fn;return s};J.prototype.listenerCount=function(e){var t=Q?Q+e:e,n=this._events[t];return n?n.fn?1:n.length:0};J.prototype.emit=function(e,t,n,o,i,s){var a=Q?Q+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,f,l;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,o),!0;case 5:return c.fn.call(c.context,t,n,o,i),!0;case 6:return c.fn.call(c.context,t,n,o,i,s),!0}for(l=1,f=new Array(u-1);l<u;l++)f[l-1]=arguments[l];c.fn.apply(c.context,f)}else{var p=c.length,g;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;case 4:c[l].fn.call(c[l].context,t,n,o);break;default:if(!f)for(g=1,f=new Array(u-1);g<u;g++)f[g-1]=arguments[g];c[l].fn.apply(c[l].context,f)}}return!0};J.prototype.on=function(e,t,n){return df(this,e,t,n,!1)};J.prototype.once=function(e,t,n){return df(this,e,t,n,!0)};J.prototype.removeListener=function(e,t,n,o){var i=Q?Q+e:e;if(!this._events[i])return this;if(!t)return Mn(this,i),this;var s=this._events[i];if(s.fn)s.fn===t&&(!o||s.once)&&(!n||s.context===n)&&Mn(this,i);else{for(var a=0,c=[],u=s.length;a<u;a++)(s[a].fn!==t||o&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[i]=c.length===1?c[0]:c:Mn(this,i)}return this};J.prototype.removeAllListeners=function(e){var t;return e?(t=Q?Q+e:e,this._events[t]&&Mn(this,t)):(this._events=new Br,this._eventsCount=0),this};J.prototype.off=J.prototype.removeListener;J.prototype.addListener=J.prototype.on;J.prefixed=Q;J.EventEmitter=J;typeof _i<"u"&&(_i.exports=J)});var wy={};Y(wy,{createRepo:()=>yy});var ir=sl;function sl(r,e,t){if(!r)return t;var n,o;if(Array.isArray(e)&&(n=e.slice(0)),typeof e=="string"&&(n=e.split(".")),typeof e=="symbol"&&(n=[e]),!Array.isArray(n))throw new Error("props arg must be an array, a string or a symbol");for(;n.length;)if(o=n.shift(),!r||(r=r[o],r===void 0))return t;return r}var Zf=S(Ce(),1),St=S(De(),1);var vl=ds,fs=128,El=127,xl=~El,_l=Math.pow(2,31);function ds(r,e,t){e=e||[],t=t||0;for(var n=t;r>=_l;)e[t++]=r&255|fs,r/=128;for(;r&xl;)e[t++]=r&255|fs,r>>>=7;return e[t]=r|0,ds.bytes=t-n+1,e}var Al=Yn,Sl=128,ls=127;function Yn(r,n){var t=0,n=n||0,o=0,i=n,s,a=r.length;do{if(i>=a)throw Yn.bytes=0,new RangeError("Could not decode varint");s=r[i++],t+=o<28?(s&ls)<<o:(s&ls)*Math.pow(2,o),o+=7}while(s>=Sl);return Yn.bytes=i-n,t}var Ol=Math.pow(2,7),Cl=Math.pow(2,14),Tl=Math.pow(2,21),kl=Math.pow(2,28),Il=Math.pow(2,35),Pl=Math.pow(2,42),Rl=Math.pow(2,49),Nl=Math.pow(2,56),Bl=Math.pow(2,63),Ll=function(r){return r<Ol?1:r<Cl?2:r<Tl?3:r<kl?4:r<Il?5:r<Pl?6:r<Rl?7:r<Nl?8:r<Bl?9:10},Dl={encode:vl,decode:Al,encodingLength:Ll},Ml=Dl,sr=Ml;var ar=(r,e=0)=>[sr.decode(r,e),sr.decode.bytes],It=(r,e,t=0)=>(sr.encode(r,e,t),e),Pt=r=>sr.encodingLength(r);var Oy=new Uint8Array(0);var ps=(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},Me=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")};var hs=r=>new TextEncoder().encode(r),ys=r=>new TextDecoder().decode(r);var ut=(r,e)=>{let t=e.byteLength,n=Pt(r),o=n+Pt(t),i=new Uint8Array(o+t);return It(r,i,0),It(t,i,n),i.set(e,o),new Rt(r,t,e,i)},Te=r=>{let e=Me(r),[t,n]=ar(e),[o,i]=ar(e.subarray(n)),s=e.subarray(n+i);if(s.byteLength!==o)throw new Error("Incorrect length");return new Rt(t,o,s,e)},ms=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&ps(r.bytes,t.bytes)}},Rt=class{constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};var no={};Y(no,{base58btc:()=>Z,base58flickr:()=>ql});function Fl(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<r.length;o++){var i=r.charAt(o),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=o}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function l(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,I=0,B=0,W=w.length;B!==W&&w[B]===0;)B++,v++;for(var de=(W-B)*f+1>>>0,H=new Uint8Array(de);B!==W;){for(var be=w[B],pe=0,re=de-1;(be!==0||pe<I)&&re!==-1;re--,pe++)be+=256*H[re]>>>0,H[re]=be%a>>>0,be=be/a>>>0;if(be!==0)throw new Error("Non-zero carry");I=pe,B++}for(var he=de-I;he!==de&&H[he]===0;)he++;for(var Ot=c.repeat(v);he<de;++he)Ot+=r.charAt(H[he]);return Ot}function p(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var I=0,B=0;w[v]===c;)I++,v++;for(var W=(w.length-v)*u+1>>>0,de=new Uint8Array(W);w[v];){var H=t[w.charCodeAt(v)];if(H===255)return;for(var be=0,pe=W-1;(H!==0||be<B)&&pe!==-1;pe--,be++)H+=a*de[pe]>>>0,de[pe]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");B=be,v++}if(w[v]!==" "){for(var re=W-B;re!==W&&de[re]===0;)re++;for(var he=new Uint8Array(I+(W-re)),Ot=I;re!==W;)he[Ot++]=de[re++];return he}}}function g(w){var v=p(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:l,decodeUnsafe:p,decode:g}}var Ul=Fl,$l=Ul,gs=$l;var Xn=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")}},eo=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 ws(this,e)}},to=class{constructor(e){this.decoders=e}or(e){return ws(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`)}},ws=(r,e)=>new to({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),ro=class{constructor(e,t,n,o){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new Xn(e,t,n),this.decoder=new eo(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Nt=({name:r,prefix:e,encode:t,decode:n})=>new ro(r,e,t,n),We=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:o}=gs(t,e);return Nt({prefix:r,name:e,encode:n,decode:i=>Me(o(i))})},jl=(r,e,t,n)=>{let o={};for(let f=0;f<e.length;++f)o[e[f]]=f;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),a=0,c=0,u=0;for(let f=0;f<i;++f){let l=o[r[f]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|l,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},zl=(r,e,t)=>{let n=e[e.length-1]==="=",o=(1<<t)-1,i="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,i+=e[o&a>>s];if(s&&(i+=e[o&a<<t-s]),n)for(;i.length*t&7;)i+="=";return i},D=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Nt({prefix:e,name:r,encode(o){return zl(o,n,t)},decode(o){return jl(o,n,t,r)}});var Z=We({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ql=We({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var oo={};Y(oo,{base32:()=>P,base32hex:()=>Hl,base32hexpad:()=>Jl,base32hexpadupper:()=>Ql,base32hexupper:()=>Gl,base32pad:()=>Vl,base32padupper:()=>Wl,base32upper:()=>Kl,base32z:()=>Yl});var P=D({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Kl=D({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vl=D({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Wl=D({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Hl=D({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Gl=D({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Jl=D({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ql=D({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Yl=D({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var bs=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return Xl(t,io(r),e||Z.encoder);default:return ed(t,io(r),e||P.encoder)}};var vs=new WeakMap,io=r=>{let e=vs.get(r);if(e==null){let t=new Map;return vs.set(r,t),t}return e},E=class{constructor(e,t,n,o){this.code=t,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==cr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==td)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return E.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=ut(e,t);return E.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 E.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&ms(e.multihash,n.multihash)}toString(e){return bs(this,e)}toJSON(){return{"/":bs(this)}}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 E)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:i,bytes:s}=t;return new E(n,o,i,s||Es(n,o,i.bytes))}else if(t[rd]===!0){let{version:n,multihash:o,code:i}=t,s=Te(o);return E.create(n,i,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!==cr)throw new Error(`Version 0 CID must use dag-pb (code: ${cr}) block encoding`);return new E(e,t,n,n.bytes)}case 1:{let o=Es(e,t,n.bytes);return new E(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return E.create(0,cr,e)}static createV1(e,t){return E.create(1,e,t)}static decode(e){let[t,n]=E.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=E.inspectBytes(e),n=t.size-t.multihashSize,o=Me(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=o.subarray(t.multihashSize-t.digestSize),s=new Rt(t.multihashCode,t.digestSize,i,o);return[t.version===0?E.createV0(s):E.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[l,p]=ar(e.subarray(t));return t+=p,l},o=n(),i=cr;if(o===18?(o=0,t=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let s=t,a=n(),c=n(),u=t+c,f=u-s;return{version:o,codec:i,multihashCode:a,digestSize:c,multihashSize:f,size:u}}static parse(e,t){let[n,o]=Zl(e,t),i=E.decode(o);return io(i).set(n,e),i}},Zl=(r,e)=>{switch(r[0]){case"Q":{let t=e||Z;return[Z.prefix,t.decode(`${Z.prefix}${r}`)]}case Z.prefix:{let t=e||Z;return[Z.prefix,t.decode(r)]}case P.prefix:{let t=e||P;return[P.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)]}}},Xl=(r,e,t)=>{let{prefix:n}=t;if(n!==Z.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let i=t.encode(r).slice(1);return e.set(n,i),i}else return o},ed=(r,e,t)=>{let{prefix:n}=t,o=e.get(n);if(o==null){let i=t.encode(r);return e.set(n,i),i}else return o},cr=112,td=18,Es=(r,e,t)=>{let n=Pt(r),o=n+Pt(e),i=new Uint8Array(o+t.byteLength);return It(r,i,0),It(e,i,n),i.set(t,o),i},rd=Symbol.for("@ipld/js-cid/CID");var Zr=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var so={};Y(so,{identity:()=>nd});var nd=Nt({prefix:"\0",name:"identity",encode:r=>ys(r),decode:r=>hs(r)});var ao={};Y(ao,{base2:()=>od});var od=D({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var co={};Y(co,{base8:()=>id});var id=D({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var uo={};Y(uo,{base10:()=>sd});var sd=We({prefix:"9",name:"base10",alphabet:"0123456789"});var fo={};Y(fo,{base16:()=>ad,base16upper:()=>cd});var ad=D({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),cd=D({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var lo={};Y(lo,{base36:()=>ud,base36upper:()=>fd});var ud=We({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),fd=We({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var po={};Y(po,{base64:()=>ld,base64pad:()=>dd,base64url:()=>pd,base64urlpad:()=>hd});var ld=D({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),dd=D({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),pd=D({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),hd=D({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ho={};Y(ho,{base256emoji:()=>bd});var xs=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{1F6