UNPKG

280 kBJavaScriptView Raw
1/*! For license information please see index.min.js.LICENSE.txt */
2!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IpfsRepo=t():e.IpfsRepo=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=70)}([function(e,t,r){"use strict";(function(e){var n=r(78),i=r(79),o=r(80);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,r),i=(e=a(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|p(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=a(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|p(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function y(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){f=!1;break}if(f)return o}return-1}function k(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function w(e,t,r,n){return K(U(t,e.length-r),e,r,n)}function m(e,t,r,n){return K(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return m(e,t,r,n)}function S(e,t,r,n){return K(q(t),e,r,n)}function E(e,t,r,n){return K(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):y.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r),f=0;f<a;++f)if(c[f]!==l[f]){o=c[f],s=l[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return m(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function C(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=F(e[o]);return i}function I(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function P(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function B(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return o||B(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,o){return o||B(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||T(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||T(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||T(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||T(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||T(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||T(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||T(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||j(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||j(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);j(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);j(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=u.isBuffer(e)?e:U(new u(e,n).toString()),a=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var M=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(4))},function(e,t,r){"use strict";var n,i,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c,l=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?l=c.concat(l):h=-1,l.length&&d())}function d(){if(!f){var e=u(p);f=!0;for(var t=l.length;t;){for(c=l,l=[];++h<t;)c&&c[h].run();h=-1,t=l.length}c=null,f=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function b(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new y(e,t)),1!==l.length||f||u(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";const n=r(39),i=r(97),o=r(42),s=r(43),a=r(41);t.Key=n,t.MemoryDatastore=i,t.utils=o,t.Errors=s,t.Adapter=a},function(e,t,r){"use strict";"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,r){"use strict";(function(n){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(r){}!e&&void 0!==n&&"env"in n&&(e={NODE_ENV:"production"}.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.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"],e.exports=r(72)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(1))},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,s,a;if("string"==typeof t&&(i="not ",t.substr(!s||s<0?0:+s,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(54),o=r(58);r(3)(c,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||t.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,r(1))},function(e,t,r){"use strict";e.exports=function(e,t,r){var n;if(!(e instanceof Error))throw new TypeError("Please pass an Error to err-code");if("object"==typeof t?r=t:null!=t&&(e.code=t),r)for(n in r)e[n]=r[n];return e}},function(e,t,r){"use strict";e.exports=function(e,{className:t,symbolName:r}){const n=Symbol.for(r),i={[t]:class extends e{constructor(...e){super(...e),Object.defineProperty(this,n,{value:!0})}get[Symbol.toStringTag](){return t}}}[t];return i["is".concat(t)]=e=>!(!e||!e[n]),i},e.exports.proto=function(e,{className:t,symbolName:r,withoutNew:n}){const i=Symbol.for(r),o={[t]:function(...t){if(n&&!(this instanceof o))return new o(...t);const r=e.call(this,...t)||this;return r&&!r[i]&&Object.defineProperty(r,i,{value:!0}),r}}[t];return o.prototype=Object.create(e.prototype),o.prototype.constructor=o,Object.defineProperty(o.prototype,Symbol.toStringTag,{get:()=>t}),o["is".concat(t)]=e=>!(!e||!e[i]),o}},function(e){e.exports=JSON.parse('{"identity":0,"ip4":4,"tcp":6,"sha1":17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"dccp":33,"murmur3-128":34,"murmur3-32":35,"ip6":41,"ip6zone":42,"path":47,"multicodec":48,"multihash":49,"multiaddr":50,"multibase":51,"dns":53,"dns4":54,"dns6":55,"dnsaddr":56,"protobuf":80,"cbor":81,"raw":85,"dbl-sha2-256":86,"rlp":96,"bencode":99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,"sctp":132,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"bitcoin-block":176,"bitcoin-tx":177,"zcash-block":192,"zcash-tx":193,"stellar-block":208,"stellar-tx":209,"md4":212,"md5":213,"bmt":214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,"zeronet":230,"ed25519-pub":237,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,"udp":273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,"udt":301,"utp":302,"unix":400,"p2p":421,"ipfs":421,"https":443,"onion":444,"onion3":445,"garlic64":446,"garlic32":447,"tls":448,"quic":460,"ws":477,"wss":478,"p2p-websocket-star":479,"http":480,"json":512,"messagepack":513,"x11":4352,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46000,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332}')},function(e,t,r){"use strict";const{Adapter:n,utils:i}=r(2),o=i.map;e.exports=class extends n{constructor(e,t){super(),this.child=e,this.transform=t}open(){return this.child.open()}put(e,t,r){return this.child.put(this.transform.convert(e),t,r)}get(e,t){return this.child.get(this.transform.convert(e),t)}has(e,t){return this.child.has(this.transform.convert(e),t)}delete(e,t){return this.child.delete(this.transform.convert(e),t)}batch(){const e=this.child.batch();return{put:(t,r)=>{e.put(this.transform.convert(t),r)},delete:t=>{e.delete(this.transform.convert(t))},commit:t=>e.commit(t)}}query(e,t){return o(this.child.query(e,t),e=>(e.key=this.transform.invert(e.key),e))}close(){return this.child.close()}}},function(e,t,r){"use strict";(function(t){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{Key:s,Errors:a,Adapter:u,utils:{filter:c,map:l,take:f,sortAll:h}}=r(2);e.exports=class extends u{constructor(e,t){let n;super(),t&&t.db?(n=t.db,delete t.db):n=r(138),this.db=this._initDb(n,e,t)}_initDb(e,t,r){return e(t,i(i({},r),{},{valueEncoding:"binary",compression:!1}))}async open(){try{await this.db.open()}catch(e){throw a.dbOpenFailedError(e)}}async put(e,t){try{await this.db.put(e.toString(),t)}catch(r){throw a.dbWriteFailedError(r)}}async get(e){let t;try{t=await this.db.get(e.toString())}catch(r){if(r.notFound)throw a.notFoundError(r);throw a.dbWriteFailedError(r)}return t}async has(e){try{await this.db.get(e.toString())}catch(t){if(t.notFound)return!1;throw t}return!0}async delete(e){try{await this.db.del(e.toString())}catch(t){throw a.dbDeleteFailedError(t)}}close(){return this.db.close()}batch(){const e=[];return{put:(t,r)=>{e.push({type:"put",key:t.toString(),value:r})},delete:t=>{e.push({type:"del",key:t.toString()})},commit:()=>this.db.batch(e)}}query(e){let r=!0;null!=e.keysOnly&&(r=!e.keysOnly);const n={keys:!0,values:r,keyAsBuffer:!0};if(null!=e.prefix){const t=e.prefix.toString();n.gte=t,n.lt=t+"ÿ"}let i=(o=this.db.iterator(n),{next:()=>new Promise((e,t)=>{o.next((r,n,i)=>r?t(r):null==n?o.end(r=>{if(r)return t(r);e({done:!0})}):void e({done:!1,value:{key:n,value:i}}))}),return:()=>new Promise((e,t)=>{o.end(r=>{if(r)return t(r);e({done:!0})})}),[Symbol.asyncIterator](){return this}});var o;if(i=l(i,({key:e,value:n})=>{const i={key:new s(e,!1)};return r&&(i.value=t.from(n)),i}),Array.isArray(e.filters)&&(i=e.filters.reduce((e,t)=>c(e,t),i)),Array.isArray(e.orders)&&(i=e.orders.reduce((e,t)=>h(e,t),i)),null!=e.offset){let t=0;i=c(i,()=>t++>=e.offset)}return null!=e.limit&&(i=f(i,e.limit)),i}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},function(e,t,r){"use strict";t.getCallback=function(e,t){return"function"==typeof e?e:t},t.getOptions=function(e){return"object"==typeof e&&null!==e?e:{}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.random=t.urlAlphabet=t.customRandom=t.customAlphabet=t.nanoid=void 0;t.urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";let n=e=>crypto.getRandomValues(new Uint8Array(e));t.random=n;let i=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return()=>{let o="";for(;;){let s=r(i),a=i;for(;a--;)if(o+=e[s[a]&n]||"",o.length===+t)return o}}};t.customRandom=i;t.customAlphabet=(e,t)=>i(e,t,n);t.nanoid=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t}},function(e,t,r){"use strict";class n extends Error{constructor(e){super(e),this.name="LockExistsError",this.code=n.code}}n.code="ERR_LOCK_EXISTS",t.LockExistsError=n;class i extends Error{constructor(e){super(e),this.name="NotFoundError",this.code=i.code}}i.code="ERR_NOT_FOUND",t.NotFoundError=i;class o extends Error{constructor(e){super(e),this.name="InvalidRepoVersionError",this.code=o.code}}o.code="ERR_INVALID_REPO_VERSION",t.InvalidRepoVersionError=o,t.ERR_REPO_NOT_INITIALIZED="ERR_REPO_NOT_INITIALIZED",t.ERR_REPO_ALREADY_OPEN="ERR_REPO_ALREADY_OPEN",t.ERR_REPO_ALREADY_CLOSED="ERR_REPO_ALREADY_CLOSED"},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(119);function o(e,t){if(!t)throw new Error("requires an encoded buffer");const r=s(e),i=n.from(r.code);return function(e,t){s(e).decode(t.toString())}(r.name,t),n.concat([i,t])}function s(e){let t;if(i.names[e])t=i.names[e];else{if(!i.codes[e])throw new Error("Unsupported encoding");t=i.codes[e]}if(!t.isImplemented())throw new Error("Base "+e+" is not implemented yet");return t}(t=e.exports=o).encode=function(e,t){const r=s(e);return o(r.name,n.from(r.encode(t)))},t.decode=function(e){n.isBuffer(e)&&(e=e.toString());const t=e.substring(0,1);"string"==typeof(e=e.substring(1,e.length))&&(e=n.from(e));const r=s(t);return n.from(r.decode(e.toString()))},t.isEncoded=function(e){n.isBuffer(e)&&(e=e.toString());if("[object String]"!==Object.prototype.toString.call(e))return!1;const t=e.substring(0,1);try{return s(t).name}catch(r){return!1}},t.names=Object.freeze(Object.keys(i.names)),t.codes=Object.freeze(Object.keys(i.codes))},function(e,t,r){"use strict";e.exports={encode:r(125),decode:r(126),encodingLength:r(127)}},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,s,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return e}function h(){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 p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(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):b(i,i.length)}function y(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 b(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),a.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},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(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},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,l=b(u,c);for(r=0;r<c;++r)o(l[r],this,t)}return!0},a.prototype.addListener=function(e,t){return f(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return f(this,e,t,!0)},a.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,o,s;if(c(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,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;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,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.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,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[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},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},a.prototype.listenerCount=y,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";var n=r(144),i=r(145);e.exports=function(){var e=n.apply(null,arguments);return i(e,{bufferKeys:e.bufferKeys||!1,snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,openCallback:e.openCallback||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:e.encodings||!1,additionalMethods:n(e.additionalMethods)})}},function(e,t,r){"use strict";e.exports=r(22)},function(e,t,r){"use strict";var n,i,o,s=[r(146),r(147),r(148),r(149),r(150)],a=-1,u=[],c=!1;function l(){n&&i&&(n=!1,i.length?u=i.concat(u):a=-1,u.length&&f())}function f(){if(!n){c=!1,n=!0;for(var e=u.length,t=setTimeout(l);e;){for(i=u,u=[];i&&++a<e;)i[a].run();a=-1,e=u.length}i=null,a=-1,n=!1,clearTimeout(t)}}for(var h=-1,p=s.length;++h<p;)if(s[h]&&s[h].test&&s[h].test()){o=s[h].install(f);break}function d(e,t){this.fun=e,this.array=t}d.prototype.run=function(){var e=this.fun,t=this.array;switch(t.length){case 0:return e();case 1:return e(t[0]);case 2:return e(t[0],t[1]);case 3:return e(t[0],t[1],t[2]);default:return e.apply(null,t)}},e.exports=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),c||n||(c=!0,o())}},function(e,t,r){"use strict";var n=r(6).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){a=!1,c=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,a||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",l),t.on("abort",d),t.req?y():t.on("request",y)),t.on("end",h),t.on("finish",l),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",l),t.removeListener("abort",d),t.removeListener("request",y),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",h),t.removeListener("error",p),t.removeListener("close",d)}}},function(e,t,r){"use strict";var n=r(165).create,i=n("LevelUPError"),o=n("NotFoundError",i);o.prototype.notFound=!0,o.prototype.status=404,e.exports={LevelUPError:i,InitializationError:n("InitializationError",i),OpenError:n("OpenError",i),ReadError:n("ReadError",i),WriteError:n("WriteError",i),NotFoundError:o,EncodingError:n("EncodingError",i)}},function(e,t,r){"use strict";t.AbstractLevelDOWN=r(171),t.AbstractIterator=r(62),t.AbstractChainedBatch=r(63)},function(e,t,r){"use strict";e.exports=r(22)},function(e,t,r){"use strict";e.exports=function(e,t,r){if(!e)return r;var n,i;Array.isArray(t)&&(n=t.slice(0));"string"==typeof t&&(n=t.split("."));"symbol"==typeof t&&(n=[t]);if(!Array.isArray(n))throw new Error("props arg must be an array, a string or a symbol");for(;n.length;){if(i=n.shift(),!e)return r;if(void 0===(e=e[i]))return r}return e}},function(e,t,r){"use strict";class n extends Error{constructor(e){super(e),this.name="NonReversibleMigrationError",this.code="ERR_NON_REVERSIBLE_MIGRATION",this.message=e}}n.code="ERR_NON_REVERSIBLE_MIGRATION",t.NonReversibleMigrationError=n;class i extends Error{constructor(e){super(e),this.name="NotInitializedRepoError",this.code="ERR_NOT_INITIALIZED_REPO",this.message=e}}i.code="ERR_NOT_INITIALIZED_REPO",t.NotInitializedRepoError=i;class o extends Error{constructor(e){super(e),this.name="RequiredParameterError",this.code="ERR_REQUIRED_PARAMETER",this.message=e}}o.code="ERR_REQUIRED_PARAMETER",t.RequiredParameterError=o;class s extends Error{constructor(e){super(e),this.name="InvalidValueError",this.code="ERR_INVALID_VALUE",this.message=e}}s.code="ERR_INVALID_VALUE",t.InvalidValueError=s},function(e,t,r){"use strict";function n(e){return new o(e)}function i(e){var t,r;function n(t,r){try{var s=e[t](r),a=s.value,u=a instanceof o;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(s.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){this.wrapped=e}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)};const{Buffer:s}=r(0),{openDB:a,deleteDB:u}=r(82),{Key:c,Errors:l,utils:f,Adapter:h}=r(84),{filter:p,sortAll:d}=f,y=e=>{if((e=>e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)(e)){let t=s.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return s.from(e)},b=e=>{const t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let n=0,i=e.length;n<i;n++)r[n]=e.charCodeAt(n);return t},g=function(){var e,t=(e=function*(e,t,r){const i=e.prefix?self.IDBKeyRange.bound(b(e.prefix),b(e.prefix+"ÿ"),!1,!0):void 0;let o=yield n(t.transaction(r).store.openCursor(i)),a=0;for(o&&e.offset&&e.offset>0&&(o=yield n(o.advance(e.offset)));o;){if(void 0!==e.limit&&e.limit===a)return;a++;const t=new c(s.from(o.key));if(e.keysOnly)yield{key:t};else{const e=s.from(o.value);yield{key:t,value:e}}o=yield n(o.continue())}},function(){return new i(e.apply(this,arguments))});return function(e,r,n){return t.apply(this,arguments)}}();e.exports=class extends h{constructor(e,t={}){super(),this.store=null,this.options=t,this.location=t.prefix+e,this.version=t.version||1}async open(){if(null!==this.store)return;const e=this.location;try{this.store=await a(this.location,this.version,{upgrade(t){t.createObjectStore(e)}})}catch(t){throw l.dbOpenFailedError(t)}}async put(e,t){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.put(this.location,t,e.toBuffer())}catch(r){throw l.dbWriteFailedError(r)}}async get(e){if(null===this.store)throw new Error("Datastore needs to be opened.");let t;try{t=await this.store.get(this.location,e.toBuffer())}catch(r){throw l.dbWriteFailedError(r)}if(!t)throw l.notFoundError();return y(t)}async has(e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.get(e)}catch(t){if("ERR_NOT_FOUND"===t.code)return!1;throw t}return!0}async delete(e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.delete(this.location,e.toBuffer())}catch(t){throw l.dbDeleteFailedError(t)}}batch(){const e=[],t=[];return{put(t,r){e.push([t.toBuffer(),r])},delete(e){t.push(e.toBuffer())},commit:async()=>{if(null===this.store)throw new Error("Datastore needs to be opened.");const r=this.store.transaction(this.location,"readwrite"),n=r.store;await Promise.all(e.map(e=>n.put(e[1],e[0]))),await Promise.all(t.map(e=>n.delete(e))),await r.done}}}query(e){if(null===this.store)throw new Error("Datastore needs to be opened.");let t=g(e,this.store,this.location);return Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>p(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>d(e,t),t)),t}close(){if(null===this.store)throw new Error("Datastore needs to be opened.");this.store.close(),this.store=null}destroy(){return u(this.location)}}},function(e,t,r){"use strict";const{Buffer:n}=r(0),{nanoid:i}=r(15),o=r(9),s=n.from("/"),a=s[0];class u{constructor(e,t){if("string"==typeof e?this._buf=n.from(e):n.isBuffer(e)&&(this._buf=e),null==t&&(t=!0),t&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error("Invalid key")}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return"Key(".concat(this.toString(),")")}static withNamespaces(e){return new c(e.join("/"))}static random(){return new c(i().replace(/-/g,""))}clean(){for(this._buf&&0!==this._buf.length||(this._buf=n.from("/")),this._buf[0]!==a&&(this._buf=n.concat([s,this._buf]));this._buf.length>1&&this._buf[this._buf.length-1]===a;)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;n<t.length;n++){if(r.length<n+1)return!1;const e=t[n],i=r[n];if(e<i)return!0;if(e>i)return!1}return t.length<r.length}reverse(){return u.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const e=this.namespaces();return e[e.length-1]}list(){return this.toString().split("/").slice(1)}type(){return function(e){const t=e.split(":");if(t.length<2)return"";return t.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(e){const t=e.split(":");return t[t.length-1]}(this.baseNamespace())}instance(e){return new c(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith("/")||(e+="/"),e+=this.type(),new c(e)}parent(){const e=this.list();return 1===e.length?new c("/"):new c(e.slice(0,-1).join("/"))}child(e){return"/"===this.toString()?e:"/"===e.toString()?this:new c(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()!==this.toString()&&e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()!==this.toString()&&this.toString().startsWith(e.toString())}isTopLevel(){return 1===this.list().length}concat(...e){return u.withNamespaces([...this.namespaces(),...(t=e.map(e=>e.namespaces()),[].concat(...t))]);var t}}const c=o(u,{className:"Key",symbolName:"@ipfs/interface-datastore/key"});e.exports=c},function(e,t,r){"use strict";function n(e){return new s(e)}function i(e){return function(){return new o(e.apply(this,arguments))}}function o(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)};const{filter:u,sortAll:c,take:l,map:f}=r(32),h=r(33);e.exports=class{async open(){}async close(){}async put(e,t,r={}){}putMany(e,t={}){var r=this;return i((function*(){var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const{key:e,value:i}=c;yield n(r.put(e,i,t)),yield{key:e,value:i}}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))()}async get(e,t={}){}getMany(e,t={}){var r=this;return i((function*(){var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;yield r.get(e,t)}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))()}async has(e){}async delete(e,t={}){}deleteMany(e,t={}){var r=this;return i((function*(){var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;yield n(r.delete(e,t)),yield e}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))()}batch(){let e=[],t=[];return{put(t,r){e.push({key:t,value:r})},delete(e){t.push(e)},commit:async r=>{await h(this.putMany(e,r)),e=[],await h(this.deleteMany(t,r)),t=[]}}}_all(e,t){return i((function*(){}))()}query(e,t){var r=this;return i((function*(){let i=r._all(e,t);if(null!=e.prefix&&(i=u(i,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(i=e.filters.reduce((e,t)=>u(e,t),i)),Array.isArray(e.orders)&&(i=e.orders.reduce((e,t)=>c(e,t),i)),null!=e.offset){let t=0;i=u(i,()=>t++>=e.offset)}null!=e.limit&&(i=l(i,e.limit)),!0===e.keysOnly&&(i=f(i,e=>({key:e.key}))),yield*function(e,t){var r={},n=!1;function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return"function"==typeof Symbol&&Symbol.iterator&&(r[Symbol.iterator]=function(){return this}),r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}(a(i),n)}))()}}},function(e,t,r){"use strict";function n(e){return new s(e)}function i(e){return function(){return new o(e.apply(this,arguments))}}function o(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)};const u=r(86);t.filter=(e,t)=>i((function*(){var r,i=!0,o=!1;try{for(var s,u,c=a(e);i=(s=yield n(c.next())).done,u=yield n(s.value),!i;i=!0){const e=u;(yield n(t(e)))&&(yield e)}}catch(l){o=!0,r=l}finally{try{i||null==c.return||(yield n(c.return()))}finally{if(o)throw r}}}))(),t.sortAll=(e,t)=>i((function*(){let r=[];var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;r.push(e)}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}r=yield n(t(r));for(const e of r)yield e}))(),t.take=(e,t)=>i((function*(){if(t<=0)return;let r=0;var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;if(yield e,r++,r>=t)return}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))(),t.map=(e,t)=>i((function*(){var r,i=!0,o=!1;try{for(var s,u,c=a(e);i=(s=yield n(c.next())).done,u=yield n(s.value),!i;i=!0){const e=u;yield t(e)}}catch(l){o=!0,r=l}finally{try{i||null==c.return||(yield n(c.return()))}finally{if(o)throw r}}}))(),t.replaceStartWith=function(e,t){const r=new RegExp("^"+t);return e.replace(r,"")},t.tmpdir=u},function(e,t,r){"use strict";e.exports=async e=>{var t,r=!0,n=!1;try{for(var i,o=function(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}(e);r=(i=await o.next()).done,await i.value,!r;r=!0){}}catch(s){n=!0,t=s}finally{try{r||null==o.return||await o.return()}finally{if(n)throw t}}}},function(e,t,r){"use strict";const n=r(87);e.exports.dbOpenFailedError=e=>(e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")),e.exports.dbDeleteFailedError=e=>(e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")),e.exports.dbWriteFailedError=e=>(e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")),e.exports.notFoundError=e=>(e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND")),e.exports.abortedError=e=>(e=e||new Error("Aborted"),n(e,"ERR_ABORTED"))},function(e,t,r){"use strict";const n=r(36),i=r(88),o=r(37),s=r(38);t.Key=n,t.MemoryDatastore=i,t.utils=o,t.Errors=s},function(e,t,r){"use strict";const{Buffer:n}=r(0),{nanoid:i}=r(15),o=r(9),s=n.from("/"),a=s[0];class u{constructor(e,t){if("string"==typeof e?this._buf=n.from(e):n.isBuffer(e)&&(this._buf=e),null==t&&(t=!0),t&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error("Invalid key")}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return"[Key ".concat(this.toString(),"]")}static withNamespaces(e){return new c(e.join("/"))}static random(){return new c(i().replace(/-/g,""))}clean(){for(this._buf&&0!==this._buf.length||(this._buf=n.from("/")),this._buf[0]!==a&&(this._buf=n.concat([s,this._buf]));this._buf.length>1&&this._buf[this._buf.length-1]===a;)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;n<t.length;n++){if(r.length<n+1)return!1;const e=t[n],i=r[n];if(e<i)return!0;if(e>i)return!1}return t.length<r.length}reverse(){return u.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const e=this.namespaces();return e[e.length-1]}list(){return this.toString().split("/").slice(1)}type(){return function(e){const t=e.split(":");if(t.length<2)return"";return t.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(e){const t=e.split(":");return t[t.length-1]}(this.baseNamespace())}instance(e){return new c(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith("/")||(e+="/"),e+=this.type(),new c(e)}parent(){const e=this.list();return 1===e.length?new c("/"):new c(e.slice(0,-1).join("/"))}child(e){return"/"===this.toString()?e:"/"===e.toString()?this:new c(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()!==this.toString()&&e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()!==this.toString()&&this.toString().startsWith(e.toString())}isTopLevel(){return 1===this.list().length}concat(...e){return u.withNamespaces([...this.namespaces(),...(t=e.map(e=>e.namespaces()),[].concat(...t))]);var t}}const c=o(u,{className:"Key",symbolName:"@ipfs/interface-datastore/key"});e.exports=c},function(e,t,r){"use strict";function n(e){return new s(e)}function i(e){return function(){return new o(e.apply(this,arguments))}}function o(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)};const u=r(89);t.filter=(e,t)=>i((function*(){var r,i=!0,o=!1;try{for(var s,u,c=a(e);i=(s=yield n(c.next())).done,u=yield n(s.value),!i;i=!0){const e=u;(yield n(t(e)))&&(yield e)}}catch(l){o=!0,r=l}finally{try{i||null==c.return||(yield n(c.return()))}finally{if(o)throw r}}}))(),t.sortAll=(e,t)=>i((function*(){let r=[];var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;r.push(e)}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}r=yield n(t(r));for(const e of r)yield e}))(),t.take=(e,t)=>i((function*(){if(t<=0)return;let r=0;var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;if(yield e,r++,r>=t)return}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))(),t.map=(e,t)=>i((function*(){var r,i=!0,o=!1;try{for(var s,u,c=a(e);i=(s=yield n(c.next())).done,u=yield n(s.value),!i;i=!0){const e=u;yield t(e)}}catch(l){o=!0,r=l}finally{try{i||null==c.return||(yield n(c.return()))}finally{if(o)throw r}}}))(),t.replaceStartWith=function(e,t){const r=new RegExp("^"+t);return e.replace(r,"")},t.tmpdir=u},function(e,t,r){"use strict";const n=r(8);e.exports.dbOpenFailedError=e=>(e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")),e.exports.dbDeleteFailedError=e=>(e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")),e.exports.dbWriteFailedError=e=>(e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")),e.exports.notFoundError=e=>(e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND"))},function(e,t,r){"use strict";const{Buffer:n}=r(0),{nanoid:i}=r(40),o=r(9),s=n.from("/"),a=s[0];class u{constructor(e,t){if("string"==typeof e?this._buf=n.from(e):n.isBuffer(e)&&(this._buf=e),null==t&&(t=!0),t&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error("Invalid key")}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return"Key(".concat(this.toString(),")")}static withNamespaces(e){return new c(e.join("/"))}static random(){return new c(i().replace(/-/g,""))}clean(){for(this._buf&&0!==this._buf.length||(this._buf=n.from("/")),this._buf[0]!==a&&(this._buf=n.concat([s,this._buf]));this._buf.length>1&&this._buf[this._buf.length-1]===a;)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;n<t.length;n++){if(r.length<n+1)return!1;const e=t[n],i=r[n];if(e<i)return!0;if(e>i)return!1}return t.length<r.length}reverse(){return u.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const e=this.namespaces();return e[e.length-1]}list(){return this.toString().split("/").slice(1)}type(){return function(e){const t=e.split(":");if(t.length<2)return"";return t.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(e){const t=e.split(":");return t[t.length-1]}(this.baseNamespace())}instance(e){return new c(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith("/")||(e+="/"),e+=this.type(),new c(e)}parent(){const e=this.list();return 1===e.length?new c("/"):new c(e.slice(0,-1).join("/"))}child(e){return"/"===this.toString()?e:"/"===e.toString()?this:new c(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()!==this.toString()&&e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()!==this.toString()&&this.toString().startsWith(e.toString())}isTopLevel(){return 1===this.list().length}concat(...e){return u.withNamespaces([...this.namespaces(),...(t=e.map(e=>e.namespaces()),[].concat(...t))]);var t}}const c=o(u,{className:"Key",symbolName:"@ipfs/interface-datastore/key"});e.exports=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.random=t.urlAlphabet=t.customRandom=t.customAlphabet=t.nanoid=void 0;t.urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";let n=e=>crypto.getRandomValues(new Uint8Array(e));t.random=n;let i=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return()=>{let o="";for(;;){let s=r(i),a=i;for(;a--;)if(o+=e[s[a]&n]||"",o.length===+t)return o}}};t.customRandom=i;t.customAlphabet=(e,t)=>i(e,t,n);t.nanoid=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t}},function(e,t,r){"use strict";function n(e){return new s(e)}function i(e){return function(){return new o(e.apply(this,arguments))}}function o(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)};const{filter:u,sortAll:c,take:l,map:f}=r(42),h=r(33);e.exports=class{async open(){}async close(){}async put(e,t,r={}){}putMany(e,t={}){var r=this;return i((function*(){var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const{key:e,value:i}=c;yield n(r.put(e,i,t)),yield{key:e,value:i}}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))()}async get(e,t={}){}getMany(e,t={}){var r=this;return i((function*(){var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;yield r.get(e,t)}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))()}async has(e){}async delete(e,t={}){}deleteMany(e,t={}){var r=this;return i((function*(){var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;yield n(r.delete(e,t)),yield e}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))()}batch(){let e=[],t=[];return{put(t,r){e.push({key:t,value:r})},delete(e){t.push(e)},commit:async r=>{await h(this.putMany(e,r)),e=[],await h(this.deleteMany(t,r)),t=[]}}}_all(e,t){return i((function*(){}))()}query(e,t){var r=this;return i((function*(){let i=r._all(e,t);if(null!=e.prefix&&(i=u(i,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(i=e.filters.reduce((e,t)=>u(e,t),i)),Array.isArray(e.orders)&&(i=e.orders.reduce((e,t)=>c(e,t),i)),null!=e.offset){let t=0;i=u(i,()=>t++>=e.offset)}null!=e.limit&&(i=l(i,e.limit)),!0===e.keysOnly&&(i=f(i,e=>({key:e.key}))),yield*function(e,t){var r={},n=!1;function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return"function"==typeof Symbol&&Symbol.iterator&&(r[Symbol.iterator]=function(){return this}),r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}(a(i),n)}))()}}},function(e,t,r){"use strict";function n(e){return new s(e)}function i(e){return function(){return new o(e.apply(this,arguments))}}function o(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)};const u=r(98);t.filter=(e,t)=>i((function*(){var r,i=!0,o=!1;try{for(var s,u,c=a(e);i=(s=yield n(c.next())).done,u=yield n(s.value),!i;i=!0){const e=u;(yield n(t(e)))&&(yield e)}}catch(l){o=!0,r=l}finally{try{i||null==c.return||(yield n(c.return()))}finally{if(o)throw r}}}))(),t.sortAll=(e,t)=>i((function*(){let r=[];var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;r.push(e)}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}r=yield n(t(r));for(const e of r)yield e}))(),t.take=(e,t)=>i((function*(){if(t<=0)return;let r=0;var i,o=!0,s=!1;try{for(var u,c,l=a(e);o=(u=yield n(l.next())).done,c=yield n(u.value),!o;o=!0){const e=c;if(yield e,r++,r>=t)return}}catch(f){s=!0,i=f}finally{try{o||null==l.return||(yield n(l.return()))}finally{if(s)throw i}}}))(),t.map=(e,t)=>i((function*(){var r,i=!0,o=!1;try{for(var s,u,c=a(e);i=(s=yield n(c.next())).done,u=yield n(s.value),!i;i=!0){const e=u;yield t(e)}}catch(l){o=!0,r=l}finally{try{i||null==c.return||(yield n(c.return()))}finally{if(o)throw r}}}))(),t.replaceStartWith=function(e,t){const r=new RegExp("^"+t);return e.replace(r,"")},t.tmpdir=u},function(e,t,r){"use strict";const n=r(8);e.exports.dbOpenFailedError=e=>(e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")),e.exports.dbDeleteFailedError=e=>(e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")),e.exports.dbWriteFailedError=e=>(e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")),e.exports.notFoundError=e=>(e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND")),e.exports.abortedError=e=>(e=e||new Error("Aborted"),n(e,"ERR_ABORTED"))},function(e,t,r){"use strict";const n=r(2).Key,i=r(114),o=t.PREFIX="/repo/flatfs/shard/",s=t.SHARDING_FN="SHARDING";t.README_FN="_README";class a{constructor(e){this.param=e}fun(e){throw new Error("implement me")}toString(){return"".concat(o,"v1/").concat(this.name,"/").concat(this.param)}}class u extends a{constructor(e){super(e),this._padding="".padStart(e,"_"),this.name="prefix"}fun(e){return(e+this._padding).slice(0,this.param)}}class c extends a{constructor(e){super(e),this._padding="".padStart(e,"_"),this.name="suffix"}fun(e){const t=this._padding+e;return t.slice(t.length-this.param)}}class l extends a{constructor(e){super(e),this._padding="".padStart(e+1,"_"),this.name="next-to-last"}fun(e){const t=this._padding+e,r=t.length-this.param-1;return t.slice(r,r+this.param)}}function f(e){if(0===(e=e.trim()).length)throw new Error("empty shard string");if(!e.startsWith(o))throw new Error("invalid or no path prefix: ".concat(e));const t=e.slice(o.length).split("/"),r=t[0];if("v1"!==r)throw new Error("expect 'v1' version, got '".concat(r,"'"));const n=t[1];if(!t[2])throw new Error("missing param");const i=parseInt(t[2],10);switch(n){case"prefix":return new u(i);case"suffix":return new c(i);case"next-to-last":return new l(i);default:throw new Error("unkown sharding function: ".concat(n))}}t.readShardFun=async(e,t)=>{const r=new n(e).child(new n(s)),i="function"==typeof t.getRaw?t.getRaw.bind(t):t.get.bind(t);return f((await i(r)||"").toString().trim())},t.readme=i,t.parseShardFun=f,t.Prefix=u,t.Suffix=c,t.NextToLast=l},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(46),o=r(17),s=r(129),a=r(10),u=r(134),c=r(9);class l{constructor(e,t,r,a){if(f.isCID(e)){const t=e;return this.version=t.version,this.codec=t.codec,this.multihash=n.from(t.multihash),void(this.multibaseName=t.multibaseName||(0===t.version?"base58btc":"base32"))}if("string"==typeof e){const t=o.isEncoded(e);if(t){const r=o.decode(e);this.version=parseInt(r.slice(0,1).toString("hex"),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=i.fromB58String(e),this.multibaseName="base58btc";return l.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(n.isBuffer(e)){const t=e.slice(0,1),r=parseInt(t.toString("hex"),16);if(1===r){const t=e;this.version=r,this.codec=s.getCodec(t.slice(1)),this.multihash=s.rmPrefix(t.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";l.validateCID(this)}else this.version=e,this.codec=t,this.multihash=r,this.multibaseName=a||(0===e?"base58btc":"base32"),l.validateCID(this)}get buffer(){let e=this._buffer;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");e=n.concat([n.from("01","hex"),s.getCodeVarint(this.codec),this.multihash])}Object.defineProperty(this,"_buffer",{value:e})}return e}get prefix(){return n.concat([n.from("0".concat(this.version),"hex"),s.getCodeVarint(this.codec),i.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:t}=i.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 f(0,this.codec,this.multihash)}toV1(){return new f(1,this.codec,this.multihash)}toBaseEncodedString(e=this.multibaseName){if(this.string&&e===this.multibaseName)return this.string;let t=null;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=i.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");t=o.encode(e,this.buffer).toString()}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&&this.multihash.equals(e.multihash)}static validateCID(e){const t=u.checkCIDComponents(e);if(t)throw new Error(t)}}const f=c(l,{className:"CID",symbolName:"@ipld/js-cid/CID"});f.codecs=a,e.exports=f},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(17),o=r(18),s=r(128);function a(e){t.decode(e)}t.names=s.names,t.codes=s.codes,t.defaultLengths=s.defaultLengths,t.toHexString=function(e){if(!n.isBuffer(e))throw new Error("must be passed a buffer");return e.toString("hex")},t.fromHexString=function(e){return n.from(e,"hex")},t.toB58String=function(e){if(!n.isBuffer(e))throw new Error("must be passed a buffer");return i.encode("base58btc",e).toString().slice(1)},t.fromB58String=function(e){let t=e;return n.isBuffer(e)&&(t=e.toString()),i.decode("z"+t)},t.decode=function(e){if(!n.isBuffer(e))throw new Error("multihash must be a Buffer");if(e.length<3)throw new Error("multihash too short. must be > 3 bytes.");const r=o.decode(e);if(!t.isValidCode(r))throw new Error("multihash unknown function code: 0x".concat(r.toString(16)));e=e.slice(o.decode.bytes);const i=o.decode(e);if(i<1)throw new Error("multihash invalid length: 0x".concat(i.toString(16)));if((e=e.slice(o.decode.bytes)).length!==i)throw new Error("multihash length inconsistent: 0x".concat(e.toString("hex")));return{code:r,name:s.codes[r],length:i,digest:e}},t.encode=function(e,r,i){if(!e||void 0===r)throw new Error("multihash encode requires at least two args: digest, code");const s=t.coerceCode(r);if(!n.isBuffer(e))throw new Error("digest should be a Buffer");if(null==i&&(i=e.length),i&&e.length!==i)throw new Error("digest length should be equal to specified length.");return n.concat([n.from(o.encode(s)),n.from(o.encode(i)),e])},t.coerceCode=function(e){let r=e;if("string"==typeof e){if(void 0===s.names[e])throw new Error("Unrecognized hash function named: ".concat(e));r=s.names[e]}if("number"!=typeof r)throw new Error("Hash function code should be a number. Got: ".concat(r));if(void 0===s.codes[r]&&!t.isAppCode(r))throw new Error("Unrecognized function code: ".concat(r));return r},t.isAppCode=function(e){return e>0&&e<16},t.isValidCode=function(e){return!!t.isAppCode(e)||!!s.codes[e]},t.validate=a,t.prefix=function(e){return a(e),e.slice(0,2)}},function(e,t,r){"use strict";var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";const n=r(18),{Buffer:i}=r(0);function o(e){return parseInt(e.toString("hex"),16)}function s(e){let t=e.toString(16);return t.length%2==1&&(t="0"+t),i.from(t,"hex")}e.exports={numberToBuffer:s,bufferToNumber:o,varintBufferEncode:function(e){return i.from(n.encode(o(e)))},varintBufferDecode:function(e){return s(n.decode(e))},varintEncode:function(e){return i.from(n.encode(e))}}},function(e,t,r){"use strict";const{Key:n}=r(2),i=r(45),o=r(17),s=r(8);t.cidToKey=e=>{if(!i.isCID(e))throw s(new Error("Not a valid cid"),"ERR_INVALID_CID");return new n("/"+o.encode("base32",e.buffer).toString().slice(1).toUpperCase(),!1)},t.keyToCid=e=>new i(o.decode("b"+e.toString().slice(1).toLowerCase()))},function(e,t,r){"use strict";(function(e){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),u=n[r];r<o;u=n[++r])y(u)||!w(u)?s+=" "+u:s+=" "+a(u);return s},t.deprecate=function(r,n){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var o,s={};function a(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,e,n.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function c(e,t){return e}function l(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=l(e,i,n)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(b(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),_(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(r);if(0===s.length){if(S(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(k(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(m(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var c,w="",E=!1,x=["{","}"];(p(r)&&(E=!0,x=["[","]"]),S(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return k(r)&&(w=" "+RegExp.prototype.toString.call(r)),m(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==s.length||E&&0!=r.length?n<0?k(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=E?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)R(t,String(s))?o.push(h(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(h(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return h(e,r,n,a,t,E)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,w,x)):x[0]+w+x[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),R(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=y(r)?l(e,u.value,null):l(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function y(e){return null===e}function b(e){return"number"==typeof e}function g(e){return"string"==typeof e}function v(e){return void 0===e}function k(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function m(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(v(o)&&(o={NODE_ENV:"production"}.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;s[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else s[r]=function(){};return s[r]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=k,t.isObject=w,t.isDate=m,t.isError=_,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(141);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(){var e=new Date,t=[x(e.getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":");return[e.getDate(),O[e.getMonth()],t].join(" ")}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",A(),t.format.apply(t,arguments))},t.inherits=r(3),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(C&&e[C]){var t;if("function"!=typeof(t=e[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(s){r(s)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),C&&Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},t.promisify.custom=C,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};t.apply(this,r).then((function(t){e.nextTick(s,null,t)}),(function(t){e.nextTick(I,t,s)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,n(t)),r}}).call(this,r(1))},function(e,t,r){"use strict";t.AbstractLevelDOWN=r(143),t.AbstractIterator=r(52),t.AbstractChainedBatch=r(53)},function(e,t,r){"use strict";var n=r(21);function i(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._ended=!1,this._nexting=!1}i.prototype.next=function(e){var t=this;if("function"!=typeof e)throw new Error("next() requires a callback argument");return t._ended?(n(e,new Error("cannot call next() after end()")),t):t._nexting?(n(e,new Error("cannot call next() before previous next() has completed")),t):(t._nexting=!0,t._next((function(){t._nexting=!1,e.apply(null,arguments)})),t)},i.prototype._next=function(e){n(e)},i.prototype.seek=function(e){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");e=this.db._serializeKey(e),this._seek(e)},i.prototype._seek=function(e){},i.prototype.end=function(e){if("function"!=typeof e)throw new Error("end() requires a callback argument");if(this._ended)return n(e,new Error("end() already called on iterator"));this._ended=!0,this._end(e)},i.prototype._end=function(e){n(e)},i.prototype._nextTick=n,e.exports=i},function(e,t,r){"use strict";var n=r(21);function i(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(e,t){this._checkWritten();var r=this.db._checkKey(e)||this.db._checkValue(t);if(r)throw r;return e=this.db._serializeKey(e),t=this.db._serializeValue(t),this._put(e,t),this},i.prototype._put=function(e,t){this._operations.push({type:"put",key:e,value:t})},i.prototype.del=function(e){this._checkWritten();var t=this.db._checkKey(e);if(t)throw t;return e=this.db._serializeKey(e),this._del(e),this},i.prototype._del=function(e){this._operations.push({type:"del",key:e})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(e,t){if(this._checkWritten(),"function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("write() requires a callback argument");"object"==typeof e&&null!==e||(e={}),this._written=!0,this._write(e,t)},i.prototype._write=function(e,t){this.db._batch(this._operations,e,t)},i.prototype._nextTick=n,e.exports=i},function(e,t,r){"use strict";(function(t,n){var i;e.exports=E,E.ReadableState=S;r(19).EventEmitter;var o=function(e,t){return e.listeners(t).length},s=r(55),a=r(0).Buffer,u=t.Uint8Array||function(){};var c,l=r(155);c=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,p=r(156),d=r(56),y=r(57).getHighWaterMark,b=r(6).codes,g=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,k=b.ERR_METHOD_NOT_IMPLEMENTED,w=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,m=r(158).emitExperimentalWarning;r(3)(E,s);var _=["error","close","destroy","pause","resume"];function S(e,t,n){i=i||r(7),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(59).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function E(e){if(i=i||r(7),!(this instanceof E))return new E(e);var t=this instanceof i;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function x(e,t,r,n,i){c("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}(e,s);else if(i||(o=function(e,t){var r;n=t,a.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(s,t)),o)e.emit("error",o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)s.endEmitted?e.emit("error",new w):O(e,s,t,!0);else if(s.ended)e.emit("error",new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?O(e,s,t,!1):I(e,s)):O(e,s,t,!1)}else n||(s.reading=!1,I(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&R(e)),I(e,t)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=d.destroy,E.prototype._undestroy=d.undestroy,E.prototype._destroy=function(e,t){t(e)},E.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=a.from(e,t),t=""),r=!0),x(this,e,t,!1,r)},E.prototype.unshift=function(e){return x(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){return f||(f=r(59).StringDecoder),this._readableState.decoder=new f(e),this._readableState.encoding=this._readableState.decoder.encoding,this};function A(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(C,e))}function C(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||e.emit("readable"),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function I(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function j(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){c("readable nexttick read 0"),e.read(0)}function P(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function L(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(M,t,e))}function M(e,t){c("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}E.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):R(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&L(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(r,t))),null===(n=e>0?D(e,t):null)?(t.needReadable=!0,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&L(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){this.emit("error",new k("_read()"))},E.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?u:b;function a(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",d),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",a),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",h),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",l);var f=!1;function h(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function p(t){c("onerror",t),b(),e.removeListener("error",p),0===o(e,"error")&&e.emit("error",t)}function d(){e.removeListener("finish",y),b()}function y(){c("onfinish"),e.removeListener("close",d),b()}function b(){c("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",d),e.once("finish",y),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},E.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||n.nextTick(N,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(j,this),r},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(j,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(P,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<_.length;o++)e.on(_[o],this.emit.bind(this,_[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return m("Readable[Symbol.asyncIterator]"),void 0===h&&(h=r(160)),h(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=D,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}})}).call(this,r(4),r(1))},function(e,t,r){"use strict";e.exports=r(19).EventEmitter},function(e,t,r){"use strict";(function(t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var s=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(o?o(e):!e||this._writableState&&this._writableState.errorEmitted||t.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?(t.nextTick(r,s,e),s._writableState&&(s._writableState.errorEmitted=!0)):o?(t.nextTick(n,s),o(e)):t.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}}).call(this,r(1))},function(e,t,r){"use strict";var n=r(6).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},function(e,t,r){"use strict";(function(t,n){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=E,E.WritableState=S;var s={deprecate:r(159)},a=r(55),u=r(0).Buffer,c=t.Uint8Array||function(){};var l,f=r(56),h=r(57).getHighWaterMark,p=r(6).codes,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,b=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,k=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,m=p.ERR_UNKNOWN_ENCODING;function _(){}function S(e,t,s){o=o||r(7),e=e||{},"boolean"!=typeof s&&(s=t instanceof o),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,o){--t.pendingcb,r?(n.nextTick(o,i),n.nextTick(I,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(o(i),e._writableState.errorEmitted=!0,e.emit("error",i),I(e,t))}(e,r,i,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||A(e,r),i?n.nextTick(O,e,r,s,o):O(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function E(e){var t=this instanceof(o=o||r(7));if(!t&&!l.call(E,this))return new E(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function x(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),I(e,t)}function A(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,x(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(x(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(e,t){var r=R(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(C,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}r(3)(E,a),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===E&&(e&&e._writableState instanceof S)}})):l=function(e){return e instanceof this},E.prototype.pipe=function(){this.emit("error",new g)},E.prototype.write=function(e,t,r){var i,o=this._writableState,s=!1,a=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof c);return a&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=_),o.ending?function(e,t){var r=new w;e.emit("error",r),n.nextTick(t,r)}(this,r):(a||function(e,t,r,i){var o;return null===r?o=new k:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(e.emit("error",o),n.nextTick(i,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else x(e,t,!1,a,n,i,o);return c}(this,o,a,e,t,r)),s},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},E.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new m(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new y("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(1))},function(e,t,r){"use strict";var n=r(47).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";e.exports=l;var n=r(6).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(7);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(3)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,r){"use strict";e.exports=function(){var e,t=new Promise((function(t,r){e=function(e,n){e?r(e):t(n)}}));return e.promise=t,e}},function(e,t,r){"use strict";var n=r(26);function i(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._ended=!1,this._nexting=!1}i.prototype.next=function(e){var t=this;if("function"!=typeof e)throw new Error("next() requires a callback argument");return t._ended?(n(e,new Error("cannot call next() after end()")),t):t._nexting?(n(e,new Error("cannot call next() before previous next() has completed")),t):(t._nexting=!0,t._next((function(){t._nexting=!1,e.apply(null,arguments)})),t)},i.prototype._next=function(e){n(e)},i.prototype.seek=function(e){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");e=this.db._serializeKey(e),this._seek(e)},i.prototype._seek=function(e){},i.prototype.end=function(e){if("function"!=typeof e)throw new Error("end() requires a callback argument");if(this._ended)return n(e,new Error("end() already called on iterator"));this._ended=!0,this._end(e)},i.prototype._end=function(e){n(e)},i.prototype._nextTick=n,e.exports=i},function(e,t,r){"use strict";var n=r(26);function i(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(e,t){this._checkWritten();var r=this.db._checkKey(e)||this.db._checkValue(t);if(r)throw r;return e=this.db._serializeKey(e),t=this.db._serializeValue(t),this._put(e,t),this},i.prototype._put=function(e,t){this._operations.push({type:"put",key:e,value:t})},i.prototype.del=function(e){this._checkWritten();var t=this.db._checkKey(e);if(t)throw t;return e=this.db._serializeKey(e),this._del(e),this},i.prototype._del=function(e){this._operations.push({type:"del",key:e})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(e,t){if(this._checkWritten(),"function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("write() requires a callback argument");"object"==typeof e&&null!==e||(e={}),this._written=!0,this._write(e,t)},i.prototype._write=function(e,t){this.db._batch(this._operations,e,t)},i.prototype._nextTick=n,e.exports=i},function(e,t,r){"use strict";t.AbstractLevelDOWN=r(175),t.AbstractIterator=r(65),t.AbstractChainedBatch=r(66)},function(e,t,r){"use strict";(function(t){function r(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._ended=!1,this._nexting=!1}r.prototype.next=function(e){var r=this;if("function"!=typeof e)throw new Error("next() requires a callback argument");return r._ended?(t.nextTick(e,new Error("cannot call next() after end()")),r):r._nexting?(t.nextTick(e,new Error("cannot call next() before previous next() has completed")),r):(r._nexting=!0,r._next((function(){r._nexting=!1,e.apply(null,arguments)})),r)},r.prototype._next=function(e){t.nextTick(e)},r.prototype.seek=function(e){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");e=this.db._serializeKey(e),this._seek(e)},r.prototype._seek=function(e){},r.prototype.end=function(e){if("function"!=typeof e)throw new Error("end() requires a callback argument");if(this._ended)return t.nextTick(e,new Error("end() already called on iterator"));this._ended=!0,this._end(e)},r.prototype._end=function(e){t.nextTick(e)},e.exports=r}).call(this,r(1))},function(e,t,r){"use strict";function n(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._operations=[],this._written=!1}n.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},n.prototype.put=function(e,t){this._checkWritten();var r=this.db._checkKey(e)||this.db._checkValue(t);if(r)throw r;return e=this.db._serializeKey(e),t=this.db._serializeValue(t),this._put(e,t),this},n.prototype._put=function(e,t){this._operations.push({type:"put",key:e,value:t})},n.prototype.del=function(e){this._checkWritten();var t=this.db._checkKey(e);if(t)throw t;return e=this.db._serializeKey(e),this._del(e),this},n.prototype._del=function(e){this._operations.push({type:"del",key:e})},n.prototype.clear=function(){return this._checkWritten(),this._clear(),this},n.prototype._clear=function(){this._operations=[]},n.prototype.write=function(e,t){if(this._checkWritten(),"function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("write() requires a callback argument");"object"==typeof e&&null!==e||(e={}),this._written=!0,this._write(e,t)},n.prototype._write=function(e,t){this.db._batch(this._operations,e,t)},e.exports=n},function(e,t,r){"use strict";(function(t){var n=r(178);e.exports=function(e){return e instanceof Uint8Array?n(e):e instanceof ArrayBuffer?t.from(e):t.from(String(e))}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";e.exports=r(22)},function(e,t,r){"use strict";const n=r(16),i=r(5)("repo:lock"),o={};t.lock=async e=>{const t=e+"/repo.lock";if(i("locking %s",t),!0===o[t])throw new n.LockExistsError("Lock already being held for file: ".concat(t));return o[t]=!0,{async close(){o[t]&&delete o[t]}}},t.locked=async e=>{const t=e+"/repo.lock";return i("checking lock: ".concat(t)),Boolean(o[t])}},function(e,t,r){e.exports=r(71)},function(e,t,r){"use strict";function n(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}const i=r(27),o=r(5),s=r(74),a=r(8),u=r(75),c=r(92),l=r(93),f=r(94),h=r(95),p=r(96),d=r(99),y=r(107),b=r(110),g=r(111),v=r(137),k=r(181),w=r(16),m=o("repo"),_=Number.MAX_SAFE_INTEGER,S={memory:r(69),fs:r(69)};async function E(e){const t=new s(0);var r,i=!0,o=!1;try{for(var a,u,c=n(e.query({}));i=(a=await c.next()).done,u=await a.value,!i;i=!0){const e=u;t.plus(e.value.byteLength).plus(e.key._buf.byteLength)}}catch(l){o=!0,r=l}finally{try{i||null==c.return||await c.return()}finally{if(o)throw r}}return t}e.exports=class{constructor(e,t){if("string"!=typeof e)throw new Error("missing repoPath");this.options=function(e){const t=Object.assign({},v,e);return t.storageBackends=Object.assign({},v.storageBackends,t.storageBackends),t.storageBackendOptions=Object.assign({},v.storageBackendOptions,t.storageBackendOptions),t}(t),this.closed=!0,this.path=e,this._locker=this._getLocker(),this.root=h.create("root",this.path,this.options),this.version=p(this.root),this.config=d(this.root),this.spec=y(this.root),this.apiAddr=b(this.root)}async init(e){var t;m("initializing at: %s",this.path),await this._openRoot(),await this.config.set((t=e,t.datastore=Object.assign({},k,i(t,"datastore",{})),t)),await this.spec.set(function(e){const t=Object.assign({},k.Spec,i(e,"datastore.Spec",{}));return{type:t.type,mounts:t.mounts.map(e=>({mountpoint:e.mountpoint,type:e.child.type,path:e.child.path,shardFunc:e.child.shardFunc}))}}(e)),await this.version.set(f.repoVersion)}async isInitialized(){if(!this.closed)return!0;try{return await this._openRoot(),await this._checkInitialized(),await this.root.close(),!0}catch(e){return!1}}async open(){if(!this.closed)throw a(new Error("repo is already open"),w.ERR_REPO_ALREADY_OPEN);m("opening at: %s",this.path);try{await this._openRoot(),await this._checkInitialized(),this.lockfile=await this._openLock(this.path),m("acquired repo.lock"),m("creating datastore"),this.datastore=h.create("datastore",l(this.path,"datastore"),this.options),await this.datastore.open(),m("creating blocks");const e=h.create("blocks",l(this.path,"blocks"),this.options);if(await e.open(),this.blocks=await g(e,this.options.storageBackendOptions.blocks),m("creating keystore"),this.keys=h.create("keys",l(this.path,"keys"),this.options),await this.keys.open(),!await this.version.check(f.repoVersion)){if(!await this._isAutoMigrationEnabled())throw new w.InvalidRepoVersionError("Incompatible repo versions. Automatic migrations disabled. Please migrate the repo manually.");await this._migrate(f.repoVersion)}this.closed=!1,m("all opened")}catch(e){if(this.lockfile)try{await this._closeLock(),this.lockfile=null}catch(t){m("error removing lock",t)}throw e}}_getLocker(){if("string"==typeof this.options.lock){if(!S[this.options.lock])throw new Error("Unknown lock type: "+this.options.lock);return S[this.options.lock]}if(!this.options.lock)throw new Error("No lock provided");return this.options.lock}async _openRoot(){try{await this.root.open()}catch(e){if("Already open"!==e.message)throw e}}async _openLock(e){const t=await this._locker.lock(e);if("function"!=typeof t.close)throw a(new Error("Locks must have a close method"),"ERR_NO_CLOSE_FUNCTION");return t}_closeLock(){return this.lockfile.close()}async _checkInitialized(){let e;m("init check");try{[e]=await Promise.all([this.config.exists(),this.spec.exists(),this.version.exists()])}catch(t){if("ERR_NOT_FOUND"===t.code)throw a(new Error("repo is not initialized yet"),w.ERR_REPO_NOT_INITIALIZED,{path:this.path});throw t}if(!e)throw a(new Error("repo is not initialized yet"),w.ERR_REPO_NOT_INITIALIZED,{path:this.path})}async close(){if(this.closed)throw a(new Error("repo is already closed"),w.ERR_REPO_ALREADY_CLOSED);m("closing at: %s",this.path);try{await this.apiAddr.delete()}catch(e){if(e.code!==w.ERR_REPO_NOT_INITIALIZED&&!e.message.startsWith("ENOENT"))throw e}await Promise.all([this.root,this.blocks,this.keys,this.datastore].map(e=>e.close())),m("unlocking"),this.closed=!0,await this._closeLock(),this.lockfile=null}async exists(){return this.version.exists()}async stat(){const[e,t,r,n,i]=await Promise.all([this._storageMaxStat(),this._blockStat(),this.version.get(),E(this.datastore),E(this.keys)]),o=t.size.plus(n).plus(i);return{repoPath:this.path,storageMax:e,version:r,numObjects:t.count,repoSize:o}}async _isAutoMigrationEnabled(){if(void 0!==this.options.autoMigrate)return this.options.autoMigrate;let e;try{e=await this.config.get("repoAutoMigrate")}catch(t){if(t.code!==w.NotFoundError.code)throw t;e=!0}return e}async _migrate(e){return await this.version.get()>e?(m("reverting to version "+e),u.revert(this.path,e,{ignoreLock:!0,repoOptions:this.options})):(m("migrating to version "+e),u.migrate(this.path,e,{ignoreLock:!0,repoOptions:this.options}))}async _storageMaxStat(){try{const e=await this.config.get("Datastore.StorageMax");return new s(c(e))}catch(e){return new s(_)}}async _blockStat(){let e=new s(0),t=new s(0);var r,i=!0,o=!1;try{for(var a,u,c=n(this.blocks.query({}));i=(a=await c.next()).done,u=await a.value,!i;i=!0){const r=u;e=e.plus(1),t=t.plus(r.value.byteLength).plus(r.key._buf.byteLength)}}catch(l){o=!0,r=l}finally{try{i||null==c.return||await c.return()}finally{if(o)throw r}}return{count:e,size:t}}},e.exports.utils={blockstore:r(49)},e.exports.repoVersion=f.repoVersion,e.exports.errors=w},function(e,t,r){"use strict";e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){let r;function s(...e){if(!s.enabled)return;const t=s,i=Number(new Date),o=i-(r||i);t.diff=o,t.prev=r,t.curr=i,r=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return r;a++;const o=n.formatters[i];if("function"==typeof o){const n=e[a];r=o.call(t,n),e.splice(a,1),a--}return r}),n.formatArgs.call(t,e),(t.log||n.log).apply(t,e)}return s.namespace=e,s.enabled=n.enabled(e),s.useColors=n.useColors(),s.color=t(e),s.destroy=i,s.extend=o,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function i(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function o(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(s),...n.skips.map(s).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(t=0;t<i;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){const e=n.instances[t];e.enabled=n.enabled(e.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(73),Object.keys(e).forEach(t=>{n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t,r){"use strict";var n=1e3,i=6e4,o=60*i,s=24*o;function a(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*o;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===r&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=s)return a(e,t,s,"day");if(t>=o)return a(e,t,o,"hour");if(t>=i)return a(e,t,i,"minute");if(t>=n)return a(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=s)return Math.round(e/s)+"d";if(t>=o)return Math.round(e/o)+"h";if(t>=i)return Math.round(e/i)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";var n;!function(i){var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e9;function d(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function b(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,u=e.e,c=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function v(e){var t=e.c.length-1;return d(e.e/14)==t&&e.c[t]%2!=0}function k(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(o=function e(t){var r,n,i,o,m,_,S,E,x,O=F.prototype={constructor:F,toString:null,valueOf:null},A=new F(1),R=20,C=4,I=-7,T=21,j=-1e7,N=1e7,P=!1,B=1,D=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz";function F(e,t){var r,o,a,c,f,h,p,d,y=this;if(!(y instanceof F))return new F(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>N?y.c=y.e=null:e.e<j?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((h="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,f=e;f>=10;f/=10,c++);return void(c>N?y.c=y.e=null:(y.e=c,y.c=[e]))}d=String(e)}else{if(!s.test(d=String(e)))return i(y,d,h);y.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(c=d.indexOf("."))>-1&&(d=d.replace(".","")),(f=d.search(/e/i))>0?(c<0&&(c=f),c+=+d.slice(f+1),d=d.substring(0,f)):c<0&&(c=d.length)}else{if(g(t,2,M.length,"Base"),10==t)return z(y=new F(e),R+y.e+1,C);if(d=String(e),h="number"==typeof e){if(0*e!=0)return i(y,d,h,t);if(y.s=1/e<0?(d=d.slice(1),-1):1,F.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else y.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=M.slice(0,t),c=f=0,p=d.length;f<p;f++)if(r.indexOf(o=d.charAt(f))<0){if("."==o){if(f>c){c=p;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,f=-1,c=0;continue}return i(y,String(e),h,t)}h=!1,(c=(d=n(d,t,10,y.s)).indexOf("."))>-1?d=d.replace(".",""):c=d.length}for(f=0;48===d.charCodeAt(f);f++);for(p=d.length;48===d.charCodeAt(--p););if(d=d.slice(f,++p)){if(p-=f,h&&F.DEBUG&&p>15&&(e>9007199254740991||e!==u(e)))throw Error(l+y.s*e);if((c=c-f-1)>N)y.c=y.e=null;else if(c<j)y.c=[y.e=0];else{if(y.e=c,y.c=[],f=(c+1)%14,c<0&&(f+=14),f<p){for(f&&y.c.push(+d.slice(0,f)),p-=14;f<p;)y.c.push(+d.slice(f,f+=14));f=14-(d=d.slice(f)).length}else f-=p;for(;f--;d+="0");y.c.push(+d)}}else y.c=[y.e=0]}function U(e,t,r,n){var i,o,s,a,u;if(null==r?r=C:g(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)u=y(e.c),u=1==n||2==n&&(s<=I||s>=T)?k(u,s):w(u,s,"0");else if(o=(e=z(new F(e),t,r)).e,a=(u=y(e.c)).length,1==n||2==n&&(t<=o||o<=I)){for(;a<t;u+="0",a++);u=k(u,o)}else if(t-=s,u=w(u,o,"0"),o+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function q(e,t){for(var r,n=1,i=new F(e[0]);n<e.length;n++){if(!(r=new F(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function K(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+14*r-1)>N?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function z(e,t,r,n){var i,o,s,c,l,p,d,y=e.c,b=h;if(y){e:{for(i=1,c=y[0];c>=10;c/=10,i++);if((o=t-i)<0)o+=14,s=t,d=(l=y[p=0])/b[i-s-1]%10|0;else if((p=a((o+1)/14))>=y.length){if(!n)break e;for(;y.length<=p;y.push(0));l=d=0,i=1,s=(o%=14)-14+1}else{for(l=c=y[p],i=1;c>=10;c/=10,i++);d=(s=(o%=14)-14+i)<0?0:l/b[i-s-1]%10|0}if(n=n||t<0||null!=y[p+1]||(s<0?l:l%b[i-s-1]),n=r<4?(d||n)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||n||6==r&&(o>0?s>0?l/b[i-s]:0:y[p-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=b[(14-t%14)%14],e.e=-t||0):y[0]=e.e=0,e;if(0==o?(y.length=p,c=1,p--):(y.length=p+1,c=b[14-o],y[p]=s>0?u(l/b[i-s]%b[s])*c:0),n)for(;;){if(0==p){for(o=1,s=y[0];s>=10;s/=10,o++);for(s=y[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(e.e++,y[0]==f&&(y[0]=1));break}if(y[p]+=c,y[p]!=f)break;y[p--]=0,c=1}for(o=y.length;0===y[--o];y.pop());}e.e>N?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function V(e){var t,r=e.e;return null===r?e.toString():(t=y(e.c),t=r<=I||r>=T?k(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return F.clone=e,F.ROUND_UP=0,F.ROUND_DOWN=1,F.ROUND_CEIL=2,F.ROUND_FLOOR=3,F.ROUND_HALF_UP=4,F.ROUND_HALF_DOWN=5,F.ROUND_HALF_EVEN=6,F.ROUND_HALF_CEIL=7,F.ROUND_HALF_FLOOR=8,F.EUCLID=9,F.config=F.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,p,t),R=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),C=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-p,0,t),g(r[1],0,p,t),I=r[0],T=r[1]):(g(r,-p,p,t),I=-(T=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-p,-1,t),g(r[1],1,p,t),j=r[0],N=r[1];else{if(g(r,-p,p,t),!r)throw Error(c+t+" cannot be zero: "+r);j=-(N=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(c+"crypto unavailable");P=r}else P=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,p,t),D=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);L=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);M=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:C,EXPONENTIAL_AT:[I,T],RANGE:[j,N],CRYPTO:P,MODULO_MODE:B,POW_PRECISION:D,FORMAT:L,ALPHABET:M}},F.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!F.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-p&&i<=p&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=f||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},F.maximum=F.max=function(){return q(arguments,O.lt)},F.minimum=F.min=function(){return q(arguments,O.gt)},F.random=(o=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,s,l=0,f=[],d=new F(A);if(null==e?e=R:g(e,0,p),i=a(e/14),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));l<i;)(s=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(f.push(s%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw P=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);l<i;)(s=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(f.push(s%1e14),l+=7);l=i/7}if(!P)for(;l<i;)(s=o())<9e15&&(f[l++]=s%1e14);for(e%=14,(i=f[--l])&&e&&(s=h[14-e],f[l]=u(i/s)*s);0===f[l];f.pop(),l--);if(l<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=14);for(l=1,s=f[0];s>=10;s/=10,l++);l<14&&(n-=14-l)}return d.e=n,d.c=f,d}),F.sum=function(){for(var e=1,t=arguments,r=new F(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,s=[0],a=0,u=e.length;a<u;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(t,n,i,o,s){var a,u,c,l,f,h,p,d,b=t.indexOf("."),g=R,v=C;for(b>=0&&(l=D,D=0,t=t.replace(".",""),h=(d=new F(n)).pow(t.length-b),D=l,d.c=e(w(y(h.c),h.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=l=(p=e(t,n,i,s?(a=M,"0123456789"):(a="0123456789",M))).length;0==p[--l];p.pop());if(!p[0])return a.charAt(0);if(b<0?--c:(h.c=p,h.e=c,h.s=o,p=(h=r(h,d,g,v,i)).c,f=h.r,c=h.e),b=p[u=c+g+1],l=i/2,f=f||u<0||null!=p[u+1],f=v<4?(null!=b||f)&&(0==v||v==(h.s<0?3:2)):b>l||b==l&&(4==v||f||6==v&&1&p[u-1]||v==(h.s<0?8:7)),u<1||!p[0])t=f?w(a.charAt(1),-g,a.charAt(0)):a.charAt(0);else{if(p.length=u,f)for(--i;++p[--u]>i;)p[u]=0,u||(++c,p=[1].concat(p));for(l=p.length;!p[--l];);for(b=0,t="";b<=l;t+=a.charAt(p[b++]));t=w(t,c,a.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%1e7,l=t/1e7|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%1e7)+(n=l*o+(s=e[u]/1e7|0)*c)%1e7*1e7+a)/r|0)+(n/1e7|0)+l*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var c,l,h,p,y,b,g,v,k,w,m,_,S,E,x,O,A,R=n.s==i.s?1:-1,C=n.c,I=i.c;if(!(C&&C[0]&&I&&I[0]))return new F(n.s&&i.s&&(C?!I||C[0]!=I[0]:I)?C&&0==C[0]||!I?0*R:R/0:NaN);for(k=(v=new F(R)).c=[],R=o+(l=n.e-i.e)+1,a||(a=f,l=d(n.e/14)-d(i.e/14),R=R/14|0),h=0;I[h]==(C[h]||0);h++);if(I[h]>(C[h]||0)&&l--,R<0)k.push(1),p=!0;else{for(E=C.length,O=I.length,h=0,R+=2,(y=u(a/(I[0]+1)))>1&&(I=e(I,y,a),C=e(C,y,a),O=I.length,E=C.length),S=O,m=(w=C.slice(0,O)).length;m<O;w[m++]=0);A=I.slice(),A=[0].concat(A),x=I[0],I[1]>=a/2&&x++;do{if(y=0,(c=t(I,w,O,m))<0){if(_=w[0],O!=m&&(_=_*a+(w[1]||0)),(y=u(_/x))>1)for(y>=a&&(y=a-1),g=(b=e(I,y,a)).length,m=w.length;1==t(b,w,g,m);)y--,r(b,O<g?A:I,g,a),g=b.length,c=1;else 0==y&&(c=y=1),g=(b=I.slice()).length;if(g<m&&(b=[0].concat(b)),r(w,b,m,a),m=w.length,-1==c)for(;t(I,w,O,m)<1;)y++,r(w,O<m?A:I,m,a),m=w.length}else 0===c&&(y++,w=[0]);k[h++]=y,w[0]?w[m++]=C[S]||0:(w=[C[S]],m=1)}while((S++<E||null!=w[0])&&R--);p=null!=w[0],k[0]||k.splice(0,1)}if(a==f){for(h=1,R=k[0];R>=10;R/=10,h++);z(v,o+(v.e=h+14*l-1)+1,s,p)}else v.e=l,v.r=+p;return v}}(),m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,_=/^([^.]+)\.$/,S=/^\.([^.]+)$/,E=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(E.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(m,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(_,"$1").replace(S,"0.$1")),t!=o))return new F(o,i);if(F.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},O.absoluteValue=O.abs=function(){var e=new F(this);return e.s<0&&(e.s=1),e},O.comparedTo=function(e,t){return b(this,new F(e,t))},O.decimalPlaces=O.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,p),null==t?t=C:g(t,0,8),z(new F(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=14*((i=r.length-1)-d(this.e/14)),i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},O.dividedBy=O.div=function(e,t){return r(this,new F(e,t),R,C)},O.dividedToIntegerBy=O.idiv=function(e,t){return r(this,new F(e,t),0,1)},O.exponentiatedBy=O.pow=function(e,t){var r,n,i,o,s,l,f,h,p=this;if((e=new F(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+V(e));if(null!=t&&(t=new F(t)),s=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new F(Math.pow(+V(p),s?2-v(e):+V(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new F(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&v(e)?-0:0,p.e>-1&&(o=1/o),new F(l?1/o:o);D&&(o=a(D/14+2))}for(s?(r=new F(.5),l&&(e.s=1),f=v(e)):f=(i=Math.abs(+V(e)))%2,h=new F(A);;){if(f){if(!(h=h.times(p)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;f=i%2}else if(z(e=e.times(r),e.e+1,1),e.e>14)f=v(e);else{if(0===(i=+V(e)))break;f=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?h:(l&&(h=A.div(h)),t?h.mod(t):o?z(h,D,C,void 0):h)},O.integerValue=function(e){var t=new F(this);return null==e?e=C:g(e,0,8),z(t,t.e+1,e)},O.isEqualTo=O.eq=function(e,t){return 0===b(this,new F(e,t))},O.isFinite=function(){return!!this.c},O.isGreaterThan=O.gt=function(e,t){return b(this,new F(e,t))>0},O.isGreaterThanOrEqualTo=O.gte=function(e,t){return 1===(t=b(this,new F(e,t)))||0===t},O.isInteger=function(){return!!this.c&&d(this.e/14)>this.c.length-2},O.isLessThan=O.lt=function(e,t){return b(this,new F(e,t))<0},O.isLessThanOrEqualTo=O.lte=function(e,t){return-1===(t=b(this,new F(e,t)))||0===t},O.isNaN=function(){return!this.s},O.isNegative=function(){return this.s<0},O.isPositive=function(){return this.s>0},O.isZero=function(){return!!this.c&&0==this.c[0]},O.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new F(e,t)).s,!a||!t)return new F(NaN);if(a!=t)return e.s=-t,s.plus(e);var u=s.e/14,c=e.e/14,l=s.c,h=e.c;if(!u||!c){if(!l||!h)return l?(e.s=-t,e):new F(h?s:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new F(l[0]?s:3==C?-0:0)}if(u=d(u),c=d(c),l=l.slice(),a=u-c){for((o=a<0)?(a=-a,i=l):(c=u,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(l[t]!=h[t]){o=l[t]<h[t];break}if(o&&(i=l,l=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=f-1;n>a;){if(l[--n]<h[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=f}l[n]-=h[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?K(e,l,c):(e.s=3==C?-1:1,e.c=[e.e=0],e)},O.modulo=O.mod=function(e,t){var n,i,o=this;return e=new F(e,t),!o.c||!e.s||e.c&&!e.c[0]?new F(NaN):!e.c||o.c&&!o.c[0]?new F(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},O.multipliedBy=O.times=function(e,t){var r,n,i,o,s,a,u,c,l,h,p,y,b,g,v=this,k=v.c,w=(e=new F(e,t)).c;if(!(k&&w&&k[0]&&w[0]))return!v.s||!e.s||k&&!k[0]&&!w||w&&!w[0]&&!k?e.c=e.e=e.s=null:(e.s*=v.s,k&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=d(v.e/14)+d(e.e/14),e.s*=v.s,(u=k.length)<(h=w.length)&&(b=k,k=w,w=b,i=u,u=h,h=i),i=u+h,b=[];i--;b.push(0));for(g=f,1e7,i=h;--i>=0;){for(r=0,p=w[i]%1e7,y=w[i]/1e7|0,o=i+(s=u);o>i;)r=((c=p*(c=k[--s]%1e7)+(a=y*c+(l=k[s]/1e7|0)*p)%1e7*1e7+b[o]+r)/g|0)+(a/1e7|0)+y*l,b[o--]=c%g;b[o]=r}return r?++n:b.splice(0,1),K(e,b,n)},O.negated=function(){var e=new F(this);return e.s=-e.s||null,e},O.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new F(e,t)).s,!i||!t)return new F(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/14,s=e.e/14,a=n.c,u=e.c;if(!o||!s){if(!a||!u)return new F(i/0);if(!a[0]||!u[0])return u[0]?e:new F(a[0]?n:0*i)}if(o=d(o),s=d(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/f|0,a[t]=f===a[t]?0:a[t]%f;return i&&(a=[i].concat(a),++s),K(e,a,s)},O.precision=O.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return g(e,1,p),null==t?t=C:g(t,0,8),z(new F(o),e,t);if(!(r=o.c))return null;if(n=14*(i=r.length-1)+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},O.shiftedBy=function(e){return g(e,-9007199254740991,9007199254740991),this.times("1e"+e)},O.squareRoot=O.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,l=R+4,f=new F("0.5");if(1!==u||!a||!a[0])return new F(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+V(s)))||u==1/0?(((t=y(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=d((c+1)/2)-(c<0||c%2),n=new F(t=u==1/0?"1e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new F(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(o=n,n=f.times(o.plus(r(s,o,l,1))),y(o.c).slice(0,u)===(t=y(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(z(n,n.e+R+2,1),e=!n.times(n).eq(s));break}if(!i&&(z(o,o.e+R+2,0),o.times(o).eq(s))){n=o;break}l+=4,u+=4,i=1}return z(n,n.e+R+1,C,e)},O.toExponential=function(e,t){return null!=e&&(g(e,0,p),e++),U(this,e,t,1)},O.toFixed=function(e,t){return null!=e&&(g(e,0,p),e=e+this.e+1),U(this,e,t)},O.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=L;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",f=s[0],h=s[1],p=i.s<0,d=p?f.slice(1):f,y=d.length;if(u&&(o=a,a=u,u=o,y-=o),a>0&&y>0){for(o=y%a||a,f=d.substr(0,o);o<y;o+=a)f+=l+d.substr(o,a);u>0&&(f+=l+d.slice(o)),p&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},O.toFraction=function(e){var t,n,i,o,s,a,u,l,f,p,d,b,g=this,v=g.c;if(null!=e&&(!(u=new F(e)).isInteger()&&(u.c||1!==u.s)||u.lt(A)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+V(u));if(!v)return new F(g);for(t=new F(A),f=n=new F(A),i=l=new F(A),b=y(v),s=t.e=b.length-g.e-1,t.c[0]=h[(a=s%14)<0?14+a:a],e=!e||u.comparedTo(t)>0?s>0?t:f:u,a=N,N=1/0,u=new F(b),l.c[0]=0;p=r(u,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,f=l.plus(p.times(o=f)),l=o,t=u.minus(p.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),l=l.plus(o.times(f)),n=n.plus(o.times(i)),l.s=f.s=g.s,d=r(f,i,s*=2,C).minus(g).abs().comparedTo(r(l,n,s,C).minus(g).abs())<1?[f,i]:[l,n],N=a,d},O.toNumber=function(){return+V(this)},O.toPrecision=function(e,t){return null!=e&&g(e,1,p),U(this,e,t,2)},O.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=I||o>=T?k(y(r.c),o):w(y(r.c),o,"0"):10===e?t=w(y((r=z(new F(r),R+o+1,C)).c),r.e,"0"):(g(e,2,M.length,"Base"),t=n(w(y(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},O.valueOf=O.toJSON=function(){return V(this)},O._isBigNumber=!0,null!=t&&F.set(t),F}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){"use strict";const n=r(76),i=r(77),o=r(91),s=r(28),a=r(5)("repo-migrations:migrator");function u(e){return e=e||n,Array.isArray(e)&&0!==e.length?e[e.length-1].version:0}function c(e,t,r,n=!1){let i=0;for(const o of e){if(o.version>r)break;if(o.version>t){if(n&&!o.revert)throw new s.NonReversibleMigrationError("It is not possible to revert to version ".concat(t," because migration version ").concat(o.version," is not reversible. Cancelling reversion."));i++}}if(i!==r-t)throw new s.InvalidValueError("The ipfs-repo-migrations package does not have all migration to migrate from version ".concat(t," to ").concat(r))}t.getCurrentRepoVersion=i.getVersion,t.errors=s,t.getLatestMigrationVersion=u,t.migrate=async function(e,t,{ignoreLock:r=!1,repoOptions:l,onProgress:f,isDryRun:h=!1,migrations:p}){if(p=p||n,f=f||(()=>{}),!e)throw new s.RequiredParameterError("Path argument is required!");if(!t)throw new s.RequiredParameterError("toVersion argument is required!");if(!Number.isInteger(t)||t<=0)throw new s.InvalidValueError("Version has to be positive integer!");const d=await i.getVersion(e);if(d===t)return void a("Nothing to migrate.");if(d>t)throw new s.InvalidValueError("Current repo's version (".concat(d,") is higher then toVersion (").concat(t,"), you probably wanted to revert it?"));let y;c(p,d,t),h||r||(y=await o.lock(d,e));try{let n=0;const o=t-d;for(const r of p){if(void 0!==t&&r.version>t)break;if(!(r.version<=d)){n++,a("Migrating version ".concat(r.version));try{h||await r.migrate(e,l)}catch(b){const t=r.version-1;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully migrated version: ".concat(t)),await i.setVersion(e,t),b.message="During migration to version ".concat(r.version," exception was raised: ").concat(b.message),b}f(r,n,o),a("Migrating to version ".concat(r.version," finished"))}}h||await i.setVersion(e,t||u(p)),a("Repo successfully migrated ",void 0!==t?"to version ".concat(t,"!"):"to latest version!")}finally{h||r||await y.close()}},t.revert=async function(e,t,{ignoreLock:r=!1,repoOptions:u,onProgress:l,isDryRun:f=!1,migrations:h}){if(h=h||n,l=l||(()=>{}),!e)throw new s.RequiredParameterError("Path argument is required!");if(!t)throw new s.RequiredParameterError("When reverting migrations, you have to specify to which version to revert!");if(!Number.isInteger(t)||t<=0)throw new s.InvalidValueError("Version has to be positive integer!");const p=await i.getVersion(e);if(p===t)return void a("Nothing to revert.");if(p<t)throw new s.InvalidValueError("Current repo's version (".concat(p,") is lower then toVersion (").concat(t,"), you probably wanted to migrate it?"));let d;c(h,t,p,!0),f||r||(d=await o.lock(p,e)),a("Reverting from version ".concat(p," to ").concat(t));try{let n=0;const o=p-t,s=h.slice().reverse();for(const r of s){if(r.version<=t)break;if(!(r.version>p)){n++,a("Reverting migration version ".concat(r.version));try{f||await r.revert(e,u)}catch(y){const t=r.version;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully reverted version: ".concat(t)),await i.setVersion(e,t),y.message="During reversion to version ".concat(r.version," exception was raised: ").concat(y.message),y}l(r,n,o),a("Reverting to version ".concat(r.version," finished"))}}f||await i.setVersion(e,t),a("All migrations successfully reverted to version ".concat(t,"!"))}finally{f||r||await d.close()}}},function(e,t,r){"use strict";const n={description:"Empty migration.",migrate:()=>{},revert:()=>{},empty:!0};e.exports=[Object.assign({},n,{version:7,revert:void 0}),Object.assign({},n,{version:6,revert:void 0}),Object.assign({},n,{version:5,revert:void 0}),Object.assign({},n,{version:4,revert:void 0}),Object.assign({},n,{version:3,revert:void 0}),Object.assign({},n,{version:2,revert:void 0}),Object.assign({},n,{version:1,revert:void 0})]},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(28),o=r(81),s=r(29),a=new(0,r(35).Key)("version");t.getVersion=async function(e){if(!await o.isRepoInitialized(e))throw new i.NotInitializedRepoError("Repo in path ".concat(e," is not initialized!"));const t=new s(e,{extension:"",createIfMissing:!1});await t.open();const r=parseInt(await t.get(a));return await t.close(),r},t.setVersion=async function(e,t){const r=new s(e,{extension:"",createIfMissing:!1});await r.open(),await r.put(a,n.from(String(t))),await r.close()}},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),s=n[0],a=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(l(e,s,s+16383>a?a:s+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y}},function(e,t,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,r){"use strict";const n=r(29),i=r(5)("repo-migrations:repo:init"),o=r(35).Key,s=new o("/version"),a=new o("/config");t.isRepoInitialized=async function(e){let t;try{t=new n(e,{extension:"",createIfMissing:!1}),await t.open();const r=await t.has(s),o=await t.has(a);return!(!r||!o)||(i("Version entry present: ".concat(r)),i("Config entry present: ".concat(o)),!1)}catch(r){return i("While checking if repo is initialized error was thrown: "+r.message),!1}finally{void 0!==t&&await t.close()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteDB=function(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);t&&r.addEventListener("blocked",()=>t());return(0,n.w)(r).then(()=>{})},t.openDB=function(e,t,{blocked:r,upgrade:i,blocking:o,terminated:s}={}){const a=indexedDB.open(e,t),u=(0,n.w)(a);i&&a.addEventListener("upgradeneeded",e=>{i((0,n.w)(a.result),e.oldVersion,e.newVersion,(0,n.w)(a.transaction))});r&&a.addEventListener("blocked",()=>r());return u.then(e=>{s&&e.addEventListener("close",()=>s()),o&&e.addEventListener("versionchange",()=>o())}).catch(()=>{}),u},Object.defineProperty(t,"unwrap",{enumerable:!0,get:function(){return n.u}}),Object.defineProperty(t,"wrap",{enumerable:!0,get:function(){return n.w}});var n=r(83);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const a=["get","getKey","getAll","getAllKeys","count"],u=["put","add","delete","clear"],c=new Map;function l(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(c.get(t))return c.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=u.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!a.includes(r))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;n&&(s=s.index(t.shift()));const a=await s[r](...t);return i&&await o.done,a};return c.set(t,o),o}(0,n.r)(e=>o(o({},e),{},{get:(t,r,n)=>l(t,r)||e.get(t,r,n),has:(t,r)=>!!l(t,r)||e.has(t,r)}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.r=function(e){f=e(f)},t.w=d,t.u=t.i=t.a=void 0;const n=(e,t)=>t.some(t=>e instanceof t);let i,o;t.i=n;const s=new WeakMap,a=new WeakMap,u=new WeakMap,c=new WeakMap,l=new WeakMap;t.a=l;let f={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return a.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return d(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(o||(o=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(y(this),t),d(s.get(this))}:function(...t){return d(e.apply(y(this),t))}:function(t,...r){const n=e.call(y(this),t,...r);return u.set(n,t.sort?t.sort():[t]),d(n)}}function p(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(a.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),n()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});a.set(e,t)}(e),n(e,i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,f):e)}function d(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(d(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)});return t.then(t=>{t instanceof IDBCursor&&s.set(t,e)}).catch(()=>{}),l.set(t,e),t}(e);if(c.has(e))return c.get(e);const t=p(e);return t!==e&&(c.set(e,t),l.set(t,e)),t}const y=e=>l.get(e);t.u=y},function(e,t,r){"use strict";const n=r(30),i=r(85),o=r(32),s=r(34),a=r(31);t.Key=n,t.MemoryDatastore=i,t.utils=o,t.Errors=s,t.Adapter=a},function(e,t,r){"use strict";const n=r(30),i=r(31),o=r(34);e.exports=class extends i{constructor(){super(),this.data={}}async put(e,t){this.data[e.toString()]=t}async get(e){if(!await this.has(e))throw o.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}*_all(){yield*Object.entries(this.data).map(([e,t])=>({key:new n(e),value:t}))}}},function(e,t,r){"use strict";const{nanoid:n}=r(15);e.exports=(e=(e=>e))=>e(n())},function(e,t,r){"use strict";function n(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,t,r){if(!(e instanceof Error))throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"==typeof t&&(r=t,t=void 0),null!=t&&(r.code=t);try{return n(e,r)}catch(i){r.message=e.message,r.stack=e.stack;const t=function(){};return t.prototype=Object.create(Object.getPrototypeOf(e)),n(new t,r)}}},function(e,t,r){"use strict";const{filter:n,sortAll:i,take:o,map:s}=r(37),a=r(36),u=r(38);e.exports=class{constructor(){this.data={}}async open(){}async put(e,t){this.data[e.toString()]=t}async get(e){if(!await this.has(e))throw u.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}batch(){let e=[],t=[];return{put(t,r){e.push([t,r])},delete(e){t.push(e)},commit:async()=>{e.forEach(e=>{this.data[e[0].toString()]=e[1]}),e=[],t.forEach(e=>{delete this.data[e.toString()]}),t=[]}}}query(e){let t=Object.entries(this.data);if(t=s(t,e=>({key:new a(e[0]),value:e[1]})),null!=e.prefix&&(t=n(t,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>n(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>i(e,t),t)),null!=e.offset){let r=0;t=n(t,()=>r++>=e.offset)}return null!=e.limit&&(t=o(t,e.limit)),!0===e.keysOnly&&(t=s(t,e=>({key:e.key}))),t}async close(){}}},function(e,t,r){"use strict";const n=r(90);e.exports=(e=(e=>e))=>e(n())},function(e,t,r){"use strict";for(var n=self.crypto||self.msCrypto,i="-_",o=36;o--;)i+=o.toString(36);for(o=36;o---10;)i+=o.toString(36).toUpperCase();e.exports=function(e){var t="",r=n.getRandomValues(new Uint8Array(e||21));for(o=e||21;o--;)t+=i[63&r[o]];return t}},function(e,t,r){"use strict";const n=r(5)("repo-migrations:repo_mem_lock"),i={};t.lock=async function(e,t){const r=t+"/repo.lock";if(n("locking %s",r),!0===i[r])throw Error("There is already present lock for: ".concat(r));return i[r]=!0,{close(){i[r]&&(n("releasing lock %s",r),delete i[r])}}}},function(e,t,r){"use strict";e.exports=function(e,t){if("string"==typeof e)return u(e);if("number"==typeof e)return a(e,t);return null},e.exports.format=a,e.exports.parse=u;var n=/\B(?=(\d{3})+(?!\d))/g,i=/(?:\.0*|(\.[^0]+)0+)$/,o={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},s=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function a(e,t){if(!Number.isFinite(e))return null;var r=Math.abs(e),s=t&&t.thousandsSeparator||"",a=t&&t.unitSeparator||"",u=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,c=Boolean(t&&t.fixedDecimals),l=t&&t.unit||"";l&&o[l.toLowerCase()]||(l=r>=o.pb?"PB":r>=o.tb?"TB":r>=o.gb?"GB":r>=o.mb?"MB":r>=o.kb?"KB":"B");var f=(e/o[l.toLowerCase()]).toFixed(u);return c||(f=f.replace(i,"$1")),s&&(f=f.replace(n,s)),f+a+l}function u(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,r=s.exec(e),n="b";return r?(t=parseFloat(r[1]),n=r[4].toLowerCase()):(t=parseInt(e,10),n="b"),Math.floor(o[n]*t)}},function(e,t,r){"use strict";e.exports=function(...e){return 0===e.length?".":e.join("/")}},function(e,t,r){"use strict";e.exports={repoVersion:7}},function(e,t,r){"use strict";t.create=function(e,t,r){return new(0,r.storageBackends[e])(t,Object.assign({},r.storageBackendOptions[e]||{}))}},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(2).Key,o=r(5)("repo:version"),s=new i("version");e.exports=e=>({exists:async()=>e.has(s),async get(){const t=await e.get(s);return parseInt(t.toString().trim(),10)},set:async t=>e.put(s,n.from(String(t))),async check(e){const t=await this.get();return o("comparing version: %s and %s",t,e),t===e||(6===t&&7===e||6===e&&7===t)}})},function(e,t,r){"use strict";const n=r(39),i=r(41),o=r(43);e.exports=class extends i{constructor(){super(),this.data={}}async put(e,t){this.data[e.toString()]=t}async get(e){if(!await this.has(e))throw o.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}*_all(){yield*Object.entries(this.data).map(([e,t])=>({key:new n(e),value:t}))}}},function(e,t,r){"use strict";const{nanoid:n}=r(40);e.exports=(e=(e=>e))=>e(n())},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(2).Key,{default:o}=r(100),s=r(27),a=r(106),u=r(8),c=r(16),l=new i("config");e.exports=e=>{const t=new o({concurrency:1}),r={getAll:async(e={})=>r.get(void 0,e),async get(t,r={}){t||(t=void 0);const n=await e.get(l);if(r.signal&&r.signal.aborted)return;const i=JSON.parse(n.toString());if(void 0!==t&&void 0===s(i,t))throw new c.NotFoundError("Key ".concat(t," does not exist in config"));return void 0!==t?s(i,t):i},async set(e,r,o={}){if(1===arguments.length)r=e,e=void 0;else if(!e||"string"!=typeof e)throw u(new Error("Invalid key type: "+typeof e),"ERR_INVALID_KEY");if(void 0===r||n.isBuffer(r))throw u(new Error("Invalid value type: "+typeof r),"ERR_INVALID_VALUE");return t.add(()=>i({key:e,value:r},o.signal))},async replace(e,r={}){if(!e||n.isBuffer(e))throw u(new Error("Invalid value type: "+typeof e),"ERR_INVALID_VALUE");return t.add(()=>i({key:void 0,value:e},r.signal))},exists:async()=>e.has(l)};return r;async function i(e,t){if(t&&t.aborted)return;const n=e.key,i=e.value;if(n){const e=await r.get();return a(e,n,i),f(e)}return f(i)}function f(t){const r=n.from(JSON.stringify(t,null,2));return e.put(l,r)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(101),i=r(102),o=r(104),s=()=>{},a=new i.TimeoutError;t.default=class extends n{constructor(e){if(super(),Object.defineProperty(this,"_carryoverConcurrencyCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isIntervalIgnored",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalCap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interval",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalEnd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queueClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pendingCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_concurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isPaused",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolveEmpty",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_resolveIdle",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_throwOnTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:o.default},e)).intervalCap&&e.intervalCap>=1))throw new TypeError("Expected `intervalCap` to be a number from 1 and up, got `".concat(e.intervalCap,"` (").concat(typeof e.intervalCap,")"));if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError("Expected `interval` to be a finite number >= 0, got `".concat(e.interval,"` (").concat(typeof e.interval,")"));this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother()}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=s,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=s)}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const e=Date.now();if(void 0===this._intervalId){const t=this._intervalEnd-e;if(!(t<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother)return this.emit("active"),this._queue.dequeue()(),e&&this._initializeIntervalIfNeeded(),!0}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError("Expected `concurrency` to be a number from 1 and up, got `".concat(e,"` (").concat(typeof e,")"));this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise((r,n)=>{this._queue.enqueue(async()=>{this._pendingCount++,this._intervalCount++;try{const o=void 0===this._timeout&&void 0===t.timeout?e():i.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&n(a)});r(await o)}catch(o){n(o)}this._next()},t),this._tryToStartAnother()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise(e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}})}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise(e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}})}get size(){return this._queue.size}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}set timeout(e){this._timeout=e}get timeout(){return this._timeout}}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(e,t,r,n,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new s(r,n||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},c.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n<o;n++)s[n]=r[n].fn;return s},c.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,n,o,s){var a=i?i+e:e;if(!this._events[a])return!1;var u,c,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){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,r),!0;case 4:return l.fn.call(l.context,t,r,n),!0;case 5:return l.fn.call(l.context,t,r,n,o),!0;case 6:return l.fn.call(l.context,t,r,n,o,s),!0}for(c=1,u=new Array(f-1);c<f;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),f){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,n);break;default:if(!u)for(h=1,u=new Array(f-1);h<f;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},c.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},c.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},c.prototype.removeListener=function(e,t,r,n){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return u(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||u(this,o);else{for(var a=0,c=[],l=s.length;a<l;a++)(s[a].fn!==t||n&&!s[a].once||r&&s[a].context!==r)&&c.push(s[a]);c.length?this._events[o]=1===c.length?c[0]:c:u(this,o)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&u(this,t)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,e.exports=c},function(e,t,r){"use strict";const n=r(103);class i extends Error{constructor(e){super(e),this.name="TimeoutError"}}const o=(e,t,r)=>new Promise((o,s)=>{if("number"!=typeof t||t<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(t===1/0)return void o(e);const a=setTimeout(()=>{if("function"==typeof r){try{o(r())}catch(u){s(u)}return}const n="string"==typeof r?r:"Promise timed out after ".concat(t," milliseconds"),a=r instanceof Error?r:new i(n);"function"==typeof e.cancel&&e.cancel(),s(a)},t);n(e.then(o,s),()=>{clearTimeout(a)})});e.exports=o,e.exports.default=o,e.exports.TimeoutError=i},function(e,t,r){"use strict";e.exports=(e,t)=>(t=t||(()=>{}),e.then(e=>new Promise(e=>{e(t())}).then(()=>e),e=>new Promise(e=>{e(t())}).then(()=>{throw e})))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(105);t.default=class{constructor(){Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:[]})}enqueue(e,t){const r={priority:(t=Object.assign({priority:0},t)).priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority)return void this._queue.push(r);const i=n.default(this._queue,r,(e,t)=>t.priority-e.priority);this._queue.splice(i,0,r)}dequeue(){const e=this._queue.shift();return e&&e.run}get size(){return this._queue.length}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=0,i=e.length;for(;i>0;){const o=i/2|0;let s=n+o;r(e[s],t)<=0?(n=++s,i-=o+1):i=o}return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){"string"==typeof t&&(t=t.split("."));"symbol"==typeof t&&(t=[t]);var n,i=t.pop();if(!i)return!1;for(;n=t.shift();)if(void 0===e[n]&&(e[n]={}),!(e=e[n])||"object"!=typeof e)return!1;return e[i]=r,!0}},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(2).Key,o=r(108),s=new i("datastore_spec");e.exports=e=>({exists:async()=>e.has(s),async get(){const t=await e.get(s);return JSON.parse(t.toString())},set:async t=>e.put(s,n.from(JSON.stringify(o(t,{deep:!0}))))})},function(e,t,r){"use strict";const n=r(109);e.exports=(e,t={})=>{if(!n(e))throw new TypeError("Expected a plain object");const{deep:r}=t,i=[],o=[],s=e=>{const t=i.indexOf(e);if(-1!==t)return o[t];const r=[];return i.push(e),o.push(r),r.push(...e.map(e=>Array.isArray(e)?s(e):n(e)?a(e):e)),r},a=e=>{const u=i.indexOf(e);if(-1!==u)return o[u];const c={},l=Object.keys(e).sort(t.compare);i.push(e),o.push(c);for(const t of l){const i=e[t];r&&Array.isArray(i)?c[t]=s(i):c[t]=r&&n(i)?a(i):i}return c};return a(e)}},function(e,t,r){"use strict";e.exports=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=new(0,r(2).Key)("api");e.exports=e=>({async get(){const t=await e.get(i);return t&&t.toString()},set:async t=>e.put(i,n.from(t.toString())),delete:async()=>e.delete(i)})},function(e,t,r){"use strict";function n(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){return new s(e)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}function u(e,t){var r={},n=!1;function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return"function"==typeof Symbol&&Symbol.iterator&&(r[Symbol.iterator]=function(){return this}),r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)};const c=r(112),l=c.ShardingDatastore,f=r(118),{cidToKey:h,keyToCid:p}=r(49),d=r(135),y=r(136);function b(e){try{return 0===e.version?e.toV1():e.toV0()}catch(t){return null}}e.exports=async(e,t)=>function(e){return{query:(t,r)=>n((function*(){yield*u(a(e.query(t,r)),o)}))(),async get(t,r){const n=h(t);let i;try{return i=await e.get(n,r),new f(i,t)}catch(o){if("ERR_NOT_FOUND"===o.code){const i=b(t);if(!i)throw o;const s=h(i),a=await e.get(s,r);return await e.put(n,a),new f(a,t)}throw o}},getMany(e,t){var r=this;return n((function*(){var n,i=!0,s=!1;try{for(var u,c,l=a(e);i=(u=yield o(l.next())).done,c=yield o(u.value),!i;i=!0){const e=c;yield r.get(e,t)}}catch(f){s=!0,n=f}finally{try{i||null==l.return||(yield o(l.return()))}finally{if(s)throw n}}}))()},async put(t,r){if(!f.isBlock(t))throw new Error("invalid block");return await this.has(t.cid)?this.get(t.cid,r):(await e.put(h(t.cid),t.data,r),t)},putMany:(t,r)=>n((function*(){yield*u(a(y(t,e=>d(e,e=>({key:h(e.cid),value:e.data})),t=>e.putMany(t,r),e=>d(e,({key:e,value:t})=>new f(t,p(e))))),o)}))(),async has(t,r){const n=await e.has(h(t),r);if(n)return n;const i=b(t);return!!i&&e.has(h(i),r)},delete:async(t,r)=>e.delete(h(t),r),deleteMany:(t,r)=>n((function*(){yield*u(a(e.deleteMany(n((function*(){var e,r=!0,n=!1;try{for(var i,s,u=a(t);r=(i=yield o(u.next())).done,s=yield o(i.value),!r;r=!0){const e=s;yield h(e)}}catch(c){n=!0,e=c}finally{try{r||null==u.return||(yield o(u.return()))}finally{if(n)throw e}}}))(),r)),o)}))(),close:async()=>e.close()}}(await function(e,t){if(t.sharding){const t=new c.shard.NextToLast(2);return l.createOrOpen(e,t)}return e}(e,t))},function(e,t,r){"use strict";const n=r(11),i=r(113),o=r(115),s=r(116),a=r(117),u=r(44);t.KeytransformDatastore=n,t.ShardingDatastore=i,t.MountDatastore=o,t.TieredDatastore=s,t.NamespaceDatastore=a,t.shard=u},function(e,t,r){"use strict";const{Buffer:n}=r(0),{Adapter:i,Key:o}=r(2),s=r(44),a=r(11),u=new o(s.SHARDING_FN),c=new o(s.README_FN);class l extends i{constructor(e,t){super(),this.child=new a(e,{convert:this._convertKey.bind(this),invert:this._invertKey.bind(this)}),this.shard=t}open(){return this.child.open()}_convertKey(e){const t=e.toString();return t===u.toString()||t===c.toString()?e:new o(this.shard.fun(t)).child(e)}_invertKey(e){const t=e.toString();return t===u.toString()||t===c.toString()?e:o.withNamespaces(e.list().slice(1))}static async createOrOpen(e,t){try{await l.create(e,t)}catch(r){if(r&&"datastore exists"!==r.message)throw r}return l.open(e)}static async open(e){const t=await s.readShardFun("/",e);return new l(e,t)}static async create(e,t){if(!await e.has(u)){const r="function"==typeof e.putRaw?e.putRaw.bind(e):e.put.bind(e);return Promise.all([r(u,n.from(t.toString()+"\n")),r(c,n.from(s.readme))])}const r=(await s.readShardFun("/",e)||"").toString(),i=t.toString();if(r!==i)throw new Error("specified fun ".concat(i," does not match repo shard fun ").concat(r));throw new Error("datastore exists")}put(e,t,r){return this.child.put(e,t,r)}get(e,t){return this.child.get(e,t)}has(e,t){return this.child.has(e,t)}delete(e,t){return this.child.delete(e,t)}batch(){return this.child.batch()}query(e,t){const r={keysOnly:e.keysOnly,offset:e.offset,limit:e.limit,filters:[e=>e.key.toString()!==u.toString(),e=>e.key.toString()!==c.toString()]};if(null!=e.prefix&&r.filters.push(t=>this._invertKey(t.key).toString().startsWith(e.prefix)),null!=e.filters){const t=e.filters.map(e=>t=>e(Object.assign({},t,{key:this._invertKey(t.key)})));r.filters=r.filters.concat(t)}return null!=e.orders&&(r.orders=e.orders.map(e=>async t=>{t.forEach(e=>{e.key=this._invertKey(e.key)});const r=await e(t);return r.forEach(e=>{e.key=this._convertKey(e.key)}),r})),this.child.query(r,t)}close(){return this.child.close()}}e.exports=l},function(e,t,r){"use strict";e.exports="This is a repository of IPLD objects. Each IPLD object is in a single file,\nnamed <base32 encoding of cid>.data. Where <base32 encoding of cid> is the\n\"base32\" encoding of the CID (as specified in\nhttps://github.com/multiformats/multibase) without the 'B' prefix.\nAll the object files are placed in a tree of directories, based on a\nfunction of the CID. This is a form of sharding similar to\nthe objects directory in git repositories. Previously, we used\nprefixes, we now use the next-to-last two charters.\n func NextToLast(base32cid string) {\n nextToLastLen := 2\n offset := len(base32cid) - nextToLastLen - 1\n return str[offset : offset+nextToLastLen]\n }\nFor example, an object with a base58 CIDv1 of\n zb2rhYSxw4ZjuzgCnWSt19Q94ERaeFhu9uSqRgjSdx9bsgM6f\nhas a base32 CIDv1 of\n BAFKREIA22FLID5AJ2KU7URG47MDLROZIH6YF2KALU2PWEFPVI37YLKRSCA\nand will be placed at\n SC/AFKREIA22FLID5AJ2KU7URG47MDLROZIH6YF2KALU2PWEFPVI37YLKRSCA.data\nwith 'SC' being the last-to-next two characters and the 'B' at the\nbeginning of the CIDv1 string is the multibase prefix that is not\nstored in the filename.\n"},function(e,t,r){"use strict";function n(e){return new o(e)}function i(e){var t,r;function n(t,r){try{var s=e[t](r),a=s.value,u=a instanceof o;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(s.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){this.wrapped=e}function s(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)};const{Adapter:a,Key:u,Errors:c,utils:{filter:l,take:f,sortAll:h,replaceStartWith:p}}=r(2),d=r(11);e.exports=class extends a{constructor(e){super(),this.mounts=e.slice()}open(){return Promise.all(this.mounts.map(e=>e.datastore.open()))}_lookup(e){for(const t of this.mounts)if(t.prefix.toString()===e.toString()||t.prefix.isAncestorOf(e)){const r=p(e.toString(),t.prefix.toString());return{datastore:t.datastore,mountpoint:t.prefix,rest:new u(r)}}}put(e,t,r){const n=this._lookup(e);if(null==n)throw c.dbWriteFailedError(new Error("No datastore mounted for this key"));return n.datastore.put(n.rest,t,r)}get(e,t){const r=this._lookup(e);if(null==r)throw c.notFoundError(new Error("No datastore mounted for this key"));return r.datastore.get(r.rest,t)}has(e,t){const r=this._lookup(e);return null!=r&&r.datastore.has(r.rest,t)}delete(e,t){const r=this._lookup(e);if(null==r)throw c.dbDeleteFailedError(new Error("No datastore mounted for this key"));return r.datastore.delete(r.rest,t)}close(){return Promise.all(this.mounts.map(e=>e.datastore.close()))}batch(){const e={},t=t=>{const r=this._lookup(t);if(null==r)throw new Error("No datastore mounted for this key");const n=r.mountpoint.toString();return null==e[n]&&(e[n]=r.datastore.batch()),{batch:e[n],rest:r.rest}};return{put:(e,r)=>{const n=t(e);n.batch.put(n.rest,r)},delete:e=>{const r=t(e);r.batch.delete(r.rest)},commit:t=>Promise.all(Object.keys(e).map(r=>e[r].commit(t)))}}query(e,t){const r=this.mounts.map(r=>{const n=new d(r.datastore,{convert:e=>{throw new Error("should never be called")},invert:e=>r.prefix.child(e)});let i;return null!=e.prefix&&(i=p(e.prefix,r.prefix.toString())),n.query({prefix:i,filters:e.filters,keysOnly:e.keysOnly},t)});let o=(a=r,(u=function*(){for(let l=0;l<a.length;l++){var e,t=!0,r=!1;try{for(var i,o,u=s(a[l]);t=(i=yield n(u.next())).done,o=yield n(i.value),!t;t=!0){const e=o;yield e}}catch(c){r=!0,e=c}finally{try{t||null==u.return||(yield n(u.return()))}finally{if(r)throw e}}}},function(){return new i(u.apply(this,arguments))})());var a,u;if(e.filters&&e.filters.forEach(e=>{o=l(o,e)}),e.orders&&e.orders.forEach(e=>{o=h(o,e)}),null!=e.offset){let t=0;o=l(o,()=>t++>=e.offset)}return null!=e.limit&&(o=f(o,e.limit)),o}}},function(e,t,r){"use strict";const{Adapter:n,Errors:i}=r(2),o=r(5)("datastore:core:tiered");e.exports=class extends n{constructor(e){super(),this.stores=e.slice()}async open(){try{await Promise.all(this.stores.map(e=>e.open()))}catch(e){throw i.dbOpenFailedError()}}async put(e,t){try{await Promise.all(this.stores.map(r=>r.put(e,t)))}catch(r){throw i.dbWriteFailedError()}}async get(e,t){for(const n of this.stores)try{const r=await n.get(e,t);if(r)return r}catch(r){o(r)}throw i.notFoundError()}async has(e,t){for(const r of this.stores)if(await r.has(e,t))return!0;return!1}async delete(e,t){try{await Promise.all(this.stores.map(r=>r.delete(e,t)))}catch(r){throw i.dbDeleteFailedError()}}async close(){await Promise.all(this.stores.map(e=>e.close()))}batch(){const e=this.stores.map(e=>e.batch());return{put:(t,r)=>{e.forEach(e=>e.put(t,r))},delete:t=>{e.forEach(e=>e.delete(t))},commit:async t=>{for(const r of e)await r.commit(t)}}}query(e,t){return this.stores[this.stores.length-1].query(e,t)}}},function(e,t,r){"use strict";const n=r(2).Key,i=r(11);e.exports=class extends i{constructor(e,t){super(e,{convert:e=>t.child(e),invert(e){if("/"===t.toString())return e;if(!t.isAncestorOf(e))throw new Error("Expected prefix: (".concat(t.toString(),") in key: ").concat(e.toString()));return new n(e.toString().slice(t.toString().length),!1)}}),this.prefix=t}query(e){return e.prefix&&"/"!==this.prefix.toString()?super.query(Object.assign({},e,{prefix:this.prefix.child(new n(e.prefix)).toString()})):super.query(e)}}},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(45),o=r(9);e.exports=o(class{constructor(e,t){if(!e||!n.isBuffer(e))throw new Error("first argument must be a buffer");if(!t||!i.isCID(t))throw new Error("second argument must be a CID");this._data=e,this._cid=t}get data(){return this._data}set data(e){throw new Error("Tried to change an immutable block")}get cid(){return this._cid}set cid(e){throw new Error("Tried to change an immutable block")}},{className:"Block",symbolName:"@ipld/js-ipld-block/block"})},function(e,t,r){"use strict";const n=r(120),i=r(121),o=r(122),s=r(123),a=r(124),u=[["base1","1","","1"],["base2","0",i,"01"],["base8","7",i,"01234567"],["base10","9",i,"0123456789"],["base16","f",o,"0123456789abcdef"],["base32","b",s,"abcdefghijklmnopqrstuvwxyz234567"],["base32pad","c",s,"abcdefghijklmnopqrstuvwxyz234567="],["base32hex","v",s,"0123456789abcdefghijklmnopqrstuv"],["base32hexpad","t",s,"0123456789abcdefghijklmnopqrstuv="],["base32z","h",s,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",i,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",i,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",a,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",a,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",a,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",a,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],c=u.reduce((e,t)=>(e[t[0]]=new n(t[0],t[1],t[2],t[3]),e),{}),l=u.reduce((e,t)=>(e[t[1]]=c[t[0]],e),{});e.exports={names:c,codes:l}},function(e,t,r){"use strict";e.exports=class{constructor(e,t,r,n){this.name=e,this.code=t,this.alphabet=n,r&&n&&(this.engine=r(n))}encode(e){return this.engine.encode(e)}decode(e){return this.engine.decode(e)}isImplemented(){return this.engine}}},function(e,t,r){"use strict";var n=r(47).Buffer;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 i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==t[s])throw new TypeError(o+" is ambiguous");t[s]=i}var a=e.length,u=e.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);var r=0;if(" "!==e[r]){for(var i=0,o=0;e[r]===u;)i++,r++;for(var s=(e.length-r)*c+1>>>0,l=new Uint8Array(s);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var h=0,p=s-1;(0!==f||h<o)&&-1!==p;p--,h++)f+=a*l[p]>>>0,l[p]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=h,r++}if(" "!==e[r]){for(var d=s-o;d!==s&&0===l[d];)d++;var y=n.allocUnsafe(i+(s-d));y.fill(0,0,i);for(var b=i;d!==s;)y[b++]=l[d++];return y}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var c=(s-o)*l+1>>>0,f=new Uint8Array(c);o!==s;){for(var h=t[o],p=0,d=c-1;(0!==h||p<i)&&-1!==d;d--,p++)h+=256*f[d]>>>0,f[d]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");i=p,o++}for(var y=c-i;y!==c&&0===f[y];)y++;for(var b=u.repeat(r);y<c;++y)b+=e.charAt(f[y]);return b},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},function(e,t,r){"use strict";const{Buffer:n}=r(0);e.exports=function(e){return{encode:e=>"string"==typeof e?n.from(e).toString("hex"):e.toString("hex"),decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base16 character");return n.from(t,"hex")}}}},function(e,t,r){"use strict";function n(e,t){const r=e.byteLength,n=new Uint8Array(e),i=t.indexOf("=")===t.length-1;i&&(t=t.substring(0,t.length-1));let o=0,s=0,a="";for(let u=0;u<r;u++)for(s=s<<8|n[u],o+=8;o>=5;)a+=t[s>>>o-5&31],o-=5;if(o>0&&(a+=t[s<<5-o&31]),i)for(;a.length%8!=0;)a+="=";return a}e.exports=function(e){return{encode:t=>n("string"==typeof t?Uint8Array.from(t):t,e),decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base32 character");return function(e,t){const r=(e=e.replace(new RegExp("=","g"),"")).length;let n=0,i=0,o=0;const s=new Uint8Array(5*r/8|0);for(let a=0;a<r;a++)i=i<<5|t.indexOf(e[a]),n+=5,n>=8&&(s[o++]=i>>>n-8&255,n-=8);return s.buffer}(t,e)}}}},function(e,t,r){"use strict";const{Buffer:n}=r(0);e.exports=function(e){const t=e.indexOf("=")>-1,r=e.indexOf("-")>-1&&e.indexOf("_")>-1;return{encode(e){let i="";i="string"==typeof e?n.from(e).toString("base64"):e.toString("base64"),r&&(i=i.replace(/\+/g,"-").replace(/\//g,"_"));const o=i.indexOf("=");return o>0&&!t&&(i=i.substring(0,o)),i},decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base64 character");return n.from(t,"base64")}}}},function(e,t,r){"use strict";e.exports=function e(t,r,i){r=r||[];var o=i=i||0;for(;t>=n;)r[i++]=255&t|128,t/=128;for(;-128&t;)r[i++]=255&t|128,t>>>=7;return r[i]=0|t,e.bytes=i-o+1,r};var n=Math.pow(2,31)},function(e,t,r){"use strict";e.exports=function e(t,r){var n,i=0,o=0,s=r=r||0,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=s-r,i}},function(e,t,r){"use strict";var n=Math.pow(2,7),i=Math.pow(2,14),o=Math.pow(2,21),s=Math.pow(2,28),a=Math.pow(2,35),u=Math.pow(2,42),c=Math.pow(2,49),l=Math.pow(2,56),f=Math.pow(2,63);e.exports=function(e){return e<n?1:e<i?2:e<o?3:e<s?4:e<a?5:e<u?6:e<c?7:e<l?8:e<f?9:10}},function(e,t,r){"use strict";t.names=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"dbl-sha2-256":86,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"Skein256-8":45825,"Skein256-16":45826,"Skein256-24":45827,"Skein256-32":45828,"Skein256-40":45829,"Skein256-48":45830,"Skein256-56":45831,"Skein256-64":45832,"Skein256-72":45833,"Skein256-80":45834,"Skein256-88":45835,"Skein256-96":45836,"Skein256-104":45837,"Skein256-112":45838,"Skein256-120":45839,"Skein256-128":45840,"Skein256-136":45841,"Skein256-144":45842,"Skein256-152":45843,"Skein256-160":45844,"Skein256-168":45845,"Skein256-176":45846,"Skein256-184":45847,"Skein256-192":45848,"Skein256-200":45849,"Skein256-208":45850,"Skein256-216":45851,"Skein256-224":45852,"Skein256-232":45853,"Skein256-240":45854,"Skein256-248":45855,"Skein256-256":45856,"Skein512-8":45857,"Skein512-16":45858,"Skein512-24":45859,"Skein512-32":45860,"Skein512-40":45861,"Skein512-48":45862,"Skein512-56":45863,"Skein512-64":45864,"Skein512-72":45865,"Skein512-80":45866,"Skein512-88":45867,"Skein512-96":45868,"Skein512-104":45869,"Skein512-112":45870,"Skein512-120":45871,"Skein512-128":45872,"Skein512-136":45873,"Skein512-144":45874,"Skein512-152":45875,"Skein512-160":45876,"Skein512-168":45877,"Skein512-176":45878,"Skein512-184":45879,"Skein512-192":45880,"Skein512-200":45881,"Skein512-208":45882,"Skein512-216":45883,"Skein512-224":45884,"Skein512-232":45885,"Skein512-240":45886,"Skein512-248":45887,"Skein512-256":45888,"Skein512-264":45889,"Skein512-272":45890,"Skein512-280":45891,"Skein512-288":45892,"Skein512-296":45893,"Skein512-304":45894,"Skein512-312":45895,"Skein512-320":45896,"Skein512-328":45897,"Skein512-336":45898,"Skein512-344":45899,"Skein512-352":45900,"Skein512-360":45901,"Skein512-368":45902,"Skein512-376":45903,"Skein512-384":45904,"Skein512-392":45905,"Skein512-400":45906,"Skein512-408":45907,"Skein512-416":45908,"Skein512-424":45909,"Skein512-432":45910,"Skein512-440":45911,"Skein512-448":45912,"Skein512-456":45913,"Skein512-464":45914,"Skein512-472":45915,"Skein512-480":45916,"Skein512-488":45917,"Skein512-496":45918,"Skein512-504":45919,"Skein512-512":45920,"Skein1024-8":45921,"Skein1024-16":45922,"Skein1024-24":45923,"Skein1024-32":45924,"Skein1024-40":45925,"Skein1024-48":45926,"Skein1024-56":45927,"Skein1024-64":45928,"Skein1024-72":45929,"Skein1024-80":45930,"Skein1024-88":45931,"Skein1024-96":45932,"Skein1024-104":45933,"Skein1024-112":45934,"Skein1024-120":45935,"Skein1024-128":45936,"Skein1024-136":45937,"Skein1024-144":45938,"Skein1024-152":45939,"Skein1024-160":45940,"Skein1024-168":45941,"Skein1024-176":45942,"Skein1024-184":45943,"Skein1024-192":45944,"Skein1024-200":45945,"Skein1024-208":45946,"Skein1024-216":45947,"Skein1024-224":45948,"Skein1024-232":45949,"Skein1024-240":45950,"Skein1024-248":45951,"Skein1024-256":45952,"Skein1024-264":45953,"Skein1024-272":45954,"Skein1024-280":45955,"Skein1024-288":45956,"Skein1024-296":45957,"Skein1024-304":45958,"Skein1024-312":45959,"Skein1024-320":45960,"Skein1024-328":45961,"Skein1024-336":45962,"Skein1024-344":45963,"Skein1024-352":45964,"Skein1024-360":45965,"Skein1024-368":45966,"Skein1024-376":45967,"Skein1024-384":45968,"Skein1024-392":45969,"Skein1024-400":45970,"Skein1024-408":45971,"Skein1024-416":45972,"Skein1024-424":45973,"Skein1024-432":45974,"Skein1024-440":45975,"Skein1024-448":45976,"Skein1024-456":45977,"Skein1024-464":45978,"Skein1024-472":45979,"Skein1024-480":45980,"Skein1024-488":45981,"Skein1024-496":45982,"Skein1024-504":45983,"Skein1024-512":45984,"Skein1024-520":45985,"Skein1024-528":45986,"Skein1024-536":45987,"Skein1024-544":45988,"Skein1024-552":45989,"Skein1024-560":45990,"Skein1024-568":45991,"Skein1024-576":45992,"Skein1024-584":45993,"Skein1024-592":45994,"Skein1024-600":45995,"Skein1024-608":45996,"Skein1024-616":45997,"Skein1024-624":45998,"Skein1024-632":45999,"Skein1024-640":46e3,"Skein1024-648":46001,"Skein1024-656":46002,"Skein1024-664":46003,"Skein1024-672":46004,"Skein1024-680":46005,"Skein1024-688":46006,"Skein1024-696":46007,"Skein1024-704":46008,"Skein1024-712":46009,"Skein1024-720":46010,"Skein1024-728":46011,"Skein1024-736":46012,"Skein1024-744":46013,"Skein1024-752":46014,"Skein1024-760":46015,"Skein1024-768":46016,"Skein1024-776":46017,"Skein1024-784":46018,"Skein1024-792":46019,"Skein1024-800":46020,"Skein1024-808":46021,"Skein1024-816":46022,"Skein1024-824":46023,"Skein1024-832":46024,"Skein1024-840":46025,"Skein1024-848":46026,"Skein1024-856":46027,"Skein1024-864":46028,"Skein1024-872":46029,"Skein1024-880":46030,"Skein1024-888":46031,"Skein1024-896":46032,"Skein1024-904":46033,"Skein1024-912":46034,"Skein1024-920":46035,"Skein1024-928":46036,"Skein1024-936":46037,"Skein1024-944":46038,"Skein1024-952":46039,"Skein1024-960":46040,"Skein1024-968":46041,"Skein1024-976":46042,"Skein1024-984":46043,"Skein1024-992":46044,"Skein1024-1000":46045,"Skein1024-1008":46046,"Skein1024-1016":46047,"Skein1024-1024":46048}),t.codes=Object.freeze({0:"identity",17:"sha1",18:"sha2-256",19:"sha2-512",86:"dbl-sha2-256",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256",45825:"Skein256-8",45826:"Skein256-16",45827:"Skein256-24",45828:"Skein256-32",45829:"Skein256-40",45830:"Skein256-48",45831:"Skein256-56",45832:"Skein256-64",45833:"Skein256-72",45834:"Skein256-80",45835:"Skein256-88",45836:"Skein256-96",45837:"Skein256-104",45838:"Skein256-112",45839:"Skein256-120",45840:"Skein256-128",45841:"Skein256-136",45842:"Skein256-144",45843:"Skein256-152",45844:"Skein256-160",45845:"Skein256-168",45846:"Skein256-176",45847:"Skein256-184",45848:"Skein256-192",45849:"Skein256-200",45850:"Skein256-208",45851:"Skein256-216",45852:"Skein256-224",45853:"Skein256-232",45854:"Skein256-240",45855:"Skein256-248",45856:"Skein256-256",45857:"Skein512-8",45858:"Skein512-16",45859:"Skein512-24",45860:"Skein512-32",45861:"Skein512-40",45862:"Skein512-48",45863:"Skein512-56",45864:"Skein512-64",45865:"Skein512-72",45866:"Skein512-80",45867:"Skein512-88",45868:"Skein512-96",45869:"Skein512-104",45870:"Skein512-112",45871:"Skein512-120",45872:"Skein512-128",45873:"Skein512-136",45874:"Skein512-144",45875:"Skein512-152",45876:"Skein512-160",45877:"Skein512-168",45878:"Skein512-176",45879:"Skein512-184",45880:"Skein512-192",45881:"Skein512-200",45882:"Skein512-208",45883:"Skein512-216",45884:"Skein512-224",45885:"Skein512-232",45886:"Skein512-240",45887:"Skein512-248",45888:"Skein512-256",45889:"Skein512-264",45890:"Skein512-272",45891:"Skein512-280",45892:"Skein512-288",45893:"Skein512-296",45894:"Skein512-304",45895:"Skein512-312",45896:"Skein512-320",45897:"Skein512-328",45898:"Skein512-336",45899:"Skein512-344",45900:"Skein512-352",45901:"Skein512-360",45902:"Skein512-368",45903:"Skein512-376",45904:"Skein512-384",45905:"Skein512-392",45906:"Skein512-400",45907:"Skein512-408",45908:"Skein512-416",45909:"Skein512-424",45910:"Skein512-432",45911:"Skein512-440",45912:"Skein512-448",45913:"Skein512-456",45914:"Skein512-464",45915:"Skein512-472",45916:"Skein512-480",45917:"Skein512-488",45918:"Skein512-496",45919:"Skein512-504",45920:"Skein512-512",45921:"Skein1024-8",45922:"Skein1024-16",45923:"Skein1024-24",45924:"Skein1024-32",45925:"Skein1024-40",45926:"Skein1024-48",45927:"Skein1024-56",45928:"Skein1024-64",45929:"Skein1024-72",45930:"Skein1024-80",45931:"Skein1024-88",45932:"Skein1024-96",45933:"Skein1024-104",45934:"Skein1024-112",45935:"Skein1024-120",45936:"Skein1024-128",45937:"Skein1024-136",45938:"Skein1024-144",45939:"Skein1024-152",45940:"Skein1024-160",45941:"Skein1024-168",45942:"Skein1024-176",45943:"Skein1024-184",45944:"Skein1024-192",45945:"Skein1024-200",45946:"Skein1024-208",45947:"Skein1024-216",45948:"Skein1024-224",45949:"Skein1024-232",45950:"Skein1024-240",45951:"Skein1024-248",45952:"Skein1024-256",45953:"Skein1024-264",45954:"Skein1024-272",45955:"Skein1024-280",45956:"Skein1024-288",45957:"Skein1024-296",45958:"Skein1024-304",45959:"Skein1024-312",45960:"Skein1024-320",45961:"Skein1024-328",45962:"Skein1024-336",45963:"Skein1024-344",45964:"Skein1024-352",45965:"Skein1024-360",45966:"Skein1024-368",45967:"Skein1024-376",45968:"Skein1024-384",45969:"Skein1024-392",45970:"Skein1024-400",45971:"Skein1024-408",45972:"Skein1024-416",45973:"Skein1024-424",45974:"Skein1024-432",45975:"Skein1024-440",45976:"Skein1024-448",45977:"Skein1024-456",45978:"Skein1024-464",45979:"Skein1024-472",45980:"Skein1024-480",45981:"Skein1024-488",45982:"Skein1024-496",45983:"Skein1024-504",45984:"Skein1024-512",45985:"Skein1024-520",45986:"Skein1024-528",45987:"Skein1024-536",45988:"Skein1024-544",45989:"Skein1024-552",45990:"Skein1024-560",45991:"Skein1024-568",45992:"Skein1024-576",45993:"Skein1024-584",45994:"Skein1024-592",45995:"Skein1024-600",45996:"Skein1024-608",45997:"Skein1024-616",45998:"Skein1024-624",45999:"Skein1024-632",46e3:"Skein1024-640",46001:"Skein1024-648",46002:"Skein1024-656",46003:"Skein1024-664",46004:"Skein1024-672",46005:"Skein1024-680",46006:"Skein1024-688",46007:"Skein1024-696",46008:"Skein1024-704",46009:"Skein1024-712",46010:"Skein1024-720",46011:"Skein1024-728",46012:"Skein1024-736",46013:"Skein1024-744",46014:"Skein1024-752",46015:"Skein1024-760",46016:"Skein1024-768",46017:"Skein1024-776",46018:"Skein1024-784",46019:"Skein1024-792",46020:"Skein1024-800",46021:"Skein1024-808",46022:"Skein1024-816",46023:"Skein1024-824",46024:"Skein1024-832",46025:"Skein1024-840",46026:"Skein1024-848",46027:"Skein1024-856",46028:"Skein1024-864",46029:"Skein1024-872",46030:"Skein1024-880",46031:"Skein1024-888",46032:"Skein1024-896",46033:"Skein1024-904",46034:"Skein1024-912",46035:"Skein1024-920",46036:"Skein1024-928",46037:"Skein1024-936",46038:"Skein1024-944",46039:"Skein1024-952",46040:"Skein1024-960",46041:"Skein1024-968",46042:"Skein1024-976",46043:"Skein1024-984",46044:"Skein1024-992",46045:"Skein1024-1000",46046:"Skein1024-1008",46047:"Skein1024-1016",46048:"Skein1024-1024"}),t.defaultLengths=Object.freeze({17:20,18:32,19:64,86:32,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32,45825:1,45826:2,45827:3,45828:4,45829:5,45830:6,45831:7,45832:8,45833:9,45834:10,45835:11,45836:12,45837:13,45838:14,45839:15,45840:16,45841:17,45842:18,45843:19,45844:20,45845:21,45846:22,45847:23,45848:24,45849:25,45850:26,45851:27,45852:28,45853:29,45854:30,45855:31,45856:32,45857:1,45858:2,45859:3,45860:4,45861:5,45862:6,45863:7,45864:8,45865:9,45866:10,45867:11,45868:12,45869:13,45870:14,45871:15,45872:16,45873:17,45874:18,45875:19,45876:20,45877:21,45878:22,45879:23,45880:24,45881:25,45882:26,45883:27,45884:28,45885:29,45886:30,45887:31,45888:32,45889:33,45890:34,45891:35,45892:36,45893:37,45894:38,45895:39,45896:40,45897:41,45898:42,45899:43,45900:44,45901:45,45902:46,45903:47,45904:48,45905:49,45906:50,45907:51,45908:52,45909:53,45910:54,45911:55,45912:56,45913:57,45914:58,45915:59,45916:60,45917:61,45918:62,45919:63,45920:64,45921:1,45922:2,45923:3,45924:4,45925:5,45926:6,45927:7,45928:8,45929:9,45930:10,45931:11,45932:12,45933:13,45934:14,45935:15,45936:16,45937:17,45938:18,45939:19,45940:20,45941:21,45942:22,45943:23,45944:24,45945:25,45946:26,45947:27,45948:28,45949:29,45950:30,45951:31,45952:32,45953:33,45954:34,45955:35,45956:36,45957:37,45958:38,45959:39,45960:40,45961:41,45962:42,45963:43,45964:44,45965:45,45966:46,45967:47,45968:48,45969:49,45970:50,45971:51,45972:52,45973:53,45974:54,45975:55,45976:56,45977:57,45978:58,45979:59,45980:60,45981:61,45982:62,45983:63,45984:64,45985:65,45986:66,45987:67,45988:68,45989:69,45990:70,45991:71,45992:72,45993:73,45994:74,45995:75,45996:76,45997:77,45998:78,45999:79,46e3:80,46001:81,46002:82,46003:83,46004:84,46005:85,46006:86,46007:87,46008:88,46009:89,46010:90,46011:91,46012:92,46013:93,46014:94,46015:95,46016:96,46017:97,46018:98,46019:99,46020:100,46021:101,46022:102,46023:103,46024:104,46025:105,46026:106,46027:107,46028:108,46029:109,46030:110,46031:111,46032:112,46033:113,46034:114,46035:115,46036:116,46037:117,46038:118,46039:119,46040:120,46041:121,46042:122,46043:123,46044:124,46045:125,46046:126,46047:127,46048:128})},function(e,t,r){"use strict";const{Buffer:n}=r(0),i=r(18),o=r(130),s=r(131),a=r(48);(t=e.exports).addPrefix=(e,t)=>{let r;if(n.isBuffer(e))r=a.varintBufferEncode(e);else{if(!s[e])throw new Error("multicodec not recognized");r=s[e]}return n.concat([r,t])},t.rmPrefix=e=>(i.decode(e),e.slice(i.decode.bytes)),t.getCodec=e=>{const t=i.decode(e),r=o.get(t);if(void 0===r)throw new Error("Code ".concat(t," not found"));return r},t.getName=e=>o.get(e),t.getNumber=e=>{const t=s[e];if(void 0===t)throw new Error("Codec `"+e+"` not found");return a.varintBufferDecode(t)[0]},t.getCode=e=>i.decode(e),t.getCodeVarint=e=>{const t=s[e];if(void 0===t)throw new Error("Codec `"+e+"` not found");return t},t.getVarint=e=>i.encode(e);const u=r(132);Object.assign(t,u),t.print=r(133)},function(e,t,r){"use strict";const n=r(10),i=new Map;for(const o in n){const e=n[o];i.set(e,o)}e.exports=Object.freeze(i)},function(e,t,r){"use strict";const n=r(10),i=r(48).varintEncode,o={};for(const s in n){const e=n[s];o[s]=i(e)}e.exports=Object.freeze(o)},function(e,t,r){"use strict";const n=r(10),i={};for(const[o,s]of Object.entries(n))i[o.toUpperCase().replace(/-/g,"_")]=s;e.exports=Object.freeze(i)},function(e,t,r){"use strict";const n=r(10),i={};for(const[o,s]of Object.entries(n))void 0===i[s]&&(i[s]=o);e.exports=Object.freeze(i)},function(e,t,r){"use strict";const n=r(46),{Buffer:i}=r(0);var o={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(!i.isBuffer(e.multihash))return"multihash must be a Buffer";try{n.validate(e.multihash)}catch(t){let e=t.message;return e||(e="Multihash validation failed"),e}}};e.exports=o},function(e,t,r){"use strict";function n(e){return new o(e)}function i(e){var t,r;function n(t,r){try{var s=e[t](r),a=s.value,u=a instanceof o;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(s.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(c){i("throw",c)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){this.wrapped=e}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)};const s=function(){var e,t=(e=function*(e,t){var r,i=!0,o=!1;try{for(var s,a,u=function(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}(e);i=(s=yield n(u.next())).done,a=yield n(s.value),!i;i=!0){const e=a;yield t(e)}}catch(c){o=!0,r=c}finally{try{i||null==u.return||(yield n(u.return()))}finally{if(o)throw r}}},function(){return new i(e.apply(this,arguments))});return function(e,r){return t.apply(this,arguments)}}();e.exports=s},function(e,t,r){"use strict";const n=(...e)=>{let t;for(;e.length;)t=e.shift()(t);return t},i=e=>e&&("function"==typeof e[Symbol.asyncIterator]||"function"==typeof e[Symbol.iterator]||"function"==typeof e.next),o=e=>e&&"function"==typeof e.sink&&i(e.source),s=e=>t=>(e.sink(t),e.source),a=(...e)=>{if(o(e[0])){const t=e[0];e[0]=()=>t.source}else if(i(e[0])){const t=e[0];e[0]=()=>t}if(e.length>1&&o(e[e.length-1])&&(e[e.length-1]=e[e.length-1].sink),e.length>2)for(let t=1;t<e.length-1;t++)o(e[t])&&(e[t]=s(e[t]));return n(...e)};e.exports=a,e.exports.pipe=a,e.exports.rawPipe=n,e.exports.isIterable=i,e.exports.isDuplex=o},function(e,t,r){"use strict";e.exports={lock:"memory",storageBackends:{root:r(12),blocks:r(12),keys:r(12),datastore:r(12)},storageBackendOptions:{root:{extension:"",prefix:"",version:2},blocks:{sharding:!1,prefix:"",version:2},keys:{sharding:!1,prefix:"",version:2},datastore:{sharding:!1,prefix:"",version:2}}}},function(e,t,r){"use strict";e.exports=r(139)(r(174))},function(e,t,r){"use strict";var n=r(140),i=r(170);e.exports=function(e){function t(t,o,s){return"function"==typeof t?s=t:"function"==typeof o&&(s=o),r(o)||(o=r(t)?t:{}),n(i(e(t,o),o),o,s)}function r(e){return"object"==typeof e&&null!==e}return["destroy","repair"].forEach((function(r){"function"==typeof e[r]&&(t[r]=function(){e[r].apply(e,arguments)})})),t.errors=n.errors,t}},function(e,t,r){"use strict";(function(t){var n=r(19).EventEmitter,i=r(50).inherits,o=r(13),s=r(142),a=r(152),u=r(164),c=r(24),l=r(20),f=r(168),h=r(61),p=r(14).getCallback,d=r(14).getOptions,y=c.WriteError,b=c.ReadError,g=c.NotFoundError,v=c.OpenError,k=c.InitializationError;function w(e,r,i){if(!(this instanceof w))return new w(e,r,i);var o,a=this;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof r&&(i=r,r={}),r=r||{},!e||"object"!=typeof e){if(o=new k("First argument must be an abstract-leveldown compliant store"),"function"==typeof i)return t.nextTick(i,o);throw o}f.strictEqual(typeof e.status,"string",".status required, old abstract-leveldown"),this.options=d(r),this._db=e,this.db=new s(e),this.open(i||function(e){e&&a.emit("error",e)}),this.supports=l(this.db.supports,{status:!1,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0}),Object.keys(this.supports.additionalMethods).forEach((function(e){null==this[e]&&(this[e]=function(){return this.db[e].apply(this.db,arguments)})}),this)}function m(e,r){if(!e._isOpening()&&!e.isOpen())return t.nextTick(r,new b("Database is not open")),!0}w.prototype.emit=n.prototype.emit,w.prototype.once=n.prototype.once,i(w,n),w.prototype.open=function(e,r){var n,i=this;return"function"==typeof e&&(r=e,e=null),r||(n=(r=h()).promise),e||(e=this.options),this.isOpen()?(t.nextTick(r,null,i),n):this._isOpening()?(this.once("open",(function(){r(null,i)})),n):(this.emit("opening"),this.db.open(e,(function(e){if(e)return r(new v(e));i.db=i._db,r(null,i),i.emit("open"),i.emit("ready")})),n)},w.prototype.close=function(e){var r,n=this;return e||(r=(e=h()).promise),this.isOpen()?(this.db.close((function(){n.emit("closed"),e.apply(null,arguments)})),this.emit("closing"),this.db=new s(this._db)):this.isClosed()?t.nextTick(e):"closing"===this.db.status?this.once("closed",e):this._isOpening()&&this.once("open",(function(){n.close(e)})),r},w.prototype.isOpen=function(){return"open"===this.db.status},w.prototype._isOpening=function(){return"opening"===this.db.status},w.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},w.prototype.get=function(e,t,r){var n;return(r=p(t,r))||(n=(r=h()).promise),m(this,r)||(t=d(t),this.db.get(e,t,(function(t,n){if(t)return t=/notfound/i.test(t)||t.notFound?new g("Key not found in database ["+e+"]",t):new b(t),r(t);r(null,n)}))),n},w.prototype.put=function(e,t,r,n){var i,o=this;return(n=p(r,n))||(i=(n=h()).promise),m(this,n)||(r=d(r),this.db.put(e,t,r,(function(r){if(r)return n(new y(r));o.emit("put",e,t),n()}))),i},w.prototype.del=function(e,t,r){var n,i=this;return(r=p(t,r))||(n=(r=h()).promise),m(this,r)||(t=d(t),this.db.del(e,t,(function(t){if(t)return r(new y(t));i.emit("del",e),r()}))),n},w.prototype.batch=function(e,t,r){if(!arguments.length)return new u(this);var n,i=this;return(r="function"==typeof e?e:p(t,r))||(n=(r=h()).promise),m(this,r)||(t=d(t),this.db.batch(e,t,(function(t){if(t)return r(new y(t));i.emit("batch",e),r()}))),n},w.prototype.iterator=function(e){return this.db.iterator(e)},w.prototype.clear=function(e,t){var r,n=this;return t=p(e,t),e=d(e),t||(r=(t=h()).promise),m(this,t)||this.db.clear(e,(function(r){if(r)return t(new y(r));n.emit("clear",e),t()})),r},w.prototype.readStream=w.prototype.createReadStream=function(e){return"number"!=typeof(e=o({keys:!0,values:!0},e)).limit&&(e.limit=-1),new a(this.db.iterator(e),e)},w.prototype.keyStream=w.prototype.createKeyStream=function(e){return this.createReadStream(o(e,{keys:!0,values:!1}))},w.prototype.valueStream=w.prototype.createValueStream=function(e){return this.createReadStream(o(e,{keys:!1,values:!0}))},w.prototype.toString=function(){return"LevelUP"},w.prototype.type="levelup",w.errors=c,e.exports=w.default=w}).call(this,r(1))},function(e,t,r){"use strict";e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,r){"use strict";var n=r(51).AbstractLevelDOWN,i=r(3),o=r(151),s="put get del batch clear".split(" "),a="approximateSize compactRange".split(" ");function u(e){n.call(this,e.supports||{}),a.forEach((function(t){"function"!=typeof e[t]||this.supports.additionalMethods[t]||(this.supports.additionalMethods[t]=!0)}),this),this._db=e,this._operations=[],c(this)}function c(e){s.forEach((function(t){e["_"+t]=function(){this._operations.push({method:t,args:arguments})}})),Object.keys(e.supports.additionalMethods).forEach((function(t){e[t]=function(){this._operations.push({method:t,args:arguments})}})),e._iterator=function(t){var r=new o(e,t);return this._operations.push({iterator:r}),r}}i(u,n),u.prototype.type="deferred-leveldown",u.prototype._open=function(e,t){var r=this;this._db.open(e,(function(e){if(e)return t(e);r._operations.forEach((function(e){e.iterator?e.iterator.setDb(r._db):r._db[e.method].apply(r._db,e.args)})),r._operations=[],function(e){s.concat("iterator").forEach((function(t){e["_"+t]=function(){return this._db[t].apply(this._db,arguments)}})),Object.keys(e.supports.additionalMethods).forEach((function(t){e[t]=function(){return this._db[t].apply(this._db,arguments)}}))}(r),t()}))},u.prototype._close=function(e){var t=this;this._db.close((function(r){if(r)return e(r);c(t),e()}))},u.prototype._serializeKey=function(e){return e},u.prototype._serializeValue=function(e){return e},e.exports=u,e.exports.DeferredIterator=o},function(e,t,r){"use strict";var n=r(13),i=r(20),o=r(0).Buffer,s=r(52),a=r(53),u=r(21),c=Object.prototype.hasOwnProperty,l="start end gt gte lt lte".split(" ");function f(e){this.status="new",this.supports=i(e,{status:!0})}function h(e,t){var r={};for(var n in t)if(c.call(t,n)){var i=t[n];p(n)&&(i=e._serializeKey(i)),r[n]=i}return r}function p(e){return-1!==l.indexOf(e)}f.prototype.open=function(e,t){var r=this,n=this.status;if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");"object"==typeof e&&null!==e||(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,(function(e){if(e)return r.status=n,t(e);r.status="open",t()}))},f.prototype._open=function(e,t){u(t)},f.prototype.close=function(e){var t=this,r=this.status;if("function"!=typeof e)throw new Error("close() requires a callback argument");this.status="closing",this._close((function(n){if(n)return t.status=r,e(n);t.status="closed",e()}))},f.prototype._close=function(e){u(e)},f.prototype.get=function(e,t,r){if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("get() requires a callback argument");var n=this._checkKey(e);if(n)return u(r,n);e=this._serializeKey(e),"object"==typeof t&&null!==t||(t={}),t.asBuffer=!1!==t.asBuffer,this._get(e,t,r)},f.prototype._get=function(e,t,r){u((function(){r(new Error("NotFound"))}))},f.prototype.put=function(e,t,r,n){if("function"==typeof r&&(n=r),"function"!=typeof n)throw new Error("put() requires a callback argument");var i=this._checkKey(e)||this._checkValue(t);if(i)return u(n,i);e=this._serializeKey(e),t=this._serializeValue(t),"object"==typeof r&&null!==r||(r={}),this._put(e,t,r,n)},f.prototype._put=function(e,t,r,n){u(n)},f.prototype.del=function(e,t,r){if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("del() requires a callback argument");var n=this._checkKey(e);if(n)return u(r,n);e=this._serializeKey(e),"object"==typeof t&&null!==t||(t={}),this._del(e,t,r)},f.prototype._del=function(e,t,r){u(r)},f.prototype.batch=function(e,t,r){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(r=t),"function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return u(r,new Error("batch(array) requires an array argument"));if(0===e.length)return u(r);"object"==typeof t&&null!==t||(t={});for(var i=new Array(e.length),o=0;o<e.length;o++){if("object"!=typeof e[o]||null===e[o])return u(r,new Error("batch(array) element must be an object and not `null`"));var s=n(e[o]);if("put"!==s.type&&"del"!==s.type)return u(r,new Error("`type` must be 'put' or 'del'"));var a=this._checkKey(s.key);if(a)return u(r,a);if(s.key=this._serializeKey(s.key),"put"===s.type){var c=this._checkValue(s.value);if(c)return u(r,c);s.value=this._serializeValue(s.value)}i[o]=s}this._batch(i,t,r)},f.prototype._batch=function(e,t,r){u(r)},f.prototype.clear=function(e,t){if("function"==typeof e)t=e;else if("function"!=typeof t)throw new Error("clear() requires a callback argument");(e=h(this,e)).reverse=!!e.reverse,e.limit="limit"in e?e.limit:-1,this._clear(e,t)},f.prototype._clear=function(e,t){e.keys=!0,e.values=!1,e.keyAsBuffer=!0,e.valueAsBuffer=!0;var r=this._iterator(e),n={},i=this;!function e(o){if(o)return r.end((function(){t(o)}));r.next((function(o,s){return o?e(o):void 0===s?r.end(t):void i._del(s,n,e)}))}()},f.prototype._setupIteratorOptions=function(e){return(e=h(this,e)).reverse=!!e.reverse,e.keys=!1!==e.keys,e.values=!1!==e.values,e.limit="limit"in e?e.limit:-1,e.keyAsBuffer=!1!==e.keyAsBuffer,e.valueAsBuffer=!1!==e.valueAsBuffer,e},f.prototype.iterator=function(e){return"object"==typeof e&&null!==e||(e={}),e=this._setupIteratorOptions(e),this._iterator(e)},f.prototype._iterator=function(e){return new s(this)},f.prototype._chainedBatch=function(){return new a(this)},f.prototype._serializeKey=function(e){return e},f.prototype._serializeValue=function(e){return e},f.prototype._checkKey=function(e){return null==e?new Error("key cannot be `null` or `undefined`"):o.isBuffer(e)&&0===e.length?new Error("key cannot be an empty Buffer"):""===e?new Error("key cannot be an empty String"):Array.isArray(e)&&0===e.length?new Error("key cannot be an empty Array"):void 0},f.prototype._checkValue=function(e){if(null==e)return new Error("value cannot be `null` or `undefined`")},f.prototype._nextTick=u,e.exports=f},function(e,t,r){"use strict";e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},function(e,t,r){"use strict";e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},function(e,t,r){"use strict";(function(e){t.test=function(){return void 0!==e&&!e.browser},t.install=function(t){return function(){e.nextTick(t)}}}).call(this,r(1))},function(e,t,r){"use strict";(function(e){var r=e.MutationObserver||e.WebKitMutationObserver;t.test=function(){return r},t.install=function(t){var n=0,i=new r(t),o=e.document.createTextNode("");return i.observe(o,{characterData:!0}),function(){o.data=n=++n%2}}}).call(this,r(4))},function(e,t,r){"use strict";(function(e){t.test=function(){return!e.setImmediate&&void 0!==e.MessageChannel},t.install=function(t){var r=new e.MessageChannel;return r.port1.onmessage=t,function(){r.port2.postMessage(0)}}}).call(this,r(4))},function(e,t,r){"use strict";(function(e){t.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},t.install=function(t){return function(){var r=e.document.createElement("script");return r.onreadystatechange=function(){t(),r.onreadystatechange=null,r.parentNode.removeChild(r),r=null},e.document.documentElement.appendChild(r),t}}}).call(this,r(4))},function(e,t,r){"use strict";t.test=function(){return!0},t.install=function(e){return function(){setTimeout(e,0)}}},function(e,t,r){"use strict";var n=r(51).AbstractIterator;function i(e,t){n.call(this,e),this._options=t,this._iterator=null,this._operations=[]}r(3)(i,n),i.prototype.setDb=function(e){var t=this._iterator=e.iterator(this._options);this._operations.forEach((function(e){t[e.method].apply(t,e.args)}))},i.prototype._operation=function(e,t){if(this._iterator)return this._iterator[e].apply(this._iterator,t);this._operations.push({method:e,args:t})},"next end".split(" ").forEach((function(e){i.prototype["_"+e]=function(){this._operation(e,arguments)}})),i.prototype.seek=function(){this._operation("seek",arguments)},e.exports=i},function(e,t,r){"use strict";var n=r(153),i=r(154).Readable,o=r(163);function s(e,t){if(!(this instanceof s))return new s(e,t);t=t||{},i.call(this,o(t,{objectMode:!0})),this._iterator=e,this._options=t,this.on("end",this.destroy.bind(this,null,null))}e.exports=s,n(s,i),s.prototype._read=function(){var e=this,t=this._options;this.destroyed||this._iterator.next((function(r,n,i){if(!e.destroyed)return r?e.destroy(r):void(void 0===n&&void 0===i?e.push(null):!1!==t.keys&&!1===t.values?e.push(n):!1===t.keys&&!1!==t.values?e.push(i):e.push({key:n,value:i}))}))},s.prototype._destroy=function(e,t){this._iterator.end((function(r){t(e||r)}))}},function(e,t,r){"use strict";"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}}},function(e,t,r){"use strict";(t=e.exports=r(54)).Stream=t,t.Readable=t,t.Writable=r(58),t.Duplex=r(7),t.Transform=r(60),t.PassThrough=r(161),t.finished=r(23),t.pipeline=r(162)},function(e,t){},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=r(0).Buffer,o=r(157).inspect,s=o&&o.custom||"inspect";e.exports=function(){function e(){this.head=null,this.tail=null,this.length=0}var t=e.prototype;return t.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},t.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},t.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},t.clear=function(){this.head=this.tail=null,this.length=0},t.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},t.concat=function(e){if(0===this.length)return i.alloc(0);for(var t,r,n,o=i.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,r=o,n=a,i.prototype.copy.call(t,r,n),a+=s.data.length,s=s.next;return o},t.consume=function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r},t.first=function(){return this.head.data},t._getString=function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n},t._getBuffer=function(e){var t=i.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,s),0===(e-=s)){s===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(s));break}++n}return this.length-=n,t},t[s]=function(e,t){return o(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){n(e,t,r[t])}))}return e}({},t,{depth:0,customInspect:!1}))},e}()},function(e,t){},function(e,t,r){"use strict";(function(t){var r=new Set;e.exports.emitExperimentalWarning=t.emitWarning?function(e){if(!r.has(e)){var n=e+" is an experimental feature. This feature could change at any time";r.add(e),t.emitWarning(n,"ExperimentalWarning")}}:function(){}}).call(this,r(1))},function(e,t,r){"use strict";(function(t){function r(e){try{if(!t.localStorage)return!1}catch(n){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(4))},function(e,t,r){"use strict";(function(t){var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(23),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function d(e){var t=e[s];if(null!==t){var r=e[h].read();null!==r&&(e[l]=null,e[s]=null,e[a]=null,t(p(r,!1)))}}function y(e){t.nextTick(d,e)}var b=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[u]?n(e[u]):r(p(void 0,!0))}))}));var n,i=this[l];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[f](r,n)}),n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(p(o,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),b);e.exports=function(e){var t,r=Object.create(g,(i(t={},h,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read();n?(r[l]=null,r[s]=null,r[a]=null,e(p(n,!1))):(r[s]=e,r[a]=t)},writable:!0}),t));return r[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[l]=null,r[s]=null,r[a]=null,t(e)),void(r[u]=e)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[a]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",y.bind(null,r)),r}}).call(this,r(1))},function(e,t,r){"use strict";e.exports=i;var n=r(60);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(3)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(6).codes,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(23)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}function c(e){e()}function l(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var s=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return t.reduce(l)}},function(e,t,r){"use strict";e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},function(e,t,r){"use strict";var n=r(24).WriteError,i=r(61),o=r(14).getCallback,s=r(14).getOptions;function a(e){this.db=this._levelup=e,this.batch=e.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(e,t){try{this.batch.put(e,t)}catch(r){throw new n(r)}return this.ops.push({type:"put",key:e,value:t}),this.length++,this},a.prototype.del=function(e){try{this.batch.del(e)}catch(t){throw new n(t)}return this.ops.push({type:"del",key:e}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(e){throw new n(e)}return this.ops=[],this.length=0,this},a.prototype.write=function(e,t){var r,a=this._levelup,u=this.ops;(t=o(e,t))||(r=(t=i()).promise),e=s(e);try{this.batch.write(e,(function(e){if(e)return t(new n(e));a.emit("batch",u),t()}))}catch(c){throw new n(c)}return r},e.exports=a},function(e,t,r){"use strict";var n=e.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];e.exports.errno={},e.exports.code={},n.forEach((function(t){e.exports.errno[t.errno]=t,e.exports.code[t.code]=t})),e.exports.custom=r(166)(e.exports),e.exports.create=e.exports.custom.createError},function(e,t,r){"use strict";var n=r(167);function i(e,t,r){t&&"string"!=typeof t&&(t=t.message||t.name),n(this,{type:e,name:e,cause:"string"!=typeof t?t:r,message:t},"ewr")}function o(e,t){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),i.call(this,"CustomError",e,t)}o.prototype=new Error,e.exports=function(e){var t=function(t,r){return function(e,t,r){var n=function r(n,o){i.call(this,t,n,o),"FilesystemError"==t&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(e.errno[this.cause.errno]?e.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,r)};return n.prototype=r?new r:new o,n}(e,t,r)};return{CustomError:o,FilesystemError:t("FilesystemError"),createError:t}}},function(e,t,r){"use strict";var n;n=function(){var e="function"==typeof Object.defineProperty?function(e,t,r){return Object.defineProperty(e,t,r),e}:function(e,t,r){return e[t]=r.value,e};return function(t,r,n,i){var o;if(i=function(e,t){var r="object"==typeof t,n=!r&&"string"==typeof t,i=function(e){return r?!!t[e]:!!n&&t.indexOf(e[0])>-1};return{enumerable:i("enumerable"),configurable:i("configurable"),writable:i("writable"),value:e}}(n,i),"object"==typeof r){for(o in r)Object.hasOwnProperty.call(r,o)&&(i.value=r[o],e(t,o,i));return t}return e(t,r,i)}},e.exports?e.exports=n():(void 0).prr=n()},function(e,t,r){"use strict";(function(t){var n=r(169);function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var s=r(50),a=Object.prototype.hasOwnProperty,u=Array.prototype.slice,c="foo"===function(){}.name;function l(e){return Object.prototype.toString.call(e)}function f(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=e.exports=v,p=/\s*function\s+([^\(\s]*)\s*/;function d(e){if(s.isFunction(e)){if(c)return e.name;var t=e.toString().match(p);return t&&t[1]}}function y(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function b(e){if(c||!s.isFunction(e))return s.inspect(e);var t=d(e);return"[Function"+(t?": "+t:"")+"]"}function g(e,t,r,n,i){throw new h.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function v(e,t){e||g(e,!0,t,"==",h.ok)}function k(e,t,r,n){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(s.isDate(e)&&s.isDate(t))return e.getTime()===t.getTime();if(s.isRegExp(e)&&s.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(f(e)&&f(t)&&l(e)===l(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var a=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==a&&a===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(s.isPrimitive(e)||s.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=w(e),o=w(t);if(i&&!o||!i&&o)return!1;if(i)return e=u.call(e),t=u.call(t),k(e,t,r);var a,c,l=S(e),f=S(t);if(l.length!==f.length)return!1;for(l.sort(),f.sort(),c=l.length-1;c>=0;c--)if(l[c]!==f[c])return!1;for(c=l.length-1;c>=0;c--)if(a=l[c],!k(e[a],t[a],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function m(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(r){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(r){t=r}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!e&&i&&!r;if((!e&&s.isError(i)&&o&&m(i,r)||a)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!m(i,r)||!e&&i)throw i}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return y(b(e.actual),128)+" "+e.operator+" "+y(b(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=d(t),o=n.indexOf("\n"+i);if(o>=0){var s=n.indexOf("\n",o+1);n=n.substring(s+1)}this.stack=n}}},s.inherits(h.AssertionError,Error),h.fail=g,h.ok=v,h.equal=function(e,t,r){e!=t&&g(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){k(e,t,!1)||g(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){k(e,t,!0)||g(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){k(e,t,!1)&&g(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){k(t,r,!0)&&g(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){_(!0,e,t,r)},h.doesNotThrow=function(e,t,r){_(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=n((function e(t,r){t||g(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var S=Object.keys||function(e){var t=[];for(var r in e)a.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var r,a,u=s(e),c=1;c<arguments.length;c++){for(var l in r=Object(arguments[c]))i.call(r,l)&&(u[l]=r[l]);if(n){a=n(r);for(var f=0;f<a.length;f++)o.call(r,a[f])&&(u[a[f]]=r[a[f]])}}return u}},function(e,t,r){"use strict";var n=r(25).AbstractLevelDOWN,i=r(25).AbstractChainedBatch,o=r(25).AbstractIterator,s=r(3),a=r(172),u=r(24).EncodingError,c=["approximateSize","compactRange"];function l(e,t){if(!(this instanceof l))return new l(e,t);var r=e.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(t){var r="function"==typeof e[t];(i[t]||r)&&(this.supports.additionalMethods[t]=!0,this[t]=function(e,r,n,i){return e=this.codec.encodeKey(e,n),r=this.codec.encodeKey(r,n),this.db[t](e,r,n,i)})}),this),void 0===(t=t||{}).keyEncoding&&(t.keyEncoding="utf8"),void 0===t.valueEncoding&&(t.valueEncoding="utf8"),this.db=e,this.codec=new a(t)}function f(e,t){o.call(this,e),this.codec=e.codec,this.keys=t.keys,this.values=t.values,this.opts=this.codec.encodeLtgt(t),this.it=e.db.iterator(this.opts)}function h(e,t){i.call(this,e),this.codec=e.codec,this.batch=e.db.batch()}e.exports=l.default=l,s(l,n),l.prototype.type="encoding-down",l.prototype._serializeKey=l.prototype._serializeValue=function(e){return e},l.prototype._open=function(e,t){this.db.open(e,t)},l.prototype._close=function(e){this.db.close(e)},l.prototype._put=function(e,t,r,n){e=this.codec.encodeKey(e,r),t=this.codec.encodeValue(t,r),this.db.put(e,t,r,n)},l.prototype._get=function(e,t,r){var n=this;e=this.codec.encodeKey(e,t),t.asBuffer=this.codec.valueAsBuffer(t),this.db.get(e,t,(function(e,i){if(e)return r(e);try{i=n.codec.decodeValue(i,t)}catch(e){return r(new u(e))}r(null,i)}))},l.prototype._del=function(e,t,r){e=this.codec.encodeKey(e,t),this.db.del(e,t,r)},l.prototype._chainedBatch=function(){return new h(this)},l.prototype._batch=function(e,t,r){e=this.codec.encodeBatch(e,t),this.db.batch(e,t,r)},l.prototype._iterator=function(e){return e.keyAsBuffer=this.codec.keyAsBuffer(e),e.valueAsBuffer=this.codec.valueAsBuffer(e),new f(this,e)},l.prototype._clear=function(e,t){e=this.codec.encodeLtgt(e),this.db.clear(e,t)},s(f,o),f.prototype._next=function(e){var t=this;this.it.next((function(r,n,i){if(r)return e(r);try{n=t.keys&&void 0!==n?t.codec.decodeKey(n,t.opts):void 0,i=t.values&&void 0!==i?t.codec.decodeValue(i,t.opts):void 0}catch(r){return e(new u(r))}e(null,n,i)}))},f.prototype._seek=function(e){e=this.codec.encodeKey(e,this.opts),this.it.seek(e)},f.prototype._end=function(e){this.it.end(e)},s(h,i),h.prototype._put=function(e,t){e=this.codec.encodeKey(e),t=this.codec.encodeValue(t),this.batch.put(e,t)},h.prototype._del=function(e){e=this.codec.encodeKey(e),this.batch.del(e)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(e,t){this.batch.write(e,t)}},function(e,t,r){"use strict";var n=r(13),i=r(20),o=r(0).Buffer,s=r(62),a=r(63),u=r(26),c=Object.prototype.hasOwnProperty,l="start end gt gte lt lte".split(" ");function f(e){this.status="new",this.supports=i(e,{status:!0})}function h(e,t){var r={};for(var n in t)if(c.call(t,n)){var i=t[n];p(n)&&(i=e._serializeKey(i)),r[n]=i}return r}function p(e){return-1!==l.indexOf(e)}f.prototype.open=function(e,t){var r=this,n=this.status;if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");"object"==typeof e&&null!==e||(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,(function(e){if(e)return r.status=n,t(e);r.status="open",t()}))},f.prototype._open=function(e,t){u(t)},f.prototype.close=function(e){var t=this,r=this.status;if("function"!=typeof e)throw new Error("close() requires a callback argument");this.status="closing",this._close((function(n){if(n)return t.status=r,e(n);t.status="closed",e()}))},f.prototype._close=function(e){u(e)},f.prototype.get=function(e,t,r){if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("get() requires a callback argument");var n=this._checkKey(e);if(n)return u(r,n);e=this._serializeKey(e),"object"==typeof t&&null!==t||(t={}),t.asBuffer=!1!==t.asBuffer,this._get(e,t,r)},f.prototype._get=function(e,t,r){u((function(){r(new Error("NotFound"))}))},f.prototype.put=function(e,t,r,n){if("function"==typeof r&&(n=r),"function"!=typeof n)throw new Error("put() requires a callback argument");var i=this._checkKey(e)||this._checkValue(t);if(i)return u(n,i);e=this._serializeKey(e),t=this._serializeValue(t),"object"==typeof r&&null!==r||(r={}),this._put(e,t,r,n)},f.prototype._put=function(e,t,r,n){u(n)},f.prototype.del=function(e,t,r){if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("del() requires a callback argument");var n=this._checkKey(e);if(n)return u(r,n);e=this._serializeKey(e),"object"==typeof t&&null!==t||(t={}),this._del(e,t,r)},f.prototype._del=function(e,t,r){u(r)},f.prototype.batch=function(e,t,r){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(r=t),"function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return u(r,new Error("batch(array) requires an array argument"));if(0===e.length)return u(r);"object"==typeof t&&null!==t||(t={});for(var i=new Array(e.length),o=0;o<e.length;o++){if("object"!=typeof e[o]||null===e[o])return u(r,new Error("batch(array) element must be an object and not `null`"));var s=n(e[o]);if("put"!==s.type&&"del"!==s.type)return u(r,new Error("`type` must be 'put' or 'del'"));var a=this._checkKey(s.key);if(a)return u(r,a);if(s.key=this._serializeKey(s.key),"put"===s.type){var c=this._checkValue(s.value);if(c)return u(r,c);s.value=this._serializeValue(s.value)}i[o]=s}this._batch(i,t,r)},f.prototype._batch=function(e,t,r){u(r)},f.prototype.clear=function(e,t){if("function"==typeof e)t=e;else if("function"!=typeof t)throw new Error("clear() requires a callback argument");(e=h(this,e)).reverse=!!e.reverse,e.limit="limit"in e?e.limit:-1,this._clear(e,t)},f.prototype._clear=function(e,t){e.keys=!0,e.values=!1,e.keyAsBuffer=!0,e.valueAsBuffer=!0;var r=this._iterator(e),n={},i=this;!function e(o){if(o)return r.end((function(){t(o)}));r.next((function(o,s){return o?e(o):void 0===s?r.end(t):void i._del(s,n,e)}))}()},f.prototype._setupIteratorOptions=function(e){return(e=h(this,e)).reverse=!!e.reverse,e.keys=!1!==e.keys,e.values=!1!==e.values,e.limit="limit"in e?e.limit:-1,e.keyAsBuffer=!1!==e.keyAsBuffer,e.valueAsBuffer=!1!==e.valueAsBuffer,e},f.prototype.iterator=function(e){return"object"==typeof e&&null!==e||(e={}),e=this._setupIteratorOptions(e),this._iterator(e)},f.prototype._iterator=function(e){return new s(this)},f.prototype._chainedBatch=function(){return new a(this)},f.prototype._serializeKey=function(e){return e},f.prototype._serializeValue=function(e){return e},f.prototype._checkKey=function(e){return null==e?new Error("key cannot be `null` or `undefined`"):o.isBuffer(e)&&0===e.length?new Error("key cannot be an empty Buffer"):""===e?new Error("key cannot be an empty String"):Array.isArray(e)&&0===e.length?new Error("key cannot be an empty Array"):void 0},f.prototype._checkValue=function(e){if(null==e)return new Error("value cannot be `null` or `undefined`")},f.prototype._nextTick=u,e.exports=f},function(e,t,r){"use strict";var n=r(173);function i(e){if(!(this instanceof i))return new i(e);this.opts=e||{},this.encodings=n}e.exports=i,i.prototype._encoding=function(e){return"string"==typeof e&&(e=n[e]),e||(e=n.id),e},i.prototype._keyEncoding=function(e,t){return this._encoding(t&&t.keyEncoding||e&&e.keyEncoding||this.opts.keyEncoding)},i.prototype._valueEncoding=function(e,t){return this._encoding(t&&(t.valueEncoding||t.encoding)||e&&(e.valueEncoding||e.encoding)||this.opts.valueEncoding||this.opts.encoding)},i.prototype.encodeKey=function(e,t,r){return this._keyEncoding(t,r).encode(e)},i.prototype.encodeValue=function(e,t,r){return this._valueEncoding(t,r).encode(e)},i.prototype.decodeKey=function(e,t){return this._keyEncoding(t).decode(e)},i.prototype.decodeValue=function(e,t){return this._valueEncoding(t).decode(e)},i.prototype.encodeBatch=function(e,t){var r=this;return e.map((function(e){var n={type:e.type,key:r.encodeKey(e.key,t,e)};return r.keyAsBuffer(t,e)&&(n.keyEncoding="binary"),e.prefix&&(n.prefix=e.prefix),"value"in e&&(n.value=r.encodeValue(e.value,t,e),r.valueAsBuffer(t,e)&&(n.valueEncoding="binary")),n}))};var o=["lt","gt","lte","gte","start","end"];i.prototype.encodeLtgt=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){r[n]=o.indexOf(n)>-1?t.encodeKey(e[n],e):e[n]})),r},i.prototype.createStreamDecoder=function(e){var t=this;return e.keys&&e.values?function(r,n){return{key:t.decodeKey(r,e),value:t.decodeValue(n,e)}}:e.keys?function(r){return t.decodeKey(r,e)}:e.values?function(r,n){return t.decodeValue(n,e)}:function(){}},i.prototype.keyAsBuffer=function(e){return this._keyEncoding(e).buffer},i.prototype.valueAsBuffer=function(e){return this._valueEncoding(e).buffer}},function(e,t,r){"use strict";(function(e){t.utf8=t["utf-8"]={encode:function(e){return n(e)?e:String(e)},decode:r,buffer:!1,type:"utf8"},t.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},t.binary={encode:function(t){return n(t)?t:e.from(t)},decode:r,buffer:!0,type:"binary"},t.none={encode:r,decode:r,buffer:!1,type:"id"},t.id=t.none;function r(e){return e}function n(t){return null==t||e.isBuffer(t)}["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach((function(r){t[r]={encode:function(t){return n(t)?t:e.from(t,r)},decode:function(e){return e.toString(r)},buffer:!0,type:r}}))}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t){e.exports=c;var n=r(64).AbstractLevelDOWN,i=r(3),o=r(176),s=r(67),a=r(68),u=r(180);function c(e,t){if(!(this instanceof c))return new c(e,t);if(n.call(this),t=t||{},"string"!=typeof e)throw new Error("constructor requires a location string argument");this.location=e,this.prefix=null==t.prefix?"level-js-":t.prefix,this.version=parseInt(t.version||1,10)}i(c,n),c.binaryKeys=u.binaryKeys(indexedDB),c.arrayKeys=u.arrayKeys(indexedDB),c.prototype._open=function(e,t){var r=indexedDB.open(this.prefix+this.location,this.version),n=this;r.onerror=function(){t(r.error||new Error("unknown error"))},r.onsuccess=function(){n.db=r.result,t()},r.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains(n.location)||t.createObjectStore(n.location)}},c.prototype.store=function(e){return this.db.transaction([this.location],e).objectStore(this.location)},c.prototype.await=function(e,t){var r=e.transaction;r.onabort=function(){t(r.error||new Error("aborted by user"))},r.oncomplete=function(){t(null,e.result)}},c.prototype._get=function(e,t,r){var n=this.store("readonly");try{var i=n.get(e)}catch(o){return a((function(){r(o)}))}this.await(i,(function(e,n){return e?r(e):void 0===n?r(new Error("NotFound")):(t.asBuffer&&(n=s(n)),void r(null,n))}))},c.prototype._del=function(e,t,r){var n=this.store("readwrite");try{var i=n.delete(e)}catch(o){return a((function(){r(o)}))}this.await(i,r)},c.prototype._put=function(e,t,r,n){var i=this.store("readwrite");try{var o=i.put(t,e)}catch(s){return a((function(){n(s)}))}this.await(o,n)},c.prototype._serializeKey=function(e){return t.isBuffer(e)?c.binaryKeys?e:e.toString():Array.isArray(e)?c.arrayKeys?e.map(this._serializeKey,this):String(e):e},c.prototype._serializeValue=function(e){return e},c.prototype._iterator=function(e){return new o(this,this.location,e)},c.prototype._batch=function(e,t,r){if(0===e.length)return a(r);var n,i=this.store("readwrite"),o=i.transaction,s=0;o.onabort=function(){r(n||o.error||new Error("aborted by user"))},o.oncomplete=function(){r()},function t(){var r=e[s++],a=r.key;try{var u="del"===r.type?i.delete(a):i.put(r.value,a)}catch(c){return n=c,void o.abort()}s<e.length&&(u.onsuccess=t)}()},c.prototype._close=function(e){this.db.close(),a(e)},c.destroy=function(e,t,r){"function"==typeof t&&(r=t,t="level-js-");var n=indexedDB.deleteDatabase(t+e);n.onsuccess=function(){r()},n.onerror=function(e){r(e)}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t,n){var i=r(13),o=r(65),s=r(66),a=Object.prototype.hasOwnProperty,u="start end gt gte lt lte".split(" ");function c(){this.status="new"}function l(e){return-1!==u.indexOf(e)}c.prototype.open=function(e,t){var r=this,n=this.status;if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");"object"==typeof e&&null!==e||(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,(function(e){if(e)return r.status=n,t(e);r.status="open",t()}))},c.prototype._open=function(e,r){t.nextTick(r)},c.prototype.close=function(e){var t=this,r=this.status;if("function"!=typeof e)throw new Error("close() requires a callback argument");this.status="closing",this._close((function(n){if(n)return t.status=r,e(n);t.status="closed",e()}))},c.prototype._close=function(e){t.nextTick(e)},c.prototype.get=function(e,r,n){if("function"==typeof r&&(n=r),"function"!=typeof n)throw new Error("get() requires a callback argument");var i=this._checkKey(e);if(i)return t.nextTick(n,i);e=this._serializeKey(e),"object"==typeof r&&null!==r||(r={}),r.asBuffer=!1!==r.asBuffer,this._get(e,r,n)},c.prototype._get=function(e,r,n){t.nextTick((function(){n(new Error("NotFound"))}))},c.prototype.put=function(e,r,n,i){if("function"==typeof n&&(i=n),"function"!=typeof i)throw new Error("put() requires a callback argument");var o=this._checkKey(e)||this._checkValue(r);if(o)return t.nextTick(i,o);e=this._serializeKey(e),r=this._serializeValue(r),"object"==typeof n&&null!==n||(n={}),this._put(e,r,n,i)},c.prototype._put=function(e,r,n,i){t.nextTick(i)},c.prototype.del=function(e,r,n){if("function"==typeof r&&(n=r),"function"!=typeof n)throw new Error("del() requires a callback argument");var i=this._checkKey(e);if(i)return t.nextTick(n,i);e=this._serializeKey(e),"object"==typeof r&&null!==r||(r={}),this._del(e,r,n)},c.prototype._del=function(e,r,n){t.nextTick(n)},c.prototype.batch=function(e,r,n){if(!arguments.length)return this._chainedBatch();if("function"==typeof r&&(n=r),"function"==typeof e&&(n=e),"function"!=typeof n)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return t.nextTick(n,new Error("batch(array) requires an array argument"));if(0===e.length)return t.nextTick(n);"object"==typeof r&&null!==r||(r={});for(var o=new Array(e.length),s=0;s<e.length;s++){if("object"!=typeof e[s]||null===e[s])return t.nextTick(n,new Error("batch(array) element must be an object and not `null`"));var a=i(e[s]);if("put"!==a.type&&"del"!==a.type)return t.nextTick(n,new Error("`type` must be 'put' or 'del'"));var u=this._checkKey(a.key);if(u)return t.nextTick(n,u);if(a.key=this._serializeKey(a.key),"put"===a.type){var c=this._checkValue(a.value);if(c)return t.nextTick(n,c);a.value=this._serializeValue(a.value)}o[s]=a}this._batch(o,r,n)},c.prototype._batch=function(e,r,n){t.nextTick(n)},c.prototype._setupIteratorOptions=function(e){return(e=function(e,t){var r={};for(var n in t)if(a.call(t,n)){var i=t[n];l(n)&&(i=e._serializeKey(i)),r[n]=i}return r}(this,e)).reverse=!!e.reverse,e.keys=!1!==e.keys,e.values=!1!==e.values,e.limit="limit"in e?e.limit:-1,e.keyAsBuffer=!1!==e.keyAsBuffer,e.valueAsBuffer=!1!==e.valueAsBuffer,e},c.prototype.iterator=function(e){return"object"==typeof e&&null!==e||(e={}),e=this._setupIteratorOptions(e),this._iterator(e)},c.prototype._iterator=function(e){return new o(this)},c.prototype._chainedBatch=function(){return new s(this)},c.prototype._serializeKey=function(e){return e},c.prototype._serializeValue=function(e){return e},c.prototype._checkKey=function(e){return null==e?new Error("key cannot be `null` or `undefined`"):n.isBuffer(e)&&0===e.length?new Error("key cannot be an empty Buffer"):""===e?new Error("key cannot be an empty String"):Array.isArray(e)&&0===e.length?new Error("key cannot be an empty Array"):void 0},c.prototype._checkValue=function(e){if(null==e)return new Error("value cannot be `null` or `undefined`")},e.exports=c}).call(this,r(1),r(0).Buffer)},function(e,t,r){"use strict";var n=r(3),i=r(64).AbstractIterator,o=r(177),s=r(67),a=r(68),u=function(){};function c(e,t,r){if(i.call(this,e),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0!==this._limit){try{var n=this.createKeyRange(r)}catch(o){return void(this._completed=!0)}this.createIterator(t,n,r.reverse)}else this._completed=!0}e.exports=c,n(c,i),c.prototype.createKeyRange=function(e){var t=o.lowerBound(e),r=o.upperBound(e),n=o.lowerBoundExclusive(e),i=o.upperBoundExclusive(e);return void 0!==t&&void 0!==r?IDBKeyRange.bound(t,r,n,i):void 0!==t?IDBKeyRange.lowerBound(t,n):void 0!==r?IDBKeyRange.upperBound(r,i):null},c.prototype.createIterator=function(e,t,r){var n=this,i=this.db.db.transaction([e],"readonly");i.objectStore(e).openCursor(t,r?"prev":"next").onsuccess=function(e){var t=e.target.result;t&&n.onItem(t)},this._transaction=i,i.onabort=function(){n.onAbort(n._transaction.error||new Error("aborted by user"))},i.oncomplete=function(){n.onComplete()}},c.prototype.onItem=function(e){this._cache.push(e.key,e.value),(this._limit<=0||++this._count<this._limit)&&e.continue(),this.maybeNext()},c.prototype.onAbort=function(e){this._aborted=!0,this._error=e,this.maybeNext()},c.prototype.onComplete=function(){this._completed=!0,this.maybeNext()},c.prototype.maybeNext=function(){this._callback&&(this._next(this._callback),this._callback=null)},c.prototype._next=function(e){if(this._aborted){var t=this._error;this._error=null,a((function(){e(t)}))}else if(this._cache.length>0){var r=this._cache.shift(),n=this._cache.shift();this._keyAsBuffer&&(r=s(r)),this._valueAsBuffer&&(n=s(n)),a((function(){e(null,r,n)}))}else this._completed?a(e):this._callback=e},c.prototype._end=function(e){if(this._aborted||this._completed){var t=this._error;a((function(){e(t)}))}else this.onItem=u,this.onAbort=e,this.onComplete=e}},function(e,t,r){"use strict";(function(e){function r(e){return void 0!==e&&""!==e}function n(e,t){return Object.hasOwnProperty.call(e,t)}function i(e,t){return Object.hasOwnProperty.call(e,t)&&t}t.compare=function(t,r){if(e.isBuffer(t)){for(var n=Math.min(t.length,r.length),i=0;i<n;i++){var o=t[i]-r[i];if(o)return o}return t.length-r.length}return t<r?-1:t>r?1:0};var o=t.lowerBoundKey=function(e){return i(e,"gt")||i(e,"gte")||i(e,"min")||(e.reverse?i(e,"end"):i(e,"start"))||void 0},s=t.lowerBound=function(e,t){var r=o(e);return r?e[r]:t},a=t.lowerBoundInclusive=function(e){return!n(e,"gt")},u=t.upperBoundInclusive=function(e){return!n(e,"lt")},c=t.lowerBoundExclusive=function(e){return!a(e)},l=t.upperBoundExclusive=function(e){return!u(e)},f=t.upperBoundKey=function(e){return i(e,"lt")||i(e,"lte")||i(e,"max")||(e.reverse?i(e,"start"):i(e,"end"))||void 0},h=t.upperBound=function(e,t){var r=f(e);return r?e[r]:t};function p(e){return e}t.start=function(e,t){return e.reverse?h(e,t):s(e,t)},t.end=function(e,t){return e.reverse?s(e,t):h(e,t)},t.startInclusive=function(e){return e.reverse?u(e):a(e)},t.endInclusive=function(e){return e.reverse?a(e):u(e)},t.toLtgt=function(e,r,i,o,s){r=r||{},i=i||p;var a=arguments.length>3,u=t.lowerBoundKey(e),c=t.upperBoundKey(e);return u?"gt"===u?r.gt=i(e.gt,!1):r.gte=i(e[u],!1):a&&(r.gte=i(o,!1)),c?"lt"===c?r.lt=i(e.lt,!0):r.lte=i(e[c],!0):a&&(r.lte=i(s,!0)),null!=e.reverse&&(r.reverse=!!e.reverse),n(r,"max")&&delete r.max,n(r,"min")&&delete r.min,n(r,"start")&&delete r.start,n(r,"end")&&delete r.end,r},t.contains=function(e,n,i){i=i||t.compare;var o=s(e);if(r(o)&&((a=i(n,o))<0||0===a&&c(e)))return!1;var a,u=h(e);if(r(u)&&((a=i(n,u))>0||0===a&&l(e)))return!1;return!0},t.filter=function(e,r){return function(n){return t.contains(e,n,r)}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(179).strict;e.exports=function(e){if(n(e)){var r=t.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(r=r.slice(e.byteOffset,e.byteOffset+e.byteLength)),r}return t.from(e)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";e.exports=o,o.strict=s,o.loose=a;var n=Object.prototype.toString,i={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function o(e){return s(e)||a(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function a(e){return i[n.call(e)]}},function(e,t,r){"use strict";t.test=function(e){return function(t){try{return t.cmp(e,0),!0}catch(r){return!1}}},t.binaryKeys=t.test(new Uint8Array(0)),t.arrayKeys=t.test([1])},function(e,t,r){"use strict";e.exports={Spec:{type:"mount",mounts:[{mountpoint:"/blocks",type:"measure",prefix:"flatfs.datastore",child:{type:"flatfs",path:"blocks",sync:!0,shardFunc:"/repo/flatfs/shard/v1/next-to-last/2"}},{mountpoint:"/",type:"measure",prefix:"leveldb.datastore",child:{type:"levelds",path:"datastore",compression:"none"}}]}}}])}));
\No newline at end of file