orbit-db-kastore
Version:
Key-Array Store for orbit-db
2 lines • 172 kB
JavaScript
/*! For license information please see orbitdb.kastore.min.js.LICENSE.txt */
var OrbitDBKAStore;(()=>{var __webpack_modules__={8820:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),s=i.charCodeAt(0);if(255!==t[s])throw new TypeError(i+" is ambiguous");t[s]=n}var o=e.length,a=e.charAt(0),c=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===a;)n++,r++;for(var s=(e.length-r)*c+1>>>0,u=new Uint8Array(s);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var h=0,f=s-1;(0!==l||h<i)&&-1!==f;f--,h++)l+=o*u[f]>>>0,u[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=h,r++}if(" "!==e[r]){for(var p=s-i;p!==s&&0===u[p];)p++;for(var d=new Uint8Array(n+(s-p)),y=n;p!==s;)d[y++]=u[p++];return d}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var c=(s-i)*u+1>>>0,l=new Uint8Array(c);i!==s;){for(var h=t[i],f=0,p=c-1;(0!==h||f<n)&&-1!==p;p--,f++)h+=256*l[p]>>>0,l[p]=h%o>>>0,h=h/o>>>0;if(0!==h)throw new Error("Non-zero carry");n=f,i++}for(var d=c-n;d!==c&&0===l[d];)d++;for(var y=a.repeat(r);d<c;++d)y+=e.charAt(l[d]);return y},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+o+" character")}}}},4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,o){r[n]=function(e){if(s)if(s=!1,e)o(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){s&&(s=!1,o(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),s=0;s<64;)i[n[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(e,t,r){for(var i,s=null,o=[],a=0,c=0;t<r;){var u=e[t++];switch(c){case 0:o[a++]=n[u>>2],i=(3&u)<<4,c=1;break;case 1:o[a++]=n[i|u>>4],i=(15&u)<<2,c=2;break;case 2:o[a++]=n[i|u>>6],o[a++]=n[63&u],c=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return c&&(o[a++]=n[i],o[a++]=61,1===c&&(o[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";r.decode=function(e,t,r){for(var n,s=r,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=i[u]))throw Error(o);switch(a){case 0:n=u,a=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,a=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,a=3;break;case 3:t[r++]=(3&n)<<6|u,a=0}}if(1===a)throw Error(o);return r-s},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function s(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function o(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:s,e.writeFloatBE=n?s:i,e.readFloatLE=n?o:a,e.readFloatBE=n?a:o}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var s=Math.floor(Math.log(t)/Math.LN2);e((i<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,r,n)}}function o(e,t,r){var n=e(t,r),i=2*(n>>31)+1,s=n>>>23&255,o=8388607&n;return 255===s?o?NaN:i*(1/0):0===s?1401298464324817e-60*i*o:i*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=o.bind(null,i),e.readFloatBE=o.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function s(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function o(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:s,e.writeDoubleBE=n?s:i,e.readDoubleLE=n?o:a,e.readDoubleBE=n?a:o}():function(){function t(e,t,r,n,i,s){var o=n<0?1:0;if(o&&(n=-n),0===n)e(0,i,s+t),e(1/n>0?0:2147483648,i,s+r);else if(isNaN(n))e(0,i,s+t),e(2146959360,i,s+r);else if(n>17976931348623157e292)e(0,i,s+t),e((o<<31|2146435072)>>>0,i,s+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,i,s+t),e((o<<31|a/4294967296)>>>0,i,s+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,i,s+t),e((o<<31|c+1023<<20|1048576*a&1048575)>>>0,i,s+r)}}}function o(e,t,r,n,i){var s=e(n,i+t),o=e(n,i+r),a=2*(o>>31)+1,c=o>>>20&2047,u=4294967296*(1048575&o)+s;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=o.bind(null,i,0,4),e.readDoubleBE=o.bind(null,s,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},6662:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,s=null,o=n;return function(r){if(r<1||r>i)return e(r);o+r>n&&(s=e(n),o=0);var a=t.call(s,o,o+=r);return 7&o&&(o=1+(7|o)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,s=[],o=0;t<r;)(n=e[t++])<128?s[o++]=n:n>191&&n<224?s[o++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(n>>10),s[o++]=56320+(1023&n)):s[o++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(e,t,r){for(var n,i,s=r,o=0;o<e.length;++o)(n=e.charCodeAt(o))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(o+1)))?(n=65536+((1023&n)<<10)+(1023&i),++o,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-s}},6455:(e,t,r)=>{"use strict";const n=r(5602),i=r(5281);class s extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t=(e=[...e].map((e=>e instanceof Error?e:null!==e&&"object"==typeof e?Object.assign(new Error(e.message),e):new Error(e)))).map((e=>"string"==typeof e.stack?i(e.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(e))).join("\n");t="\n"+n(t,4),super(t),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:e})}*[Symbol.iterator](){for(const e of this._errors)yield e}}e.exports=s},6314:e=>{"use strict";var t=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];e.exports=function(){for(var e=[],r=0;r<t.length;r++)"function"==typeof global[t[r]]&&(e[e.length]=t[r]);return e}},8442:(e,t,r)=>{var n=r(9488);function i(e,t,r){var n=e[t]+e[r],i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function s(e,t,r,n){var i=e[t]+r;r<0&&(i+=4294967296);var s=e[t+1]+n;i>=4294967296&&s++,e[t]=i,e[t+1]=s}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,o,a){var c=h[o],u=h[o+1],f=h[a],p=h[a+1];i(l,e,t),s(l,e,c,u);var d=l[n]^l[e],y=l[n+1]^l[e+1];l[n]=y,l[n+1]=d,i(l,r,n),d=l[t]^l[r],y=l[t+1]^l[r+1],l[t]=d>>>24^y<<8,l[t+1]=y>>>24^d<<8,i(l,e,t),s(l,e,f,p),d=l[n]^l[e],y=l[n+1]^l[e+1],l[n]=d>>>16^y<<16,l[n+1]=y>>>16^d<<16,i(l,r,n),d=l[t]^l[r],y=l[t+1]^l[r+1],l[t]=y>>>31^d<<1,l[t+1]=d>>>31^y<<1}var c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),h=new Uint32Array(32);function f(e,t){var r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=c[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)h[r]=o(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,u[16*r+0],u[16*r+1]),a(2,10,18,26,u[16*r+2],u[16*r+3]),a(4,12,20,28,u[16*r+4],u[16*r+5]),a(6,14,22,30,u[16*r+6],u[16*r+7]),a(0,10,20,30,u[16*r+8],u[16*r+9]),a(2,12,22,24,u[16*r+10],u[16*r+11]),a(4,14,16,26,u[16*r+12],u[16*r+13]),a(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}function p(e,t){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e},n=0;n<16;n++)r.h[n]=c[n];var i=t?t.length:0;return r.h[0]^=16842752^i<<8^e,t&&(d(r,t),r.c=128),r}function d(e,t){for(var r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,f(e,!1),e.c=0),e.b[e.c++]=t[r]}function y(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;f(e,!0);for(var t=new Uint8Array(e.outlen),r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function b(e,t,r){r=r||64,e=n.normalizeInput(e);var i=p(r,t);return d(i,e),y(i)}e.exports={blake2b:b,blake2bHex:function(e,t,r){var i=b(e,t,r);return n.toHex(i)},blake2bInit:p,blake2bUpdate:d,blake2bFinal:y}},5297:(e,t,r)=>{var n=r(9488);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function s(e,t,r,n,i,s){u[e]=u[e]+u[t]+i,u[n]=o(u[n]^u[e],16),u[r]=u[r]+u[n],u[t]=o(u[t]^u[r],12),u[e]=u[e]+u[t]+s,u[n]=o(u[n]^u[e],8),u[r]=u[r]+u[n],u[t]=o(u[t]^u[r],7)}function o(e,t){return e>>>t^e<<32-t}var a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),l=new Uint32Array(16);function h(e,t){var r=0;for(r=0;r<8;r++)u[r]=e.h[r],u[r+8]=a[r];for(u[12]^=e.t,u[13]^=e.t/4294967296,t&&(u[14]=~u[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)s(0,4,8,12,l[c[16*r+0]],l[c[16*r+1]]),s(1,5,9,13,l[c[16*r+2]],l[c[16*r+3]]),s(2,6,10,14,l[c[16*r+4]],l[c[16*r+5]]),s(3,7,11,15,l[c[16*r+6]],l[c[16*r+7]]),s(0,5,10,15,l[c[16*r+8]],l[c[16*r+9]]),s(1,6,11,12,l[c[16*r+10]],l[c[16*r+11]]),s(2,7,8,13,l[c[16*r+12]],l[c[16*r+13]]),s(3,4,9,14,l[c[16*r+14]],l[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=u[r]^u[r+8]}function f(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");var r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");var n={h:new Uint32Array(a),b:new Uint32Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(p(n,t),n.c=64),n}function p(e,t){for(var r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[r]}function d(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;h(e,!0);for(var t=new Uint8Array(e.outlen),r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function y(e,t,r){r=r||32,e=n.normalizeInput(e);var i=f(r,t);return p(i,e),d(i)}e.exports={blake2s:y,blake2sHex:function(e,t,r){var i=y(e,t,r);return n.toHex(i)},blake2sInit:f,blake2sUpdate:p,blake2sFinal:d}},1191:(e,t,r)=>{var n=r(8442),i=r(5297);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},9488:e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){var t;if(e instanceof Uint8Array)t=e;else if(e instanceof Buffer)t=new Uint8Array(e);else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=new Uint8Array(Buffer.from(e,"utf8"))}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,n){for(var i="\n"+e+" = ",s=0;s<r.length;s+=2){if(32===n)i+=t(r[s]).toUpperCase(),i+=" ",i+=t(r[s+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[s+1]).toUpperCase(),i+=t(r[s]).toUpperCase()}s%6==4?i+="\n"+new Array(e.length+4).join(" "):s<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){for(var n=(new Date).getTime(),i=new Uint8Array(t),s=0;s<t;s++)i[s]=s%256;var o=(new Date).getTime();for(console.log("Generated random input in "+(o-n)+"ms"),n=o,s=0;s<r;s++){var a=e(i),c=(new Date).getTime(),u=c-n;n=c,console.log("Hashed in "+u+"ms: "+a.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(u/1e3)*100)/100+" MB PER SECOND")}}}},1924:(e,t,r)=>{"use strict";var n=r(210),i=r(5559),s=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&s(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),i=r(210),s=i("%Function.prototype.apply%"),o=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(o,s),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=a(n,o,arguments);if(c&&u){var r=c(t,"length");r.configurable&&u(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var h=function(){return a(n,s,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h},8303:(e,t,r)=>{"use strict";const n=r(8370),i={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!=typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!(e.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{n.validate(e.multihash)}catch(e){let t=e.message;return t||(t="Multihash validation failed"),t}}};e.exports=i},8878:(e,t,r)=>{"use strict";const n=r(8370),i=r(6957),s=r(6883),o=r(8303),a=r(6643),c=r(3071),u=r(2142),l=s.nameToCode,h=Object.keys(l).reduce(((e,t)=>(e[l[t]]=t,e)),{}),f=Symbol.for("@ipld/js-cid/CID");class p{constructor(e,t,r,o){if(this.version,this.codec,this.multihash,Object.defineProperty(this,f,{value:!0}),p.isCID(e)){const t=e;return this.version=t.version,this.codec=t.codec,this.multihash=t.multihash,void(this.multibaseName=t.multibaseName||(0===t.version?"base58btc":"base32"))}if("string"==typeof e){const t=i.isEncoded(e);if(t){const r=i.decode(e);this.version=parseInt(r[0].toString(),16),this.codec=s.getCodec(r.slice(1)),this.multihash=s.rmPrefix(r.slice(1)),this.multibaseName=t}else this.version=0,this.codec="dag-pb",this.multihash=n.fromB58String(e),this.multibaseName="base58btc";return p.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){const t=parseInt(e[0].toString(),16);if(1===t){const r=e;this.version=t,this.codec=s.getCodec(r.slice(1)),this.multihash=s.rmPrefix(r.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";p.validateCID(this)}else this.version=e,"number"==typeof t&&(t=h[t]),this.codec=t,this.multihash=r,this.multibaseName=o||(0===e?"base58btc":"base32"),p.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");{const t=s.getCodeVarint(this.codec);e=a([[1],t,this.multihash],1+t.byteLength+this.multihash.byteLength)}}Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){const e=s.getCodeVarint(this.codec),t=n.prefix(this.multihash);return a([[this.version],e,t],1+e.byteLength+t.byteLength)}get code(){return l[this.codec]}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:t}=n.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==t)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new p(0,this.codec,this.multihash)}toV1(){return new p(1,this.codec,this.multihash,this.multibaseName)}toBaseEncodedString(e=this.multibaseName){if(this.string&&0!==this.string.length&&e===this.multibaseName)return this.string;let t;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");t=n.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");t=c(i.encode(e,this.bytes))}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:t}),t}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&u(this.multihash,e.multihash)}static validateCID(e){const t=o.checkCIDComponents(e);if(t)throw new Error(t)}static isCID(e){return e instanceof p||Boolean(e&&e[f])}}p.codecs=l,e.exports=p},5281:(e,t,r)=>{"use strict";const n=r(5696),i=/\s+at.*(?:\(|\s)(.*)\)?/,s=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,o=void 0===n.homedir?"":n.homedir();e.exports=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(i);if(null===t||!t[1])return!0;const r=t[1];return!r.includes(".app/Contents/Resources/electron.asar")&&!r.includes(".app/Contents/Resources/default_app.asar")&&!s.test(r)})).filter((e=>""!==e.trim())).map((e=>t.pretty?e.replace(i,((e,t)=>e.replace(t,t.replace(o,"~")))):e)).join("\n"))},2114:e=>{"use strict";function t(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,r,n){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof r&&(n=r,r=""),r&&(n.code=r);try{return t(e,n)}catch(r){n.message=e.message,n.stack=e.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),t(new i,n)}}},4079:(e,t,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%");if(n)try{n([],"length")}catch(e){n=null}e.exports=n},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,s||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,s,o){var a=r?r+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,i),!0;case 5:return l.fn.call(l.context,t,n,i,s),!0;case 6:return l.fn.call(l.context,t,n,i,s,o),!0}for(u=1,c=new Array(h-1);u<h;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var f,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),h){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,i);break;default:if(!c)for(f=1,c=new Array(h-1);f<h;f++)c[f-1]=arguments[f];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var s=r?r+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||i&&!a[c].once||n&&a[c].context!==n)&&u.push(a[c]);u.length?this._events[s]=1===u.length?u[0]:u:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,s,o,u;if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):d(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(s){n.once&&e.removeEventListener(t,i),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=d(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,s,o;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9804:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var s=e.length;if(s===+s)for(var o=0;o<s;o++)n.call(i,e[o],o,e);else for(var a in e)t.call(e,a)&&n.call(i,e[a],a,e)}},7648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var s=this;if("function"!=typeof s||n.call(s)!==i)throw new TypeError(t+s);for(var o,a=r.call(arguments,1),c=function(){if(this instanceof o){var t=s.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return s.apply(e,a.concat(r.call(arguments)))},u=Math.max(0,s.length-a.length),l=[],h=0;h<u;h++)l.push("$"+h);if(o=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(c),s.prototype){var f=function(){};f.prototype=s.prototype,o.prototype=new f,f.prototype=null}return o}},8612:(e,t,r)=>{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=SyntaxError,s=Function,o=TypeError,a=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var u=function(){throw new o},l=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(e){return u}}}():u,h=r(1405)(),f=Object.getPrototypeOf||function(e){return e.__proto__},p={},d="undefined"==typeof Uint8Array?n:f(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?f(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},b=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=f(i.prototype))}return y[t]=r,r},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=r(8612),m=r(7642),v=k.call(Function.call,Array.prototype.concat),w=k.call(Function.apply,Array.prototype.splice),_=k.call(Function.call,String.prototype.replace),A=k.call(Function.call,String.prototype.slice),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,S=function(e){var t=A(e,0,1),r=A(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,x,(function(e,t,r,i){n[n.length]=r?_(i,E,"$1"):t||e})),n},O=function(e,t){var r,n=e;if(m(g,n)&&(n="%"+(r=g[n])[0]+"%"),m(y,n)){var s=y[n];if(s===p&&(s=b(n)),void 0===s&&!t)throw new o("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:s}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new o('"allowMissing" argument must be a boolean');var r=S(e),n=r.length>0?r[0]:"",s=O("%"+n+"%",t),a=s.name,u=s.value,l=!1,h=s.alias;h&&(n=h[0],w(r,v([0,1],h)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],b=A(d,0,1),g=A(d,-1);if(('"'===b||"'"===b||"`"===b||'"'===g||"'"===g||"`"===g)&&b!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==d&&p||(l=!0),m(y,a="%"+(n+="."+d)+"%"))u=y[a];else if(null!=u){if(!(d in u)){if(!t)throw new o("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&f+1>=r.length){var k=c(u,d);u=(p=!!k)&&"get"in k&&!("originalValue"in k.get)?k.get:u[d]}else p=m(u,d),u=u[d];p&&!l&&(y[a]=u)}}return u}},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7642:(e,t,r)=>{"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},5602:e=>{"use strict";e.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},"string"!=typeof e)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if("string"!=typeof r.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(0===t)return e;const n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},2154:e=>{"use strict";e.exports=class{async canAppend(e,t){return!0}}},8925:e=>{"use strict";e.exports=class{constructor(e={}){this._cache=e}set(e,t){this._cache[e]=t}get(e){return this._cache[e]}delete(e){return delete this._cache[e]}add(e){this._cache=Object.assign(this._cache,e)}get length(){return Object.values(this._cache).length}}},7349:(e,t,r)=>{"use strict";const n=r(6301),i=r(9045),s=r(7117),o=e=>e&&e.length>0;class a{static async fetchParallel(e,t,{length:r,exclude:i=[],timeout:s,concurrency:o,onProgressCallback:c}){return(await n(t,(async t=>a.fetchAll(e,t,{length:r,exclude:i,timeout:s,onProgressCallback:c,concurrency:o})),{concurrency:Math.max(o||t.length,1)})).reduce(((e,t)=>e.concat(t)),[])}static async fetchAll(e,t,{length:r=-1,exclude:a=[],timeout:c,onProgressCallback:u,onStartProgressCallback:l,concurrency:h=32,delay:f=0}={}){const p=[],d={},y={},b=Array.isArray(t)?{0:t.slice()}:{0:[t]};let g=0,k=0,m=0;const v=(e,t)=>{y[e]||(b[t]||(b[t]=[]),b[t].includes(e)||b[t].push(e),y[e]=!0)},w=async t=>{if(t&&!d[t])return new Promise(((n,i)=>{const o=c&&c>0?setTimeout((()=>{console.warn(`Warning: Couldn't fetch entry '${t}', request timed out (${c}ms)`),n()}),c):null;l&&l(t,null,0,p.length),s.fromMultihash(e,t).then((async e=>{try{if((e=>{if(s.isEntry(e)){const n=e.clock.time;k=Math.max(k,n),m=p.length>0?Math.min(p[p.length-1].clock.time,m):k;const i=p.length>=r&&n>=m,s=e=>k-n+(e+1)*e;(r<0||p.length<r||i)&&(p.push(e),d[t]=!0,u&&u(t,e,p.length,p.length)),r<0?(e.next.forEach(v),e.refs&&e.refs.forEach(v)):((p.length<r||n>m||n===m&&!d[e.hash])&&e.next.forEach((e=>v(e,s(0)))),e.refs&&p.length+e.refs.length<=r&&e.refs.forEach(((e,t)=>v(e,s(t)))))}})(e),f>0){const e=(e=0)=>new Promise((t=>setTimeout(t,e)));await e(f)}n()}catch(e){i(e)}finally{clearTimeout(o)}})).catch(i)}))};return a.forEach((e=>{d[e.hash]=!0})),await i((async()=>{if(g<h){const e=((e=1)=>Object.keys(b).reduce(((t,r,n)=>{const i=b[r];for(;i.length>0&&t.length<e;){const e=i.shift();t.push(e)}return 0===i.length&&delete b[r],t}),[]))(h);g+=e.length,await n(e,w),g-=e.length}}),(()=>void 0!==Object.values(b).find(o))),p}}e.exports=a},7117:(e,t,r)=>{"use strict";const n=r(2333),{isDefined:i,io:s}=r(4053),o=r(8299),a=()=>new Error("Ipfs instance not defined"),c=["next","refs"],u=e=>0===e?"dag-pb":"dag-cbor",l=e=>h.isEntry(e)?u(e.v):u(e);class h{static async create(e,t,r,s,o=[],c,u=[],l){if(!i(e))throw a();if(!i(t))throw new Error("Identity is required, cannot create entry");if(!i(r))throw new Error("Entry requires an id");if(!i(s))throw new Error("Entry requires data");if(!i(o)||!Array.isArray(o))throw new Error("'next' argument is not an array");const f={hash:null,id:r,payload:s,next:o.filter(i).map((e=>e.hash?e.hash:e)),refs:u,v:2,clock:c||new n(t.publicKey)},p=await t.provider.sign(t,h.toBuffer(f));return f.key=t.publicKey,f.identity=t.toJSON(),f.sig=p,f.hash=await h.toMultihash(e,f,l),f}static async verify(e,t){if(!e)throw new Error("Identity-provider is required, cannot verify entry");if(!h.isEntry(t))throw new Error("Invalid Log entry");if(!t.key)throw new Error("Entry doesn't have a key");if(!t.sig)throw new Error("Entry doesn't have a signature");const r=h.toEntry(t,{presigned:!0}),n=t.v<1?"v0":"v1";return e.verify(t.sig,t.key,h.toBuffer(r),n)}static toBuffer(e){const t=0===e.v?JSON.stringify(e):o(e);return Buffer.from(t)}static async toMultihash(e,t,r=!1){if(!e)throw a();if(!h.isEntry(t))throw new Error("Invalid object format, cannot generate entry hash");const n=h.toEntry(t);return s.write(e,l(n.v),n,{links:c,pin:r})}static toEntry(e,{presigned:t=!1,includeHash:r=!1}={}){const i={hash:r?e.hash:null,id:e.id,payload:e.payload,next:e.next},s=e.v;return s>1&&(i.refs=e.refs),i.v=e.v,i.clock=new n(e.clock.id,e.clock.time),t||(i.key=e.key,s>0&&(i.identity=e.identity),i.sig=e.sig),i}static async fromMultihash(e,t){if(!e)throw a();if(!t)throw new Error(`Invalid hash: ${t}`);const r=await s.read(e,t,{links:c}),n=h.toEntry(r);return n.hash=t,n}static isEntry(e){return e&&void 0!==e.id&&void 0!==e.next&&void 0!==e.payload&&void 0!==e.v&&void 0!==e.hash&&void 0!==e.clock&&(void 0!==e.refs||e.v<2)}static compare(e,t){const r=n.compare(e.clock,t.clock);return 0===r?e.clock.id<t.clock.id?-1:1:r}static isEqual(e,t){return e.hash===t.hash}static isParent(e,t){return t.next.indexOf(e.hash)>-1}static findChildren(e,t){let r=[],n=t.find((t=>h.isParent(e,t))),i=e;for(;n;)r.push(n),i=n,n=t.find((e=>h.isParent(i,e)));return r=r.sort(((e,t)=>e.clock.time>t.clock.time)),r}}e.exports=h,e.exports.IPLD_LINKS=c,e.exports.getWriteFormat=l},4144:e=>{"use strict";e.exports=class{constructor(e){}append(e){}merge(e){}get(e){}has(e){}get values(){}get length(){}}},2333:e=>{"use strict";class t{constructor(e,t){this.id=e,this.time=t||0}tick(){return new t(this.id,++this.time)}merge(e){return this.time=Math.max(this.time,e.time),new t(this.id,this.time)}clone(){return new t(this.id,this.time)}static compare(e,t){const r=e.time-t.time;return 0===r&&e.id!==t.id?e.id<t.id?-1:1:r}}e.exports=t},5746:e=>{"use strict";e.exports={IPFSNotDefinedError:()=>new Error("IPFS instance not defined"),LogNotDefinedError:()=>new Error("Log instance not defined"),NotALogError:()=>new Error("Given argument is not an instance of Log"),CannotJoinWithDifferentId:()=>new Error("Can't join logs with different IDs"),LtOrLteMustBeStringOrArray:()=>new Error("lt or lte must be a string or array of Entries")}},1417:(e,t,r)=>{"use strict";const n=r(7117),i=r(7349),s=r(6218),{LastWriteWins:o,NoZeroes:a}=s,c=r(5746),{isDefined:u,findUniques:l,difference:h,io:f}=r(4053),p=["heads"],d=(e,t)=>e.slice(e.length-Math.min(e.length,t),e.length);e.exports=class{static async toMultihash(e,t,{format:r}={}){if(!u(e))throw c.IPFSNotDefinedError();if(!u(t))throw c.LogNotDefinedError();if(u(r)||(r="dag-cbor"),t.values.length<1)throw new Error("Can't serialize an empty log");return f.write(e,r,t.toJSON(),{links:p})}static async fromMultihash(e,t,{length:r=-1,exclude:n=[],timeout:s,concurrency:l,sortFn:h,onProgressCallback:y}){if(!u(e))throw c.IPFSNotDefinedError();if(!u(t))throw new Error(`Invalid hash: ${t}`);const b=await f.read(e,t,{links:p});if(!b.heads||!b.id)throw c.NotALogError();h=h||a(o);const g=await i.fetchAll(e,b.heads,{length:r,exclude:n,timeout:s,concurrency:l,onProgressCallback:y}),k=b.id,m=r>-1?d(g.sort(h),r):g,v=m.filter((e=>b.heads.includes(e.hash)));return{logId:k,entries:m,heads:v}}static async fromEntryHash(e,t,{length:r=-1,exclude:n=[],timeout:s,concurrency:l,sortFn:h,onProgressCallback:f}){if(!u(e))throw c.IpfsNotDefinedError();if(!u(t))throw new Error("'hash' must be defined");const p=Array.isArray(t)?t:[t];r=r>-1?Math.max(r,1):r;const y=await i.fetchParallel(e,p,{length:r,exclude:n,timeout:s,concurrency:l,onProgressCallback:f});return h=h||a(o),{entries:r>-1?d(y.sort(h),r):y}}static async fromJSON(e,t,{length:r=-1,timeout:s,concurrency:o,onProgressCallback:a}){if(!u(e))throw c.IPFSNotDefinedError();const{id:l,heads:h}=t,f=h.map((e=>e.hash));return{logId:l,entries:(await i.fetchParallel(e,f,{length:r,timeout:s,concurrency:o,onProgressCallback:a})).sort(n.compare),heads:h}}static async fromEntry(e,t,{length:r=-1,exclude:s=[],timeout:o,concurrency:a,onProgressCallback:f}){if(!u(e))throw c.IPFSNotDefinedError();if(!u(t))throw new Error("'sourceEntries' must be defined");if(!Array.isArray(t)&&!n.isEntry(t))throw new Error("'sourceEntries' argument must be an array of Entry instances or a single Entry");Array.isArray(t)||(t=[t]),r=r>-1?Math.max(r,t.length):r;const p=t.map((e=>e.hash)),d=await i.fetchParallel(e,p,{length:r,exclude:s,timeout:o,concurrency:a,onProgressCallback:f}),y=t.concat(d).concat(s),b=l(y,"hash").sort(n.compare),g=b.slice(r>-1?-r:-b.length),k=((e,t)=>{const r=e.slice(t.length,e.length);return t.concat(r)})(g,h(g,t,"hash"));return{logId:k[k.length-1].id,entries:k}}}},6218:(e,t,r)=>{"use strict";const n=r(2333);function i(e,t,r){const i=n.compare(e.clock,t.clock);return 0===i?r(e,t):i}function s(e,t,r){return e.clock.id===t.clock.id?r(e,t):e.clock.id<t.clock.id?-1:1}t.SortByClocks=i,t.SortByClockId=s,t.LastWriteWins=function(e,t){const r=(e,t)=>e,n=(e,t)=>s(e,t,r);return((e,t)=>i(e,t,n))(e,t)},t.SortByEntryHash=function(e,t){const r=(e,t)=>e.hash<t.hash?-1:1,n=(e,t)=>s(e,t,r);return((e,t)=>i(e,t,n))(e,t)},t.NoZeroes=function(e){const t=`Your log's tiebreaker function, ${e.name}, has returned zero and therefore cannot be`;return(r,n)=>{const i=e(r,n);if(0===i)throw Error(t);return i}}},4867:(e,t,r)=>{"use strict";const n=r(6301),i=r(4144),s=r(7117),o=r(1417),a=r(5746),c=r(2333),u=r(6218),{LastWriteWins:l,NoZeroes:h}=u,f=r(2154),{isDefined:p,findUniques:d}=r(4053),y=r(8925),b=e=>e.hash,g=(e,t)=>e.concat(t),k=e=>e.next,m=(e,t)=>Math.max(e,t.clock.time),v=(e,t)=>(e[t.hash]=t,e);class w extends i{constructor(e,t,{logId:r,access:n,entries:i,heads:s,clock:o,sortFn:u,concurrency:d}={}){if(!p(e))throw a.IPFSNotDefinedError();if(!p(t))throw new Error("Identity is required");if(p(n)||(n=new f),p(i)&&!Array.isArray(i))throw new Error("'entries' argument must be an array of Entry instances");if(p(s)&&!Array.isArray(s))throw new Error("'h