diff --git a/index.html b/index.html index d1b0dee..0c18565 100644 --- a/index.html +++ b/index.html @@ -1,25 +1,37 @@ -Banana split
\ No newline at end of file +var n=r("1fb5"),i=r("9152"),o=r("e3db");function a(){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}}function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),u.alloc(+e)}function w(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 J(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 J(e).length;t=(""+t).toLowerCase(),n=!0}}function _(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,r<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return j(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function k(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(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:M(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):M(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function M(e,t,r,n,i){var o,a=1,s=e.length,c=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-c),o=r;o>=0;o--){for(var h=!0,d=0;di&&(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 a=0;a239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(f=u);break;case 2:o=e[i+1],128===(192&o)&&(c=(31&u)<<6|63&o,c>127&&(f=c));break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a,c>2047&&(c<55296||c>57343)&&(f=c));break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s,c>65535&&c<1114112&&(f=c))}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return L(n)}t.Buffer=u,t.SlowBuffer=g,t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:a(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return f(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 d(null,e,t,r)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(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);i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(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(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,a=r-t,s=Math.min(o,a),c=this.slice(n,i),f=e.slice(t,r),h=0;hi)&&(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 C(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":return B(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(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)}};var O=4096;function L(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var r="",n=0;while(nn)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function z(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function F(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function q(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function H(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 $(e,t,r,n,o){return o||H(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function V(e,t,r,n,o){return o||H(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t0&&(i*=256))n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||U(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||U(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||U(e,t,this.length);var n=this[e],i=1,o=0;while(++o=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||U(e,t,this.length);var n=t,i=1,o=this[e+--n];while(n>0&&(i*=256))o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||U(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||U(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||U(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||U(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||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;z(this,e,t,r,i,0)}var o=1,a=0;this[t]=255&e;while(++a=0&&(a*=256))this[t+o]=e/a&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||z(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||z(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||z(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||z(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):q(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||z(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):q(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);z(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;this[t]=255&e;while(++o>0)-s&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);z(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;this[t+o]=255&e;while(--o>=0&&(a*=256))e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||z(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||z(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||z(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||z(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):q(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||z(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):q(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return $(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return $(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return V(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return V(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=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=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+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 Y(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n)}return o}function Q(e){return n.toByteArray(W(e))}function ee(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function te(e){return e!==e}}).call(this,r("c8ba"))},b672:function(e,t,r){var n=r("8707").Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"===typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},b692:function(e,t,r){var n=r("8707").Buffer,i=r("98e6"),o=r("34d5"),a=r("3fb5"),s=r("6fe7"),c=r("980c"),u=r("b4e8");function f(e){o.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function h(e){o.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new f(e)}function l(e){return new h(e)}Object.keys(u).forEach((function(e){u[e].id=n.from(u[e].id,"hex"),u[e.toLowerCase()]=u[e]})),a(f,o.Writable),f.prototype._write=function(e,t,r){this._hash.update(e),r()},f.prototype.update=function(e,t){return"string"===typeof e&&(e=n.from(e,t)),this._hash.update(e),this},f.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=s(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},a(h,o.Writable),h.prototype._write=function(e,t,r){this._hash.update(e),r()},h.prototype.update=function(e,t){return"string"===typeof e&&(e=n.from(e,t)),this._hash.update(e),this},h.prototype.verify=function(e,t,r){"string"===typeof t&&(t=n.from(t,r)),this.end();var i=this._hash.digest();return c(t,i,e,this._signType,this._tag)},e.exports={Sign:d,Verify:l,createSign:d,createVerify:l}},b6aa: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}function i(e,t,r){if(!e||"string"===typeof e)throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"===typeof t&&(r=t,t=""),t&&(r.code=t);try{return n(e,r)}catch(i){r.message=e.message,r.stack=e.stack;const t=function(){};t.prototype=Object.create(Object.getPrototypeOf(e));const o=n(new t,r);return o}}e.exports=i},b73f:function(e,t,r){"use strict";var n=r("399f"),i=r("f3a3"),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function u(e){var t=0,r=e.length-1;while(!e[t]&&!(128&e[t+1])&&t>>3);e.push(128|r);while(--r)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=c(e,r);if(!1===a)return!1;var u=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var f=c(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;var h=e.slice(r.place,f+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(u),this.s=new n(h),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);while(!r[0]&&!(128&r[1]))r=r.slice(1);var n=[2];f(n,t.length),n=n.concat(t),n.push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},b7d1:function(e,t,r){(function(t){function r(e,t){if(n("noDeprecation"))return e;var r=!1;function i(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return i}function n(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=r}).call(this,r("c8ba"))},b837:function(e,t,r){var n=r("3fb5"),i=r("4fd1"),o=r("b672"),a=r("8707").Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},b9a8:function(e,t,r){"use strict";var n=r("399f"),i=r("6aa2"),o=r("f3a3"),a=r("0cbb"),s=r("fdac"),c=o.assert,u=r("bb34"),f=r("b73f");function h(e){if(!(this instanceof h))return new h(e);"string"===typeof e&&(c(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=h,h.prototype.keyPair=function(e){return new u(this,e)},h.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},h.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},h.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(e,t,r,o){"object"===typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),c=e.toArray("be",a),u=new i({hash:this.hash,entropy:s,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(u.generate(this.n.byteLength()));if(l=this._truncateToN(l,!0),!(l.cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var v=l.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(v=v.umod(this.n),0!==v.cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new f({r:m,s:v,recoveryParam:y})}}}}}},h.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i),t=new f(t,"hex");var o=t.r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),u=c.mul(e).umod(this.n),h=c.mul(o).umod(this.n);return this.curve._maxwellTrick?(s=this.g.jmulAdd(u,r.getPublic(),h),!s.isInfinity()&&s.eqXToP(o)):(s=this.g.mulAdd(u,r.getPublic(),h),!s.isInfinity()&&0===s.getX().umod(this.n).cmp(o))},h.prototype.recoverPubKey=function(e,t,r,i){c((3&r)===r,"The recovery param is more than two bits"),t=new f(t,i);var o=this.n,a=new n(e),s=t.r,u=t.s,h=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var l=t.r.invm(o),p=o.sub(a).mul(l).umod(o),b=u.mul(l).umod(o);return this.g.mulAdd(p,s,b)},h.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new f(t,n),null!==t.recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},b9b5:function(e,t,r){"use strict";var n=r("9d8a").codes.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}function o(e,t,r,o){var a=i(t,o,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0){var s=o?r:"highWaterMark";throw new n(s,a)}return Math.floor(a)}return e.objectMode?16:16384}e.exports={getHighWaterMark:o}},bac2:function(e,t,r){var n={ECB:r("0145"),CBC:r("c119"),CFB:r("3505"),CFB8:r("62c9"),CFB1:r("5239"),OFB:r("5165"),CTR:r("6ade"),GCM:r("6ade")},i=r("e85f");for(var o in i)i[o].module=n[i[o].mode];e.exports=i},baee:function(e,t,r){(function(e){(function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(11).Buffer}catch(A){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function c(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),c=t;c=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,s+=24,s>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,s+=24,s>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=c(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else{var s=e.length-t;for(n=s%2===0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8}this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,f=r;f1&&0===this.words[this.length-1])this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(A){o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,r=0!==o||a!==this.length-1?d[6-c.length]+c+r:c+r,i+=2,i>=26&&(i-=26,a--)}0!==o&&(r=o.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=p[e];r="";var h=this.clone();h.negative=0;while(!h.isZero()){var b=h.modrn(f).toString(e);h=h.idivn(f),r=h.isZero()?b+r:d[u-b.length]+b+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var b=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function m(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}function v(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&c,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;i=0|e.words[p],o=0|t.words[l],a=i*o+h,f+=a/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=b(e,o),s="le"===t?"LE":"BE";return this["_toArrayLike"+s](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0){e[r--]=n;while(r>=0)e[r--]=0}},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],v=8191&m,y=m>>>13,g=0|a[3],w=8191&g,_=g>>>13,k=0|a[4],S=8191&k,M=k>>>13,C=0|a[5],x=8191&C,B=C>>>13,E=0|a[6],P=8191&E,A=E>>>13,T=0|a[7],R=8191&T,O=T>>>13,L=0|a[8],j=8191&L,I=L>>>13,D=0|a[9],N=8191&D,U=D>>>13,z=0|s[0],F=8191&z,q=z>>>13,H=0|s[1],$=8191&H,V=H>>>13,G=0|s[2],W=8191&G,K=G>>>13,X=0|s[3],J=8191&X,Y=X>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],he=8191&fe,de=fe>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(h,F),i=Math.imul(h,q),i=i+Math.imul(d,F)|0,o=Math.imul(d,q);var me=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,F),i=Math.imul(p,q),i=i+Math.imul(b,F)|0,o=Math.imul(b,q),n=n+Math.imul(h,$)|0,i=i+Math.imul(h,V)|0,i=i+Math.imul(d,$)|0,o=o+Math.imul(d,V)|0;var ve=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,F),i=Math.imul(v,q),i=i+Math.imul(y,F)|0,o=Math.imul(y,q),n=n+Math.imul(p,$)|0,i=i+Math.imul(p,V)|0,i=i+Math.imul(b,$)|0,o=o+Math.imul(b,V)|0,n=n+Math.imul(h,W)|0,i=i+Math.imul(h,K)|0,i=i+Math.imul(d,W)|0,o=o+Math.imul(d,K)|0;var ye=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,F),i=Math.imul(w,q),i=i+Math.imul(_,F)|0,o=Math.imul(_,q),n=n+Math.imul(v,$)|0,i=i+Math.imul(v,V)|0,i=i+Math.imul(y,$)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,K)|0,i=i+Math.imul(b,W)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(h,J)|0,i=i+Math.imul(h,Y)|0,i=i+Math.imul(d,J)|0,o=o+Math.imul(d,Y)|0;var ge=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(S,F),i=Math.imul(S,q),i=i+Math.imul(M,F)|0,o=Math.imul(M,q),n=n+Math.imul(w,$)|0,i=i+Math.imul(w,V)|0,i=i+Math.imul(_,$)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=i+Math.imul(v,K)|0,i=i+Math.imul(y,W)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,i=i+Math.imul(b,J)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0,i=i+Math.imul(d,Q)|0,o=o+Math.imul(d,ee)|0;var we=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,F),i=Math.imul(x,q),i=i+Math.imul(B,F)|0,o=Math.imul(B,q),n=n+Math.imul(S,$)|0,i=i+Math.imul(S,V)|0,i=i+Math.imul(M,$)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(w,W)|0,i=i+Math.imul(w,K)|0,i=i+Math.imul(_,W)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,i=i+Math.imul(y,J)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0,i=i+Math.imul(d,re)|0,o=o+Math.imul(d,ne)|0;var _e=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,F),i=Math.imul(P,q),i=i+Math.imul(A,F)|0,o=Math.imul(A,q),n=n+Math.imul(x,$)|0,i=i+Math.imul(x,V)|0,i=i+Math.imul(B,$)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(S,W)|0,i=i+Math.imul(S,K)|0,i=i+Math.imul(M,W)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,i=i+Math.imul(_,J)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,i=i+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(h,oe)|0,i=i+Math.imul(h,ae)|0,i=i+Math.imul(d,oe)|0,o=o+Math.imul(d,ae)|0;var ke=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,F),i=Math.imul(R,q),i=i+Math.imul(O,F)|0,o=Math.imul(O,q),n=n+Math.imul(P,$)|0,i=i+Math.imul(P,V)|0,i=i+Math.imul(A,$)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(x,W)|0,i=i+Math.imul(x,K)|0,i=i+Math.imul(B,W)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(S,J)|0,i=i+Math.imul(S,Y)|0,i=i+Math.imul(M,J)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ne)|0,i=i+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,ae)|0,i=i+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(h,ce)|0,i=i+Math.imul(h,ue)|0,i=i+Math.imul(d,ce)|0,o=o+Math.imul(d,ue)|0;var Se=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,F),i=Math.imul(j,q),i=i+Math.imul(I,F)|0,o=Math.imul(I,q),n=n+Math.imul(R,$)|0,i=i+Math.imul(R,V)|0,i=i+Math.imul(O,$)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(P,W)|0,i=i+Math.imul(P,K)|0,i=i+Math.imul(A,W)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(x,J)|0,i=i+Math.imul(x,Y)|0,i=i+Math.imul(B,J)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(S,Q)|0,i=i+Math.imul(S,ee)|0,i=i+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,ae)|0,i=i+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(p,ce)|0,i=i+Math.imul(p,ue)|0,i=i+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(h,he)|0,i=i+Math.imul(h,de)|0,i=i+Math.imul(d,he)|0,o=o+Math.imul(d,de)|0;var Me=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(N,F),i=Math.imul(N,q),i=i+Math.imul(U,F)|0,o=Math.imul(U,q),n=n+Math.imul(j,$)|0,i=i+Math.imul(j,V)|0,i=i+Math.imul(I,$)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(R,W)|0,i=i+Math.imul(R,K)|0,i=i+Math.imul(O,W)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(P,J)|0,i=i+Math.imul(P,Y)|0,i=i+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,i=i+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,i=i+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,ae)|0,i=i+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(v,ce)|0,i=i+Math.imul(v,ue)|0,i=i+Math.imul(y,ce)|0,o=o+Math.imul(y,ue)|0,n=n+Math.imul(p,he)|0,i=i+Math.imul(p,de)|0,i=i+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0,n=n+Math.imul(h,pe)|0,i=i+Math.imul(h,be)|0,i=i+Math.imul(d,pe)|0,o=o+Math.imul(d,be)|0;var Ce=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(N,$),i=Math.imul(N,V),i=i+Math.imul(U,$)|0,o=Math.imul(U,V),n=n+Math.imul(j,W)|0,i=i+Math.imul(j,K)|0,i=i+Math.imul(I,W)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(R,J)|0,i=i+Math.imul(R,Y)|0,i=i+Math.imul(O,J)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,i=i+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,i=i+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(S,oe)|0,i=i+Math.imul(S,ae)|0,i=i+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(w,ce)|0,i=i+Math.imul(w,ue)|0,i=i+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(v,he)|0,i=i+Math.imul(v,de)|0,i=i+Math.imul(y,he)|0,o=o+Math.imul(y,de)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,o=o+Math.imul(b,be)|0;var xe=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,W),i=Math.imul(N,K),i=i+Math.imul(U,W)|0,o=Math.imul(U,K),n=n+Math.imul(j,J)|0,i=i+Math.imul(j,Y)|0,i=i+Math.imul(I,J)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,i=i+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,i=i+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(x,oe)|0,i=i+Math.imul(x,ae)|0,i=i+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,i=i+Math.imul(M,ce)|0,o=o+Math.imul(M,ue)|0,n=n+Math.imul(w,he)|0,i=i+Math.imul(w,de)|0,i=i+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0,n=n+Math.imul(v,pe)|0,i=i+Math.imul(v,be)|0,i=i+Math.imul(y,pe)|0,o=o+Math.imul(y,be)|0;var Be=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(N,J),i=Math.imul(N,Y),i=i+Math.imul(U,J)|0,o=Math.imul(U,Y),n=n+Math.imul(j,Q)|0,i=i+Math.imul(j,ee)|0,i=i+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,i=i+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(P,oe)|0,i=i+Math.imul(P,ae)|0,i=i+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(x,ce)|0,i=i+Math.imul(x,ue)|0,i=i+Math.imul(B,ce)|0,o=o+Math.imul(B,ue)|0,n=n+Math.imul(S,he)|0,i=i+Math.imul(S,de)|0,i=i+Math.imul(M,he)|0,o=o+Math.imul(M,de)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,o=o+Math.imul(_,be)|0;var Ee=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,Q),i=Math.imul(N,ee),i=i+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,i=i+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(R,oe)|0,i=i+Math.imul(R,ae)|0,i=i+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(P,ce)|0,i=i+Math.imul(P,ue)|0,i=i+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(x,he)|0,i=i+Math.imul(x,de)|0,i=i+Math.imul(B,he)|0,o=o+Math.imul(B,de)|0,n=n+Math.imul(S,pe)|0,i=i+Math.imul(S,be)|0,i=i+Math.imul(M,pe)|0,o=o+Math.imul(M,be)|0;var Pe=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(N,re),i=Math.imul(N,ne),i=i+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(j,oe)|0,i=i+Math.imul(j,ae)|0,i=i+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(R,ce)|0,i=i+Math.imul(R,ue)|0,i=i+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(P,he)|0,i=i+Math.imul(P,de)|0,i=i+Math.imul(A,he)|0,o=o+Math.imul(A,de)|0,n=n+Math.imul(x,pe)|0,i=i+Math.imul(x,be)|0,i=i+Math.imul(B,pe)|0,o=o+Math.imul(B,be)|0;var Ae=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(N,oe),i=Math.imul(N,ae),i=i+Math.imul(U,oe)|0,o=Math.imul(U,ae),n=n+Math.imul(j,ce)|0,i=i+Math.imul(j,ue)|0,i=i+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(R,he)|0,i=i+Math.imul(R,de)|0,i=i+Math.imul(O,he)|0,o=o+Math.imul(O,de)|0,n=n+Math.imul(P,pe)|0,i=i+Math.imul(P,be)|0,i=i+Math.imul(A,pe)|0,o=o+Math.imul(A,be)|0;var Te=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(N,ce),i=Math.imul(N,ue),i=i+Math.imul(U,ce)|0,o=Math.imul(U,ue),n=n+Math.imul(j,he)|0,i=i+Math.imul(j,de)|0,i=i+Math.imul(I,he)|0,o=o+Math.imul(I,de)|0,n=n+Math.imul(R,pe)|0,i=i+Math.imul(R,be)|0,i=i+Math.imul(O,pe)|0,o=o+Math.imul(O,be)|0;var Re=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(N,he),i=Math.imul(N,de),i=i+Math.imul(U,he)|0,o=Math.imul(U,de),n=n+Math.imul(j,pe)|0,i=i+Math.imul(j,be)|0,i=i+Math.imul(I,pe)|0,o=o+Math.imul(I,be)|0;var Oe=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,pe),i=Math.imul(N,be),i=i+Math.imul(U,pe)|0,o=Math.imul(U,be);var Le=(u+n|0)+((8191&i)<<13)|0;return u=(o+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,c[0]=me,c[1]=ve,c[2]=ye,c[3]=ge,c[4]=we,c[5]=_e,c[6]=ke,c[7]=Se,c[8]=Me,c[9]=Ce,c[10]=xe,c[11]=Be,c[12]=Ee,c[13]=Pe,c[14]=Ae,c[15]=Te,c[16]=Re,c[17]=Oe,c[18]=Le,0!==u&&(c[19]=u,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0,i+=a>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function w(e,t,r){return g(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(y=v),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?y(this,e,t):n<63?v(this,e,t):n<1024?g(this,e,t):w(this,e,t),r},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=m(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-o|h>>>o,f=h&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,a=0|i.words[i.length-1],s=this._countBits(a);r=26-s,0!==r&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var c,u=n.length-i.length;if("mod"!==t){c=new o(null),c.length=u+1,c.words=new Array(c.length);for(var f=0;f=0;d--){var l=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,d);while(0!==n.negative)l--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);c&&(c.words[d]=l)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var i=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++u;var f=r.clone(),h=t.clone();while(!t.isZero()){for(var d=0,l=1;0===(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0){t.iushrn(d);while(d-- >0)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(h)),i.iushrn(1),a.iushrn(1)}for(var p=0,b=1;0===(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0){r.iushrn(p);while(p-- >0)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(h)),s.iushrn(1),c.iushrn(1)}t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(c)):(r.isub(t),s.isub(i),c.isub(a))}return{a:s,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var i,a=new o(1),s=new o(0),c=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var u=0,f=1;0===(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0){t.iushrn(u);while(u-- >0)a.isOdd()&&a.iadd(c),a.iushrn(1)}for(var h=0,d=1;0===(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0){r.iushrn(h);while(h-- >0)s.isOdd()&&s.iadd(c),s.iushrn(1)}t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return i=0===t.cmpn(1)?a:s,i.cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var k={k256:null,p224:null,p192:null,p25519:null};function S(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function C(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}S.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},S.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},S.prototype.split=function(e,t){e.iushrn(this.n,0,t)},S.prototype.imulK=function(e){return e.imul(this.k)},i(M,S),M.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(k[e])return k[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new C;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return k[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1),a=0;while(!i.isZero()&&0===i.andln(1))a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();f=new o(2*f*f).toRed(this);while(0!==this.pow(f,u).cmp(c))f.redIAdd(c);var h=this.pow(f,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;while(0!==l.cmp(s)){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;i--){for(var f=t.words[i],h=u-1;h>=0;h--){var d=f>>h&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,c++,(c===r||0===i&&0===h)&&(a=this.mul(a,n[s]),c=0,s=0)):c=0}u=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new P(e)},i(P,E),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},P.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(e,this)}).call(this,r("62e4")(e))},bb34:function(e,t,r){"use strict";var n=r("399f"),i=r("f3a3"),o=i.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"===typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||o(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.validate()||o(e.validate(),"public point not validated"),e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},bb44:function(e,t,r){"use strict";var n=r("c3c0"),i=r("edc9"),o=n.rotl32,a=n.sum32,s=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,u),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],f=this.h[4],y=r,g=n,w=i,_=u,k=f,S=0;S<80;S++){var M=a(o(c(r,h(S,n,i,u),e[p[S]+t],d(S)),m[S]),f);r=f,f=u,u=o(i,10),i=n,n=M,M=a(o(c(y,h(79-S,g,w,_),e[b[S]+t],l(S)),v[S]),k),y=k,k=_,_=o(w,10),w=g,g=M}M=s(this.h[1],i,_),this.h[1]=s(this.h[2],u,k),this.h[2]=s(this.h[3],f,y),this.h[3]=s(this.h[4],r,g),this.h[4]=s(this.h[0],n,w),this.h[0]=M},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},bc82:function(e,t,r){"use strict";const{DAGLink:n,DAGNode:i}=r("8141"),{UnixFS:o}=r("9fd0"),a=r("0bb1"),s=r("3ba3"),{createHAMT:c,Bucket:u}=r("d81a");class f extends a{constructor(e,t){super(e,t),this._bucket=c({hashFn:t.hamtHashFn,bits:t.hamtBucketBits})}async put(e,t){await this._bucket.put(e,t)}get(e){return this._bucket.get(e)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(const{key:e,value:t}of this._bucket.eachLeafSeries())yield{key:e,child:t}}async*flush(e){for await(const t of h(this._bucket,e,this,this.options))yield{...t,path:this.path}}}async function*h(e,t,r,a){const c=e._children,f=[];let d=0;for(let i=0;i=0?h.subarray(0,d):h}}e.exports=r},c2f9:function(e,t,r){"use strict";var n=r("543b"),i=n.Reader,o=n.Writer,a=n.util,s=n.roots["ipfs-unixfs"]||(n.roots["ipfs-unixfs"]={});s.Data=function(){function e(e){if(this.blocksizes=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;case 3:n.filesize=e.uint64();break;case 4:if(n.blocksizes&&n.blocksizes.length||(n.blocksizes=[]),2===(7&o)){var c=e.uint32()+e.pos;while(e.pos>>0,e.filesize.high>>>0).toNumber(!0))),e.blocksizes){if(!Array.isArray(e.blocksizes))throw TypeError(".Data.blocksizes: array expected");t.blocksizes=[];for(var r=0;r>>0,e.blocksizes[r].high>>>0).toNumber(!0))}if(null!=e.hashType&&(a.Long?(t.hashType=a.Long.fromValue(e.hashType)).unsigned=!0:"string"===typeof e.hashType?t.hashType=parseInt(e.hashType,10):"number"===typeof e.hashType?t.hashType=e.hashType:"object"===typeof e.hashType&&(t.hashType=new a.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0))),null!=e.fanout&&(a.Long?(t.fanout=a.Long.fromValue(e.fanout)).unsigned=!0:"string"===typeof e.fanout?t.fanout=parseInt(e.fanout,10):"number"===typeof e.fanout?t.fanout=e.fanout:"object"===typeof e.fanout&&(t.fanout=new a.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0))),null!=e.mode&&(t.mode=e.mode>>>0),null!=e.mtime){if("object"!==typeof e.mtime)throw TypeError(".Data.mtime: object expected");t.mtime=s.UnixTime.fromObject(e.mtime)}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.blocksizes=[]),t.defaults){if(r.Type=t.enums===String?"Raw":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data))),a.Long){var n=new a.Long(0,0,!0);r.filesize=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.filesize=t.longs===String?"0":0;if(a.Long){n=new a.Long(0,0,!0);r.hashType=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.hashType=t.longs===String?"0":0;if(a.Long){n=new a.Long(0,0,!0);r.fanout=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.fanout=t.longs===String?"0":0;r.mode=0,r.mtime=null}if(null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.Data.DataType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),null!=e.filesize&&e.hasOwnProperty("filesize")&&("number"===typeof e.filesize?r.filesize=t.longs===String?String(e.filesize):e.filesize:r.filesize=t.longs===String?a.Long.prototype.toString.call(e.filesize):t.longs===Number?new a.LongBits(e.filesize.low>>>0,e.filesize.high>>>0).toNumber(!0):e.filesize),e.blocksizes&&e.blocksizes.length){r.blocksizes=[];for(var i=0;i>>0,e.blocksizes[i].high>>>0).toNumber(!0):e.blocksizes[i]}return null!=e.hashType&&e.hasOwnProperty("hashType")&&("number"===typeof e.hashType?r.hashType=t.longs===String?String(e.hashType):e.hashType:r.hashType=t.longs===String?a.Long.prototype.toString.call(e.hashType):t.longs===Number?new a.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0):e.hashType),null!=e.fanout&&e.hasOwnProperty("fanout")&&("number"===typeof e.fanout?r.fanout=t.longs===String?String(e.fanout):e.fanout:r.fanout=t.longs===String?a.Long.prototype.toString.call(e.fanout):t.longs===Number?new a.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0):e.fanout),null!=e.mode&&e.hasOwnProperty("mode")&&(r.mode=e.mode),null!=e.mtime&&e.hasOwnProperty("mtime")&&(r.mtime=s.UnixTime.toObject(e.mtime,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.DataType=function(){var e={},t=Object.create(e);return t[e[0]="Raw"]=0,t[e[1]="Directory"]=1,t[e[2]="File"]=2,t[e[3]="Metadata"]=3,t[e[4]="Symlink"]=4,t[e[5]="HAMTShard"]=5,t}(),e}(),s.UnixTime=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Seconds=e.int64();break;case 2:n.FractionalNanoseconds=e.fixed32();break;default:e.skipType(7&o);break}}if(!n.hasOwnProperty("Seconds"))throw a.ProtocolError("missing required 'Seconds'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.UnixTime)return e;var t=new s.UnixTime;return null!=e.Seconds&&(a.Long?(t.Seconds=a.Long.fromValue(e.Seconds)).unsigned=!1:"string"===typeof e.Seconds?t.Seconds=parseInt(e.Seconds,10):"number"===typeof e.Seconds?t.Seconds=e.Seconds:"object"===typeof e.Seconds&&(t.Seconds=new a.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber())),null!=e.FractionalNanoseconds&&(t.FractionalNanoseconds=e.FractionalNanoseconds>>>0),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(a.Long){var n=new a.Long(0,0,!1);r.Seconds=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.Seconds=t.longs===String?"0":0;r.FractionalNanoseconds=0}return null!=e.Seconds&&e.hasOwnProperty("Seconds")&&("number"===typeof e.Seconds?r.Seconds=t.longs===String?String(e.Seconds):e.Seconds:r.Seconds=t.longs===String?a.Long.prototype.toString.call(e.Seconds):t.longs===Number?new a.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber():e.Seconds),null!=e.FractionalNanoseconds&&e.hasOwnProperty("FractionalNanoseconds")&&(r.FractionalNanoseconds=e.FractionalNanoseconds),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),s.Metadata=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.MimeType=e.string();break;default:e.skipType(7&o);break}}return n},e.fromObject=function(e){if(e instanceof s.Metadata)return e;var t=new s.Metadata;return null!=e.MimeType&&(t.MimeType=String(e.MimeType)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.MimeType=""),null!=e.MimeType&&e.hasOwnProperty("MimeType")&&(r.MimeType=e.MimeType),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=s},c3c0:function(e,t,r){"use strict";var n=r("da3e"),i=r("3fb5");function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"===typeof e)if(t){if("hex"===t)for(e=e.replace(/[^a-z0-9]+/gi,""),e.length%2!==0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24;return t>>>0}function u(e,t){for(var r="",n=0;n>>0}return a}function l(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r}function p(e,t){return e>>>t|e<<32-t}function b(e,t){return e<>>32-t}function m(e,t){return e+t>>>0}function v(e,t,r){return e+t+r>>>0}function y(e,t,r,n){return e+t+r+n>>>0}function g(e,t,r,n,i){return e+t+r+n+i>>>0}function w(e,t,r,n){var i=e[t],o=e[t+1],a=n+o>>>0,s=(a>>0,e[t+1]=a}function _(e,t,r,n){var i=t+n>>>0,o=(i>>0}function k(e,t,r,n){var i=t+n;return i>>>0}function S(e,t,r,n,i,o,a,s){var c=0,u=t;u=u+n>>>0,c+=u>>0,c+=u>>0,c+=u>>0}function M(e,t,r,n,i,o,a,s){var c=t+n+o+s;return c>>>0}function C(e,t,r,n,i,o,a,s,c,u){var f=0,h=t;h=h+n>>>0,f+=h>>0,f+=h>>0,f+=h>>0,f+=h>>0}function x(e,t,r,n,i,o,a,s,c,u){var f=t+n+o+s+u;return f>>>0}function B(e,t,r){var n=t<<32-r|e>>>r;return n>>>0}function E(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}function P(e,t,r){return e>>>r}function A(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}t.inherits=i,t.toArray=a,t.toHex=s,t.htonl=c,t.toHex32=u,t.zero2=f,t.zero8=h,t.join32=d,t.split32=l,t.rotr32=p,t.rotl32=b,t.sum32=m,t.sum32_3=v,t.sum32_4=y,t.sum32_5=g,t.sum64=w,t.sum64_hi=_,t.sum64_lo=k,t.sum64_4_hi=S,t.sum64_4_lo=M,t.sum64_5_hi=C,t.sum64_5_lo=x,t.rotr64_hi=B,t.rotr64_lo=E,t.shr64_hi=P,t.shr64_lo=A},c449:function(e,t,r){"use strict";const n=r("354e"),i=r("675c"),o=r("5d98"),a=r("42a6"),{concat:s}=r("a828"),{toString:c}=r("eaf0"),{equals:u}=r("b2af"),f=o.nameToCode,h=Object.keys(f).reduce((e,t)=>(e[f[t]]=t,e),{}),d=Symbol.for("@ipld/js-cid/CID");class l{constructor(e,t,r,a){if(this.version,this.codec,this.multihash,Object.defineProperty(this,d,{value:!0}),l.isCID(e)){const t=e;return this.version=t.version,this.codec=t.codec,this.multihash=t.multihash,void(this.multibaseName=t.multibaseName||(0===t.version?"base58btc":"base32"))}if("string"===typeof e){const t=i.isEncoded(e);if(t){const r=i.decode(e);this.version=parseInt(r[0].toString(),16),this.codec=o.getCodec(r.slice(1)),this.multihash=o.rmPrefix(r.slice(1)),this.multibaseName=t}else this.version=0,this.codec="dag-pb",this.multihash=n.fromB58String(e),this.multibaseName="base58btc";return l.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){const t=parseInt(e[0].toString(),16);if(1===t){const r=e;this.version=t,this.codec=o.getCodec(r.slice(1)),this.multihash=o.rmPrefix(r.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,"number"===typeof t&&(t=h[t]),this.codec=t,this.multihash=r,this.multibaseName=a||(0===e?"base58btc":"base32"),l.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");{const t=o.getCodeVarint(this.codec);e=s([[1],t,this.multihash],1+t.byteLength+this.multihash.byteLength)}}Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){const e=o.getCodeVarint(this.codec),t=n.prefix(this.multihash),r=s([[this.version],e,t],1+e.byteLength+t.byteLength);return r}get code(){return f[this.codec]}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:t}=n.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==t)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new l(0,this.codec,this.multihash)}toV1(){return new l(1,this.codec,this.multihash,this.multibaseName)}toBaseEncodedString(e=this.multibaseName){if(this.string&&0!==this.string.length&&e===this.multibaseName)return this.string;let t;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");t=n.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");t=c(i.encode(e,this.bytes))}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:t}),t}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&u(this.multihash,e.multihash)}static validateCID(e){const t=a.checkCIDComponents(e);if(t)throw new Error(t)}static isCID(e){return e instanceof l||Boolean(e&&e[d])}}l.codecs=f,e.exports=l},c486:function(e,t,r){const n=r("1c46"),{checkAndInit:i,smix:o}=r("8f3b");async function a(e,t,r,a,s,c,u,f){const{XY:h,V:d,B32:l,x:p,_X:b,B:m,tickCallback:v}=i(e,t,r,a,s,c,u);for(var y=0;y=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(c){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,r("4362"))},c6f1:function(e,t,r){"use strict";var n=r("b280");function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",e=>{const t=new TextDecoder("utf8");return"u"+t.decode(e)},e=>{const t=new TextEncoder;return t.encode(e.substring(1))}),a=i("ascii","a",e=>{let t="a";for(let r=0;r{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r191&&i<224?a[s++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[s++]=55296+(i>>10),a[s++]=56320+(1023&i)):a[s++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))},n.write=function(e,t,r){for(var n,i,o=r,a=0;a>6|192,t[r++]=63&n|128):55296===(64512&n)&&56320===(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},c8f6:function(e,t,r){const n=r("14ec"),i=r("3193");e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},cd91:function(e){e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},cf35:function(e,t,r){"use strict";(function(t,n){var i;e.exports=P,P.ReadableState=E;r("faa1").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=r("f12a"),s=r("b639").Buffer,c=t.Uint8Array||function(){};function u(e){return s.from(e)}function f(e){return s.isBuffer(e)||e instanceof c}var h,d=r(8);h=d&&d.debuglog?d.debuglog("stream"):function(){};var l,p,b,m=r("22ab"),v=r("9019"),y=r("05f0"),g=y.getHighWaterMark,w=r("d113").codes,_=w.ERR_INVALID_ARG_TYPE,k=w.ERR_STREAM_PUSH_AFTER_EOF,S=w.ERR_METHOD_NOT_IMPLEMENTED,M=w.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r("3fb5")(P,a);var C=v.errorOrDestroy,x=["error","close","destroy","pause","resume"];function B(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)}function E(e,t,n){i=i||r("5e7d"),e=e||{},"boolean"!==typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",n),this.buffer=new m,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.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r("7d72").StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function P(e){if(i=i||r("5e7d"),!(this instanceof P))return new P(e);var t=this instanceof i;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,r,n,i){h("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,I(e,a);else if(i||(o=R(a,t)),o)C(e,o);else if(a.objectMode||t&&t.length>0)if("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=u(t)),n)a.endEmitted?C(e,new M):T(e,a,t,!0);else if(a.ended)C(e,new k);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?T(e,a,t,!1):U(e,a)):T(e,a,t,!1)}else n||(a.reading=!1,U(e,a));return!a.ended&&(a.length=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function j(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=L(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e,t){if(h("onEofChunk"),!t.ended){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?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}}function D(e){var t=e._readableState;h("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(N,e))}function N(e){var t=e._readableState;h("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,G(e)}function U(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(z,e,t))}function z(e,t){while(!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function H(e){h("readable nexttick read 0"),e.read(0)}function $(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(V,e,t))}function V(e,t){h("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),G(e),t.flowing&&!t.reading&&e.read(0)}function G(e){var t=e._readableState;h("flow",t.flowing);while(t.flowing&&null!==e.read());}function W(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 K(e){var t=e._readableState;h("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(X,t,e))}function X(e,t){if(h("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function J(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?K(this):D(this),null;if(e=j(e,t),0===e&&t.ended)return 0===t.length&&K(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e0?W(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&K(this)),null!==n&&this.emit("data",n),n},P.prototype._read=function(e){C(this,new S("_read()"))},P.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);break}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,s=a?u:y;function c(e,t){h("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,l())}function u(){h("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",c);var f=F(r);e.on("drain",f);var d=!1;function l(){h("cleanup"),e.removeListener("close",m),e.removeListener("finish",v),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",p),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f()}function p(t){h("ondata");var n=e.write(t);h("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==J(i.pipes,e))&&!d&&(h("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function b(t){h("onerror",t),y(),e.removeListener("error",b),0===o(e,"error")&&C(e,t)}function m(){e.removeListener("finish",v),y()}function v(){h("onfinish"),e.removeListener("close",m),y()}function y(){h("unpipe"),r.unpipe(e)}return r.on("data",p),B(e,"error",b),e.once("close",m),e.once("finish",v),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},P.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;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,h("on readable",i.length,i.reading),i.length?D(this):i.reading||n.nextTick(H,this))),r},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(q,this),r},P.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(q,this),t},P.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!e.readableListening,$(this,e)),e.paused=!1,this},P.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},P.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(h("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){if(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)){var o=t.push(i);o||(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>6],i=0===(32&r);if(31===(31&r)){let n=r;r=0;while(128===(128&n)){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;const o=s.tag[r];return{cls:n,primitive:i,tag:r,tagStr:o}}function h(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0===(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let o=0;o{const s=await i();return new n(s,e,t,r,o,a)};e.exports={Rabin:n,create:o}},d113:function(e,t,r){"use strict";function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var i={};function o(e,t,r){function o(e,r,n){return"string"===typeof t?t:t(e,r,n)}r||(r=Error);var a=function(e){function t(t,r,n){return e.call(this,o(t,r,n))||this}return n(t,e),t}(r);a.prototype.name=r.name,a.prototype.code=e,i[e]=a}function a(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))}function s(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function c(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function u(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i;if("string"===typeof t&&s(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be",c(e," argument"))i="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var o=u(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(a(t,"type"))}return i+=". Received type ".concat(typeof r),i}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},d17b:function(e,t,r){e.exports=r("e372").Transform},d1c8:function(e,t,r){"use strict";const n=r("3fb5");function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},d3f8:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("dc74");const i=n.rfc4648({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});t.base2=i},d424:function(e,t,r){"use strict";var n=r("3fb5"),i=r("8707").Buffer,o=r("6430"),a=i.alloc(128),s=64;function c(e,t){o.call(this,"digest"),"string"===typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length1?o(i,t,r):i[0]}e.exports=i},d4dd:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("fb86"),i=r("ac1b"),o=r("dd7b"),a=r("9a44"),s=r("29f9");t.CID=n.CID,t.varint=i,t.bytes=o,t.hasher=a,t.digest=s},d70e:function(e){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},d81a:function(e,t,r){"use strict";const n=r("42f1"),i=r("0662");function o(e){if(!e||!e.hashFn)throw new Error("please define an options.hashFn");const t={bits:e.bits||8,hash:i(e.hashFn)};return new n(t)}e.exports={createHAMT:o,Bucket:n}},d9fc:function(e,t,r){"use strict";const n=r("a037");function i(e,t="utf8"){const r=n[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return r.decoder.decode(`${r.prefix}${e}`)}e.exports=i},da12:function(e,t,r){"use strict";const n=r("bc82"),i=r("0ca7");async function o(e,t){const r=new n({root:e.root,dir:!0,parent:e.parent,parentKey:e.parentKey,path:e.path,dirty:e.dirty,flat:!1,mtime:e.mtime,mode:e.mode},t);for await(const{key:n,child:i}of e.eachChildSeries())await r.put(n,i);return r}e.exports=async function e(t,r,n,a){let s=r;r instanceof i&&r.directChildrenCount()>=n&&(s=await o(r,a));const c=s.parent;if(c){if(s!==r){if(t&&(t.parent=s),!s.parentKey)throw new Error("No parent key found");await c.put(s.parentKey,s)}return e(s,c,n,a)}return s}},da3e:function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},dc14:function(e,t,r){"use strict";(function(t,n){var i=r("966d");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){I(t,e)}}e.exports=g;var a,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?setImmediate:i.nextTick;g.WritableState=y;var c=Object.create(r("3a7c"));c.inherits=r("3fb5");var u={deprecate:r("b7d1")},f=r("429b"),h=r("a8f0").Buffer,d=n.Uint8Array||function(){};function l(e){return h.from(e)}function p(e){return h.isBuffer(e)||e instanceof d}var b,m=r("4681");function v(){}function y(e,t){a=a||r("b19a"),e=e||{};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,s=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){B(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function g(e){if(a=a||r("b19a"),!b.call(g,this)&&!(this instanceof a))return new g(e);this._writableState=new y(e,this),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)),f.call(this)}function w(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}function _(e,t,r,n){var o=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(n,a),o=!1),o}function k(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=h.from(t,r)),t}function S(e,t,r,n,i,o){if(!r){var a=k(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||j(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=m.destroy,g.prototype._undestroy=m.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r("4362"),r("c8ba"))},dc6f:function(e,t,r){"use strict";e.exports=o;var n=r("0c83");(o.prototype=Object.create(n.prototype)).constructor=o;var i=r("e938");function o(){n.call(this)}function a(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},dc74:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("6e41"),i=r("dd7b");class o{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class a{constructor(e,t,r){this.name=e,this.prefix=t,this.baseDecode=r}decode(e){if("string"!==typeof e)throw Error("Can only multibase decode strings");switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}}or(e){const t={[this.prefix]:this,...e.decoders||{[e.prefix]:e}};return new s(t)}}class s{constructor(e){this.decoders=e}or(e){const t=e.decoders||{[e.prefix]:e};return new s({...this.decoders,...t})}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}class c{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new o(e,t,r),this.decoder=new a(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const u=({name:e,prefix:t,encode:r,decode:n})=>new c(e,t,r,n),f=({prefix:e,name:t,alphabet:r})=>{const{encode:o,decode:a}=n(r,t);return u({prefix:e,name:t,encode:o,decode:e=>i.coerce(a(e))})},h=(e,t,r,n)=>{const i={};for(let f=0;f=8&&(s-=8,a[u++]=255&c>>s)}if(s>=r||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return a},d=(e,t,r)=>{const n="="===t[t.length-1],i=(1<r)a-=r,o+=t[i&s>>a]}if(a&&(o+=t[i&s<u({prefix:t,name:e,encode(e){return d(e,n,r)},decode(t){return h(t,n,r,e)}});t.Codec=c,t.baseX=f,t.from=u,t.rfc4648=l},dd7b:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=new Uint8Array(0),i=e=>e.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),o=e=>{const t=e.match(/../g);return t?new Uint8Array(t.map(e=>parseInt(e,16))):n},a=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},c=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),u=e=>(new TextEncoder).encode(e),f=e=>(new TextDecoder).decode(e);t.coerce=s,t.empty=n,t.equals=a,t.fromHex=o,t.fromString=u,t.isBinary=c,t.toHex=i,t.toString=f},decc:function(e,t){e.exports=i;var r=128,n=127;function i(e,t){var o,a=0,s=(t=t||0,0),c=t,u=e.length;do{if(c>=u||s>49)throw i.bytes=0,new RangeError("Could not decode varint");o=e[c++],a+=s<28?(o&n)<=r);return i.bytes=c-t,a}},df7c:function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e){"string"!==typeof e&&(e+="");var t,r=0,n=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){r=t+1;break}}else-1===n&&(i=!1,n=t+1);return-1===n?"":e.slice(r,n)}function i(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!n;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,n="/"===a.charAt(0))}return t=r(i(t.split("/"),(function(e){return!!e})),!n).join("/"),(n?"/":"")+t||"."},t.normalize=function(e){var n=t.isAbsolute(e),a="/"===o(e,-1);return e=r(i(e.split("/"),(function(e){return!!e})),!n).join("/"),e||n||(e="."),e&&a&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(i(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t=0;r--)if(""!==e[r])break;return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),o=n(r.split("/")),a=Math.min(i.length,o.length),s=a,c=0;c=1;--o)if(t=e.charCodeAt(o),47===t){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var r=n(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){r=a+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===r+1?"":e.slice(t,n)};var o="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,r("4362"))},e07b:function(e,t,r){var n=r("5a76"),i=r("b5ca"),o=r("69f2"),a=r("8707").Buffer,s=r("7d2a"),c=r("9f9d"),u=r("8be6"),f=a.alloc(128),h={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,r){var n=l(e),i="sha512"===e||"sha384"===e?128:64;t.length>i?t=n(t):t.length{throw new Error("unexpected block API get for "+e)},put:async()=>{throw new Error("unexpected block API put")}};t.of=async(e,t)=>{let r;t=t||{},t.onlyHash=!0,"string"===typeof e&&(e=(new TextEncoder).encode(e));for await(const{cid:o}of n([{content:e}],i,t))r=o;return""+r}},e3db:function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},e4de:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("dc74");const i=n.baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),o=n.baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});t.base58btc=i,t.base58flickr=o},e4e2:function(e,t,r){"use strict";const n=r("65a5");async function*i(e,t=1){for await(const r of n(e,t)){const e=r.map(e=>e().then(e=>({ok:!0,value:e}),e=>({ok:!1,err:e})));for(let t=0;t0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"===typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"===typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<=a;f--)c=(c<<1)+n[f];u.push(c)}for(var h=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(a=0;a=0;u--){for(var f=0;u>=0&&0===a[u];u--)f++;if(u>=0&&f++,c=c.dblp(f),u<0)break;var h=a[u];s(0!==h),c="affine"===e.type?h>0?c.mixedAdd(i[h-1>>1]):c.mixedAdd(i[-h-1>>1].neg()):h>0?c.add(i[h-1>>1]):c.add(i[-h-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var s,c,u,f=this._wnafT1,h=this._wnafT2,d=this._wnafT3,l=0;for(s=0;s=1;s-=2){var b=s-1,m=s;if(1===f[b]&&1===f[m]){var v=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(v[1]=t[b].add(t[m]),v[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(v[1]=t[b].toJ().mixedAdd(t[m]),v[2]=t[b].add(t[m].neg())):(v[1]=t[b].toJ().mixedAdd(t[m]),v[2]=t[b].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[b],r[m]);for(l=Math.max(g[0].length,l),d[b]=new Array(l),d[m]=new Array(l),c=0;c=0;s--){var M=0;while(s>=0){var C=!0;for(c=0;c=0&&M++,k=k.dblp(M),s<0)break;for(c=0;c0?u=h[c][x-1>>1]:x<0&&(u=h[c][-x-1>>1].neg()),k="affine"===u.type?k.mixedAdd(u):k.add(u))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,f=new Uint8Array(c);while(i!==o){for(var h=t[i],d=0,l=c-1;(0!==h||d>>0,f[l]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=d,i++}var p=c-n;while(p!==c&&0===f[p])p++;for(var b=s.repeat(r);p>>0,u=new Uint8Array(o);while(e[r]){var f=t[e.charCodeAt(r)];if(255===f)return;for(var h=0,d=o-1;(0!==f||h>>0,u[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=h,r++}if(" "!==e[r]){var l=o-i;while(l!==o&&0===u[l])l++;var p=new Uint8Array(n+(o-l)),b=n;while(l!==o)p[b++]=u[l++];return p}}}function d(e){var t=h(e);if(t)return t;throw new Error("Non-base"+a+" character")}return{encode:f,decodeUnsafe:h,decode:d}}e.exports=n},f12a:function(e,t,r){e.exports=r("faa1").EventEmitter},f140:function(e,t,r){"use strict";const n=r("543b"),{PBLink:i}=r("892c"),{createDagLinkFromB58EncodedHash:o}=r("bf15"),a=e=>{const t={};return e.Data&&e.Data.byteLength>0?t.Data=e.Data:t.Data=null,e.Links&&e.Links.length>0?t.Links=e.Links.map(e=>({Hash:e.Hash.bytes,Name:e.Name,Tsize:e.Tsize})):t.Links=null,t},s=e=>u(a(e)),c=(e,t=[])=>{const r={Data:e,Links:t.map(e=>o(e))};return u(a(r))};function u(e){const t=n.Writer.create();if(null!=e.Links)for(let r=0;r(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n}function c(e,t){var r=[[],[]];e=e.clone(),t=t.clone();var n,i=0,o=0;while(e.cmpn(-i)>0||t.cmpn(-o)>0){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),0===(1&c)?a=0:(n=e.andln(7)+i&7,a=3!==n&&5!==n||2!==u?c:-c),r[0].push(a),0===(1&u)?s=0:(n=t.andln(7)+o&7,s=3!==n&&5!==n||2!==c?u:-u),r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r}function u(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function f(e){return"string"===typeof e?n.toArray(e,"hex"):e}function h(e){return new i(e,"hex","le")}n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=s,n.getJSF=c,n.cachedProperty=u,n.parseBytes=f,n.intFromLE=h},f460:function(e,t,r){var n=r("98e6"),i=r("8707").Buffer;function o(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){var r,a=i.alloc(0),s=0;while(a.length>>32-t}function u(e,t,r,n,i,o,a){return c(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return c(e+(t&n|r&~n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return c(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return c(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,e[0],3614090360,7),o=u(o,r,n,i,e[1],3905402710,12),i=u(i,o,r,n,e[2],606105819,17),n=u(n,i,o,r,e[3],3250441966,22),r=u(r,n,i,o,e[4],4118548399,7),o=u(o,r,n,i,e[5],1200080426,12),i=u(i,o,r,n,e[6],2821735955,17),n=u(n,i,o,r,e[7],4249261313,22),r=u(r,n,i,o,e[8],1770035416,7),o=u(o,r,n,i,e[9],2336552879,12),i=u(i,o,r,n,e[10],4294925233,17),n=u(n,i,o,r,e[11],2304563134,22),r=u(r,n,i,o,e[12],1804603682,7),o=u(o,r,n,i,e[13],4254626195,12),i=u(i,o,r,n,e[14],2792965006,17),n=u(n,i,o,r,e[15],1236535329,22),r=f(r,n,i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),n=f(n,i,o,r,e[12],2368359562,20),r=h(r,n,i,o,e[5],4294588738,4),o=h(o,r,n,i,e[8],2272392833,11),i=h(i,o,r,n,e[11],1839030562,16),n=h(n,i,o,r,e[14],4259657740,23),r=h(r,n,i,o,e[1],2763975236,4),o=h(o,r,n,i,e[4],1272893353,11),i=h(i,o,r,n,e[7],4139469664,16),n=h(n,i,o,r,e[10],3200236656,23),r=h(r,n,i,o,e[13],681279174,4),o=h(o,r,n,i,e[0],3936430074,11),i=h(i,o,r,n,e[3],3572445317,16),n=h(n,i,o,r,e[6],76029189,23),r=h(r,n,i,o,e[9],3654602809,4),o=h(o,r,n,i,e[12],3873151461,11),i=h(i,o,r,n,e[15],530742520,16),n=h(n,i,o,r,e[2],3299628645,23),r=d(r,n,i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},f83c:function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},fa45:function(e,t){e.exports=i;var r=128,n=127;function i(e,t){var o,a=0,s=(t=t||0,0),c=t,u=e.length;do{if(c>=u)throw i.bytes=0,new RangeError("Could not decode varint");o=e[c++],a+=s<28?(o&n)<=r);return i.bytes=c-t,a}},faa1: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)};function a(e){console&&console.warn&&console.warn(e)}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 c(){c.init.call(this)}e.exports=c,e.exports.once=w,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function f(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s;if(f(r),o=e._events,void 0===o?(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=h(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function b(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?g(i):v(i,i.length)}function m(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 v(e,t){for(var r=new Array(t),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if("function"===typeof c)o(c,this,t);else{var u=c.length,f=v(c,u);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():y(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(e){var t,r,n;if(r=this._events,void 0===r)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=0;n--)this.removeListener(e,t[n]);return this},c.prototype.listeners=function(e){return b(this,e,!0)},c.prototype.rawListeners=function(e){return b(this,e,!1)},c.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},c.prototype.listenerCount=m,c.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},fb86:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("ac1b"),i=r("29f9"),o=r("e4de"),a=r("17fb"),s=r("dd7b");class c{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:v,byteLength:v,code:m,version:m,multihash:m,bytes:m,_baseCache:v,asCID:v})}toV0(){switch(this.version){case 0:return this;default:{const{code:e,multihash:t}=this;if(e!==d)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==l)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return c.createV0(t)}}}toV1(){switch(this.version){case 0:{const{code:e,digest:t}=this.multihash,r=i.create(e,t);return c.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&i.equals(this.multihash,e.multihash)}toString(e){const{bytes:t,version:r,_baseCache:n}=this;switch(r){case 0:return f(t,n,e||o.base58btc.encoder);default:return h(t,n,e||a.base32.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return g(/^0\.0/,w),!(!e||!e[b]&&e.asCID!==e)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof c)return e;if(null!=e&&e.asCID===e){const{version:t,code:r,multihash:n,bytes:i}=e;return new c(t,r,n,i||p(t,r,n.bytes))}if(null!=e&&!0===e[b]){const{version:t,multihash:r,code:n}=e,o=i.decode(r);return c.create(t,n,o)}return null}static create(e,t,r){if("number"!==typeof t)throw new Error("String codecs are no longer supported");switch(e){case 0:if(t!==d)throw new Error(`Version 0 CID must use dag-pb (code: ${d}) block encoding`);return new c(e,t,r,r.bytes);case 1:{const n=p(e,t,r.bytes);return new c(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return c.create(0,d,e)}static createV1(e,t){return c.create(1,e,t)}static decode(e){const[t,r]=c.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){const t=c.inspectBytes(e),r=t.size-t.multihashSize,n=s.coerce(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");const o=n.subarray(t.multihashSize-t.digestSize),a=new i.Digest(t.multihashCode,t.digestSize,o,n),u=0===t.version?c.createV0(a):c.createV1(t.codec,a);return[u,e.subarray(t.size)]}static inspectBytes(e){let t=0;const r=()=>{const[r,i]=n.decode(e.subarray(t));return t+=i,r};let i=r(),o=d;if(18===i?(i=0,t=0):1===i&&(o=r()),0!==i&&1!==i)throw new RangeError("Invalid CID version "+i);const a=t,s=r(),c=r(),u=t+c,f=u-a;return{version:i,codec:o,multihashCode:s,digestSize:c,multihashSize:f,size:u}}static parse(e,t){const[r,n]=u(e,t),i=c.decode(n);return i._baseCache.set(r,e),i}}const u=(e,t)=>{switch(e[0]){case"Q":{const r=t||o.base58btc;return[o.base58btc.prefix,r.decode(`${o.base58btc.prefix}${e}`)]}case o.base58btc.prefix:{const r=t||o.base58btc;return[o.base58btc.prefix,r.decode(e)]}case a.base32.prefix:{const r=t||a.base32;return[a.base32.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},f=(e,t,r)=>{const{prefix:n}=r;if(n!==o.base58btc.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);const i=t.get(n);if(null==i){const i=r.encode(e).slice(1);return t.set(n,i),i}return i},h=(e,t,r)=>{const{prefix:n}=r,i=t.get(n);if(null==i){const i=r.encode(e);return t.set(n,i),i}return i},d=112,l=18,p=(e,t,r)=>{const i=n.encodingLength(e),o=i+n.encodingLength(t),a=new Uint8Array(o+r.byteLength);return n.encodeTo(e,a,0),n.encodeTo(t,a,i),a.set(r,o),a},b=Symbol.for("@ipld/js-cid/CID"),m={writable:!1,configurable:!1,enumerable:!0},v={writable:!1,enumerable:!1,configurable:!1},y="0.0.0-dev",g=(e,t)=>{if(!e.test(y))throw new Error(t);console.warn(t)},w="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n";t.CID=c},fbd5:function(e,t,r){"use strict";var n;function i(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var o=r("9d8a").codes,a=o.ERR_MISSING_ARGS,s=o.ERR_STREAM_DESTROYED;function c(e){if(e)throw e}function u(e){return e.setHeader&&"function"===typeof e.abort}function f(e,t,o,a){a=i(a);var c=!1;e.on("close",(function(){c=!0})),void 0===n&&(n=r("ee93")),n(e,{readable:t,writable:o},(function(e){if(e)return a(e);c=!0,a()}));var f=!1;return function(t){if(!c&&!f)return f=!0,u(e)?e.abort():"function"===typeof e.destroy?e.destroy():void a(t||new s("pipe"))}}function h(e){e()}function d(e,t){return e.pipe(t)}function l(e){return e.length?"function"!==typeof e[e.length-1]?c:e.pop():c}function p(){for(var e=arguments.length,t=new Array(e),r=0;r0;return f(e,a,s,(function(e){n||(n=e),e&&o.forEach(h),a||(o.forEach(h),i(n))}))}));return t.reduce(d)}e.exports=p},fd46:function(e,t,r){"use strict";const n=[255,254,252,248,240,224,192,128],i=[1,3,7,15,31,63,127,255];function o(e,t,r){const n=a(t,r);return(e&n)>>>t}function a(e,t){return n[e]&i[Math.min(t+e-1,7)]}e.exports=class{constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(e){let t=e,r=0;while(t&&this._haveBits()){const e=this._value[this._currentBytePos],n=this._currentBitPos+1,i=Math.min(n,t),a=o(e,n-i,i);r=(r<7)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}},fda6:function(e,t,r){var n=r("8947"),i=r("4228"),o=r("e85f");function a(){return Object.keys(o)}t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=a},fdac:function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r \ No newline at end of file